Comments (4)
Not explicitly tbh. I'm not particularly opposed to either but it will depend on which way we jump/how we implement things like algebraic effects and a signature-module system. I think both of those are pretty important to include at some point and I would be reluctant to restrict or contort our syntax for the sake of compatibility. My prolonged inactivity here is mostly due to me struggling with the related papers for these things (and probably getting too lost in some details, if I'm honest 😄 )
Having said that, it would probably be relatively simple to make a ReasonML parser that outputs Alpaca's AST. Messages and processes might be a bit of a wrinkle but maybe not severe? (I may be underestimating the required effort)
from alpaca.
It would take more than adopting the syntax, OCaml/Reason and Alpaca are semantically different languages.
If I were to put OCaml on the BEAM I'd probably go down the path that Bucklescript did with OCaml -> Javascript and write a new backend for the compiler that compiles the Lambda intermediate representation into Erlang or Core Erlang. I had a little play with this here, but I really needed more OCaml knowledge to make good progress -> https://github.com/lpil/erlcaml
from alpaca.
js_of_ocaml takes the bytecode representation and converts it to Javascript, thus it's method is lower level and generates ugly code, but it can generate fast code while being able to handle anything and everything regardless of PPX's and all.
Bucklescript, on the other hand, uses a mixed-representation (and because of that it has to rewrite parts of the compiler instead of just being a plugin to it) that allows it to retain some typed information, but it also means that some PPX's cannot be used.
js_of_ocaml's method might be too low level, as by the time of bytecode the type information is gone and it is handling direct access of things like byte arrays.
Bucklescript's method is way too far in my opinion, it could still be done by a middle-layer PPX compiler plugin, though depending on the level you choose is a balance between full PPX support or full Type information.
It 'might' be possible to bytecode level to the BEAM, easier so if you happen to exempt a construct or two as well... >.>
from alpaca.
https://github.com/kjnilsson/fez is similar attempt but with F# as source language.
from alpaca.
Related Issues (20)
- Function parsing as incorrect arity with ADT as first arg HOT 2
- Auto-imported pipe operator HOT 2
- Treat types with a single unqualified member as aliases HOT 1
- Overlap between function heads and match expression HOT 1
- How to type Erlang terms without built-in types. HOT 7
- alias module name HOT 1
- Zero arity functions HOT 5
- Inconsistent function case HOT 2
- Compile error with type signature annotation
- Defining the function (>>) does not yield a helpful error
- Use values to signify test pass/fail rather than exceptions
- Can't find a way to contact the creator/mantainers of alpaca :) HOT 2
- provide prebuilt "binaries" for OTP 21
- Status? HOT 4
- "Overloaded" records with constructors in patterns fail instead of getting a proper warning.
- Incorrect line numbers for missing record field errors
- clarify - nominal or structural type system HOT 3
- ADT argument in function header crashes compiler
- Non-exhaustive patterns in "match" expressions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alpaca.