Dao language 1.0 beta is release!

Discussion in 'Perl Misc' started by fulimin, Nov 20, 2006.

  1. fulimin

    fulimin Guest


    After a few months' effort, I have finished the implementation of Dao
    Virtual Machine(DVM), and released it as 1.0-beta. The DVM is
    implemented as a very efficient virtual register machine. This version
    has implemented all the features I have planned. Most importantly, the
    implementation has been switched from C++ to standard C. As a
    consequence, the binary code of DVM is much smaller than before (as
    executable 250KB, as dynamic linking library 300KB, linux/gcc4). The
    efficiency has also been improved as well. The structure of DVM has
    been changed slightly, such that the embedding and extending of DVM
    becomes more convinient. In fact, now the mechanism to call internal
    functions is exactly the same as the mechanism to call extended
    functions. To allow DVM being more freely used, GLPL (GNU Lesser
    General Public Licence) has been adopted since this release. The DVM
    can be compiled and run in both windows and linux, but so far, it is
    tested mainly under linux. As before, the documentation of Dao is not
    well prepared yet; and there are only a few extended modules available
    for using. These two things will be the prioritized work in the near

    website: http://www.xdao.org
    documentations: http://www.xdao.org/daoweb.dao?page=document

    Changed or new features

    Multiple lines comment: <<<...>>> is changed to #{...#}, which can be
    used anywhere in the scripts.

    Built-in functions have been organized into some basic libraries:
    stdlib, stdio, math, reflect, coroutine, thread etc. So now Built-in
    function xyz(...) should be used abc.xyz(...), where "abc" is the
    proper library. For convinience and efficiency, one may also do:
    xyz = abc.xyz;

    More methods are added for basic data types;

    Bit operations |, &, ^, ~, <<, >>;

    Typed variables, assignment between variable of different types will
    issure an error:

    a : 1; # a is a number; not compiled virtual instruction;
    a := 1; # a is a number; compiled into assignment instruction;

    The right side of : or := must be a const. This kind of syntax is for
    consistence with syntax for specifying typed parameters in function

    Similarly class may have typed instance variables. Moreover, "my a :=
    1" will also specify the default value for the variable;

    Class instance creation by enumeration:
    class MyNumber
    my value := 0;

    num1 = MyNumber{ 123 };

    num2 = MyNumber {
    value @= 456; # may specify the name of variables to be

    Be cautious when enumerating class members without speficying names
    to create class instances for derived classes.

    Creating multi-dimensional array:

    changed from
    list = { 2, 3 } : 100;
    array = [ 2, 3 ] : 100; # 2 X 3 matrix
    list = 100 <@> { 2, 3 };
    array = 100 <@> [ 2, 3 ];

    operator <@> can be called arrange operator. A<@>B, arrange A or copies
    of A into a list or array of shape B. If B is a list, this operator
    will create a new list which has shape specified by B, and contains A
    or copies of A as elements. If B is a numeric array, this operator will
    create a numeric array with shape B; if A is also a numberic array, the
    resulting array will contain multiple subarrays that are equal to A.

    This new operator is introduce because the previous using colon for
    multiple purpose is confusing.

    Support coroutines similar to Lua coroutines;

    Previous built-in functions sort(),apply(),noapply() have become
    methods of list
    or numeric array with some changing in syntax:

    sort( list, @0 < @1, n );
    list.sort( @{ @0 < @1 }, n );
    apply( array[ 1:5, : ], @0 + @1 * @2 );
    array.apply( @{ @0 + @1 * @2 }, { 1:5, : } );

    Expressions that are used as parameters should be put inside @{ }. The
    advantage for this is,
    simpler parsing; and moreover, they can be passed to C extending

    Extending modules:
    New modules available:
    - DaoCGI: CGI web programming;
    - DaoFastCGI: FastCGI web programming;allow DVM to run as FastCGI
    - DaoSqlite: binding to Sqlite3 database; lighttpd +sqlite +dao could
    be a good option
    for some websites, since each of them is designed to be
    light and efficient.
    - DaoOpenGL: 3D graphics; support upto DaoOpenGL1.1£¬including GLU;
    - DaoSDL: binding to Single DirectMedia Layer, partially finished;
    - DaoCamellia: binding to camellia image processing library;

    The previous modules DaoMySQL, DaoBLAS and DaoPython are not yet
    upgraded accordingly for this release.

    Have fun!

    Limin Fu
    fulimin, Nov 20, 2006
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Oliver

    install Beta 2 after Beta 1?

    Mark Oliver, Jan 25, 2005, in forum: ASP .Net
    Scott Allen
    Jan 25, 2005
  2. Replies:
    Marc 'BlackJack' Rintsch
    Dec 13, 2005
  3. Replies:
  4. fulimin
    Nov 28, 2005
  5. fulimin
    Nov 20, 2006

Share This Page