Felix is to C++ what F# is to C# http://felix-lang.org/share/src/web/tut/tutorial.fdoc (I am not the author, just excited about this language) OCaML programmers will feel immediately at home. It 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 somew…
Why OCaml, Why Now?
51–60 of 106 posts
Re: Why OCaml, Why Now?
#52I'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?
#53Look, 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…
However I do think that from the ML family, F# might be the one getting more widespread.
Re: Why OCaml, Why Now?
#54If 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!
Re: Why OCaml, Why Now?
#55Re: Why OCaml, Why Now?
#56For 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.
Re: Why OCaml, Why Now?
#57For 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 have three issues with Scala:
- Having to wrap free functions in objects
- I feel Haskell type system is easier to understand than Scala's
- The concept of open and closed case classes for sum types feel wrong
So in the end I actually enjoy more using F# in general, and Clojure when targeting the JVM.
Now back to reading "Real World OCaml". :)
Re: Why OCaml, Why Now?
#58For 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.
What are you mean at "not-quite-as-good-as-haskell"? What are the killer features of haskell?
Re: Why OCaml, Why Now?
#59Earlier quoted context omitted.
> This might be entirely superficial of me, but I always preferred Haskell over OCaml simply because OCaml required me to type ";;" after every line. That's easily fixed: only the toplevel requires ;; (to commence evaluation of the phrases you've typed in). Just don't use it in normal code and everything will parse fine.
> 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.
Re: Why OCaml, Why Now?
#60Earlier quoted context omitted.
> This might be entirely superficial of me, but I always preferred Haskell over OCaml simply because OCaml required me to type ";;" after every line. That's easily fixed: only the toplevel requires ;; (to commence evaluation of the phrases you've typed in). Just don't use it in normal code and everything will parse fine.
> 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.