learn-ocaml-workshop

by janestreet

Exercises and projects for Jane Street's OCaml Workshop

212 Stars 64 Forks Last release: Not found Apache License 2.0 172 Commits 1 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

+TITLE: Jane Street OCaml Workshop

This repo contains exercises and build instructions to help you get started developing in OCaml.

  • Installing build tools and libraries See [[https://github.com/janestreet/install-ocaml/blob/master/README.org][README.org in install-ocaml]] for instructions.
  • Exercises The [[file:02-exercises][exercises]] directory contains a number of exercises to get you started with OCaml. Each one has some expect-tests embedded in it. The workflow is:

#+BEGINSRC bash cd 02-exercises/$problemdir

dune runtest # builds and runs inline tests # Look at test output and compiler errors, edit problem.ml, rerun: dune runtest #+END_SRC * Snake, Lumines, and Frogger Once you're done with the exercises, you can also implement simplified clones of the following arcade games:

One library for writing code in this style is [[https://opensource.janestreet.com/async/][Async]]. [[https://ocaml.janestreet.com/ocaml-core/latest/doc/async/index.html][Async]] provides ~Reader~ and ~Writer~ abstractions for I/O which, paired with the [[https://ocaml.janestreet.com/ocaml-core/latest/doc/asyncextra/Asyncextra/Tcp/][Tcp]] module should have most of what you need for either of the projects below.

Before proceeding, it would probably be a good idea to read [[https://dev.realworldocaml.org/18-concurrent-programming.html][Chapter 18]] of /Real World OCaml/. There is some example code in the next section which should set you on your way. * Bigger projects Once you've made it to this point, there are a few possible paths laid out for you:

  • You can work on writing a bot for a chat protocol called IRC. See the [[file:04-bigger-projects/irc-bot/README.org][irc-bot README]] to get started!
  • You can work on writing your very own version of [[https://github.com/junegunn/fzf][fzf]] in OCaml. See the [[file:04-bigger-projects/fuzzy-finder/README.org][fuzzy-finder README]] to get started!
  • Or, if you want, you can continue making improvements and extensions to your version of Frogger (see the [[file:03-frogger][frogger README]] for some ideas).

    • Documentation and resources ** OCaml
    • [[https://dev.realworldocaml.org/toc.html][Real World OCaml]]
    • [[http://caml.inria.fr/pub/docs/manual-ocaml/][OCaml manual]] ** Jane Street libraries and tools
    • [[https://opensource.janestreet.com/][An overview of Jane Street's open source things]]
    • [[https://ocaml.janestreet.com/ocaml-core/v0.10/doc/][Documentation for Core]] ** dune
    • [[https://www.youtube.com/watch?v=BNZhmMAJarw][Video tutorial]]
    • [[https://dune.readthedocs.io/en/latest/][Manual]]

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.