Giter Site home page Giter Site logo

dakotamurphyucf / hello-native-bucklescript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jchavarri/hello-native-melange

0.0 0.0 0.0 100 KB

Skeleton of a shared library for bucklescript and native OCaml/Reason

Makefile 12.09% OCaml 81.23% Shell 6.68%

hello-native-bucklescript's Introduction

This repository contains an example of a library written in ocaml/reason for both javascript (through bucklescript) and native (through the ocaml compiler).

The shared directory contains the core of the library, available in both modes. js and native contain the part specific to one implementation of the library.

The library is composed of 3 modules:

  • Date, which has an implementation per platform and can have a different interface per platform.
  • Tomorrow, which has one implementation shared for both platforms.
  • Yesterday, which has a signature shared by both platforms, but an implementation per platform.

There is companion blog post giving more details on how to create this kind of library step by step.

Installation

For bucklescript:

yarn

For native:

  • install esy
  • then run esy install

It can work with opam, but we use esy in this example as it is easier to understand for people from the javascript world.

Compilation

For bucklescript:

yarn bsb -make-world

For native

esy dune build @all

The commands are wrapped in a Makefile and can be called with make js and make native.

hello-native-bucklescript's People

Contributors

khady avatar

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.