Skip to content

Synchronize reason playground and ocaml playground #611

Closed

Description

@bobzhang
  • Rewrite current Playground JS code with OCaml, refactoring JS code is not fun
  • Submodule Reason to have a reason parser
  • Add a drop down option to let user pick up which languages (OCaml or Reason )they want
  • Update examples accordignly

Activity

  1. chenglou commented on Aug 15, 2016

    @chenglou
    Member

    To yak shave a bit more, you (edit: I) can rewrite the playground using a React.js binding =D

  2. chenglou commented on Aug 15, 2016

    @chenglou
    Member

    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.

  3. bobzhang commented on Aug 15, 2016

    @bobzhang
    MemberAuthor

    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?

  4. bobzhang commented on Aug 15, 2016

    @bobzhang
    MemberAuthor

    @chenglou how about providing two objects:
    reason and ocaml they have the same interface

    val compile : ..
    val shake_compile :
    

    And 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

  5. jordwalke commented on Aug 15, 2016

    @jordwalke

    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.

  6. chenglou commented on Aug 16, 2016

    @chenglou
    Member

    (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?

  7. chenglou commented on Aug 16, 2016

    @chenglou
    Member

    Anyway yeah, two objects would work.

  8. bobzhang commented on Aug 16, 2016

    @bobzhang
    MemberAuthor

    @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

  9. chenglou commented on Aug 16, 2016

    @chenglou
    Member

    Would the evaluated code's warning locations still be for the original Reason code, or the hidden, compiled ocaml code?

  10. bobzhang commented on Aug 16, 2016

    @bobzhang
    MemberAuthor

    Should still be on the reason code

  11. bobzhang commented on Sep 25, 2017

    @bobzhang
    MemberAuthor

    closed since reason has its own one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions