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
{{ message }}
Repository navigation
Synchronize reason playground and ocaml playground #611
Might be related to #386: if we have a toggle, then bundling two ocaml compilers (bs, reason) is kinda heavy. Reason can't just start using BS' fork of the compiler (or can it... @jordwalke), but if BS can use a lightly forked version of Reason that uses the patched compiler, then we dedupe one copy of the compiler when compiled into JS.
Good thing the demo page is a poweruser page. These perf concerns can wait.
Reason should be a tiny addition. It's properly factored out into a separate findlib library that doesn't include utop so it should work as a library on the web now without having to hack/patch it like before.
What I meant is, currently there are 2 export.js bundles, which are compiled separately, each bundle being (as an advantage) independently functioning. But (as a disadvantage) if we want to include both bundles on the same page and have a checkbox that toggles between reason and ocaml syntax, then we do have two independent bundles that each includes a compiler, right?
@jordwalke is correct, it's a tiny addition (here 300KB for the reason parser, probably smaller with --table mode). We will remove reason-demo/ since js-demo/ will have both support of OCaml and Reason
Activity
chenglou commentedon Aug 15, 2016
To yak shave a bit more, you (edit: I) can rewrite the playground using a React.js binding =D
chenglou commentedon Aug 15, 2016
Might be related to #386: if we have a toggle, then bundling two ocaml compilers (bs, reason) is kinda heavy. Reason can't just start using BS' fork of the compiler (or can it... @jordwalke), but if BS can use a lightly forked version of Reason that uses the patched compiler, then we dedupe one copy of the compiler when compiled into JS.
Good thing the demo page is a poweruser page. These perf concerns can wait.
bobzhang commentedon Aug 15, 2016
I am a bit lost. It's still one compiler with two front ends, the cost is 300 K bytes( for reason parser) . is it not affordable?
bobzhang commentedon Aug 15, 2016
@chenglou how about providing two objects:
reasonandocamlthey have the same interfaceAnd from the playground
http://bloomberg.github.io/bucklescript/js-demo/?lang=reason
http://bloomberg.github.io/bucklescript/js-demo/?lang=ocaml
So we have the optimal size
jordwalke commentedon Aug 15, 2016
Reason should be a tiny addition. It's properly factored out into a separate findlib library that doesn't include
utopso it should work as a library on the web now without having to hack/patch it like before.chenglou commentedon Aug 16, 2016
(Sorry got busy, didn't reply in time)
What I meant is, currently there are 2 export.js bundles, which are compiled separately, each bundle being (as an advantage) independently functioning. But (as a disadvantage) if we want to include both bundles on the same page and have a checkbox that toggles between reason and ocaml syntax, then we do have two independent bundles that each includes a compiler, right?
chenglou commentedon Aug 16, 2016
Anyway yeah, two objects would work.
bobzhang commentedon Aug 16, 2016
@jordwalke is correct, it's a tiny addition (here 300KB for the reason parser, probably smaller with --table mode). We will remove reason-demo/ since js-demo/ will have both support of OCaml and Reason
chenglou commentedon Aug 16, 2016
Would the evaluated code's warning locations still be for the original Reason code, or the hidden, compiled ocaml code?
bobzhang commentedon Aug 16, 2016
Should still be on the reason code
bobzhang commentedon Sep 25, 2017
closed since reason has its own one