Giter Site home page Giter Site logo

vampire-droid / ghciwatch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mercurytechnologies/ghciwatch

0.0 0.0 0.0 539 KB

ghci-based file watching recompiler for Haskell development

License: MIT License

Haskell 0.10% Rust 97.03% Nix 2.65% Makefile 0.22%

ghciwatch's Introduction

ghciwatch

The next generation of ghcid, a ghci-based file watcher and recompiler. ghciwatch watches your modules for changes and reloads them in a ghci session, displaying any errors.

Why a reimplementation?

When we started working on ghciwatch, ghcid suffered from some significant limitations. In particular, ghcid couldn't deal with moved or deleted modules, and wouldn't detect new directories because it can't easily update the set of files being watched at runtime. We've also seen memory leaks requiring multiple restarts per day. Due to the ghcid codebase's relatively small size, a reimplementation seemed like a more efficient path forward than making wide-spanning changes to an unfamiliar codebase.

Why Rust?

Rust makes it easy to ship static binaries. Rust also shares many features with Haskell: a Hindley-Milner type system with inference, pattern matching, and immutability by default. Rust can also interoperate with Haskell, so in the future we'll be able to ship ghciwatch as a Hackage package natively. Also, Rust's commitment to stability makes coping with multiple GHC versions and GHC upgrades easy. Finally, Rust is home to the excellent cross-platform and battle-tested notify library, used to implement the watchexec binary and cargo-watch, which solves a lot of the thorny problems of watching files for us.

Why not just use watchexec or similar?

Recompiling a project when files change is a fairly common development task, so there's a bunch of tools with this same rough goal. In particular, watchexec is a nice off-the-shelf solution. Why not just run watchexec -e hs cabal build? In truth, ghciwatch doesn't just recompile the project when it detects changes. It instead manages an interactive ghci session, instructing it to reload modules when relevant. This involves a fairly complex dance of communicating to ghci over stdin and parsing its stdout, so a bespoke tool is useful here.

ghciwatch's People

Contributors

9999years avatar evanrelf avatar gabriella439 avatar parsonsmatt 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.