Download Latest Version dodo0-2010-10-21.tgz (4.8 MB) Get Updates
Name Modified Size InfoDownloads / Week
README.txt 2010-10-21 4.9 kB
dodo0-2010-10-21.tgz 2010-10-21 4.8 MB
dodo0-2010-10-19.tar.gz 2010-10-20 4.8 MB
dodo0-2010-10-15.tgz 2010-10-15 4.8 MB
dodostyle.css 2010-10-13 461 Bytes
dodo.html 2010-10-13 82.6 kB
Totals: 6 Items   14.6 MB 0
Minimal dodo interpreter author: Denis Bredelet 2010 ----------------------------------- This lets you write dodo programs using a minimal syntax and run them. ---------------- Installation ---------------- 1. Install the Java JDK 2. Download ANTLR 3. Generate the parser files java -jar antlr-3.2.jar dodo0.g 4. Compile the parser javac -classpath antlr-3.2.jar *.java 5. Download and unzip Clojure You can now run a dodo program. For example: (Windows) java -classpath antlr-3.2.jar;clojure-1.2.0/clojure.jar;. clojure.main dodo/runner.clj Examples/HelloWorld.do0 (Other) java -classpath antlr-3.2.jar:clojure-1.2.0/clojure.jar:. clojure.main dodo/runner.clj Examples/HelloWorld.do0 -------------------- About the syntax -------------------- This release supports a very limited subset of dodo syntax, and does not follow all dodo conventions. First off, only functional syntax works so you cannot write a program that looks like a language you are familiar with. The base of dodo syntax is: expression -> results ...instructions... | alternative results ...other instructions... ; There can be zero or more alternative branches. The final semicolon is optional at the end of the file, before a comma or a closing bracket. For example the predefined if function can be used as follows: if (true) -> println("True", exit) | println("False", exit) ; This release of dodo comes with almost no predefined operations; to use more operations, import them from the Clojure language with: clojure('function', n) -> name Where function is the name of a Clojure function, n is the number of arguments and name is the name of the imported function. You can find a list of Clojure functions at: Additionally, you can directly call a Clojure function with: 'function'(arguments) -> results -------------- Data types -------------- Supported data types are integers, floats, booleans, strings, functions, links, futures and structs. An integer is a positive of negative number with no fractional part. A float is a floating point number with a decimal part, a fractional part and an exponent. A boolean is either true or false. A string is a text between double quotes. Note that dodo uses no escape character, so you cannot have double quotes inside a string. However strings are handled by the Clojure language, so in practice other escaped characters will work. A function is a block of code that can be reused. A function takes arguments and returns a result. Note that function syntax is different from the documentation. To create a function foo, write: fun foo -> arguments, return ( ...instructions... return(results) ) | foo Refer to the examples for more details. A link is a reference to a variable that exists somewhere else. That means making changes to its value does not change the reference. It is very useful when you need all the objects to see the same value when the value is updated. A future is the result of an operation that is running in a different thread of execution. Until the operation completes, calling the future blocks. To create a future write: fork() -> return, throw ( ...instructions... return(results) ) | future Calling the future as a function will (eventually) give the results or throw an event. Finally, struct is a base dodo object with no fields. To add or update a field in a struct use: setv(object, 'field', value) -> object To read an object field use: getv(object, 'field') -> value Have fun! --------------------------------------------------------------------------------- Release Notes --------------------------------------------------------------------------------- 2010-10-21: - Default event handler Finally, we can write programs that do not handle each exceptional outcome separately! Now if an alternative is missing (eg. no handling of throw), when it is reached the default handler prints a message and exits. - Concurrent loader Using the new support for futures, the modules example now loads several modules at once. This is the first implementation of a dodo service. 2010-10-19: - Multiple file loading The runner.clj runtime now handles several dodo source files. Just specify the files on the command line after the runtime. - Dodo types and modules The modules.do0 example demonstrates dodo types with static and dynamic dispatch, qualifiers (mixins) etc. - Improved Clojure interoperability 2010-10-15: - First release Introduces dodo0, a selected subset of dodo, with the tools to run dodo0 programs. Includes a Clojure-based runtime and examples (lists.do0 demonstrates object- oriented concepts)
Source: README.txt, updated 2010-10-21