Giter Club home page Giter Club logo

learn-reasonml-workshop's Introduction

Introduction

These exercises are originally from a workshop organized by Jane Street for teaching OCaml to programmers who work in other languages and who do not necessarily have experience with functional languages. Link to the original repo.

We updated the exercises to be useful for someone interested in learning Reason. Reason is a new syntax and toolchain powered by OCaml. Reason syntax and NPM/Yarn workflow will seem familiar to Javascript programmers.

Setting Up

  1. Install reason-cli globally. The bundles are larger than 100MB and npm does not show progress while downloading.

  2. The recommended editor is VSCode along with the vscode-reasonml extension. If you prefer a different editor check the instructions for other supported editors

  3. Add the Reason Tools browser extension. It works as a popup where you can copy code to convert between Reason and OCaml syntaxes. When you visit OCaml library documentation you can switch between viewing Reason/OCaml syntax.

  4. Run npm install.

Workflow

The exercises are ordered and can be found within src/exercises directory. Start with the first exercise - src/exercises/01-introduction/introduction.re.

After completing each exercise, run its test. For example for the second exercise, run the test as:

node src/exercises/02-basic_types/basicTypes.bs.js

This .bs.js file is your Reason program .re compiled to Javascript. .bs stands for the bucklescript compiler. You should read the .bs.js file for each exercise and compare the Javascript output to the original Reason code. This will help you develop an intuition for the language very quickly.

You can also run ./run_tests which will run all the tests automatically for you and stop at the first failing one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.