Podlodka #465 -- OCaml
OCaml – уникальный язык и по своему историческому значению, и по фичам. Он сильно повлиял практически на все современные языки, на нем до сих пор написаны многие из их компиляторов, и одновременно с этим он считается идеальным входом для новичков в мир функционального программирования. А погружаемся в этот язык мы вместе с Павлом Аргентовым, программистом из Evrone, который страстно любит OCaml и пишет на нем очень много кода.
Слушать выпуск
Полезные ссылки:

Официальные ресурсы

Документация и туториалы:
  • OCaml.org — официальный сайт. Getting Started, документация, packages
https://ocaml.org/
  • OCaml Manual — полная справка по языку. Формальная семантика, все языковые конструкции
https://ocaml.org/manual/
  • Real World OCaml — практическая книга (2nd Edition).Jane Street, Yaron Minsky, Anil Madhavapeddy
https://dev.realworldocaml.org/
  • CS3110: Data Structures and Functional Programming (Cornell). Лучший образовательный ресурс для начинающих
https://cs3110.github.io/textbook/

Инструменты:
  • OPAM — package manager. 4,600+ packages
https://opam.ocaml.org/
  • Dune — build system. Композируемая, быстрая система сборки
https://dune.build/
  • Merlin — IDE support (LSP). Автодополнение, type information, jump to definition
https://github.com/ocaml/merlin
  • OCamlFormat — code formatter. Opinionated formatting
https://github.com/ocaml-ppx/ocamlformat

OCaml 5 и Multicore
Документация:
  • OCaml 5.0 Release Notes. Полное описание multicore и effects
https://ocaml.org/releases/5.0
  • Parallel Programming in Multicore OCaml. Tutorial по domains и parallelism
https://github.com/ocaml-multicore/parallel-programming-in-multicore-ocaml
  • Effects Tutorial. Concurrent programming с effect handlers
https://github.com/ocaml-multicore/ocaml-effects-tutorial

Научные статьи:
  • "Retrofitting Parallelism onto OCaml" (ICFP 2020). KC Sivaramakrishnan et al., Distinguished Paper Award
https://arxiv.org/abs/2004.11663
  • "Retrofitting Effect Handlers onto OCaml" (PLDI 2021). Stephen Dolan, Leo White et al.
https://dl.acm.org/doi/10.1145/3453483.3454039
  • "A deep dive into Multicore OCaml GC". KC Sivaramakrishnan
https://kcsrk.info/multicore/gc/2017/07/06/multicore-ocaml-gc/

Библиотеки:
  • Domainslib — high-level parallelism. Task pools, parallel_for, async/await
https://github.com/ocaml-multicore/domainslib
  • Eio — effects-based I/O. Direct-style асинхронное I/O на effect handlers
https://github.com/ocaml-multicore/eio
  • Saturn — lock-free data structures. Concurrent stacks, queues, hash tables
https://github.com/ocaml-multicore/saturn

Сообщество
Форумы и чаты:
  • OCaml Discourse — основной форум. Вопросы, объявления, обсуждения
https://discuss.ocaml.org/
  • OCaml Discord — real-time чат. Каналы по разным темам
https://discord.gg/ocaml
  • OCaml Reddit
https://reddit.com/r/ocaml

Блоги:
  • Jane Street Tech Blog. Production experience, библиотеки, техники
https://blog.janestreet.com/
  • Tarides Blog. MirageOS, OCaml 5, ecosystem
https://tarides.com/blog/
  • OCaml Labs Blog. Production Use Cases
https://ocamllabs.io/

Компании:
  • Jane Street. Tech talks, open-source библиотеки
https://www.janestreet.com/technology/
  • Ahrefs Tech Blog. Опыт работы с петабайтами данных
https://tech.ahrefs.com/
  • Tezos. Formally verified blockchain
https://tezos.com/
https://gitlab.com/tezos/tezos

Инструменты на OCaml:
  • Flow (Meta/Facebook).JavaScript type checker
https://github.com/facebook/flow
  • Infer (Meta/Facebook). Static analyzer для Java/C/C++/Objective-C
https://github.com/facebook/infer
  • Coq Proof Assistant. Formal verification, написан на OCaml
https://coq.inria.fr/
  • CompCert. Formally verified C compiler (Xavier Leroy)
https://compcert.org/

Изучение языка
Для начинающих:
  • OCaml Programming: Correct + Efficient + Beautiful. Cornell CS3110, самый дружелюбный учебник
https://cs3110.github.io/textbook/
  • OCaml From the Very Beginning. John Whitington, базовые концепции
https://ocaml-book.com/
  • Try OCaml. Interactive REPL в браузере
https://try.ocamlpro.com/

Для продвинутых:
  • Real World OCaml (2nd Edition). Functors, GADTs, async programming
https://dev.realworldocaml.org/
  • More OCaml: Algorithms, Methods & Diversions. John Whitington
https://ocaml-book.com/more-ocaml-algorithms-methods-diversions/
  • OCaml Scientific Computing. Numerical computing, machine learning
https://ocaml.xyz/

Видео и курсы:
  • Functional Programming in OCaml (Cornell CS3110). Полный курс лекций
https://www.youtube.com/playlist?list=PLre5AT9JnKShBOPeuiD9b-I4XROIJhkIU
  • Jane Street Tech Talks. Production experience, advanced topics
https://www.youtube.com/c/JaneStreetTech
  • OCaml Workshop (ICFP) Последние исследования и разработки
https://www.youtube.com/@ACMSIGPLAN

Специализированные темы
Формальная верификация:
  • Coq Documentation
https://coq.inria.fr/documentation
  • Software Foundations (серия книг на Coq)
https://softwarefoundations.cis.upenn.edu/
  • coq-of-ocaml. OCaml → Coq translation
https://github.com/formal-land/coq-of-ocaml

Системное программирование:
  • MirageOS. Unikernels на OCaml
https://mirage.io/
  • ocaml-tls. Pure OCaml TLS implementation
https://github.com/mirleft/ocaml-tls

Web и JavaScript:
  • Melange. OCaml → JavaScript compiler
https://melange.re/
  • Dream. Web framework с type-safe routing
https://aantron.github.io/dream/
  • js_of_ocaml. OCaml bytecode → JavaScript
https://ocsigen.org/js_of_ocaml/

Бенчмарки и производительность
  • Sandmark. Continuous benchmarking для OCaml compiler
https://sandmark.tarides.com/
  • OCaml Performance Tuning. Profiling tools, optimization techniques
https://ocaml.org/docs/profiling

Исторические материалы
  • A History of OCaml. Xavier Leroy interview
https://www.cs.cmu.edu/~popl-interviews/leroy.html
  • Xavier Leroy — Collège de France.Курсы по верификации ПО
https://www.college-de-france.fr/

Дополнительные ресурсы

  • Awesome OCaml. Curated list of libraries and resources
https://github.com/ocaml-community/awesome-ocaml
  • OCaml Planet. Агрегатор блогов сообщества
https://ocaml.org/planet

Похожие выпуски