GithubHelp home page GithubHelp logo

awakesecurity / language-ninja Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 1.0 1.25 MB

A Haskell library for parsing, pretty-printing, and evaluating the Ninja build language.

License: Other

Haskell 89.05% Nix 3.21% CSS 3.01% JavaScript 3.41% Makefile 1.32%

language-ninja's People

Contributors

gabriella439 avatar taktoa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

l-as

language-ninja's Issues

Remove phony builds from IR

We should remove IR.ninjaPhonys :: HashMap Target (HashSet Target) and replace it by switching IR.buildRule :: Rule to Maybe Rule.

Maintainer tools

  • Automatic release workflow
    • One command that will git tag -s release-<version> -m "Version <version>", git push --tags, and make a request against the GitHub API to add data from the changelog to the GitHub release.
  • Linter for @since attributes
    • Currently we check that everything has an @since attribute, but it would also be nice to warn the maintainer if an @since attribute has not been bumped even though the underlying definition has changed. Of course, there will be false positives due to changes that are backwards-compatible, but this is better than nothing.
  • Public Hydra jobset

Support for implicit outputs

The lexer/parser/types should be updated for compatibility with implicit outputs, added in Ninja 1.7 and documented here.

  • Update Lexeme to support implicit outputs
  • Update AST.Ninja to support implicit outputs
  • Add implicit output support to parser
  • Create tests for implicit outputs

Switch parser over to `megaparsec`

The current lexer/parser is well-optimized, but it is unclear that it is correct. We should have another parser, written using megaparsec, that is more obviously correct and easier to test. This also requires adding polymorphic annotation fields to all the datatypes. For example, this datatype:

data Foo = MkFoo { _fooBar :: Bar, _fooBaz :: Baz }

would become this datatype:

data Foo ann = MkFoo { _fooAnn :: ann, _fooBar :: Bar, _fooBaz :: Baz }
instance Annotated Foo where { ... }

where Annotated is defined by:

class (Functor t) => Annotated (t :: * -> *) where
  annotation :: Lens' (t ann) ann

The old, fast parser would then have type Text -> Parser (PNinja ()), whereas the new megaparsec parser would have type Text -> Parser (PNinja (Maybe Pos)), for example. This would allow pretty-printing such that the output is identical to the parsed input, which is important for diagnostics, testing, and formatting tools.

Dependency problem during install

I'm installing on Ubuntu 14.04 but it seems like Cabal doesn't like any of the available versions of Haskell for the requirement even though the versions appear to fall within the range. What am I doing wrong?

$ cabal install
Warning: language-ninja.cabal: Ignoring unknown section type: custom-setup
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: language-ninja-0.1.0
rejecting: base-4.6.0.1/installed-8aa... (conflict: language-ninja =>
base>=4.8 && <5.0)
rejecting: base-4.10.0.0, 4.9.1.0, 4.9.0.0, 4.8.2.0, 4.8.1.0, 4.8.0.0,
4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0, 4.5.1.0, 4.5.0.0, 4.4.1.0,
4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0,
3.0.3.2, 3.0.3.1 (global constraint requires installed instance)

Release version 0.1.0 to Hackage

Release checklist:

  • Library:
    • Address all FIXME comments.
    • Full documentation.
    • Add @since annotations to all public functions.
    • Get the code to be clean with respect to -Weverything.
    • Remove unneeded dependencies.
  • Tests:
    • Set up doctest.
    • Test all optics with tasty-lens.
    • Remove unneeded dependencies.
  • Executables:
    • Move ninja2nix into a separate project.
    • Write executables:
      • ninja-lex
      • ninja-parse
      • ninja-evaluate
    • Proper command-line interface for any executables.
    • Remove unneeded dependencies.
  • Blockers:
  • Miscellaneous:
    • Add README.md et al. to extra-*-files
    • Add .github/CONTRIBUTING.md
    • Add changelog section to Cabal file.
    • Signed git tag (non-lightweight) at the appropriate version.

Consider using `Control.Exception.Lens` instead of `ether`

Control.Exception.Lens provides a nice approach for modeling exception subtyping using prisms. Instead of an ether type like this:

(MonadExcept IOException m, MonadException CompileError m) => ...

... you would have:

(AsIOException e, AsCompileError e, MonadException e m) => ...

See this thread for more details:

https://www.reddit.com/r/haskell/comments/2utxua/prisms_and_monaderrors/?st=j4aqwbyx&sh=1c57491b

... and:

https://hackage.haskell.org/package/lens-4.15.3/docs/Control-Exception-Lens.html

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.