12

I've recently came across ghcjs haskell-to-javascript compiler, but I am not sure how "ready" it is. It seems to have little activity over the last year.

Is there an equivalent to GWT in Haskell?

Also, more of a discussion question:do you think there will be a gwt haskell equivalent? Why or why not?

2

2 Answers 2

9

There are several such compilers which can be used right away.

Sign up to request clarification or add additional context in comments.

1 Comment

7

Ji seems relevant, although it doesn't do any Haskell-to-JS compilation; it lets a Haskell server control a browser connected to it via AJAX.

It seems like UHC supports compiling to JavaScript and has some libraries along those lines, but I don't know what UHC's compatibility with GHC extensions is like, or how mature the support is.

I'm not convinced compiling full Haskell to JavaScript is a productive route; the overhead of implementing the likes of lazy evaluation on top of a high-level language is likely to be significant, and all the attempts so far (I haven't checked out UHC's generated code) seem to produce rather huge JavaScript (admittedly, HTTP compression mitigates this).

I don't think ghcjs is being actively developed, but it might be more stable than UHC's support. Yhc's support seems to be the furthest so far, but unfortunately Yhc is a dead project.

4 Comments

Wow, that is amazing! Ji, that is. It would be extremely wicked if there was a templating engine in there, and some kind of url routing. How in the world does it "control" the browser? I thought the only way was through AJAX!
@drozzy: Via AJAX, like I said :)
Oh, I just saw the little js file hidden in there! Haha, clever.
GHCJS is actively maintained at the moment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.