GitXplorerGitXplorer
s

diy_lisp_java

public
6 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
59fc2097eea4f624f36fefc325dac4a2d957214a

Adding license

ssecondsun committed 11 years ago
Unverified
3b11101445102da3a6233ba2f72577bd19e964b7

Removing implementation

ssecondsun committed 11 years ago
Unverified
35e0969ab6b5552820f41ccadc056ec64742fd6a

Auto License, auto format

ssecondsun committed 11 years ago
Unverified
1687a20caeaa919422c606b14fd1da0dfffdbbba

Adding docs

ssecondsun committed 11 years ago
Unverified
8a341bf629c1d8a5d5f0d839bb5a8c03611e6eb7

Removing python isms and replacing with java isms

ssecondsun committed 11 years ago
Unverified
4f228187c2e539129867737170603186146ec3cc

Adding/cribbing documentation

ssecondsun committed 11 years ago

README

The README file for this repository.

diy_lisp_java

A java version of https://github.com/kvalle/diy-lisp. All documentation is copied from the origial repoistory.

DIY Lisp

batteries included, some assembly required

In this tutorial/workshop we'll be implementing our own little language, more or less from scratch.

By the end of the tutorial you will be the proud author of a programming language, and will hopefully better understand how programming languages work on a fundamental level.

What we will be making

We will make a relatively simple, but neat language. We aim for the following features:

  • A handful of datatypes (integers, booleans and symbols)
  • Variables
  • First class functions with lexical scoping
  • That nice homemade quality feeling

We will not have:

  • A proper type system
  • Error handling
  • Good performance
  • And much, much more

The language should be able to interpret the following code by the time we are done:

(define fact 
    ;; Factorial function
    (lambda (n) 
        (if (eq n 0) 
            1 ; Factorial of 0 is 1
            (* n (fact (- n 1))))))

;; When parsing the file, the last statement is returned
(fact 5)

The syntax is that of the languages in the Lisp family. If you find the example unfamiliar, you might want to have a look at a more detailed description of the language.

Prerequisites

Before we get started, make sure you have installed JDK Java 8 and Maven.

You may also want to use an IDE to have better control of individual unit tests and debugging. I reccomend [NetBeans] (http://netbeans.org), but any IDE works as does the command line.

Finally, clone this repo, and you're ready to go!

git clone https://github.com/secondsun/diy_lisp_java

Get started!

The workshop is split up into seven parts. Each consist of an introduction, and a bunch of unit tests which it is your task to make run. When all the tests run, you'll have implemented that part of the language.

Have fun!