What is the most Haskell compiler for the product level compiler to write code running in the browser?

I am not looking for an unsurpassed super-reliable solution with a 10-year history, but for something that can be used in real applications, it goes beyond just the possibility of launching the Hello World example.

My preference is to run the compiler on the server, so I can compile the Haskell code in advance. Of course, the solution should be more than just a compiler, and include Haskell code to access the API available in the browser (DOM, XHR ...).

Footnote: the projects that I have seen so far do not seem to be actively supported or cannot launch the "Hello world", or in some cases even go beyond the project description.

+50
javascript haskell code-translation
Jun 07 2018-11-21T00:
source share
6 answers

Here is a more complete list:

http://www.haskell.org/haskellwiki/The_JavaScript_Problem

and there is also Fay (although this is only a subset of haskell)

https://github.com/faylang/fay

+15
May 14 '12 at 12:51
source share
— -

You may find this list useful: https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS

From the list:

* UHC (Utrecht Haskell Compiler) backend converts UHC core to JavaScript, allowing the compiling of Haskell code to JS. * YHC (York Haskell Compiler) backend, as above but with YHC core language. * jshaskell 

I know it is not Haskell, but Coffee script is an expression based on and rather elegant IMHO.

+9
Jun 07 2018-11-22T00:
source share

I came across this project called ghcjs

Seems promising!

Quote from README :

Haskell Javascript Translator

The goal of the project is to provide a solution for

  • compile modern Haskell libraries into Javascript files and use them in Ajax applications or
  • develop a complete Haskell Ajax application

The previous version of the project is in vir.mskhug.ru .

+8
Jun 15 '11 at 19:43
source share

While GHCJS does not seem to be actively supported, Emscripten seems pretty relevant.

  • Emscripten compiles LLVM bit code in JavaScript.
  • GHC LLVM backend is actively developing.
  • Intuitively, to answer the question, the following pipeline may not be very far from "product quality": Haskell lexemes (-> GHC →) LLVM lexemes (-> Emscripten →) JavaScript lexemes

I admit that this is a speculative post.

+7
Dec 05
source share

This language, Roy , may not be exactly Haskell (?), But it seems very similar:

http://roy.brianmckenna.org/

Roy seems alive; there are many forks in the GitHub repository: https://github.com/pufuwozu/roy
and it seems alive: https://github.com/pufuwozu/roy/graphs


If you are using Play Framework 2.0, then there is a Ray plugin to run Roy on Play Framework 2.0:

http://brianmckenna.org/blog/ray
https://github.com/pufuwozu/ray

The last commit was four months ago, which was a long time ago, bearing in mind that the Play Framework 2 was released, possibly 4 or 5 months ago.

+2
Jun 19 '12 at 2:16
source share

There is a list of candidates for the "most production level" from Yesod: https://github.com/yesodweb/yesod/wiki/Javascript-Options (Yesod is a very popular Haskell web frame so they can know what they are talking about)

0
May 23 '12 at 19:58
source share



All Articles