Skip to content
项目

janestreet/learn-ocaml-workshop

在 GitHub 查看

关于

Jane Street OCaml Workshop 的练习与项目。

学习与教育

这些数字如何统计

实测星标增长

24小时
+1
7天
+2
15天
+6
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

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 README.org in install-ocaml for instructions.

Exercises

The 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:

cd 02-exercises/$problem_dir

dune runtest # builds and runs inline tests
# Look at test output and compiler errors, edit problem.ml, rerun:
dune runtest

Snake, Lumines, and Frogger

Once you’re done with the exercises, you can also implement simplified clones of the following arcade games:

  • snake (runs on your computer)
  • lumines (runs on your computer)
  • frogger (runs in a web browser)

Async

The OCaml standard library has various low-level calls for working with sockets in the Unix module and Jane Street’s Core library wraps all of those. But, if you want your program to be able to wait for multiple events at the same time, you likely want to be able to program concurrently.

One library for writing code in this style is Async. Async provides Reader and Writer abstractions for I/O which, paired with the 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 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 irc-bot README to get started!
  • You can work on writing your very own version of fzf in OCaml. See the fuzzy-finder README to get started!
  • Or, if you want, you can continue making improvements and extensions to your version of Frogger (see the frogger README for some ideas).

Documentation and resources

OCaml

Jane Street libraries and tools

dune

探索相关项目

加载中…