ghl3 / Jest

An interpreted language run on the JVM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jest

I knew him, Horatio; a fellow of infinite jest, of most excellent fancy

  • Hamlet, V.i

About

Jest is an dynamic language that runs on the JVM. Jest is a (mostly) functional language with an emphasis on immutability, simplicity, and readability.

Jest programs are internally represented as Clojure data structures and are interpreted using Clojure's runtime.

Installing

Jest requires a recent version of leiningen to be installed.

To install Jest:

  • Download the jest source code.
  • Navigate inside the source directory and type "make" to run the makefile.
  • Add "jest/bin" to your path.

Usage

Run a jest program:

jest program.jst

Example Programs

let myList = range(0, 100, 10);

let incremented = map(inc, myList);

defn square(x) {
     x*x;
};

let squared = map(square, incremented);

println(squared);

let halfRange = (squared.first() + squared.last()) / 2;

println(halfRange);

Which prints

(1 121 441 961 1681 2601 3721 5041 6561 8281)
4141
let scores = [90, 85, 95, 92];

println("Scores: ", scores);

let studentAges = {"Jane" :14, "Bob": 16, "Tom": 15};

let answers = {"Jane": ["A", "C", "D", "A"],
    "Bob": ["B", "C", "D", "B"],
    "Tom": ["A", "C", "B", "A"]};

for (a, b : studentAges, answers) {
    println(a, b);
};

Which prints

[90 85 95 92]
[Tom 15] [Tom [A C B A]]
[Jane 14] [Jane [A C D A]]
[Bob 16] [Bob [B C D B]]

Documentation

For further documentation, go here.

License

Copyright © 2015

Distributed under the MIT License.

About

An interpreted language run on the JVM.

License:MIT License


Languages

Language:Clojure 47.7%Language:Java 44.7%Language:GAP 6.6%Language:Makefile 0.9%Language:Shell 0.1%