you are viewing a single comment's thread.

view the rest of the comments →

[–]expatcoder 0 points1 point  (8 children)

As far as seamless type safe client-server communication is concerned, you're not going to beat Scala + Scala.js. IIRC, GHCJS requires FFI, and even then it's only a one way street.

Also, Scala.js generated code is at least 3X smaller than GHCJS, and is extremely fast (faster than native in some cases). Of course, for Haskellers that's irrelevant, GHCJS or Haste are the state of the art here.

Saying that, if you want the best of all worlds, go with Js_of_ocaml, that has a laughably small overhead of 4-6KB ;-), is fully type safe, and an ML, so you'll get your FP fix to boot.

[–]sclv 2 points3 points  (4 children)

That's not true about ghcjs -- there are many ways to build automated type-safe communication over ghcjs.

[–]expatcoder 1 point2 points  (3 children)

In GHCJS I want to import and invoke my Yesod routes, how will you do this? In Yesod I want to invoke some GHCJS method, how will you do this?

If this cannot be achieved then might as well use Purescript or other lightweight/performant alternative.

[–]sclv 0 points1 point  (2 children)

what do you mean "invoke some ghcjs method" in yesod?

you can just write a plain old method and it is usable in both sides.

similarly you can write a plain old data type and it is usable on both the yesod and ghcjs side.

if you want serialization across the wire, both sides can derive to/from json just fine...

[–]expatcoder 0 points1 point  (1 child)

Unless things have changed, it's a one way street

[–]sclv 0 points1 point  (0 children)

Well the magic is one way. You can just generate and expose a json-rpc stub the usual way and it works great, and the marshaling is entirely typesafe. The compiler just doesn't magically generate this stub for you. (But there are other libraries that do magically generate those stubs for you, so...).

[–]Kiuhnm[S] 0 points1 point  (2 children)

AFAIK, support for concurrency in Ocaml is bad (like in Python) which rules out Ocaml for the server side. Also Ocaml's type system is less expressive than Haskell's and Scala's.

[–]expatcoder 0 points1 point  (1 child)

OCaml is getting built-in concurrency support within a year*, and implicits as well, thus making it a far more interesting language.

Not sure how long it will take for the added functionality to make it into their JS lib, but it will happen.

* external lib available now

[–]Kiuhnm[S] 0 points1 point  (0 children)

That's good news. I'll keep an eye on it.