You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue tracks the differences between melc internals and ocamlc. One of the goals is to be able to compile Melange cmi files directly with ocamlc —and maybe cmt—.
Note: strict removals of functionality in Melange / ReScript (like removal of Printf) do not affect this goal, as the idea is to build Melange code with OCaml compiler (not the other way around), so for now they are excluded from the list.
List (ongoing, non-exhaustive)
1. Melange externals can be defined with non-function types
Melange allows defining externals like external foo: string = "foo", which is invalid in ocamlc, e.g.:
File "node_modules/reason-react/src/legacy/ReactEventRe.rei", line 32, characters 27-31:
32 | external preventDefault: unit = "preventDefault";
^^^^
Error: External identifiers must be functions
Fixing this issue exclusively on Melange side (i.e. without changing the way ocamlc works) would involve breaking the ecosystem of bindings and libraries in some way.
2. Melange injects some marshalled-encoded info in externals
Melange injects some marshalled data into externals when processing the ast:
Values do not match:
external bubbles : 'a synthetic -> bool = "bubbles" "BS:external"
is not included in
external bubbles : 'a synthetic -> bool = "bubbles"
The native names of the primitives are not the same
The text was updated successfully, but these errors were encountered:
This issue tracks the differences between
melc
internals andocamlc
. One of the goals is to be able to compile Melangecmi
files directly withocamlc
—and maybecmt
—.Note: strict removals of functionality in Melange / ReScript (like removal of
Printf
) do not affect this goal, as the idea is to build Melange code with OCaml compiler (not the other way around), so for now they are excluded from the list.List (ongoing, non-exhaustive)
1. Melange externals can be defined with non-function types
Melange allows defining externals like
external foo: string = "foo"
, which is invalid inocamlc
, e.g.:Fixing this issue exclusively on Melange side (i.e. without changing the way
ocamlc
works) would involve breaking the ecosystem of bindings and libraries in some way.2. Melange injects some marshalled-encoded info in externals
Melange injects some marshalled data into externals when processing the ast:
melange/jscomp/frontend/ast_external_process.ml
Line 1013 in d979086
This breaks when using
ocamlc
to generate cmis:The text was updated successfully, but these errors were encountered: