MonoidMusician / dhall-purescript

Dhall implementation in PureScript
https://monoidmusician.github.io/dhall-purescript/index.html
BSD 2-Clause "Simplified" License
95 stars 5 forks source link

NPM Library #10

Open jacobstern opened 5 years ago

jacobstern commented 5 years ago

Hi, Are there plans to make this project into a library that can be hosted on NPM and expose a JavaScript/TypeScript API? It would be great to have an implementation of Dhall that can be consumed from JS applications. Thanks!

MonoidMusician commented 4 years ago

Hi! Thanks for the interest. I don't think this particular library will be suitable for a JS/TS API, since the datatypes are so different from what they would look like natively in JS. You would essentially have to commit to always using "foreign" functions to manipulate/inspect the data (although that's probably not so bad if you just use it for parsing/printing text/CBOR and normalizing/typechecking), or you would have to pay a conversion cost each time you want to transfer back and forth. I'm willing to be proven wrong, but I'm not going to put any effort towards it myself at this point. Eventually, though, I do hope to get around to implementing dhall-to-json here, and maybe that will make it more suitable for consumption outside of JS.

toastal commented 3 years ago

Even versioning this for Spago/Pursuit would be nice -- though the Halogen stuff isn't relevant to consuming the Dhall stuff. I was looking at this as a solution to a problem, but I'll probably just shell out to dhall-to-json via the Haskell binaries for now.