3 ms·
If you want to use OCaml-like GADTs and pattern matching in Python then there is the Haxe -> Python route. The Haxe compiler is actually written in OCaml and i
by nickmain 5y ago
If you want to use OCaml-like GADTs and pattern matching in Python then there is the Haxe -> Python route.
The Haxe compiler is actually written in OCaml and its type system is influenced by it.
- adsharma 5y agoThanks for the link. I'm thinking along the same lines and might derive some inspiration from Haxe on how to evolve python syntax to support features like GADT and FP that can be easily transpiled to other languages. It looks like Haxe was designed from day 1 to be transpiler friendly, whereas I'm trying to leverage python's popularity and language ecosystem to achieve similar goals. Sticking to a strict subset of python has the advantage that all the scripts are directly executable by the python interpreter. If we add some features (say implemented pattern matching similar to OCaml), we lose that. Perhaps some macros/library features can bridge that gap. Or over time, python evolves to be more like OCaml.