Earlier quoted context omitted.
I write all my javascript in haskell, and haven't had any problems. What do you need/want "DOM bindings" for?
As someone who would like to write his javascript in Haskell, how do you put text on the page without interfacing with the browser's DOM?
Why OCaml, Why Now?
11–20 of 106 posts
Re: Why OCaml, Why Now?
#12I'm glad that the author is picking up a new functional programming language, but choosing OCaml over Haskell because of support for the Javascript implementations strikes me as choosing a BMW over a Mercedes[0] because of the number of cupholders it has. If you don't have a particular goal in mind (ie, "I work at Jane Street and need to be compatible with our existing code"), there are a number of other factors in t…
Having a solid implementation for your target platform is very good reason to pick a language.
Re: Why OCaml, Why Now?
#13I'm glad that the author is picking up a new functional programming language, but choosing OCaml over Haskell because of support for the Javascript implementations strikes me as choosing a BMW over a Mercedes[0] because of the number of cupholders it has. If you don't have a particular goal in mind (ie, "I work at Jane Street and need to be compatible with our existing code"), there are a number of other factors in t…
Re: Why OCaml, Why Now?
#14For 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 just started at a Microsoft shop a few months ago (first time for everything), and I actually quite like F#, now that I've had a little while to play with it. It's a good contender for the NQAGAHBMIAL throne. Having used CMUCL/SBCL for a while, I always found ocaml's "well, you can compile your code, but then you can't run it in the REPL" to be off-putting. (For my purposes the CLR JIT compiler for F# is good enoug…
Re: Why OCaml, Why Now?
#15How do those "to js" code generator behave when used together with frameworks like backbone or angular ? I know things like typescript or dart have special versions of the framworks, but i'm curious to know how the ocaml to js tools behave ( since i've searched for a decent strongly typed server side technology for years, that would be an argument for me to try that language).
Re: Why OCaml, Why Now?
#16Earlier quoted context omitted.
I write all my javascript in haskell, and haven't had any problems. What do you need/want "DOM bindings" for?
As someone who would like to write his javascript in Haskell, how do you put text on the page without interfacing with the browser's DOM?
main = plainText "Hello, World!"
From the page: "Elm is a functional language that compiles to HTML, CSS, and JavaScript".
So yes, technically this is working with the DOM. But you are not writing code that interacts with a "DOM binding" directly per se.
Re: Why OCaml, Why Now?
#17It is a mature yet actively developed whole program optimized, strongly typed, polymorphic, ML like language that can interact effortlessly with C and C++ and has coroutines and threads baked in, although use of threads is somewhat discouraged. It has type-classes as well as modules. Functions written in it may be exported as a CPython module. This might be useful if one wants to gradually transition from a Python based src tree.
It uses a mix of lazy and eager evaluation for performance and compiles down to C++. Execution speed is comparable to hand written C++, mostly better. Its grammar is programmable in the sense that it is loaded as a library. So in the same way that languages may acquire libraries, Felix may acquire domain specific syntax.
It is also mostly a one man effort but with a feverish pace of development so it comes with its associated advantages and disadvantages.
Tooling info is here http://felix-lang.org/share/src/web/ref/tools.fdoc
The author likes to call it a scripting language but it really is a full-fledged statically compiled language with a single push button build-and-execute command. http://felix-lang.org/ The "fastest" claim is a bit playful and tongue in cheek, but it is indeed remarkably fast.
Re: Why OCaml, Why Now?
#18This might be entirely superficial of me, but I always preferred Haskell over OCaml simply because OCaml required me to type ";;" after every line. The only real reason that I can see to choose OCaml over Haskell is that if you learn OCaml, you might be able to work at Jane Street. Is there a strong argument for abandoning my Haskell-ing for OCaml?
;; is a special token used only in the REPL to force evaluation, it is not something you ever use in real code.
Re: Why OCaml, Why Now?
#19Earlier quoted context omitted.
As someone who would like to write his javascript in Haskell, how do you put text on the page without interfacing with the browser's DOM?
http://elm-lang.org/ for example. To display text in the browser you would use - main = plainText "Hello, World!" From the page: "Elm is a functional language that compiles to HTML, CSS, and JavaScript". So yes, technically this is working with the DOM. But you are not writing code that interacts with a "DOM binding" directly per se.
http://purescript.readthedocs.org/en/latest/intro.html#hello...
Re: Why OCaml, Why Now?
#20Haskell is an Ivory Tower. The features that generally draw one to the language also tend to be the things that eventually push one away. Haskell has grown a lot over the years however as the language evolves to allow general programming within a pure framework.
OCaml on the other hand tends to make a compromise, acknowledging that the programmer occasionally needs a different tool for the job. OCaml allows the programmer to opt into things like mutability and objected oriented code when the need arises. These compromises can also be seen as the languages downside however.
I find it interesting that the driver for the author into OCaml is JavsScript... but it's nice to see OCaml come up a bit more often. :)