Dodo is a programming language. Dodo is object oriented. Dodo is concurrent. Dodo is developed for people interested in programming languages. Dodo is not developed for general programming at this stage. Long live dodo.
Be the first to post a text review of Dodo, the programming language. Rate and review a project by clicking thumbs up or thumbs down in the right column.
The syntax of the dodo language is still a work in flux, but the documentation shows the main orientations. My main inspirations are C, Python, D and various other languages. From C I borrowed the variable declaration style, the bracket block syntax, the dot as field accessor and more. The colon-dot block syntax is inpired from Python and the exception system is inspired from D. I would like to discuss some decisions that were made that depart from these languages. While many languages are case-sensitive, they rarely attach a semantic meaning to the case of identifier names. Where there are conventions they are not enforced by the language. For example you can find the following advice on a page addressed to Java programmers: Package names should be pure lower case. Class names should begin with an upper case letter. Violating this convention will confuse the heck out of anyone trying to decipher your code. I believe that the conventions are a good thing, and I went one step further by enforcing them in the language. A dodo name that starts with a capital letter is always a class name. That decision helps the syntax parser with some constructs, such as class declaration. Like Python, the semicolon separator at the end of a line is optional. Because of this all dodo blocks are attached to the previous instruction or keyword, a block by itself is not valid dodo syntax. Instead of multiplying the keywords that introduce a loop or a test instruction, like C does, I restricted them to the two keywords 'loop' and 'test'. Variations depend on what follows the keyword. The table below shows the correspondence between Java and dodo constructs: Simple test Java: if (...) {...} dodo: test (...) {...} Test with alternative Java: if (...) {...} else {...} dodo: test {... {...} default {...}} Test expression with matches Java: switch (...) {case ...: ...; break; default: ...} dodo: test match(...) {... {...} default {...}} Infinite loop Java: while (true) {...} dodo: loop {...} Loop while condition is true Java: while (...) {...} dodo: loop while (...) {...} Do instructions and repeat while/unless condition is true Java: do {...} while (...) dodo: loop until (...) {...} (the condition is inverse of Java condition) Loop with initialiser, condition and step Java: for (...; ...; ...) {...} dodo: loop for (...; ...; ...) {...} Loop for each element in a list Java: for (...: ...) {...} dodo: loop foreach (... in ...) {...} I know that this choice will displease some, however I believe that it keeps the program readable without cluttering the namespace. In contrast I reserved a relatively large number of keywords for functional constructs: if, else, match, fun, map, fold, seed, unfold... This aims at making dodo a convenient language for functional programming. While dodo is targetted at developers with an imperative programming baggage, I would like very much to ease the transition to functional programming for those that wish. In line with this there are two syntaxes for function bodies in dodo. One is similar to C functions, the other is similar to C variables. Variables are defined by their type, their name and an initial value which is an expression. Using an expression as function body is akin to doing functional programming. An example: int square(int x) = x * x Finally, while I am not decided to include the full type inference which is widespread in functional languages, a limited form of type inference is available for variables with an initial value.
Be the first person to add a text review.
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use
Thanks for your rating!
Would you also like to write a review?