5 ms·
Teaching OCaml
- mercurial 12y agoI think "all of Ocaml compiles to JS " is a bit optimistic. AFAIK, code using Jane Street's Core stdlib doesn't work. But a lot of Ocaml code should be fine.
- jlrubin 12y agoThis is because Core relies on OS/FFI. I think as long as it isn't using OS/FFI it can compile, although I may be wrong on that count.
- avsm 12y agoAll of the core compiler library does compile to efficient JavaScript. For instance, see the IOCamlJS interactive notebooks that embed the entire compiler in the browser with a web UI. Just press the play button: - http://andrewray.github.io/iocamljs/oh261.html http://andrewray.github.io/iocamljs/oh261.html (H.261 video decoding) - http://www.ujamjar.com/hardcaml/ http://www.ujamjar.com/hardcaml/ (HardCaml RTL hardware description language, similar to Chisel in Scala) - http://gazagnaire.org/fuconf14/ http://gazagnaire.org/fuconf14/ (building a 2048 game implementation)
- ufo 12y agoHe was talking about Jane Street's replacement stdlib. I heard Core_kernel can be compiled to JS though.
- hk__2 12y ago> OCaml is a high-level language that supports […] object-oriented programming style AFAIK OCaml only support records, which are like C’s structs. Edit: no, it has real objects, as stated in comments below.
- tel 12y agoJust looking at the table of contents here http://caml.inria.fr/pub/docs/manual-ocaml/objectexamples.html http://caml.inria.fr/pub/docs/manual-ocaml/objectexamples.ht... seems to state otherwise. That said, I think the common advice is to not use most of that and to restrict yourself to just records as they are almost always the better choice.
- mjt0229 12y agoOCaml has a sophisticated object system. See: https://realworldocaml.org/v1/en/html/objects.html https://realworldocaml.org/v1/en/html/objects.html You can do a lot of traditional 'OO'-style things with functors and modules, though, so you don't need objects necessarily to get a lot of OO features.
- wk_end 12y agoOCaml is (somewhat unconventionally) object-oriented; it has classes, inheritance, what-have-you. The 'O' in the name stands for "objective". Perhaps you're thinking of SML? See: http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual005.html http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual005.ht...
- AceJohnny2 12y agoIn the "suggested textbooks" section, #3 is Real World OCaml which has Jason Hickey as an author and is available for free online, and #4 is Jason Hickey's notes for a course, is marked "Draft. Do No Redistribute", and at first glance its table of contents looks similar to Real World OCaml. Isn't the latter redundant and in violation of whatever?
- avsm 12y agoThere is no shared text at all between Real World OCaml and Jason Hickey's course notes. We wrote the RWO content from scratch due to the different style (O'Reilly vs academic) and set of libraries used.
- atestu 12y agoI'm surprised EPITA (France) is not on the school list. OCaml is the first language you learn there. Fantastic introduction to algorithms.
- bibinou 12y agoyou can add it, here's the link to the file on Github : https://github.com/ocaml/ocaml.org/blob/cd7186176a11c860ef3579ebaf326194935d8d4b/site/learn/teaching-ocaml.md https://github.com/ocaml/ocaml.org/blob/cd7186176a11c860ef35...
- amirmc 12y agoIs there a reason you're pointing to a specific commit? The link below is to the current version. Also note that it's easy to make quick edits in GitHub's web interface without having to clone the repo locally. It works well and we get a lot of quick fixes this way. https://github.com/ocaml/ocaml.org/blob/master/site/learn/teaching-ocaml.md https://github.com/ocaml/ocaml.org/blob/master/site/learn/te...
- bibinou 12y agoI don't link to branches because if the file gets moved (which it very frequent especially for doc), the link goes 404. Think of it as a use-after-free :) Blobs are mostly immuable and you have to edit in a fork anyway, unless you have rights to the repo.
- tolkienfanatic 12y agoAh, CS 3110. The bane of every Cornell Comp Sci majors existence.
- infruset 12y agoCould you elaborate?
- LadyMartel 12y agoIt made me think deeply about my decision to be a CS major and in the end I am grateful. It became one of my favorite classes at Cornell.
- tsax 12y agoSo many functional languages. Which one to learn? Haskell? OCaml? F#? Scheme? Common Lisp? Clojure?
- dragonwriter 12y agoLearn more than one. I would suggest, in no particular order, at least one from each of these three groups: Static, strict-by-default ML derivatives (Standard ML, F#, Ocaml, AliceML, etc.) Static, lazy-by-default ML-inspired (Haskell, probably others, but, really, Haskell). Dynamic Lisp-family languages (Racket, Scheme, Common Lisp, Clojure)
- pjmlp 12y agoI would add a Logic Programming language like Prolog to the list.
- cheepin 12y agoIsn't Prolog considered a "declarative" language?
- dragonwriter 12y agoFunctional and declarative aren't mutually exclusive -- in fact, functional languages are generally considered to be declarative.
- pjmlp 12y agoYes, but it complements functional programming. Plus it helps to understand how those logic programming libraries, like mini-Kanren, core.logic among others work.
- tsax 12y agoHow about w.r.t. the 'biggest bang for the buck'?
- arthurcolle 12y ago
- pjmlp 12y agoFCT UNL (Portugal) should probably be in the list. Back in the mid-90's they were teaching Caml Light. Most likely they are on OCaml nowadays. The CS department is very strong in FP and LP languages and theory.
- amirmc 12y agoIs there a link you can point us at? If it's in portugese we might have trouble understanding it.
- pjmlp 12y agoMy post was in the hope that some else might have better info as me, and comment on it. Due to Bologna, the older pages are now gone. I can try to contact some of my former teachers to find out the current set of languages.
- dkarapetyan 12y agoF# is the way to go after the recent Microsoft announcements about .NET.
- derekchiang 12y ago1 would like to recommend the lecture notes [1] used in CS3110 at Cornell to people who want to learn OCaml. They have been used and revised over the years and are of very high quality. [1] http://www.cs.cornell.edu/Courses/cs3110/2014sp/lecture_notes.php http://www.cs.cornell.edu/Courses/cs3110/2014sp/lecture_note...
- deleted 12y ago[deleted]
- deleted 12y ago[deleted]