44 ms·
Now that the native ocaml repl has landed, can't we just slap a s-expression syntax on top of ocaml and call it a day? We would have homoiconicity and the macro
by rixed 4mo ago
Now that the native ocaml repl has landed, can't we just slap a s-expression syntax on top of ocaml and call it a day? We would have homoiconicity and the macros that go with it, and still could call "(compile `some-code)". Isn't that enough?
- wryoak 4mo agoNothing will ever be enough, for all interpretations of the statement, reveling in all the irony, pathos, and prideful triumph that could possibly be extracted from such interpretations from here to eternity Humans will keep inventing and remixing
- drob518 4mo agoWe have a deep capacity for remixing.
- gwerbin 4mo agoI'd love that. The janky OCaml syntax is my least favorite part of the language.
- aidenn0 4mo agoAside from the fact that slapping an s-expression syntax on top of a language typically leaves you with a fairly crappy Lisp, that would also lack the excellent Common Lisp interop that Coalton has.
- gwerbin 4mo agoOCaml is a better candidate than most. It already has a macro system (PPX), and the core language has a lot in common with Scheme.
- rixed 4mo agoThe PPX macro system is far from perfect, that's the whole point of this idea: with the native REPL + an s-expression syntax, you have lisp-like macros for free.
- classified 4mo agoS-expressions are more than mere syntax. Lists in OCaml can only have a single element type, so you would need something different for s-expressions.
- lindig 4mo ago> native ocaml repl has landed What does this refer to? Most people use the OCaml `utop` REPL which isn't okay for some printf debugging but nowhere near what a Lisp could do.
- rixed 4mo agoThere is a native toplevel hidden in OCaml5 source tree (not installed by default). So you can basically enter an expression, and the compiler will turn it into native code and dynamically load it. Interactive REPL with native code was not possible before that (apart from a short lived experiment long ago, if memory serves me well).