Hacker News new | ask | show | jobs
by codethief 1036 days ago
This is such a great comment, which I didn't expect to find in this thread at all! I've been thinking about application "phases" for a while and I wasn't aware that there was research being done in this direction. Do you happen to have any more references beyond Racket and the link above?

> IMO it's better if the language allows the programmer to express phases as a language concept.

Yeah, not just to make life easier for the compiler, but I suspect it'd also make it easier to read & reason about the code.

I mean, performance gains are nice but sometimes performance isn't really the bottleneck but reading & maintaining that unholy cocktail of application code, bash scripts, schema files & specs, build scripts, code generators, Dockerfiles, and Gitlab YAMLs is.

2 comments

"Composable and compilable macros: you want it when?", Matthew Flatt https://scholar.google.com/citations?view_op=view_citation&h...
This is a great paper. The general idea is often called "multi-stage programming". The academic work has mainly focused on performance, which I don't think is the most interesting use in industry.
Perhaps you wish to look at Common Lisp? I think it gets you covered in all those things you mention. There is distinct read, compile and evaluation phase, all exposed to the application code.

If you get a good compiler like sbcl, you can go a long way with just the language itself since the language itself offers a blend of scripting language qualities while being a compile language. Emacs Lisp can go long way too.