I've fiddled with GHCJS Elm before, and it's a complicated road to go down. Elm-format on GHCJS is a much easier starting point.
Compiling a single Elm file with no standard library is quite easy, since you can just compile the elm-compiler library using GHCJS. However, it's trickier to get the prelude and packages working, since elm-package assumes you are using a file-system. It also uses the network library for fetching information, which uses a C FFI and thus can't compile to JS. There's been talk of rewriting an alternate elm-package/elm-make for the browser, but I don't know if anyone's made progress on that. On Thu, May 26, 2016 at 2:10 PM, Gabriel Grinberg <[email protected]> wrote: > Thanks Rex! > I actually wanted to do that in the first place - compile the Elm compiler > to JS but that didn't go to well. I hope it's possible and will try to find > time to try again. > If anyone has experience with GHCJS a client side elm com.piler can be > awesome! > On May 26, 2016 11:02 PM, "Joey Eremondi" <[email protected]> wrote: > >> Either that or GHCJS, which seems to have a lot more support from the >> Haskell community. (Not sure why though). >> >> Looking here >> <https://www.reddit.com/r/haskell/comments/31ui2h/whats_the_current_status_of_ghcjs_vs_haste/> >> it sounds like GHCJS is more complete and closer to GHC, but Haste makes >> cleaner JS. Maybe both are worth a try? >> >> On Thu, May 26, 2016 at 1:00 PM, Gage Peterson <[email protected]> >> wrote: >> >>> I think that looking at: https://github.com/valderman/haste-compiler >>> would be cool. This means that things like the elm-fmt and the elm compiler >>> itself could be (maybe easily) run in the browser. >>> >>> >>> On Thursday, May 26, 2016 at 10:52:10 AM UTC-6, Rex van der Spuy wrote: >>>> >>>> This is wonderful, thank you!! >>>> I will be using it all the time :) >>>> >>>> I know this is out-of-scope but.... >>>> >>>> ... how difficult would it be to go a few steps further and turn this >>>> into an all-in-one Elm IDE, that also works offline? >>>> A no-setup programming environment (for students especially) that's a >>>> one-stop-shop for writing and compiling Elm programs would be amazing. >>>> Anyone care to comment? >>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Elm Discuss" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Elm Discuss" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/elm-discuss/ZI7UKO1xuBk/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "Elm Discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
