Live data from Hacker News

Real World OCaml

realworldocaml.org

71–80 of 83 posts

Re: Real World OCaml

#71
post #69

Earlier quoted context omitted.

This looks really awesome! Thanks for bringing it to my attention. Why is this so much under the radar? It seems like it would have a ton going for it.

The historical answer is that originally Felix programs were being written for the Shootout and the compiler was upgraded so it performed well. In fact it trashed everything. Then control of the Shootout changed hands and Felix got dropped by the new manager. Today, there are no forums for developing new languages. Felix "targets" people that would like to use Haskell or Ocaml but have a ton of code in C and C++ to i…

No forums for developing new languages? Seems like Go, Nimrod, Rust, D, CoffeeScript and many other relatively new languages have large and active development.

That's interesting that they were booted from the shootout. I wonder what happened there. Anyway, I haven't really looked at this enough to see how its features really play out, but on the surface it looks great. Certainly as an alternative to C++ it sounds miles ahead, and indeed many of the languages being developed today are intended precisely as alternatived to C++. A guarantee of C/C++ performance or better is very enticing. :)

Re: Real World OCaml

#72

Earlier quoted context omitted.

OCaml doesn't have typeclasses, does it? It's been a while since I've used it, so things may've changed or my memory may be failing...

It now has first-order modules, which can be used to accomplish almost the same thing. The biggest difference is first-order modules are explicit while typeclasses are implicit. Whether this is a good or bad thing is up for debate.

It had first order modules when I was using it, but people may well have found uses for them that make the comparison more apparent.

Re: Real World OCaml

#74
post #33

For the early adopters and experimenters amongst you, you might like Felix http://felix-lang.org/share/src/web/tutorial.fdoc It is a whole program optimized, strongly typed, polymorphic, ML like language that can interact effortlessly with C and C++ code and has coroutines baked in. Its own demo webserver is based on coroutines. It uses a mix of lazy and eager evaluation for performance and compiles down to C++. Exec…

> compiles down to C++. Execution speed is comparable to C++, mostly better.

Uh, what. Can you clarify?

Re: Real World OCaml

#75
post #69

Earlier quoted context omitted.

The historical answer is that originally Felix programs were being written for the Shootout and the compiler was upgraded so it performed well. In fact it trashed everything. Then control of the Shootout changed hands and Felix got dropped by the new manager. Today, there are no forums for developing new languages. Felix "targets" people that would like to use Haskell or Ocaml but have a ton of code in C and C++ to i…

No forums for developing new languages? Seems like Go, Nimrod, Rust, D, CoffeeScript and many other relatively new languages have large and active development. That's interesting that they were booted from the shootout. I wonder what happened there. Anyway, I haven't really looked at this enough to see how its features really play out, but on the surface it looks great. Certainly as an alternative to C++ it sounds mi…

I think skaller meant that there is no common shared forum for (new) languages. Well, there is LTU but the discussion there tends towards the theoretical side, its focus is language implementers rather than language users. The language game site used to be one place a user could get exposed to different languages. It has largely become autocratic, arbitrary and "dont tell me how to spend my free time"hostile in the sense language gets dropped from the list for no clear reason. I think it has stopped being the de facto go to place for language comparison as well, not sure of the latter.

Re: Real World OCaml

#77

Earlier quoted context omitted.

From the little I know of OCaml, Rust isn't really in the same category. While it has functional elements, it's really aimed at being a cleaner C++ (for instance, it doesn't have TCO).

Rust was originally implemented in OCaml, though. You're correct theyre not exactly in the same category, but there is influence there.

OCaml is a popular tool for implementing languages, IIRC the javascript referecence standard was implemented in ocaml as well.

Re: Real World OCaml

#78
post #11

Here is a description of OCaml usage at Jane Street : https://queue.acm.org/detail.cfm?id=2038036 ocaml.org have a list of users: http://ocaml.org/companies.html Some "big" companies in the list: Facebook, Citrix, Dassault Système.

That acm article was very interesting, than you! Lots of nice little concrete examples - that are simple, yet not too simple.

I've yet to play much with ocaml — we had a bit of standard ml in our programming paradigms-class at university (at the time the course used [1] "Programming Languages: Concepts and Constructs (2nd Edition) by Ravi Sethi" — now they've (unfortunately, yet understandably) replaced standard ml with Haskell). I've since had a little trouble adapting to similar-yet-different languages like both Haskell and OCaml.

[1] http://www.amazon.com/Programming-Languages-Concepts-Constru...

Re: Real World OCaml

#79
post #64

Earlier quoted context omitted.

Hrm, what do you think about rust vs Felix? They seem to be targeting the same problem.

Rust and Felix both try to be general languages so they're both targeting that. Felix has a better type system. Rust provides more secure but restricted protocol for concurrency, Felix has no such restrictions, it's specifically designed to support shared memory concurrency, which Rust specifically doesn't allow. Rust uses message passing but organises via the memory management mechanism to do it very fast.

Note that Rust does allowed shared memory, either via "unsafe" code (i.e. same flexibility & dangers as in C, but the compiler only accepts it when wrapped in an `unsafe {}` block, so it's clear that you need to be careful), or higher level wrappers around this like Arc[1] for immutable shared memory, or RWArc[2] & MutexArc[3] for mutable shared memory.

> Felix has a better type system

What do you mean by this? From what I can see, the only way Felix encodes any form of memory safety (e.g. dangling pointers) in the type system is by garbage collection.

[1]: http://static.rust-lang.org/doc/master/extra/arc/struct.Arc....

[2]: http://static.rust-lang.org/doc/master/extra/arc/struct.RWAr...

[3]: http://static.rust-lang.org/doc/master/extra/arc/struct.Mute...

Re: Real World OCaml

#80
post #50

Earlier quoted context omitted.

Why OCaml over ML?

I was shown some OCaml code at the university, so learning OCaml later seemed easier than Standard ML. Also I use Debian, and after a quick look at the repositories it has far more libraries for OCaml (-ocaml-dev) than for Standard ML, which tipped the balance in favour of OCaml as the language that I wanted to learn. Why did I stick with OCaml after that? Mostly for two reasons: there are some libraries that I like…

OCaml looks clearly more verbose/shittier to me, but I did learn SML/NJ first.

http://www.mpi-sws.org/~rossberg/sml-vs-ocaml.html

Post reply on HN