glathoud/flatorize

flatorize_ocaml?

glathoud opened this issue · 1 comments

See if we can derive OCaml code generation without too much pain, most likely by cloning flatorize_c.

Closing the issue because it is not worth the work in this particular case:

  • translating from the C/D/JS-like expression syntax to the OCaml syntax requires significant work.
  • flatorize, as it is now, does not enforce any grammatical constraint on expressions.
  • on the other hand, OCaml itself is a perfect candidate to define a grammar, and derive an efficient implementation from it (see below).

In the OCaml case, it would make a lot more sense to:

  • define a mathematical grammar,
  • derive an implementation of flatorize from that grammar, which expands recursive and/or complicated mathematical expressions into flatorized expressions, still expressed in that grammar,
  • convert the flatorized expression into generated code for the language of choice (OCaml itself or any other).