Giter Club home page Giter Club logo

mumbler's Introduction

Mumbler is a lisp programming language I wrote to try out the Graal JIT for the JVM.

Mumbler

Mumbler is a very small lisp modeled after Scheme but with far fewer special forms and built-in functions. Here is the ”Mumbler language specification”.

Build

Mumbler uses Gradle as the build system. To build the code simply run

cd ${MUMBLER_REPO}/lang
./gradlew installDist

Run

Mumbler requires a special version of the JVM. You can download a graal JVM from Oracle. Mumbler requires version 19.3 or newer.

You can start Mumbler’s REPL from the build directory. Just set JAVA_HOME to point to the Graal JVM.

JAVA_HOME=<graal-vm-dir> ${MUMBLER_REPO}/lang/build/install/mumbler/bin/mumbler

Run tests

The test/ directory contains several Mumbler scripts that try out different features. To run all the tests:

${MUMBLER_REPO}/test/run_tests

You can try out individual scripts by starting running Mumbler directly.

${MUMBLER_REPO}/lang/build/install/mumbler/bin/mumbler ${MUMBLER_REPO}/test/<a-random-script>.mumbler

You can disable tail call optimization.

${MUMBLER_REPO}/lang/build/install/mumbler/bin/mumbler --tco=false ${MUMBLER_REPO}/test/<a-random-script>.mumbler

You can also run individual scripts using gradle.

cd ${MUMBLER_REPO}/lang
./gradlew run -PappArgs="['/home/jchaloup/development/mumbler/benchmark/fibonacci/fibonacci.mumbler']"
./gradlew run -PappArgs="['/home/jchaloup/development/mumbler/benchmark/fibonacci/fibonacci.mumbler', '--tco=false']"

Run benchmarks

Build Truffle and Mumbler and set environment variables.

${MUMBLER_REPO}/benchmark/measure <benchmark-name>

benchmark-name is the name of the files in one of the directories under benchmark, without the extension, as in the following example.

${MUMBLER_REPO}/benchmark/measure ${MUMBLER_REPO}/benchmark/fibonacci/fibonacci

You can uncomment the benchmark execution commands at the end of the measure script in order to benchmark mumbler against other languages than python.

Set Environment Variables

Mumbler’s scripts use two environment variables.

JAVA_HOME : The directory of the Graal VM. Mumbler may run using the default Oracle or OpenJDK JVM, but you won't see the performance gains that Graal provides.
MUMBLER_HOME : The path where gradle built and installed Mumbler. It should be under ${MUMBLER_REPO}/lang/build/install/mumbler

The MUMBLER_REPO environment variable referenced here is not used by an scripts. It signifies where the Mumbler repo was cloned on your system.

License

Copyright © 2014-2020 Cristian Esquivias

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

mumbler's People

Contributors

cesquivias avatar chumer avatar eregon avatar jchalou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mumbler's Issues

Missing files and Compilation Error

Hello Cesquivias,
Am trying to compile the source code, following files are missing , if possible please add them.
Regards
Raj

import mumbler.truffle.node.builtin.arithmetic.AddBuiltinNodeFactory;
import mumbler.truffle.node.builtin.arithmetic.DivBuiltinNodeFactory;
import mumbler.truffle.node.builtin.arithmetic.ModBuiltinNodeFactory;
import mumbler.truffle.node.builtin.arithmetic.MulBuiltinNodeFactory;
import mumbler.truffle.node.builtin.arithmetic.SubBuiltinNodeFactory;
import mumbler.truffle.node.builtin.io.NowBuiltinNodeFactory;
import mumbler.truffle.node.builtin.io.PrintlnBuiltinNodeFactory;
import mumbler.truffle.node.builtin.io.SleepBuiltinNodeFactory;
import mumbler.truffle.node.builtin.lang.ReadBuiltinNodeFactory;
import mumbler.truffle.node.builtin.list.CarBuiltinNodeFactory;
import mumbler.truffle.node.builtin.list.CdrBuiltinNodeFactory;
import mumbler.truffle.node.builtin.list.ConsBuiltinNodeFactory;
import mumbler.truffle.node.builtin.list.ListBuiltinNodeFactory;
import mumbler.truffle.node.builtin.relational.EqualBuiltinNodeFactory;
import mumbler.truffle.node.builtin.relational.GreaterThanBuiltinNodeFactory;
import mumbler.truffle.node.builtin.relational.LessThanBuiltinNodeFactory;
import mumbler.truffle.MumblerTypesGen;
import mumbler.truffle.node.special.DefineNodeGen;
import mumbler.truffle.node.read.ClosureSymbolNodeGen;
import mumbler.truffle.node.read.GlobalSymbolNodeGen;
import mumbler.truffle.node.read.LocalSymbolNodeGen;
import mumbler.truffle.node.special.DefineNodeGen;
import mumbler.truffle.node.special.LambdaNodeGen;
import mumbler.truffle.node.special.QuoteNodeGen;

Add test suite

After breaking tail call elimination there should be a battery of tests to verify that no language features regress.

Finish the rename

I see there are still a couple places where the language is still named Truffler, most notably in graal/, simple/repl, benchmark/measure and the instance in the README which is fixed by #1. It would be nice to fix those as well so there is no possible confusion.
For the pathnames, I found benchmark/fibonacci/fibonacci.truffler and graal/src/truffler.
In the blog post, under the if subsection the language is named "Truffle".
It is nice to see such a detailed experiment, keep up the good work!

how repl can save global symbol

I know repl execute mode create new context every time.
After I change to something put MumblerContext context = new MumblerContext(); outside while
and pass the global Namespace

However it still can not save global symbol.

➫ (define x 1)
FrameDescriptor@5fdef03a{0:println, 1:+, 2:-, 3:*, 4:/, 5:%, 6:=, 7:<, 8:>, 9:list, 10:cons, 11:cons?, 12:pair?, 13:car, 14:cdr, 15:now, 16:read, 17:sleep}
#'x
x
define settint 1[18,x,Long]FrameDescriptor@5fdef03a{0:println, 1:+, 2:-, 3:*, 4:/, 5:%, 6:=, 7:<, 8:>, 9:list, 10:cons, 11:cons?, 12:pair?, 13:car, 14:cdr, 15:now, 16:read, 17:sleep, 18:x}
define after settint 1[18,x,Long]org.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@26ba2a481
1
1
➫ x
FrameDescriptor@5fdef03a{0:println, 1:+, 2:-, 3:*, 4:/, 5:%, 6:=, 7:<, 8:>, 9:list, 10:cons, 11:cons?, 12:pair?, 13:car, 14:cdr, 15:now, 16:read, 17:sleep, 18:x}
globalSymbol 1 [18,x,Long]globalFrameorg.graalvm.compiler.truffle.runtime.FrameWithoutBoxing@783e6358
null
null

How can repl get the right value for x?

Add TruffleMumbler to benchmark script

The benchmark/measure script doesn't calculate the times for the TruffleMumbler implementation. Add it so it's easier to compare with the other languages/implementations.

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.