Coder Social home page Coder Social logo

garnix's Introduction

Garnix

Garnix is another parser and language server for the Nix programming language. It's theoretical foundation is the SimpleSub [Lionel Parreaux: The simple essence of Subtyping] algorithm which is much stronger than normal HM-style type inferce.

Structure

This project is a mono repository and contains the parser, inference algorithm and language server in three respective folders:

Folder Content
parser The parser folder contains the parser for the nix language. It is capable of parsing all modern nix language features (no deprecated let-bindings) but needs extensive randomised testing to verify.
infer The infer folder contains the type inference algorithm capable of infering principal types for the nix language.
lsp The lsp folder contains the language server which wraps the inference library to bring type hints and error reporting too the user.

Theoretical foundation

The repository is related to the Bachelor Thesis of Sebastian Klähn at []. It contains a discussion about the current state of developer toolings in the nix ecosystem, a thorough language definition and the theoretical background for the type inference algorithm and it's drawbacks.

Development

This project uses common development guidlines. To contribut PRs have to be made against this repository that comply to the cargo format and clippy guidlines. Tests also have to run through.

This project uses the nightly rust compiler wich can be run by adding +stable to cargo or by setting the default for a given directory.

cargo +nightly run
rustup override set nightly

Using the language server

After compiling the project in release or debug mode, the language server binary lsp can be found in the target directory. By setting the binary as language server, garnix can be used in IDEs. For VScode it might look like this:

// settings.json
{
  "nix.serverPath": "home/user/garnix/target/release/lsp",
}

Testing

The parser and inference module have extensive tests in the respective tests subfolders. These tests can be used to test new implementations and learn more about the capabiliets of the current project.

garnix's People

Contributors

septias avatar

Watchers

 avatar

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.