Hello! This is the main directory for ReScript. jscomp
is just a name that mirrors OCaml's own bytecomp
and asmcomp
(bytecode compilation and native compilation logic respectively). For building it, please see CONTRIBUTING.md.
A copy of standard library from OCaml distribution(4.02) for fast development, so that we don't need bootstrap compiler, everytime we deliver a new feature.
- Files copied
- sources
- Makefile.shared Compflags .depend Makefile
- Patches Most in Makefile.shared
The directory containing unit-test files, some unit tests are copied from OCaml distribution(4.02)
- ext (portable)
- common (portable)
- bsb
- depends (portable)
- core
- bspp
- outcome_printer
- stubs
- super_errors
- syntax
f a b [@bs]
(unsafeFullApply ((opaque f) a b ))
case 0
type 'a fn0 = {
_0 : 'a
}
create:
{_0 = fun () -> ...}
(unit -> int) fn0
is different from (unit -> int) fn1
When f
is an external, without opaque
apply (Obj.magic f a b) ==> apply (f a b)
fun [@bs] a b -> c
is the same as fun [@bs] a -> fun b -> c
from the view of parsetree
unit -> int [@bs]
--> int Js.arity0
f () [@bs]
--> (run0 f)
fun [@bs] () -> body
-> fn_mk0 (fun () -> ...)
It is special handled due to fn_mk0
, otherwise it will have arity 1
We can -open Js.Uncurry
to make names look pretty