If ocaml is a language waiting for a killer app, this might be it: http://www.openmirage.org/ There was a presentation at the FP eXchange in London last Friday about mirage and many a mind was blown!
Why OCaml, Why Now?
31–40 of 106 posts
Re: Why OCaml, Why Now?
#32Does anyone have any insight into why OCaml rose to (relative) prominence and not SML?
Re: Why OCaml, Why Now?
#33Earlier quoted context omitted.
Well, that explains a lot! I'm embarrassed I never got past that.
Don't feel too bad about it. The official OCaml tutorial is also confused: http://ocaml.org/learn/tutorials/structure_of_ocaml_programs... (someone really should go through these tutorials and fix the various misleading parts) Basically, the rule is to use "let () = ..." for your main block / top-level code and don't use ";;" ever.
open Random
open Graphics
let rec iterate r x_init i =
if i = 1 then x_init
else
let x = iterate r x_init (i - 1) in
r *. x *. (1.0 -. x)
let main () =
self_init ();
open_graph " 640x480";
for x = 0 to 639 do
let r = 4.0 *. (float_of_int x) /. 640.0 in
for i = 0 to 39 do
let x_init = Random.float 1.0 in
let x_final = iterate r x_init 500 in
let y = int_of_float (x_final *. 480.) in
Graphics.plot x y
done
done;
ignore (read_line ())
let () = main ()Re: Why OCaml, Why Now?
#34OCaml is Object Caml right? What about SML? I always loved SML, but it never got any traction at all. The O in Ocaml always turned me off, they cluttered up the syntax with all the object notation. Does anyone have any insight into why OCaml rose to (relative) prominence and not SML?
Edit: A more lengthy comparison: http://adam.chlipala.net/mlcomp/
Re: Why OCaml, Why Now?
#35Earlier quoted context omitted.
Well, that explains a lot! I'm embarrassed I never got past that.
Don't feel too bad about it. The official OCaml tutorial is also confused: http://ocaml.org/learn/tutorials/structure_of_ocaml_programs... (someone really should go through these tutorials and fix the various misleading parts) Basically, the rule is to use "let () = ..." for your main block / top-level code and don't use ";;" ever.
https://github.com/ocaml/ocaml.org/tree/master/site/learn/tu...
Re: Why OCaml, Why Now?
#36Earlier quoted context omitted.
It sounds like you have a very language-centric view of the world. In practice, deployment is everything. (Why do people write code in Objective C? Because iPhone.) Having a solid implementation for your target platform is very good reason to pick a language.
> It sounds like you have a very language-centric view of the world. > Having a solid implementation for your target platform is very good reason to pick a language. I'm not sure where you got that out of my comment; it was exactly the opposite. My point was that neither OCaml nor Haskell have particularly strong implementations in this area (to my knowledge). Last time I checked, the ability to write Javascript usin…
Facebook uses an OCaml js_of_ocaml-based frontend for a large chunk of their production code editing. Not a great video, but here's the CUFP 2013 talk on the topic: http://www.youtube.com/watch?v=gKWNjFagR9k
Re: Why OCaml, Why Now?
#37Look, I love OCaml and it's my favorite language syntax-wise, but the real big elephant in the room is not its JS-backend maturity. Rather it doesn't have kernel thread support...all threads are user-level just like Python due to a global lock for garbage collection. This means threads do not run concurrently across multiple cores. This is UNACCEPTABLE in 2014 - roughly 8 years since processors went multi-core. Intel…
That being said you can still use multiple cores by using multiple processes, and that doesn't necesarelly imply MPI. OCamlNet (and probably some other libraries) provide a way to communicate between multiple OCaml processes.
Re: Why OCaml, Why Now?
#38Look, I love OCaml and it's my favorite language syntax-wise, but the real big elephant in the room is not its JS-backend maturity. Rather it doesn't have kernel thread support...all threads are user-level just like Python due to a global lock for garbage collection. This means threads do not run concurrently across multiple cores. This is UNACCEPTABLE in 2014 - roughly 8 years since processors went multi-core. Intel…
Re: Why OCaml, Why Now?
#39OCaml is Object Caml right? What about SML? I always loved SML, but it never got any traction at all. The O in Ocaml always turned me off, they cluttered up the syntax with all the object notation. Does anyone have any insight into why OCaml rose to (relative) prominence and not SML?
Ocaml was always the more pragmatic language and for a long time the implementation was significantly faster than anything SML offered. MLton came along very late in the game and offers excellent performance, but doesn't support separate compilation. Edit: A more lengthy comparison: http://adam.chlipala.net/mlcomp/
Re: Why OCaml, Why Now?
#40Technically, yes, it's a statically typed system. But its use of structural typing instead of nominative typing effectively means it takes half the compiler assistance you can get out of static type checking and chucks it out the window. Using structural typing means that a type is nothing more than the sum of its parts; nominative typing makes it possible to add further specificity to types by naming them. This is huge. A language that doesn't do this is a language that can't be taught to understand the difference between 12 meters and 12 Newtons.