Domain: ocaml-tutorial.org
Stories and comments across the archive that link to ocaml-tutorial.org.
Comments · 8
-
Take a cue from the French - teach in ML!
I think we all could take a cue from the French, and start some of our programming classes in one of the ML families, like Caml Light, Standard ML, or my personal favorite Ocaml. These are fairly advanced languages, and support both imperative and functional features, so you can teach for loops AND recursion. Of course, you can do this with Lisp too, but honestly, the syntax of the ML families is a lot better than Lisp. Also you can do object-oriented programming with Ocaml.
In addition, Yale also taught its intro CS class in Standard ML a while back, and I understand it was a big hit.
Of course, it's the course content that matters the most, but why limit yourself? As already stated on Slashdot, FP is increasing in importance due to its ability to handle parallelism, so I think you can really have the best of both worlds with these impure functional languages. -
Ocaml
API: http://caml.inria.fr/pub/docs/manual-ocaml/index.html
Tutorial (and excellent reference in general): http://www.ocaml-tutorial.org/ -
Think functional
"Functional" languages, actually a real misnomer. Really you should look at what are currently classed as "research" languages which are interesting because they have advanced features which make programming easier and safer.
My list would include:
- OCaml (obviously, see my signature)
- Haskell
- Erlang
- SML / MLton
- CDuce, Aurochs, COQ, etc.
Rich.
-
Re:Memory "leak" (was: Re:The 9 Reasons)
That's great - sorry for being sarcastic. Check out our OCaml tutorial
... -
Re:Let's think this through...
Firefox is actually written in javascript, isn't that a modern language? The libraries firefox uses are written in C++, [...]
Small parts of it are written in Javascript (the "chrome" - ie. the rules for automating actions in the user interface), but the vast majority is C++, including the crucial rendering engine which in Moz/FF renders web pages and chrome.
Would use of a functional language provide any tangible benefit to a web browser?
The code would be shorter (so easier to modify / verify) and wouldn't be subject to buffer overflows or most types of memory leak. These seem fairly worthwhile. On the other hand fewer people are familiar with functional languages (despite attempts by people like me to continually evangelise them!) so that might put off potential contributors.
The OCAML garbage collector isn't particularly suitable for a multithreaded application,
Very true. Firefox isn't multithreaded though, it's event-driven. I'm not sure why threads are really needed for a web browser. Multiple processes might make some sense, to provide real isolation between web sites / or web browser code and plug-ins, but it would cost some speed.
Rich.
-
Re:Neither!Damn right. I recommend Objective Caml instead. A functional/object/imperative language which is type safe, practical and very very fast.
Rich.
-
Re:funny AND interesting, but yeah FP...
-
Shameless promotion