4 ms·
It makes one want a statically typed Lisp with a macro preprocessing step, or something. You want s-expressions, like Ocaml and GCC use.
by mahmud 16y ago
It makes one want a statically typed Lisp with a macro preprocessing step, or something.
You want s-expressions, like Ocaml and GCC use.
- barrkel 16y agoI'm sorry, are you suggesting that GCC is written in sexprs? For OCaml, a more relevant suggestion might be Camlp4. What I'm describing is the need for a language in which to write the compiler for the compiler's source code, so that the compiler's source code can be both high-level enough, and statically typed. Simple sexprs describing a tree aren't strongly typed enough.
- mahmud 16y agoNo, GCC is not written in s-expressions, but GNU RTL is. You can write an RTL processor in Lisp and have macros both for input and processor itself. If you want to explore macros for infix algolish languages, look into Jonathan Bachrach's D-Expressions for Dylan. Some of the people who first implemented it are here on HN as well.
- barrkel 16y agoLisp isn't good enough; both the structures and the functions are to be statically typed, that's the point. If we didn't care about static typing, this whole debate would be moot, and one could write the compiler in C with tag-discriminated unions if you like (which is in fact the AST format for the Delphi compiler).