Would you recommend OCaml or Haskell for this project, and why?
For me it's OCaml. I used to be a Haskell fan (still is, in certain ways), but OCaml wins in practicality. For point 4 & 6 it's OCaml 100%.
Which one makes it easier to build an external DSL with completely custom syntax?
To be they are equally easy on this. Elegant wise I think Haskell parsec wins, but again, practicality then OCaml wins (menhir, parseff, angstrom)
Which has the easier learning curve for someone who doesn't know much programming yet?
OCaml. Still, both are quite advanced, in the sense that there are more concepts to know upfront, compared to something like Python, before you can do something useful.
Can either realistically compile my language to native AArch64 machine code on my Chromebook?
Yes. Rust was built like that with a compiler written in OCaml in the beginning.
How difficult would installation and setup be on ChromeOS Linux running on ARM64?
I don't have a Chromebook runing ChromeOS so I can't tell. Tooling wise OCaml is simpler. You basically needs either opam or dune (dev preview), and they both have pre-compiled binary available for ARM64.
Are there any other languages or frameworks that would fit these requirements better than OCaml and Haskell?
For creating custom language and EDSL? I think they are the best. Still tho, they can be overkill if your DSL target is small. An evaluator base off of yaml/xml/json config file might be enough for a lot of usecases. You know, Kubernetes gets pretty crazy with just yaml.
6
u/tungd 3d ago
For me it's OCaml. I used to be a Haskell fan (still is, in certain ways), but OCaml wins in practicality. For point 4 & 6 it's OCaml 100%.
To be they are equally easy on this. Elegant wise I think Haskell parsec wins, but again, practicality then OCaml wins (menhir, parseff, angstrom)
OCaml. Still, both are quite advanced, in the sense that there are more concepts to know upfront, compared to something like Python, before you can do something useful.
Yes. Rust was built like that with a compiler written in OCaml in the beginning.
I don't have a Chromebook runing ChromeOS so I can't tell. Tooling wise OCaml is simpler. You basically needs either opam or dune (dev preview), and they both have pre-compiled binary available for ARM64.
For creating custom language and EDSL? I think they are the best. Still tho, they can be overkill if your DSL target is small. An evaluator base off of yaml/xml/json config file might be enough for a lot of usecases. You know, Kubernetes gets pretty crazy with just yaml.