3 ms·
I wonder how feasible it would be to develop PureScript back-ends for Swift (for the Apple platforms), Java (for Android), and C# (for Windows).
by mwcampbell 10y ago
I wonder how feasible it would be to develop PureScript back-ends for Swift (for the Apple platforms), Java (for Android), and C# (for Windows).
- purescript 10y agoWe recently added a way to dump out the compiler's intermediate representation as JSON, so it's actually very straightforward to create new backends by transforming that output [1]. The representation is fairly compact, so the requirements for a PureScript compiler backend are fairly minimal. You just have to translate all of the features of the IR: - Functions with lexical scoping - Support for the primitive types defined by PureScript (we need to define some of these types more concretely in a specification) - A way to encode records. This could be something like JavaScript's objects, or just a map data structure. The JS backend actually does more optimizations before code generation, but it starts from the same intermediate representation. [1] https://github.com/paf31/24-days-of-purescript-2016/blob/master/22.markdown https://github.com/paf31/24-days-of-purescript-2016/blob/mas...
- fuzzythinker 10y agoThere is https://github.com/andyarvanitis/purescript-native https://github.com/andyarvanitis/purescript-native for C++11.