Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reason syntax #5

Open
chenglou opened this issue Jun 21, 2017 · 12 comments
Open

Reason syntax #5

chenglou opened this issue Jun 21, 2017 · 12 comments

Comments

@chenglou
Copy link

@glennsl how do you want to do this? Inline before/after the ocaml snippets? Another doc page? Interactive web page?

@glennsl
Copy link
Owner

glennsl commented Jun 22, 2017

Ideally it would be interactive (and with runnable examples!), but that'd take a bit of work (though it also gives lots of other benefits too of course). Inline would be a bit heavy and difficult to maintain I think, but a separate page shouldn't be too hard to automate.

@bassjacob
Copy link

if you're happy to have a small express server behind it, I can whip something up that serves those snippets with a toggle pretty easily (done it before)

@chenglou
Copy link
Author

For the toggle, couldn't we just translate them and inline them as text in the code?

@bassjacob
Copy link

depends on how you'd like to store them. if we want to ship them in the bundle, or as a bunch of files, then yes. if you want to ship them async from the server and have a smaller faster bundle, then no. I guess once you go interactive, then definitely 😄 but before then, you can just store them as .re and .ml and toggle a component that fetches the right one from the server. too complex?

@bassjacob
Copy link

or do you mean run a jsoo compiled bucklescript and literally translate them?

@chenglou
Copy link
Author

Some prepublish script that uses your local refmt and goes through snippets. This way the page's serverless. Though it's kinda tempting to dog food bs-express =P

Related: reasonml/reason#960

@bassjacob
Copy link

ooh, cool PR. At the point that we have the interpreter it's definitely less of an issue. Should we maybe sync up with @jaredly on updating the bucklescript jsoo version and wrapping it with a reason-react component that can render an example and a snippet? I'm happy to take a shot at prototyping something like that.

@zploskey
Copy link

In terms of ease of maintenance, a script that reads the markdown and replaces the contents of each ```ml ``` block with the output of refmt and writes out the reason version of the document would be pretty straightforward to write and would not require a server. Sound reasonable?

@glennsl
Copy link
Owner

glennsl commented Feb 16, 2018

Absolutely! You want to take a shot at it @zploskey ?

@zploskey
Copy link

Sure, I'll take a shot at it over the weekend.

@1hko
Copy link

1hko commented Apr 14, 2022

Would love to see this updated for Rescript 🥲

@glennsl
Copy link
Owner

glennsl commented Apr 14, 2022

This is still very relevant for Melange, the spiritual successor to BuckleScript, I think. And there's enough differences in rescript libraries, idioms and just what's plain possible with the new syntax that it's probably best to make it a fork. If anyone's asking for my permission to do that, you certainly have it 🙂

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

No branches or pull requests

5 participants