292 karma · joined August 31, 2016
The docs are available https://github.com/moonbitlang/moonbit-docs, the compiler would be publicly available when we reach the beta status (expected to be the end of Q2 in 2024).
Feel free to ask me any question
ReScript is more correct than scala, ReScript's type system(essentially borrowed from OCaml) is sound while scala is unsound.
> Using `undefined` to represent `None` means that you cannot tell the difference between `None` and `Some(None)`
I don't know where you get the impression, of course they are different in ReScript.
One thing missed is that ReScript compiler may be 10-100 times faster than Scala.js (I am not kidding)
- Pros of TypeScript
- Designed for JS, easy inter-operate with JS
- A much larger community
- Nice integration with VSCode
- Cons of TypeScript - Compiler slow (not scalable for FB/Google scale)
- Verbose, very limited type inference
- Start up time slow (very hard to build traditional build tools)
- Types are only used for tooling - soundness is not the design goal, not very reliable
- Only JS backend, no code optimizations
- Pros of BuckleScript - No legacy of JS (clean slate) while great story in inter-operation
- Compiles much faster, scales much better
10% perf is a nice enhancement, 10x faster is an invaluable feature
- An arguably much better language
- Sound type system, global type inference
- Types are used in code optimization, optimizing compiler
- Javascript backend + Native backend for X86, ARM
- Cons of BuckleScript - Smaller community
- Learning curve is higher compared with TypeScriptFor example, it takes around 20~80ms to compile a single file for BuckleScript, while Fable would talk 10x more to compile.
Its generated code is pretty but its performance is not very good, see this issue (https://github.com/fable-compiler/Fable/issues/646) "this can make a difference in speed of up to about six or seven times for tight loop code using tuples, records, lists, unions, etc.(compared with BuckleScript)"
But Fable is a nice project, JavaScript platform is large enough to have both :-)
Actually it has two OCaml->JS compilers of very high quality The first one, js_of_ocaml, could bootstrap the whole compiler several years ago(probably the first one there).
The recent one, https://github.com/bloomberg/bucklescript, push the JS compilation into next level, it generates fairly readable code, good FFI story, and its compilation is extremely fast, check out the compiler in JS version(http://bloomberg.github.io/bucklescript/js-demo/), and imagine how fast it would be for the compiler in native version. BuckleScript has a good story for Windows, and generates fairly efficient code, see benchmark here: https://github.com/neonsquare/bucklescript-benchmark BuckleScript is already used in production by big companies: for example Facebook messenger.com 25% is powered by BuckleScript, the new WebAssembly spec interpreter by Google is also partly cross compiled into JS by BuckleScript.
Disclaimer: I am one of the authors of BuckleScript
Exactly, client side/ server side in a single language. People are working on porting the Elm architecture to BuckleScript, they will be coming soon
Click Examples see how the JS code generated, questions are welcome!