Giter Site home page Giter Site logo

Comments (8)

bodil avatar bodil commented on September 26, 2024

You're right, the current convention seems a bit risky. @paf31?

from pulp.

paf31 avatar paf31 commented on September 26, 2024

For this to cause problems, I think all of the following have to hold:

  1. A module is called purescript-something in bower_components
  2. That module has a .js file under src/
  3. That JS files has a magic // module ... comment (otherwise the compiler won't accept it as an FFI module anyway, and you'll get an error early on in the compilation process)

I would say this would be rare enough to not worry, but I'm happy to discuss alternatives.

It might be a good idea for the compiler to warn and continue, instead of raising an error, when 3) holds though.

from pulp.

garyb avatar garyb commented on September 26, 2024

@paf31 re: 1, the glob doesn't mention purescript-, so that's probably the only problem here.

from pulp.

paf31 avatar paf31 commented on September 26, 2024

Oops, I see. Yes, that should definitely be there.

I'll send a PR.

from pulp.

paf31 avatar paf31 commented on September 26, 2024

We are, of course, trading one global convention for another here, but I think this one (dependencies being called purescript-something) is more likely to be used in practice.

from pulp.

garyb avatar garyb commented on September 26, 2024

Very true. I quite like the idea of .purs.js too, shame we didn't do that already in the core libraries.

from pulp.

bodil avatar bodil commented on September 26, 2024

I agree, .purs.js would be the cleanest solution here. Requiring PS packages to always be called purescript-something is a bit iffy, but it's probably a convention that's entirely valid right now, so let's go with it until it starts causing trouble.

from pulp.

paf31 avatar paf31 commented on September 26, 2024

I think the problem is that the compiler tries to be entirely conventionless, whereas pulp tries to do the exact opposite, so at some point, it's naturally going to run into the need for global conventions. Arguably it already has: the compiler doesn't enforce that PureScript source files be called *.purs, but it's a global convention which everyone has adopted.

from pulp.

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.