Live data from Hacker News

Why OCaml, Why Now?

spyder.wordpress.com

51–60 of 106 posts

Re: Why OCaml, Why Now?

#51
post #17

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…

Have you actually used Felix? I agree it's a neat language but it felt to me like I'd really have to come up to speed on C++ to make much use of it. It's "FFI" is basically embedded strings of C++ source.

Re: Why OCaml, Why Now?

#52

I'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…

BMW has legendarily terrible cup holders, by the way.

Re: Why OCaml, Why Now?

#53
post #27

Look, 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…

The situation is improving, specially with companies like Facebook and Microsoft using it.

However I do think that from the ML family, F# might be the one getting more widespread.

Re: Why OCaml, Why Now?

#54

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!

I really hope such systems take up, as we need OS designed with better languages.

Re: Why OCaml, Why Now?

#55
Here's the plan -- eliminate perl, python, ruby, php or java or any slow-starting jvm-based language(the featureless landscape of clojure for example), and use just bash, sed, awk, ocaml(to replace the fear of 'C'), and we can also do f# on windows, so there would be crossover between the worlds and peace throughout the land.

Re: Why OCaml, Why Now?

#56
post #5

For 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?

#57
post #5

For 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.

Having had Camllight as my first functional language, ML language family got a special place on my heart.

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?

#58
post #56
post #5

For 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?

Not the original commenter but for me the big ones are purity and cheap direct access to C code.

Re: Why OCaml, Why Now?

#59
post #3

Earlier 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.

Don't put non-let expressions at the top level?

Re: Why OCaml, Why Now?

#60
post #3

Earlier 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.

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.
Post reply on HN