User loginNavigation |
Multi-Stage LanguagesFrom the Meta O'Caml tutorial.
Ignoring O'Caml for now, I have tried with the design of several languages to syntactically distinguish between multiple stages (like C++ does with its template system and macro system), and now I have been asking myself the fundamental question: is that really a good idea? If a language is pure (or at least side-effects are contained within some construct like monads) can the compiler not simply choose to apply as many stages as desired, using only partial evaluation? The reason I ask the question is that if I do something like create a subset of the language with a different notation, it just obfuscates things. It seems it would be much easier to provide metaprogramming primitives, and let the compiler's partial evaluation phase try to work out what it can, and do the rest at run-time. This may even solve some thorny type-system problems. So to sum up: my hypothesis is that I should let people write code, as if types are a first class citizen. The partial-evaluation phase will pre-execute what it can. Any non-resolved type expressions will be evaluated at run-time. Any thoughts on the subject would be welcome. By cdiggins at 2006-08-25 16:06 | LtU Forum | previous forum topic | next forum topic | other blogs | 7942 reads
|
Browse archives
Active forum topics |
Recent comments
27 weeks 2 days ago
27 weeks 2 days ago
27 weeks 2 days ago
49 weeks 3 days ago
1 year 1 week ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 5 weeks ago
1 year 10 weeks ago
1 year 10 weeks ago