Nim/compiler
Zahary Karadjov fee2a7ecfa Experimental support for delayed instantiation of generics
This postpones the semantic pass over the generic's body until
the generic is instantiated. There are several pros and cons for
this method and the capabilities that it enables may still be possible
in the old framework if we teach it a few new trick. Such an attempt
will follow in the next commits.

pros:
1) It allows macros to be expanded during generic instantiation that
will provide the body of the generic. See ``tmacrogenerics``.
2) The instantiation code is dramatically simplified. Dealing with unknown
types in the generic's body pre-pass requires a lot of hacky code and error
silencing in semTypeNode. See ``tgenericshardcases``.

cons:
1) There is a performance penalty of roughly 5% when bootstrapping.
2) Certain errors that used to be detected in the previous pre-pass won't
be detected with the new scheme until instantiation.
2013-08-23 01:10:20 +03:00
..
c2nim fixes #440 2013-05-18 10:12:01 +02:00
pas2nim c2nim, pas2nim compile again 2013-05-07 17:19:36 +02:00
aliases.nim year 2012 for most copyright headers 2012-01-02 23:07:35 +01:00
ast.nim Experimental support for delayed instantiation of generics 2013-08-23 01:10:20 +03:00
astalgo.nim get rid of the SymTab* procs in astalgo 2013-05-12 00:49:00 +03:00
babelcmd.nim Changed babel path handling. 2013-05-02 00:07:59 +01:00
bitsets.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
ccgcalls.nim preparations for the new symbol binding rules for clean templates 2013-05-18 10:05:06 +02:00
ccgexprs.nim hacky fix for generic constraints matching 2013-08-19 01:48:25 +03:00
ccgmerge.nim nimrod dump can now produce a machine readable json report 2013-05-01 20:46:05 +03:00
ccgstmts.nim Merge branch 'master' of github.com:Araq/Nimrod 2013-08-22 19:28:58 +02:00
ccgthreadvars.nim Revert "Revert "bugfix: emulated thread vars used in combination with the mark & sweep GC"" 2013-08-19 01:27:05 +03:00
ccgtrav.nim Revert "Revert "bugfix: emulated thread vars used in combination with the mark & sweep GC"" 2013-08-19 01:27:05 +03:00
ccgtypes.nim remerge "allow void as field type" 2013-08-19 01:29:01 +03:00
ccgutils.nim made some tests green; implemented 'from module import nil' 2013-05-19 23:17:16 +02:00
cgen.nim hacky fix for generic constraints matching 2013-08-19 01:48:25 +03:00
cgendata.nim work-in-progress for compiling generics in their owner module 2013-08-19 01:45:16 +03:00
cgmeth.nim fixes #332 2013-03-17 23:40:03 +01:00
charsets.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
commands.nim --os and --cpu work in configuration files 2013-05-19 14:40:29 +02:00
condsyms.nim implemented computed goto support 2013-08-13 11:21:02 +02:00
crc.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
depends.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
docgen.nim next steps for the new parser/grammar 2013-04-20 01:59:39 +02:00
docgen2.nim CaaS in-memory caching 2012-11-28 01:15:13 +02:00
evalffi.nim first steps to implement object construction expressions 2013-03-07 01:52:17 +01:00
evals.nim Experimental support for delayed instantiation of generics 2013-08-23 01:10:20 +03:00
evaltempl.nim bugfix: evalTemplateArgs 2012-10-14 12:02:57 +02:00
extccomp.nim bugfix: -o option doesn't crash the compiler anymore 2013-07-01 20:17:36 +02:00
filter_tmpl.nim better treatment of var/let/const/type sections in the templating system 2013-03-29 15:28:13 +01:00
filters.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
guards.nim Merge branch 'master' of github.com:Araq/Nimrod 2013-07-20 20:18:21 +02:00
hlo.nim term rewriting improvements 2012-09-08 15:43:21 +02:00
idents.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
idgen.nim next steps to hygienic templates 2012-08-20 08:44:17 +02:00
importer.nim made some tests green; implemented 'from module import nil' 2013-05-19 23:17:16 +02:00
jsgen.nim refactorings for the eval engine; bugfix: clean templates as accessors 2013-07-19 22:22:20 +02:00
jstypes.nim new JS code generator 2013-04-28 23:41:10 +02:00
lambdalifting.nim check the owners of generic instantiations properly and fix tinvalidclosure 2013-08-19 01:45:16 +03:00
lexer.nim fixes token's column information 2013-07-30 08:45:00 +02:00
lists.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
llstream.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
lookups.nim small REPL improvements 2013-06-28 16:40:01 +02:00
magicsys.nim implemented large parts of the 'not nil' checking 2013-06-09 23:29:43 +02:00
main.nim Take into account dirty buffers in suggest output; Fixes zah/nimrod.vim#14 2013-08-07 18:58:46 +03:00
modules.nim 'modules' module from 'main'; minor bugfixes 2013-07-20 20:17:23 +02:00
msgs.nim implemented computed goto support 2013-08-13 11:21:02 +02:00
nimconf.nim fixes token's column information 2013-07-30 08:45:00 +02:00
nimeval.nim first steps to a new evaluation engine 2013-07-24 21:39:39 +02:00
nimlexbase.nim nimrod dump can now produce a machine readable json report 2013-05-01 20:46:05 +03:00
nimrod.cfg Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
nimrod.dot Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
nimrod.ini fixes 465 2013-06-09 23:51:29 +02:00
nimrod.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
nimsets.nim fixed and documented computedGoto pragma 2013-08-22 08:38:47 +02:00
nversion.nim preparations for version 0.9.4 2013-05-25 23:37:40 +02:00
options.nim Experimental support for delayed instantiation of generics 2013-08-23 01:10:20 +03:00
parampatterns.nim implemented large parts of the 'not nil' checking 2013-06-09 23:29:43 +02:00
parsecfg.nim nimrod dump can now produce a machine readable json report 2013-05-01 20:46:05 +03:00
parser.nim Revert "Revert "allow keyword params for the [] and {} operators"" 2013-08-19 01:29:22 +03:00
passaux.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
passes.nim fixes #429 and tstmtexpr 2013-05-12 21:01:39 +03:00
patterns.nim lazy paths for Babel support 2012-12-11 20:06:15 +01:00
pbraces.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
pendx.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
platform.nim --os:standalone works again 2013-06-30 21:15:28 +02:00
pragmas.nim implemented computed goto support 2013-08-13 11:21:02 +02:00
pretty.nim new VM: next steps 2013-08-03 21:14:57 +02:00
procfind.nim merged the persistent scopes work with the delayed proc compilation strategy 2013-05-12 14:41:32 +03:00
readme.txt Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
renderer.nim bugfix: rendering of typ|typ2 2013-06-27 19:57:01 +02:00
rodread.nim remove some more references of containerID after merging 2013-05-04 18:10:43 +03:00
rodutils.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
rodwrite.nim 'nimrod pretty' usable 2013-07-31 20:35:04 +02:00
ropes.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
saturate.nim changed integer promotion rules; breaks bootstrapping and lots of code 2012-07-08 21:03:47 +02:00
sem.nim fixes #503 2013-07-02 19:32:12 +02:00
semcall.nim merged the persistent scopes work with the delayed proc compilation strategy 2013-05-12 14:41:32 +03:00
semdata.nim remerge "Fixes #267" 2013-08-19 01:26:37 +03:00
semdestruct.nim get rid of the SymTab* procs in astalgo 2013-05-12 00:49:00 +03:00
semexprs.nim Revert "Revert "fix threading tests"" 2013-08-19 01:29:58 +03:00
semfold.nim Experimental support for delayed instantiation of generics 2013-08-23 01:10:20 +03:00
semgnrc.nim fixes #531 2013-07-24 23:07:28 +02:00
seminst.nim Experimental support for delayed instantiation of generics 2013-08-23 01:10:20 +03:00
semmagic.nim Experimental support for delayed instantiation of generics 2013-08-23 01:10:20 +03:00
sempass2.nim fixes #534 2013-08-07 00:01:58 +03:00
semstmts.nim Experimental support for delayed instantiation of generics 2013-08-23 01:10:20 +03:00
semtempl.nim Merge branch 'master' of github.com:Araq/Nimrod 2013-05-14 00:59:07 +02:00
semthreads.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
semtypes.nim Experimental support for delayed instantiation of generics 2013-08-23 01:10:20 +03:00
semtypinst.nim Experimental support for delayed instantiation of generics 2013-08-23 01:10:20 +03:00
service.nim fix compiling after suggest 2013-05-05 16:34:00 +03:00
sigmatch.nim Experimental support for delayed instantiation of generics 2013-08-23 01:10:20 +03:00
suggest.nim Take into account dirty buffers in suggest output; Fixes zah/nimrod.vim#14 2013-08-07 18:58:46 +03:00
syntaxes.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
tccgen.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
transf.nim fixes lots of regressions 2013-06-29 10:04:18 +02:00
trees.nim implemented large parts of the 'not nil' checking 2013-06-09 23:29:43 +02:00
treetab.nim Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
types.nim hacky fix for generic constraints matching 2013-08-19 01:48:25 +03:00
vm.nim implemented opcTypeTrait 2013-08-22 19:28:34 +02:00
vmdef.nim new VM: preparations for evalMacroCall 2013-08-11 18:48:33 +02:00
vmdeps.nim implemented opcTypeTrait 2013-08-22 19:28:34 +02:00
vmgen.nim implemented opcTypeTrait 2013-08-22 19:28:34 +02:00
wordrecg.nim implemented computed goto support 2013-08-13 11:21:02 +02:00

This directory contains the Nimrod compiler written in Nimrod. Note that this
code has been translated from a bootstrapping version written in Pascal, so
the code is **not** a poster child of good Nimrod code.