• Stars
    star
    1,149
  • Rank 40,592 (Top 0.8 %)
  • Language
    Racket
  • License
    ISC License
  • Created about 8 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WIP implementation of a Haskell-like Lisp in Racket

Hackett Build Status

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. 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 variables

Here are some of the features that still need to be implemented for a minimal release:

  • Orphan/overlapping instance detection/prevention
  • Strictness analysis
  • Kindchecking

And finally, here is a (non-exhaustive) collection of features I would like to eventually support:

  • Functional dependencies
  • Row types
  • GADTs
  • Type families

Due 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:

#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.

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.

More Repositories

1

freer-simple

A friendly effect system for Haskell
Haskell
222
star
2

eff

🚧 a work in progress effect system for Haskell 🚧
Haskell
113
star
3

mtl-style-example

A small example of using mtl style to unit test effectful code
Haskell
106
star
4

higher-rank

A small Haskell implementation of Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism
Haskell
101
star
5

racket-r7rs

An implementation of R7RS in Racket
Racket
92
star
6

megaparsack

Racket parser combinators inspired by parsack and megaparsec
Racket
76
star
7

racket-collections

Generic collections API for Racket
Racket
52
star
8

blackboard

A (very) unfinished OpenType Math layout and rendering engine in Racket
Racket
51
star
9

threading

Threading macros for Racket
Racket
47
star
10

talks

Racket
42
star
11

functional

Functional interfaces and datatypes for Racket
Racket
42
star
12

monad-validate

A Haskell monad transformer library for data validation
Haskell
35
star
13

shattered-plans

Java
31
star
14

racket-commonmark

Fast, CommonMark-compliant Markdown parser written in Racket
Racket
31
star
15

heroku-buildpack-racket

a Heroku buildpack for deploying apps written in Racket
Shell
27
star
16

lexi-lambda.github.io

Racket
27
star
17

racket-mvar

An implementation of Haskell’s MVars in Racket
Racket
27
star
18

mini-ml

An experimental implementation of a tiny ML-like language using an embedded custom expander (WIP, currently just System F core language)
Racket
21
star
19

racket-higher-rank

Racket
21
star
20

envy

An environment variable manager for Racket applications
Racket
17
star
21

racket-curly-fn

A meta-language for adding Clojure-style shorthand function literals to arbitrary Racket languages.
Racket
16
star
22

racket-tulip

Racket
15
star
23

racket-alexis-collections

Deprecated. Use https://github.com/lexi-lambda/racket-collections instead.
Racket
12
star
24

libsol

A C runtime for the sol programming language.
C
11
star
25

racket-multimethod

Proof-of-concept, mostly safe multimethods in Racket
Racket
11
star
26

case-kw-lambda

Racket
11
star
27

racket-alexis-pvector

Deprecated. Use https://github.com/lexi-lambda/racket-pvector instead.
Racket
11
star
28

scripty

Distributable shell scripts with dependencies
Racket
10
star
29

racket-macro-exercises

Small macro challenges to help learn Racket’s macro system
Racket
9
star
30

lens-examples

A handful of small examples of parts of the Haskell `lens` package
Haskell
8
star
31

racket-2htdp-typed

A port of 2htdp to Typed Racket
Racket
8
star
32

learning-haskell

Racket
8
star
33

racket-pvector

Fast, immutable, persistent vectors for Racket
Racket
8
star
34

dotfiles

Racket
7
star
35

namespaced-transformer

Racket
6
star
36

racket-sample-heroku-app

a sample Racket application for deployment to Heroku
Racket
6
star
37

factorio-blueprints

Makefile
6
star
38

syntax-classes

Racket
5
star
39

SimpleJail

Simplistic Jail plugin for Bukkit
Java
5
star
40

clojure-fuzzy-urls

Clojure
5
star
41

struct-update

Racket
5
star
42

th-to-exp

Deprecated. Use Language.Haskell.TH.Syntax.Lift instead.
Haskell
4
star
43

aws-cloudformation-template

Racket
4
star
44

litpub

A small Medium clone in Racket designed for publishing stories
Racket
4
star
45

decontaminate

A Ruby DSL for extracting data from complicated XML documents
Ruby
3
star
46

alexis-collection-lens

Lens provider for Racket generic collections
Racket
3
star
47

SNESTile

A cross-platform SNES graphics editor.
Java
3
star
48

collections-lens

Lenses for Racket generic collections
Racket
3
star
49

racket-irc-client

Racket
3
star
50

racket-alexis

Various personal libraries and utilities for Racket
Racket
3
star
51

racket-match-plus

Racket
2
star
52

rackunit-spec

Racket
2
star
53

simple_split

dead simple A/B testing on Rails
Ruby
2
star
54

haskell-rolodex

Haskell
2
star
55

type-assertions

Runtime type assertions for testing
Haskell
1
star
56

monads-lecture

Haskell
1
star
57

racket-vector-struct

Racket
1
star
58

racket-semver

A Racket implementation of the semver specification
Racket
1
star
59

imgcap

Racket
1
star
60

incremental

Haskell
1
star
61

ut2k4-team-stats

A simple app that uses the data from the UT2k4 Stats server to track the performance of team duos
Racket
1
star
62

template-dom

A library for creating (V)DOM nodes using ES2015 tagged template strings
JavaScript
1
star