Giter Site home page Giter Site logo

Comments (7)

Gabriella439 avatar Gabriella439 commented on September 26, 2024

Yeah, I already test drove using GHCJS on Dhall. If I remember correctly, the main issue I ran into was that the import system didn't work for URLs, but I suppose that it's still useful if people want to "Try Dhall" in the browser. The main limitation will be the absence of the Prelude

from dhall-lang.

Profpatsch avatar Profpatsch commented on September 26, 2024

The main limitation will be the absence of the Prelude

Since we already put the whole Haskell runtime as JS into the browser, supplying the Prelude should not be that much overhead, right?
I’d love to expose the library parts to Purescript and reuse the typechecker, parser and awesome error reporting. Maybe by going through yet another json export-/import step it’s possible get something like (very non-performant) Purescript import.

from dhall-lang.

Gabriella439 avatar Gabriella439 commented on September 26, 2024

Oh yeah, I forgot that we support customizable import resolution, so this should be doable if we use the Haskell API translated to JavaScript

from dhall-lang.

Profpatsch avatar Profpatsch commented on September 26, 2024

Now we just need somebody to implement a zero-copy data view from GHCJS output to Purescript structures. :P

from dhall-lang.

Profpatsch avatar Profpatsch commented on September 26, 2024

So, I’ve had some success and set up a repo.

philip@katara ~/c/h/dhall-js (master)> 
nix-build -I nixpkgs=/home/philip/nixpkgs release.nix  --option build-use-substitutes false -A small
/nix/store/mxlcim7c9binajhgny02my3fp3lzy310-export-test-small
philip@katara ~/c/h/dhall-js (master)> nix-shell -p nodejs --run "node ./result"
Object (fromList [("bar",String "Hello DhallJS!"),("foo",Number 23.0)])

^C⏎                           

philip@katara ~/c/h/dhall-js (master)> 
nix-build -I nixpkgs=/home/philip/nixpkgs release.nix  --option build-use-substitutes false -A small
/nix/store/mxlcim7c9binajhgny02my3fp3lzy310-export-test-small
philip@katara ~/c/h/dhall-js (master)> 
du -ha /nix/store/mxlcim7c9binajhgny02my3fp3lzy310-export-test-small
624K	/nix/store/mxlcim7c9binajhgny02my3fp3lzy310-export-test-small
philip@katara ~/c/h/dhall-js (master)> 
nix-build -I nixpkgs=/home/philip/nixpkgs release.nix  --option build-use-substitutes false -A orig
/nix/store/zmp0qarqnd3c1i7yva0jmfypn89smmv8-export-test
philip@katara ~/c/h/dhall-js (master)> 
du -ha /nix/store/zmp0qarqnd3c1i7yva0jmfypn89smmv8-export-test
2.3M	/nix/store/zmp0qarqnd3c1i7yva0jmfypn89smmv8-export-test

from dhall-lang.

Gabriella439 avatar Gabriella439 commented on September 26, 2024

Nice job! :)

from dhall-lang.

Gabriella439 avatar Gabriella439 commented on September 26, 2024

This is fixed by dhall-lang/dhall-haskell#734

from dhall-lang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.