Giter Club home page Giter Club logo

musquared's Introduction

λ ∈ MLIR | mu-squared

Good resources:

Round tripping

  • What stops someone from defining a printer that is completely different from what the parser wants?

GHC Core

data Expr b
  = Var   Id
  | Lit   Literal
  | App   (Expr b) (Arg b)
  | Lam   b (Expr b)
  | Let   (Bind b) (Expr b)
  | Case  (Expr b) b Type [Alt b]       -- See #case_invariants#
  | Cast  (Expr b) Coercion
  | Tick  (Tickish Id) (Expr b)
  | Type  Type
  | Coercion Coercion
  deriving Data

type Arg b = Expr b
type Alt b = (AltCon, [b], Expr b)

data AltCon = DataAlt DataCon | LitAlt  Literal | DEFAULT

data Bind b = NonRec b (Expr b) | Rec [(b, (Expr b))]

hask-programs/

To run these, first install the GHC plugin from ghc-dump. This installs both the plugin that is loaded with -fplugin GhcDump.Plugin [The package ghc-dump-core] as well as the utility tool for dumping these called ghc-dump [The package ghc-dump-util].

# install tool and compiler plugin 
$ cd ghc-dump && cabal install --lib all && cabal install all

Then run the makefile:

# run the makefile, generate the dump, pretty print the dump
$ cd hask-programs && make && ghc-dump --show fib.pass-0000.cbor

TODO

  • Parse case x of { ... } style input.
  • Parse let var = val in ... input.
  • Add PrimInt type.
  • Get factorial up and running.
  • Get a notion of explicit GC.

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.