1 / 14

Dao

Dao. Caleb Thornton & Jasmine Walker. Programming Language. What is dao?. The word Dao is a Chinese word, with the basic meaning of path or way. It also means fundamental principles, as a concept commonly found in Chinese philosophy. . What is dao ? (cont.).

mele
Download Presentation

Dao

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Dao Caleb Thornton & Jasmine Walker Programming Language

  2. What is dao? • The word Dao is a Chinese word, with the basic meaning of path or way. • It also means fundamental principles, as a concept commonly found in Chinese philosophy.

  3. What is dao? (cont.) • Dao is a lightweight and optionally typed programming language with many interesting features. It includes features that can make concurrent programming much simpler. It has well design interfaces for easy embedding and extending. • The Dao interpreter runs in a lightweight and efficient virtual machine (Dao VM) in the standard C programming language. Dao also allows direct embedding of C and C++ code into Dao programs through a simple interface.

  4. How did dao come about? • In May of 2004, Fu Limin needed to use Gene Ontology (GO) to complete some analysis, and tried to write various Perl scripts to parse GO files. • He found the syntax of Pearl was rather frustrating, and started to wonder if he could develop a better cleaner syntax. • So he spent some time, and eventually ended up developing a programming language (Dao).

  5. Historical background • The language was developed under different names, initially as Yuan, then as Tao, and finally fixed as Dao (in later 2005). • Before 2006, the language was very different, and the implementation was completely different from what it is now. • In the beginning of 2006, the author was attracted and convinced by the design of the Lua 5 virtual machine, and started to design and implement the Dao interpreter as a new virtual machine with ideas inspired by the Lua virtual machine and instruction set.

  6. What is dao used for? • Dao is an object-oriented scripting language with dynamically-typed variables. • Dao supports complex data structures with built-in types such as complex numbers and multi-dimensional arrays, and includes their corresponding arithmetic operations. • Dao also supports multi-threaded programming, concurrent and distributed programming with message passing, regular expressions, and macros that allow new syntax to be defined.

  7. Main Features • Object-Oriented Programming (OOP) with classes and interfaces • Portable implementation using C • Functional Methods • Special functions called routines • Support for concurrent programming • Concurrent garbage collection • Syntax macro for defining customized syntax

  8. Functional Methods function composition: c = map( a, b )->|x,y|{ x + y, x - y }->|u,v|{ u * v }

  9. Routines a = "ABC"; rout = routine( x, y : string, z = a+a){ a += "_abc"; io.writeln( "lambda ", a ) io.writeln( "lambda ", y ) io.writeln( "lambda ", z ) } rout( 1, "XXX" ); • there is no need for a function name, but the created function must be assigned to a variable; • the default value expressions do not need to be constant expressions, as they are evaluated at run time when the function is created; • the function body may contain variables defined in the "upper" function that creates it.

  10. Multi-threading • Probably the simplest way to create multi-threaded programs in Dao is to use asynchronous function calls (AFC). The way of using AFC is almost identical to that of normal function calls, with the exception that the keyword async must follow the call. • myfunc(myparams)async;

  11. macros syntax{ source_syntax_pattern }as{ target_syntax_pattern } This example enables "while-do-end" without brackets: syntax{ while$EXPdo \[$BL \]end }as{ while($EXP){ \[$BL \] }

  12. Demo • I will now show a demo

  13. Current State • Dao is currently in use and just recently released a new beta for Dao 2.0 • Dao-2.0-Beta1 is released! (2013-05-28)

  14. Statement about the language • I think the language is really cool and I really love the idea of the macros you can create. • It’s a great language for scripting, and it’s convenient for congruent computing.

More Related