- How hard would it be to make a backend for Dart language?
- How one would implement the Aff? (bc it’s not possible to terminate Futures)
Would be awesome to write web and mobile (that works faster then react-native written apps) on the same language
Would be awesome to write web and mobile (that works faster then react-native written apps) on the same language
One aspect of Dart that makes it more difficult is that
Dart does not support tail-call optimization. There are no current plans to add it.
Other relatively non-trivial thing is compiling pattern matches to decision trees, see for example this paper https://www.cs.tufts.edu/~nr/cs257/archive/luc-maranget/jun08.pdf
If you use the purescript-backend-optimizer
project to codegen Dart, it already does the decision tree optimization, which is more clearly explained here (purescript-backend-optimizer/optimized-pattern-matching.md at main · aristanetworks/purescript-backend-optimizer · GitHub), and implemented in that project here (purescript-backend-optimizer/Convert.purs at main · aristanetworks/purescript-backend-optimizer · GitHub)
This is the approach we’re currently taking in the purescm
backend, which will compile PureScript to Chez Scheme.