MonoidMusician/dhall-purescript

NPM Library

Opened this issue · 2 comments

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!

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.

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.