Dao language 1.0 beta is release!

Hello,

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
future.

links:
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;
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
definition;


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;
end

num1 = MyNumber{ 123 };

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

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
to
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:

before:
sort( list, @0 < @1, n );
now:
list.sort( @{ @0 < @1 }, n );
before£º
apply( array[ 1:5, : ], @0 + @1 * @2 );
now:
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
functions.

===================
Extending modules:

New modules available:

  • DaoCGI: CGI web programming;
  • DaoFastCGI: FastCGI web programming;allow DVM to run as FastCGI
    server;
  • 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
phoolimin[AT]gmail[DOT]com

ÄúºÃ£¬

  • fulimin, 11/20/2006 11:45 AM:

To allow DVM being more freely used, GLPL (GNU Lesser
General Public Licence) has been adopted since this release.

The correct abbreviation for GNU Lesser General Public License is
LGPL, not GLPL, see GNU Lesser General Public License v3.0 - GNU Project - Free Software Foundation

ÔÙ¼û(*),

Jupp

(*) Does one use this in E-Mails?

Hi, Jupp,

Glad to see you in the list again :wink:

"Josef ‘Jupp’ Schugt дµÀ£º
"

ÄúºÃ£¬

Yes, people used it in email.

  • fulimin, 11/20/2006 11:45 AM:

To allow DVM being more freely used, GLPL (GNU Lesser
General Public Licence) has been adopted since this release.

The correct abbreviation for GNU Lesser General Public License is
LGPL, not GLPL, see GNU Lesser General Public License v3.0 - GNU Project - Free Software Foundation

It was a typo :wink:

ÔÙ¼û(*),

It is also used, but not very frequently.

Jupp

(*) Does one use this in E-Mails?

Limin