jordwalke / esy-issues

Easy ISSUES
MIT License
49 stars 5 forks source link

Make opam-file-format work with BuckleScript #98

Closed wokalski closed 7 years ago

wokalski commented 7 years ago

opam-file-format is a parser for opam files. If it is compilable by BuckleScript, we save a lot of time when implementing #81.

If we compile it with Bucklescript we can drop the OCaml dependency and publish a package containing the JS output.

81 depends on this one.

I have started working on this feature.

wokalski commented 7 years ago

This one was trivial. opam-file-format works with BuckleScript out of the box. There's some problem with Pervasives module.

  1. in_channel is an argument to Lexing.from_channel
  2. in the simplest scenario you use OcamlParser.main
  3. it takes lexbuf as one of its args
  4. BuckleScript doesn't implement open_in yet.

The parser itself works though so this is a good first step.

The source is here, although it's probably gonna live in the esy at the end of the day. https://github.com/wokalski/opam-file-format-bs

wokalski commented 7 years ago

Actually it's not a problem because we can create a lexbuf with a string. Even if there's no way to read a file into a string in BuckleScript we can resort to bs.raw.

andreypopp commented 7 years ago

Awesome! On Sun, 14 May 2017 at 22:07 Wojtek Czekalski notifications@github.com wrote:

Actually it's not a problem because we can create a lexbuf with a string. Even if there's no way to read a file into a string in BuckleScript we can resort to bs.raw.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jordwalke/esy-issues/issues/98#issuecomment-301325861, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB3giFmJsPjlXOI8RMHwQnA0y_Lcpb0ks5r5zTcgaJpZM4NZ11S .

IwanKaramazow commented 7 years ago

@wokalski Awesome work!