Coder Social home page Coder Social logo

Comments (3)

lpil avatar lpil commented on September 25, 2024

Sounds good!

What commands would we want it for? run, test, build and check seem like obvious ones.

Making it a flag means there's yet another flag that can't be passed easily down into the Gleam program, and --watch seems like a common one that would be wanted. Perhaps it could be a command itself: gleam watch test

If this feature also included a way to communicate with other processes in a similar fashion to how the language server works, ...

What do you mean by this?

from gleam.

hayleigh-dot-dev avatar hayleigh-dot-dev commented on September 25, 2024

Making it a flag means there's yet another flag that can't be passed easily down into the Gleam program

No flags can be easily passed down into a gleam program in my experience:

% gleam run -m lustre/try --include-styles
error: Found argument '--include-styles' which wasn't expected, or isn't valid in this context

        If you tried to supply `--include-styles` as a value rather than a flag, use `-- --include-styles`

USAGE:
    gleam run --module <MODULE>

For more information try --help

But a watch command sounds fine in any case.

What do you mean by this?


I'd like to be able to spawn gleam watch as a (os) process and have some way of it telling my program when/which files have changed/been compiled. Maybe that's just output on stdout or maybe its events on a socket, but some way of knowing when this stuff happened would be immensely useful I think.

I'd like to, for example, re-run lustre_ssg any time some source files change. If the compiler already has a filesystem watcher it feels a bit silly if I have to re-implement all that functionality (and it is seemingly non-trivial to do this cross-platform) so if the binary could just expose that info it'd be super great.

from gleam.

lpil avatar lpil commented on September 25, 2024

No flags can be easily passed down into a gleam program in my experience:

That's a bug with Clap when only flags are passed. It doesn't in any way impact how we design the CLI API.

I'd like to be able to spawn gleam watch as a (os) process and have some way of it telling my program when/which files have changed/been compiled.

Gleam won't offer anything like this as part of this feature as it means we're accidentally shifting into being a generic build tool rather than a specific one, and I want to do a lot of R&D before we consider moving into that space as it's extremely easy to make a rubbish generic build tool / task runner.

For this specific example you don't actually need anything new from the compiler to run the site generator, you just run gleam run -m lustre_ssg --watch (or whatever the command will be).

from gleam.

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.