Live data from Hacker News

Why OCaml, why now? (2014)

spyder.wordpress.com

1–10 of 132 posts

Re: Why OCaml, why now? (2014)

#4
> The first question I usually get ... is “Why not Haskell?”.

> The answer is JavaScript.

My current favorite language for this is Elm[1]. It compiles to JS, is based on Haskell, and has a few simple differences between either[2].

Elm doesn't let you use the tons of available Haskell libraries, and makes it slightly painful to integrate with JS. But it's the coolest thing for the web so far. And here's why:

It uses a completely declarative state machine to model a fully interactive and complete GUI! This is the dream React.js and Om didn't even know they were heading towards! And yes, it is as good as it sounds.

[1]: http://elm-lang.org/

[2]: http://elm-lang.org/learn/FAQ.elm

EDIT:

Also, Elm fixed Haskell's awful syntax record name collision problem, and awesomely too!

Re: Why OCaml, why now? (2014)

#7

> The first question I usually get ... is “Why not Haskell?”. > The answer is JavaScript. My current favorite language for this is Elm[1]. It compiles to JS, is based on Haskell, and has a few simple differences between either[2]. Elm doesn't let you use the tons of available Haskell libraries, and makes it slightly painful to integrate with JS. But it's the coolest thing for the web so far. And here's why: It uses a…

Purescript[1] is also gaining some traction and even has a pretty nice looking book out. [2]

It has some changes however; most notably it's strictly evaluated rather than lazy, and there are differences in how it handles type variables. [3]

Personally though, I've grown more fond of F# than Haskell; I only wish the documentation for Websharper and Funscript was more solid.

[1] http://www.purescript.org/ [2] https://leanpub.com/purescript/read [3] https://github.com/purescript/purescript/wiki/Differences-fr...

Re: Why OCaml, why now? (2014)

#8
post #3

Now that .net is going cross platform, I see a great future of f# (another variant of ML family). Its got multi processors support too.

Is there somewhere one can follow the Mac and Linux ports? I'm stoked about F#/OCaml too.

Have you tried Mono and Monodevelop? I have used C# with Mono and for back-end work (non-GUI) and it works pretty well so far. I think they have F# support as well.

Re: Why OCaml, why now? (2014)

#9

> The first question I usually get ... is “Why not Haskell?”. > The answer is JavaScript. My current favorite language for this is Elm[1]. It compiles to JS, is based on Haskell, and has a few simple differences between either[2]. Elm doesn't let you use the tons of available Haskell libraries, and makes it slightly painful to integrate with JS. But it's the coolest thing for the web so far. And here's why: It uses a…

Time to plug Kris' blog post about Haskell in the browser: http://blog.jenkster.com/2015/02/a-brief-and-partial-review-...

TLDR: he thinks elm's the most practical approach right now.

Re: Why OCaml, why now? (2014)

#10
post #7

> The first question I usually get ... is “Why not Haskell?”. > The answer is JavaScript. My current favorite language for this is Elm[1]. It compiles to JS, is based on Haskell, and has a few simple differences between either[2]. Elm doesn't let you use the tons of available Haskell libraries, and makes it slightly painful to integrate with JS. But it's the coolest thing for the web so far. And here's why: It uses a…

Purescript[1] is also gaining some traction and even has a pretty nice looking book out. [2] It has some changes however; most notably it's strictly evaluated rather than lazy, and there are differences in how it handles type variables. [3] Personally though, I've grown more fond of F# than Haskell; I only wish the documentation for Websharper and Funscript was more solid. [1] http://www.purescript.org/ [2] https://l…

Elm is actually 3 things rolled into one:

1. an language very similar to Haskell

2. a set of runtime libraries

3. a technique for modeling a GUI as a declarative state machine

PureScript only competes with #1 and #2 here. Where Elm really shines is #3, which #2 helps with a lot.

Technically #3 could be done in any language. But it really helps to model it in such an expressive language with immutable data and no side-effects (except via Signals).

Post reply on HN