4 ms·
Why do we need this? We've already had Frege (https://github.com/Frege/frege https://github.com/Frege/frege) filling this role for roughly three years now. Seem
by taylodl 10y ago
Why do we need this? We've already had Frege (https://github.com/Frege/frege https://github.com/Frege/frege) filling this role for roughly three years now. Seems to me the DRY principal doesn't just apply to personal projects but to public works as well.
- psibi 10y agoThis might be helpful: * https://github.com/typelead/eta/blob/master/docs/source/faq.rst#how-is-eta-different-from-frege https://github.com/typelead/eta/blob/master/docs/source/faq.... * https://github.com/typelead/eta/issues/3 https://github.com/typelead/eta/issues/3
- paulddraper 10y agotl;dr Freda uses a modified version of GHC and doesn't have a lot of commonly used extensions.
- dualogy 10y agoI'd hope Eta "just" focuses on compiling GHC's core (not Core) intermediate-representation STG (or C--) into Java bytecode: then, no need to forever catch up re-implementing the ever-evolving language extensions, plus this just gets you all the desugaring / Core-to-Core optimization/simplification roundtrips, custom rewrite-rules, type checking / verification etc pp from GHC. In fact no need for any great checks and verifications, "just" (probably highly intricate in the end) a series of code format transformations.. in theory ;) GHC's various intermediate representations are pretty brilliant and thus I think should be leveraged as much as possible when it comes to new compilation targets and transpilation. Fun fact, seems as of 2002 there was for a while an STG-to-JVM backend. Now there's issues with this approach too! You'd end up with a massively convoluted set of mappings of Haskell's factory defaults to the JVM's. We're talking the equivalents of `Prelude` module, `base` package, the RTS (garbage collector and much more.. ouch!), and for each and every individual instance deciding where to draw the line between Java's built-ins' semantics and GHC's would be a massive challenge. What's with GHC's existing LLVM backend, does LLVM not have their own Java byte-code backend(s)? (OTOH, additional major dependencies always kinda bite..)
- rahulmutt 10y agoEta in fact only deals with STG code -> Java bytecode transformation. I agree that the intermediate transformations are brilliant, so I am very careful about playing around with the frontend bit of the GHC codebase. Eta currently implements almost all of GHC's primitive operations faithfully. I have taken extreme care in preserving semantics. In some obscure cases though, I just gave up since there are no platform-independent ways of implementing certain things (like vectorised instructions).
- dualogy 10y agoNow that's awesome to hear! Can't wait to give this a go for making an Android app on the next occasion that pops up
- sbare109 10y agoFrege already has an Android library on the works. You could try that.
- sbare109 10y agoFrege already has an Android library on the works. You could try that.
- rahulmutt 10y agoGHC 8 will take some time. The current position is to prioritize those new extensions which start creeping up in Hackage libraries. There were significant changes to the codebase in 8 and I want to wait until it's stabilized. Eventually, yes.