Code Monkey home page Code Monkey logo

let-go's Introduction

Squishy loafer

Tests FOSSA Status

let-go

Greetings loafers! (ฮป-gophers haha, get it?)

This is supposed to be a compiler and bytecode VM for a language resembling Clojure as close as possible.

Now, I know about candid82/joker and I ๐Ÿ’› it. Though, it has some drawbacks and design choices that I'd like to avoid.

Here are some nebulous goals in no particular order:

  • Quality entertainment,
  • Implement as much of Clojure as possible - including persistent data types and true concurrency,
  • Provide comfy two-way interop for arbitrary functions and types,
  • Serve primarily as an embedded extension language,
  • AOT (let-go -> standalone binary) would be nice eventually,
  • Strech goal: let-go bytecode -> Go translation.
  • Pure Go, zero dependencies.

Here are the non goals:

  • Stellar performance,
  • Being a drop-in replacement for clojure/clojure at any point,
  • Being a linter/formatter/tooling for Clojure in general.

Current status

Can compile and eval basic Clojure flavored lisp.

The most impressive snippet so far

(test "Y combinator"
      (let [Y (fn [f] ((fn [x] (x x))
                        (fn [x]
                          (f (fn [y] ((x x) y))))))
            fac-gen (fn [func] (fn [n] (if (zero? n) 1 (* n (func (dec n))))))]
        (= 120 ((Y fac-gen) 5))))

See tests for more examples.

Prerequisites and installation

Building or running let-go from source requires Go 1.16. There are no binary releases yet.

Running

Sure, you can! Just keep in mind that we're not there yet and it will likely blow up in your face. Just remember to leave an issue when it does ๐Ÿ˜Š

The best way to take let-go for a spin right now is to clone this repo and run the REPL like this:

go run . 

To run an expression:

go run . -e '(+ 1 1)'

To run a file:

go run . test/hello.lg

Use the -r flag to run the REPL after the interpreter has finished with files and -e:

go run . -r test/simple.lg                # will run simple.lg first, then open up a REPL
go run . -r -e '(* fun 2)' test/simple.lg # will run simple.lg first, then (* fun 2) and REPL 

Building the interpreter -lg

To build the standalone interpreter:

make

This will produce the lg executable.


Follow me on twitter for nightly updates! ๐ŸŒ™

follow on Twitter

let-go's People

Contributors

alimpfard avatar fossabot avatar nooga 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.