Giter VIP home page Giter VIP logo

intro-to-reason-compilation's Introduction

Intro to Reason Compilation

Reason is a syntax and tooling ecosystem for OCaml. The OCaml's compilation and build system can get rather sophisticated; This repository serves as a tutorial that explains some of the intricacies. It's always nice to know what really happens under the hood!

Note that this is for the curious people. You don't need to know these things immediately when you start consuming Reason and the rest. If you just want to try Reason, this is the right place to start instead.

We start with the most basic OCaml compiler commands and gradually build up to a productive workflow. Each step resides in its independent, fully functional folder.

If you feel certain steps aren't clear, or if you'd like to request a new step, feel free to submit an issue or a pull request! P.S. we're on IRC freenode #reasonml and Discord reasonml.

Requirement

Have Reason >=1.13.5 installed. See this help page

intro-to-reason-compilation's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

intro-to-reason-compilation's Issues

Idea for simple ReasonML compilation (-re switch to ocaml commands)

Hi,

I would have love to be able to add a simple --reasonml switch to all the OCaml compiling tool family and get my .re / .rei compiled. It would help people to come to Reason from OCaml books and tutorials.

My personal religion is : "do not install something out of apt install", the command line switch I speak would already be packaged in all major GNU+Linux distributions by now, reaching a broader audience, and even regular people not interested in React (yet).

For instance it was already a struggle to install rtop on Debian : https://www.grimoire-command.es/2019/rtop_on_debian_stretch.html
And I know I wont be able to go further without a nodeenv (or an equivalent) which is a step never shown on tutorials.

Implementing this switch would also show some upstream contributed code, an example of "we're really nice".

Error running step 7

I have steps 1-6 successfully. In step7 I have run npm install. When running run.sh I get:

Fatal error: exception Failure("File \"ext_filename.ml\", line 202, characters 13-20bsconfig.json not found from /")
Fatal error: exception Failure("File \"ext_filename.ml\", line 202, characters 13-20bsconfig.json not found from /")
Fatal error: exception Failure("File \"ext_filename.ml\", line 202, characters 13-20bsconfig.json not found from /")
Fatal error: exception Failure("File \"ext_filename.ml\", line 202, characters 13-20bsconfig.json not found from /")
module.js:442
    throw err;
    ^

Can't run step7

Hi, everything is fine when running step1-6, but step7 got errors.
Environment:

MacOS 10.12.2
The OCaml compiler, version 4.02.3
node v6.3.1
npm 3.10.3

Error messages:

File "node_modules/reason-js/src/ReasonJs.re", line 15, characters 7-13:
Error: 438: <SYNTAX ERROR>

File "node_modules/reason-js/src/ReasonJs.re", line 1:
Error: Error while running external preprocessor
Command line: refmt 'node_modules/reason-js/src/ReasonJs.re' > /var/folders/qt/qx5f0wb14b923zrz5m2b7jj00000gn/T/ocamlpp4549dd

File "src/test.re", line 16, characters 0-19:
Error: Unbound module ReasonJs
module.js:442
    throw err;
    ^

Error: Cannot find module '/Users/yhsiang/w/appier/intro-to-reason-compilation/step7/_build/self/test.js'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.runMain (module.js:575:10)
    at run (bootstrap_node.js:352:7)
    at startup (bootstrap_node.js:144:9)
    at bootstrap_node.js:467:3

Check reasonJs.re Line 15: module Window, did I miss something to upgrade or ?

change name

"reason-under-the-hood" might be better. "getting-started-with-reason" implies this is what we want newcomers to try. This isn't; it's a walkthrough of the underlying compilation & tooling.

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.