开发者

Good projects to learn OCaml and F# [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

After learning the basic syntax, reading some non-trivial code is a fast way to learn a language. We can also learn how to design a library/software during reading oth开发者_运维技巧ers' code.

I have following lists.

  1. A Chess program in OCaml by Tomek Czajka.

  2. Hal Daumé has written several machine learning libraries in Ocaml. Including decision trees, logistic regression and SVM. All of them are near-production-quality code.

  3. A Chess Game Analysis program in F# in Microsoft Research.

The above three are my favorites. Will you suggest some other sources? General purpose open source software are good, specialized open source like the three I list here are even more welcome.


Jean-Christophe Filliâtre's page has numerous programs and libraries in OCaml.


One of the less well covered aspects of OCaml is the higher-order module system. The ocamlgraph library is an excellent example of benefiting from this language feature.

You may also like to read the OCaml source code to my HLVM project. The source code from my book OCaml for Scientists (2005) is freely available here but not open source. However, it has not been updated for several years and you can probably do much better today!

MLDonkey was an early file sharing client that once had hundreds of thousands of users. This is a heavily concurrent open source application written entirely in OCaml, weighing in at around 171,000 lines of code.

The Unison file synchronizer is another open source utility application written entirely in OCaml, weighing in at 24,000 lines of code. This was also the first popular application written in an ML derivative to have used asynchronous IO. So all of the F# code doing async today is essentially derived from it.

FFTW is a code generator for fast Fourier transforms (FFTs), essentially a very specialized form of optimizing compiler, that has been widely adopted and licensed for commercial use, e.g. in the core of MATLAB. Written mostly in OCaml with quite a bit of C and weighing in at 14,000 lines of OCaml code.

You may also like to read the source code to Hevea and ANT as these are fairly classical application domains for OCaml but also production quality applications with thousands of users.

I cannot think of any open source F# code to recommend. There is precious little out there and it is generally very poor quality. Most of it reads like Haskell. ;-)


Janes Street has released several libraries here. They're actually using OCaml in an industry setting. If anything, I'd check these out.


Check out these series of blog entries on Bookworm problem, they are light-hearted and show F#'s multiparadigm-ness very well. The last one looks like most "functional."

  • Trie-ing to optimize text search in F#
  • How to really be an evil genius (with F#)
  • DAWG-fight, Optimizing text search in F# II
  • DAWG-Gone!
  • The BookWorm challenge


Well, Unison has been recommended to me to have a look at, as well as solving various problems from Project Euler, but personally I get more done by writing my own practical programs, so I'll probably be adapting one of those into OCaml, to see how it goes.


You have the source of the ocaml standard library which is in o'caml.

I guess you've already looked at it, but the caml hump is a good source too: Here


For web based Ocaml code Opa has open sourced all there code as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜