I highly recommend Microsoft’s VSCode with the vscode-reasonml extension as it works great out of the box (seriously, it rocks!). You will also need to setup your editor to handle OCaml files. This tutorial assumes MacOS or Linux environment, but theoretically it should also work on Windows. You can verify your opam installation with the following command: $ opam -version 1.2.2 If you’re feeling adventurous, my “Getting your feet wet with OCaml” article (linked above) has steps to install opam v2, which is currently in beta-RC phase, and has a builtin solver. I recommend using your OS package manager, but if you’re downloading the binary, don’t forget to also download an external solver beforehand. Consult the official docs on how to install it on your machine. To be able to follow this tutorial, you would need to have opam, the OCaml package manager, installed. Hopefully what I wrote can get you hooked! Requirements If you’re still wondering about what OCaml is and why you would use it, I recommend to read the opening of my previous article: “ Getting your feet wet with OCaml ”. If it’s not enough, Dune also supports cross-compilation, builtin testing, and ReasonML syntax out-of-the-box! The overview and strengths sections of Dune’s readme explain why so: it’s fast, has no system dependencies, supports parallel builds, generates configuration and install files easily, and has first-class Windows support. Specifically, we will be setting up Dune (formerly named Jbuilder) to build our app.ĭune, formerly Jbuilder, is the state-of-the-art build system that is currently overtaking OASIS as the de facto build system for new projects. However, this post will only cover initializing and bootstrapping the project. The project we will be building throughout the series is a To-Do List app, which connects to a PostgreSQL database as its datastore. In this first article of Hands-on OCaml series, we will explore how to start building an OCaml project. Scroll to the end to see other titles in this series.Įdit 2018–08–03: Update Dune to version 1.0.1 from beta19.1. This article is part of Hands-on OCaml, a series of articles that I’m working on that is focusing on doing web app development with OCaml.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |