Earlier quoted context omitted.
I assure you that it's not a trick question, just a poorly worded one. Imagine that I'm making a page that converts meters to millimeters. The obvious part of the haskell code is convert :: Double -> Double convert = 1000 * The part which isn't obvious to me is how I get input from the user or display the result. I know how to do that in the IO monad through standard haskell, but I wouldn't know how to handle it in H…
I think fay uses its own FFI, but with haste you just use the normal FFI to call normal javascript functions the same way you would interface with C code from haskell. There's no need for special bindings or anything. You could certainly make a wrapper for jquery if you were crazy (and I'm sure someone has already done so), but this idea that you need some special DOM library to do things that javascript already does…
Why OCaml, Why Now?
101–106 of 106 posts
Re: Why OCaml, Why Now?
#102For me Scala has been the not-quite-as-good-as-haskell-but-more-industrially-acceptable language. I'd be very interested to see a more neutral comparison of functional languages for compile-to-JS, because if anything Haskell seems more popular for that - I hadn't heard anything about compiling OCaml to JS before this.
I've put a lot of work into a compile-to-JS evaluation for my day job. It's not suitable for public consumption, but of our top 5 choices: - both Kotlin and ClojureScript don't compile code written in their "native" language (java) to JavaScript, limiting the ability to leverage existing libraries. - ScalaJS is still experimental. - Haskell looked promising, I asked a haskell programmer to run that evaluation for me,…
Re: Why OCaml, Why Now?
#103Earlier quoted context omitted.
I've put a lot of work into a compile-to-JS evaluation for my day job. It's not suitable for public consumption, but of our top 5 choices: - both Kotlin and ClojureScript don't compile code written in their "native" language (java) to JavaScript, limiting the ability to leverage existing libraries. - ScalaJS is still experimental. - Haskell looked promising, I asked a haskell programmer to run that evaluation for me,…
Did you examine Ceylon? It seems to avoid the problem you describe with Kotlin and ClojureScript by explicitly abandoning the Java native library.
Re: Why OCaml, Why Now?
#104Earlier quoted context omitted.
This won't be a problem for very long. See http://www.cl.cam.ac.uk/~sd601/multicore.md for the working design.
But "someday we'll only be a decade behind haskell" isn't much of a reason to choose ocaml over haskell.
Re: Why OCaml, Why Now?
#105Earlier quoted context omitted.
But "someday we'll only be a decade behind haskell" isn't much of a reason to choose ocaml over haskell.
I don't think multicore will be touted as a reason to choose OCaml over Haskell, but it will remove one of the reasons to avoid OCaml. Subtle but important difference :)
Re: Why OCaml, Why Now?
#106Earlier quoted context omitted.
> everything will parse fine. That's an exaggeration. There are circumstances in files where it's necessary. I didn't realize this, which hung me up for a long time.
Would you care to share an example? I've never encountered a justifiable need to write ;; outside the REPL. The only uses of ;; I've encountered "in the wild" were hardly reasonable: essentially top-level code that was not wrapped in a "let () = ..." statement.