Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lexi-lambda/hackett
WIP implementation of a Haskell-like Lisp in Racket
https://github.com/lexi-lambda/hackett
racket
Last synced: 2 days ago
JSON representation
WIP implementation of a Haskell-like Lisp in Racket
- Host: GitHub
- URL: https://github.com/lexi-lambda/hackett
- Owner: lexi-lambda
- License: isc
- Created: 2016-10-09T23:44:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-14T16:40:55.000Z (10 months ago)
- Last Synced: 2024-12-02T11:22:35.728Z (2 months ago)
- Topics: racket
- Language: Racket
- Homepage: https://lexi-lambda.github.io/hackett/
- Size: 973 KB
- Stars: 1,166
- Watchers: 67
- Forks: 50
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-racket-and-scheme - hackett - like Lisp in Racket (Racket)
README
# Hackett [![Build Status](https://travis-ci.org/lexi-lambda/hackett.svg?branch=master)](https://travis-ci.org/lexi-lambda/hackett)
Hackett is an attempt to implement a Haskell-like language with support for Racket’s macro system, built using the techniques described in the paper [*Type Systems as Macros*][types-as-macros]. It is currently *extremely* work-in-progress.
Here are some of the features that Hackett supports **right now**:
- Bidirectional type inference
- Algebraic datatypes (ADTs)
- Pattern matching
- Exhaustiveness checking
- Typeclasses (including multi-parameter typeclasses)
- Higher-kinded types
- Higher-rank polymorphism
- Type-aware/type-directed macros
- Laziness
- Syntax for infix operators
- Scoped type variablesHere are some of the features that still need to be implemented for a minimal release:
- Orphan/overlapping instance detection/prevention
- Strictness analysis
- KindcheckingAnd finally, here is a (non-exhaustive) collection of features I would like to eventually support:
- Functional dependencies
- Row types
- GADTs
- Type familiesDue to the way Hackett is implemented, many things that are language features in Haskell can be derived concepts in Hackett. In fact, Hackett’s ADTs are not primitives, they are actually implemented as a library via the `data` and `case` macros in `hackett/private/adt`. Other things, like newtype deriving and generics, should be possible to implement as derived concepts as well.
Here’s some sample Hackett code that demonstrates some of Hackett’s features:
```racket
#lang hackett(data (Maybe a)
Nothing
(Just a))(def x : Integer
(let ([y 3]
[z 7])
{y + z}))(class (Show a)
[show : {a -> String}])(instance (forall [a] (Show a) => (Show (Maybe a)))
[show (λ* [[(Just x)] {"(Just " ++ (show x) ++ ")"}]
[[Nothing ] "Nothing"])])
```[**For a much more in-depth look at Hackett, see the documentation.**][hackett-docs]
## Trying Hackett
To reiterate: **Hackett is extremely experimental right now.** Things are not guaranteed to work correctly (or work at all), and things are likely to change dramatically. If you really want to install Hackett to play around with it, though, you can.
You will need to have Racket installed to use Hackett. Using `raco`, you can install Hackett as a package:
```
$ raco pkg install hackett
```Now you can use Hackett by writing `#lang hackett` at the top of a file.
[hackett-docs]: https://lexi-lambda.github.io/hackett/
[types-as-macros]: http://www.ccs.neu.edu/home/stchang/pubs/ckg-popl2017.pdf