summary refs log tree commit diff stats
path: root/compiler/main.nim
Commit message (Collapse)AuthorAgeFilesLines
* IC: green tests (#17311)Andreas Rumpf2021-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * IC: renamed to_packed_ast module to ic module * IC: don't store the --forceBuild flag, makes it easier to test * IC: enable hello world test * Codegen: refactorings for IC; changed the name mangling algorithm * fixed the HCR regressions * life is too short for HCR * tconvexhull is now allowed to use deepCopy * IC exposed a stdlib bug, required a refactoring * codegen: code cleanups * IC: even if a module is outdated, its dependencies might come from disk * IC: progress * IC: better name mangling, module IDs are not stable * IC: another refactoring helping with --ic:on --gc:arc * disable arraymancer on Windows for the time being * disable arraymancer altogether * IC: make basic test work with 'nim cpp' * IC: progress on --ic:on --gc:arc * wip; name mangling for type info
* stricter checks for RST headlines (#17089)Andrey Makarov2021-02-201-0/+8
|
* IC: next steps (#16729)Andreas Rumpf2021-01-231-9/+17
| | | | | | | | | | | * IC: dead code elimination pass * preparations for a different codegen strategy * added documentation to the newly written code * IC: backend code * IC: backend adjustments * optimized the compiler a bit * IC: yet another massive refactoring * fixes regressions * cleanups
* IC: next steps (#16632)Andreas Rumpf2021-01-121-3/+9
| | | | | | | | | | | | | * removed dead code * beginnings of a rodfile reader * IC: record global VM state changes and pragma state changes * IC: replay pragmas and VM state changes * implemented rod load file simuation for easier, extensive testing * critical bugfix * IC: stress test logic; should also help with recursive module dependencies; WIP * IC: loading from .rod files begins to work reliably * removed ugly hacks * yet another silly mistake
* compiler: minor refactoring (#16633)Andreas Rumpf2021-01-081-12/+11
|
* make --gc:arc --exceptions:quirky work again [backport:1.4] (#16583)Andreas Rumpf2021-01-041-2/+0
| | | | | * make --gc:arc --exceptions:quirky work again [backport:1.4] * fixes #16404 [backport:1.4]
* big steps torwards an efficient, simple IC implementation (#16543)Andreas Rumpf2021-01-021-3/+2
| | | | | | | | | | | | | | | | | | | * reworked ID handling * the packed AST now has its own ID mechanism * basic serialization code works * extract rodfiles to its own module * rodfiles: store and compare configs * rodfiles: store dependencies * store config at the end * precise dependency tracking * dependency tracking for rodfiles * completed loading of PSym, PType, etc * removed dead code * bugfix: do not realloc seqs when taking addr into an element * make IC opt-in for now * makes tcompilerapi green again * final cleanups Co-authored-by: Andy Davidoff <github@andy.disruptek.com>
* fix `hintProcessing` dots interference with `static:echo` and `hintCC`; add ↵Timothee Cour2020-12-301-1/+1
| | | | | | | | | | tests for `nim secret`, add tests for hintProcessing, misc other bug fixes (#16495) * fix dots interfering with static:echo * add tests * fix hintProcessing dots for hintCC * improve trunner tests * fix bug: readLineFromStdin now writes prompt to stdout, consistent with linenoise and rdstdin * disable a failing test for windows
* fix `nim secret` dots interfering with prompt (#16491)Timothee Cour2020-12-281-1/+2
| | | | | * fix nim secret dots * cleanups
* refactorings to prepare the compiler for IC (#15935)Andreas Rumpf2020-12-171-3/+3
| | | | | | | | | | | | | | * added ic specific Nim code; WIP * make the symbol import mechanism lazy; WIP * ensure that modules can be imported multiple times * ambiguity checking * handle converters and TR macros properly * make 'enum' test category green again * special logic for semi-pure enums * makes nimsuggest tests green again * fixes nimdata * makes nimpy green again * makes more important packages work
* cmdline: improve command processing (#16056)Timothee Cour2020-11-261-66/+33
|
* Correct all eggs (#15906)Miran2020-11-101-1/+1
| | | | * "eg" is a misspelled "egg", "e.g." is "exempli gratia" * Also, "ie" is "i.e.".
* new: `nim -e:cmd` to run a command directly; also fixes #15731 (#15687)Timothee Cour2020-11-091-2/+3
| | | | | | | | | | | | | | | * new: `nim -i cmd` * rename -i to -e (for eval); consistent with majority of other programing languages * `nim e -e:cmd` now works; bugfix: `echo cmd | nim e -` now works * honor --betterRun * address comments * --eval alias for -e (replaces undocumented --eval which was a noop) * --eval now defaults to e (nimscript) instead of r * address comment: remove -e, only keep --eval * address comment * fixup * Update compiler/nimconf.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Use modern enums in compiler (#15775)cooldome2020-11-021-2/+2
|
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-11/+6
| | | | | | | | | | | | | | | | | * refactoring: idents don't need inheritance * refactoring: adding an IdGenerator (part 1) * refactoring: adding an IdGenerator (part 2) * refactoring: adding an IdGenerator (part 3) * refactoring: adding an IdGenerator (part 4) * refactoring: adding an IdGenerator (part 5) * refactoring: adding an IdGenerator (part 5) * IdGenerator must be a ref type; hello world works again * make bootstrapping work again * progress: add back the 'exactReplica' ideas * added back the missing exactReplica hacks * make tcompilerapi work again * make important packages green * attempt to fix the build for 32 bit machines (probably need a better solution here)
* refactoring: moved setOutFile to where it belongsAndreas Rumpf2020-10-111-14/+0
|
* minor reformatingAraq2020-10-061-1/+1
|
* Big compiler Cleanup (#14777)Clyybber2020-08-281-2/+2
|
* VM profiler (#14833)Ico Doornekamp2020-07-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * Crude VM profiler * Added --profileVM flag, refactoring * fixed FileLine hash * Use TLineInfo instead of own FileLine, updated formatting * Refactoring, moved PStackFrame to vmdefs for cleaner data structure * Moved vmprofiler to separate file * Simplified TLineInfo hash, use toFileLineCol for output * Hash * Moved profile data into Config, dump only once at end of run * Changed profile output header to show '#instr' instead of 'count' * Do not accumulate instrcount for non-top frames Co-authored-by: Ico Doornekamp <git@zevv.nl>
* Fix #12745 (#14879)Tomohiro2020-07-021-0/+5
|
* bug fixes with sfMainModule, hints, mainPackageNotes, mainPackageId, ↵Timothee Cour2020-06-041-3/+14
| | | | | | | hintSuccessX (#14555) * SuccessX `out` now works with --compileOnly and jsonscript; fix bugs in jsonscript * several bug fixes; eg: `nim doc lib/system/io` now is sane * dummy edit to force docs CI
* * honor --errorMax even for tools (eg drnim, nim doc) (#14546)Timothee Cour2020-06-021-3/+3
| | | * fix a bug that prevented nim doc compiler/nim on windows
* fix #6583, fix #14376, index+search now generated for all projects, many bug ↵Timothee Cour2020-05-251-73/+43
| | | | | | | | | fixes with nim doc (#14324) * refs #6583 fix nim doc output * changelog * change default for outDir when unspecified * cleanups * --project implies --index
* no more code duplication bw liMessage and rawMessage + several bug fixes ↵Timothee Cour2020-05-221-4/+2
| | | | | | | (#14415) * no more code duplication bw rawMessage and liMessage; fixes some bugs in rawMessage * all compiler messages work with hint:msgorigin
* fix some issues with --backend (#14363)Timothee Cour2020-05-161-28/+49
| | | | | * fix some issues with --backend * fix https://github.com/timotheecour/Nim/issues/175; improve upon #14306
* `nim doc --backend:js`, `nim doc --doccmd:-d:foo`, `nim r --backend:js`, ↵Timothee Cour2020-05-111-31/+38
| | | | | | | | | | `--doccmd:skip` + other improvements (#14278) * `nim doc --backend:js|cpp...` `nim doc --doccmd:'-d:foo --threads:on'` `nim r --backend:cpp...` (implies --run --usenimcache) * --usenimcache works with all targets * --docCmd:skip now skips compiling snippets; 50X speedup for doc/manual.rst
* fixes #14209 [backport:1.2] (#14213)Andreas Rumpf2020-05-051-0/+3
| | | | * fixes #14209 [backport:1.2] * improve stability
* fix https://github.com/timotheecour/Nim/issues/152: avoid writing spurious ↵Timothee Cour2020-05-041-2/+0
| | | | | | | | | `^[[0m` to stderr when callStyledWriteLineStderr not called (#14214) * fix https://github.com/timotheecour/Nim/issues/152 `^[[0m` is inserted in stderr for `echo code | nim c -` * resetAttributes not even needed, already handled in styledWriteLine * simplify tests in tests/trunner.nim thanks to this fix
* new cmd: `nim r main [args...]` to compile & run, saving binary under ↵Timothee Cour2020-04-231-8/+17
| | | | | | $nimcache/main (#13382) * implement `nim r main` to compile and run, saving binary to $nimcache * remove outFileAbs for now
* add nimPath to nim dump (#13876)Timothee Cour2020-04-051-1/+2
| | | | | * add nimPath to nim dump * rename
* move tinyc to a separate repo and allow installing external dependencency ↵Timothee Cour2020-04-031-1/+1
| | | | | | | (eg tinyc) from koch / library code (#13850) * remove tinyc * installDeps * update tinyc paths
* fix #13218: avoid some irrelevant warnings for nim doc,rst2html,--app:lib, + ↵Timothee Cour2020-03-131-0/+7
| | | | | | | | other fixes (#13550) * fix #13218: avoid some irrelevant warnings for nim doc,rst2html * suppress warnRedefinitionOfLabel for nim doc * lots of fixes for UnusedImport warnings
* fix #13150 `nim doc --project` now works reliably (#13223)Timothee Cour2020-02-061-0/+3
| | | | | | | | | | * fix #13150 `nim doc --project` works with duplicate names and with imports below main project file * add to help; fixup after #13212 isRelativeTo got merged * fix test tests/compilerapi/tcompilerapi.nim * remove nimblePkg field; compute on the fly instead * kochdocs: compiler docs now under compiler/ * --docRoot now has smart default: best among @pkg, @path
* make goto based exceptions available for 'nim cpp' (#13244)Andreas Rumpf2020-01-251-1/+2
| | | | | * make goto based exceptions available for 'nim cpp' * optimize seq.add to be comparable to C++'s emplace_back
* nim dump: add libpath (#13249)Timothee Cour2020-01-241-0/+1
|
* fixes #12998 nim doc regression (#13117)Timothee Cour2020-01-161-0/+1
|
* successX now correctly shows html output for `nim doc`, `nim jsondoc`; fix ↵Timothee Cour2020-01-151-1/+2
| | | | | | | | #13121 (#13116) * successX now correctly shows html output for nim doc * fixes #13121 * fixup hintSuccessX to be less weird
* make SuccessX show project file + output file (#13043)Timothee Cour2020-01-081-10/+18
| | | | | | | * make SuccessX show project file + output file * address comments * fix test and add `result.err = reNimcCrash` otherwise hard to see where reNimcCrash used * address comments
* --exception:goto switch for deterministic exception handling (#12977)Andreas Rumpf2020-01-011-0/+2
| | | | | This implements "deterministic" exception handling for Nim based on goto instead of setjmp. This means raising an exception is much cheaper than in C++'s table based implementations. Supports hard realtime systems. Default for --gc:arc and the C target because it's generally a good idea and arc is all about deterministic behavior. Note: This implies that fatal runtime traps are not catchable anymore! This needs to be documented.
* new gensym handling (#11985)Andreas Rumpf2019-08-231-1/+1
| | | | | | | | | | | * new .gensym implementation * make astspec test green again * introduce a --useVersion switch to group compatibility switches * fixes #10180 * fixes #11494 * fixes #11483 * object constructor fields and named parameters are also not gensym'ed * disabled broken package
* fixes 'e' command handling; now only does what advopt.txt claims it does ↵Andreas Rumpf2019-08-161-10/+5
| | | | | | | (#11961) * fixes 'e' command handling; now only does what advopt.txt claims it does * address Timothee's remark
* removed unused imports [refactoring]Andreas Rumpf2019-08-081-2/+0
|
* IC: some progressAndreas Rumpf2019-07-271-3/+1
|
* [refactoring] remove unused imports in the compiler and in some stdlib modulesAraq2019-07-181-5/+5
|
* times: use posix constant instead of import (#11692)Jacek Sieka2019-07-131-3/+0
| | | | | | * times: use posix constant instead of import * simplify clock id usage
* koch/nim: completion of the 'better run' featureAraq2019-07-121-1/+1
|
* better run [feature] (#11709)Andreas Rumpf2019-07-111-0/+9
| | | | | | | * track the checksums of all involved Nim files for smarter 'nim c -r' recompiles * don't recompile unless necessary for 'nim c -r' [feature] * [feature] koch boot uses a two step process in order to free the RAM before the GCC/Clang invocations * fixes a serious regression
* make fullpaths the default in error messages and stack traces for mor… ↵Andreas Rumpf2019-06-051-1/+2
| | | | | | | | | | | | (#11385) * make fullpaths the default in error messages and stack traces for more convenient development * split up -d:release into -d:release and -d:danger flags * workaround a Nim config parser bug * fixes an old nim config parser bug * make megatest green again * make nimpretty tests work again * make nimsuggest green
* Don't include the nimhcr dev docs in the system module documentation (#10759)zah2019-03-081-3/+1
|
* compiler/[main,docgen]: don't put generated doc in subfolder (#10754)alaviss2019-02-281-1/+3
| | | | | | | | | | | | * compiler/[main,docgen]: don't put generated doc in subfolder Fixes regression caused by ca4b971bc81b2e751e0388d80896fde7079b1679. foo.nim will now generates foo.html instead of foo/foo.html * compiler/[main,docgen]: map -o to -outdir for project This reinstantiate the old behavior of -o for project-wide docgen