Label: ♦english ♦news

[107] Dao-1.0.1 is released!

Comment

Dao-1.0.1 is released!


This release mainly includes: enhanced support for debugging, some bug fixings and improvements of implementation.

Download: http://daovm.net/dao/download_en
Comments
This language looks interesting.
Can I make some suggestion?
add the keyword continue as an alias for skip because people from C expect this
Also add a do { ... } while ( ...) in the manner of C
This language looks interesting.
Can I make some suggestion?
add the keyword continue as an alias for skip because people from C expect this
Also add a do { ... } while ( ...) in the manner of C
I will add them in the next releases. Thank you for your suggestions.
In the demo program return_param.dao,
I see there is a line
Test( & i );

Is this some attempt to support passing-by-reference?
It does not seem to have any effect, and the documentation does not mention any such operator & for passing-by-reference...
Parameter passing by reference for primitive data types was supported in a few previous releases, in the recent releases, this support is limited only to C functions. I didn't mention it in documentations because I was not sure about this. I feel that it is not really needed when Dao functions can return multiple values. Supporting it for C functions just makes it simpler for wrapping and using C/C++ library, because parameter passing by reference is used in many C/C++ libraries.
Hi, just one more comment... in cases of similar constructs to the C language, it seems to me that it is the best to adapt the same behavior as the C counter part, if there is no other reason to prefer one choice over another... This helps with language adaption because people like familiarity.
Specific example:
the switch statement in Dao differs from the C in behavior: in Dao each case statement breaks automatically instead of explicit breaks and no case following through...
if there is no specific reason for this choice, would it be possible to adapt the C behavior?
Normally, Dao will try to have the same behavior as the C counter parts of similar constructs. However, some differences are introduced due to some specific reasons.

For example, the switch-case statement is designed to be different, due to the fact that, in C, sometimes bugs are introduced by unintentional omitting "break" in a case block, not by accidentally adding a "break". So with the automatic breaking in switch-case statement in Dao, even if a user is used to C switch-case statement, he will not create bugs by adding explicit breaks. So I consider automatic breaking is safer than mandatory explicit breaking.

Moreover, I planned to enhance switch-case statement in the following ways:
1. multiple cases as: case C1, C2, C3 :
2. case range: case 1 - 10 :
So the switch-case statement in Dao does not mean to be like the one in C.
One more comment*
dao seems to link the readline library unconditionally for now. That library is GPLed so that means program linking to it must be GPLed (note the Free Software Foundation has mentioned this several times) ... dao may want to link to it conditionally (not linking by default~ so dao can stay LGPLed. I would imagine in the majority of uses, for example, batch processing and embedding use (as an extension language) inside another application, readline is not useful.
Actually, I was aware of this possible problem, and had carefully avoid it. In the released source codes, there are two files with the main function:
  1. daoMain.c
  2. daoMaindl.c
Compiling by "make static" will use "daoMain.c", which does not depend on the readline library.

While compiling by simply "make" will use "daoMaindl.c", which uses the readline library, and is released under GPL. Moreover, compiling in this way does not link against the Dao library statically, instead, it uses Dao through dlopen(). If it is compiled in this way, one can see the following when run dao -v:
A simple shell for the Dao Virtual Machine.
Copyright(C) 2006-2009, Fu Limin.
This shell is distributed under GNU General Public License.

Dao Virtual Machine (1.0.1, XXX XX 2009)
Copyright(C) 2006-2009, Fu Limin.
Dao can be copied under the terms of GNU Lesser General Public License.
Dao Language website: http://www.daovm.net

Does Dao support nested functions, and if so, lexical scoping?
But, the nested function can not access the local variables of the function that contains it. If it is necessary to access the outer local variables, closure can be used.
routine  test()
{
    a  =  1;
    routine  nested(){
            c  =  a;  # wrong!
            stdio.println('nested');
    }
    nested();

    rout  =  routine(){
            c  =  a;  # OK
            stdio.println('closure');
    }
    rout();
}

test();

Does Dao support tail recurscion? I cannot find documentation on that...
Not yet, but it will be supported soon (in the next release in august).

Actually I have planned to implemented it long time ago, but then it slipped my mind due to other work, until you remind me of it by this comment:).
Hello,
I find DAO very interresting. A nice language, an IDE, and now QT bindings ...
What's the roadmap for the next releases ? How does it compare to main scripting language like LUA, Python, Ruby ?
Thank you for your comments.

At this moment, I only have a clear plan for the next release which will come out this month. I haven't set a roadmap for the releases after that, mainly because I am not sure how much time I will have. Generally, what I planned to do is listed here: http://www.daovm.net/dao/faq_en#6 . As you can see, some are done. I think after the next release, priority will be given to developing tools, modules and packages, so changes to the language will be minor.

The next release will include several improvements suggested since the 1.0 release, including:
  1. tail call elimination;
  2. double number marked by 'D' suffix instead of '00';
  3. do{}while() statement;
  4. improved switch-case statement, to allow: multiple values in one case, case c1, c2, c3: , and case with value range, case c1 ... c2: ;
  5. 'sub' as an alias of 'routine' (another alias of 'routine' is 'function'), and 'continue' as an alias of 'skip'.
This release will also add a major feature which is built-in methods (such as map(), reduce() etc.) for functional style programming. Some math functions are also supported as built-in methods. In addition, there will be some improvements to the C interfaces for extending and embedding.

I always find it hard to answer question like comparison to other languages:), let's simply put like this, Dao is oriented somewhere in between of Lua and Python, Ruby, with good efficiency, it will try to avoid introducing too many complexities as in Python and Ruby, but certainly offer sufficient features. To mention somethings that are different in Dao from these languages, Dao has a more interesting typing system and a more powerful macro system than they do. And I personally believe the C interfaces of Dao are better than the C interfaces of them, as it can be seen from how easily binding to Qt4.5 and other libraries were built;). The season that it is simpler to build bindings for Dao is also partially due to the typing system Dao has.
So the goal is bio informatics ! GREAT :-) Which means, graph, 3D, and a powerful IDE and language. So I'm eager to see the result. It's a lot of work to create all of this nearly from the ground-up !
It's been a long time I'm searching such a tool.
At first I was curious about DAO macro system, because it's more easy for end user to handle a DSL, and I don't wanted complex system to develop new languages. Then I was seduced by the clean and beatiful code. After that I was amazed by the IDE.
I can assure you that no other language have theses qualities. I've spent much time to find one matching theses criterias.
So, congratulations, great work, and long live DAO :-)
Will you develop the IDE with QT and DAO itself ? it would be great to have it all integrated and easily scriptable.
Will you develop the IDE with QT and DAO itself ? it would be great to have it all integrated and easily scriptable.

Yes, this is something in my mind to do, but not in the highest priority. I need to find time for this (or to find somebody who knows well Qt and is willing to take it over).
Trying to be samiliar to C-like languages with exceptions, such as Java, can "catch" be an alias for "rescue" in try { ... } rescue ( ... ) { ... }
Right, it will be included as well. "catch" is also used in C++, so it worth to be there.
Hi, it seems Dao supported pass by reference before (as mentioned in earlier posts). While there may be difference views on whether pass by reference or returns via touples is better, if the cost to system performance (overhead) is not high (I assume the code is in there just disabled somehow), why not supporting both?
Perl 6 seems supporting pass by reference as part of the core design.
The main reason that I excluded parameter passing by reference (for simple/primitive data types) was that, I changed to use a memory more efficient way to store simple data, in this storage scheme, passing reference of simple data has become difficult. I had an implementation of passing reference, but the implementation was too ugly and introduced much overhead, so I abandoned that implementation.

Passing local variables as references to C functions can be implemented in a simple way, that's what is done currently. Passing local variables as references to ordinary Dao functions could also be done in a similar and simple way, but I am not sure if it is good idea to support something in a limited way. I need to think of a better way for supporting this.
In Dao it is Pascal style
name : type ;
instead of
type name ;
as in C. This seems to make Dao a mixture of Pascal style and C style. Is this choice intentional (easier to parse the Pascal style declaration) or just historical?
I guess if Dao is of a totally new design today it would follow a pure C style or a pure Pascal style instead of a mixture.
This choice was partially historical and partially intentional. In the beginning, Dao did not support explicit variable types, when I started to implement the optional typing feature, I found it was simpler to parse Pascal style.

However, the more serious reason was from the consideration of type names for functions and tuples. In Dao a function type could look like this,
routine<a:string,b=int>=>float
which is more close to the following function prototype that it represents,
routine  test(  a  :  string,  b  =  123)=>float
So as you can see, the fact that parameter "b" has a default value of integer is nicely represented in the type name.

With C style, the type name may have to be,
routine<string:a,b=int>=>float
routine<string:a,int=b>=>float
which do not look very reasonable.

Similarly for tuples, a tuple is something like this,
t  =  (  name  =>'Mike',  index  =>123)
# or: t = ( name : 'Mike', index : 123 ) in some other languages
A type name like,
tuple<name:string,index:int>
would look more natural. Pascal style looks more consistent to this.

There are also other places (parameter passing by names, class instance construction by initializing members by names) where syntax such name=>value is used. So declaring variable type by name:type looks more consistent with them too.
Dao's static type system does look very powerful. It enables interesting possible reasoning based on the type data rarely possible in other languages ...
hoping we can see the next release soon...
The implementations for this release is done, I just need to do a few more tests, and update the documentation before releasing it. Within two weeks, you should see the new release:-)

It is delayed because I implemented some improvements that were not planned. One improvement might actually be interesting to you, that is, the parameter passing by reference, which was actually a by-product included when I changed parts of the internal data storage and accessing methods to fix a few bugs. Another by-product is the constant parameters specified by "const" keyword.
reference parameter and const parameter: Wonderful!
Hi, I guess the answer is true, that Dao supports multiple VMs in the same process, but just to make sure, that Dao allows multiple interpreters embedded in the same C program and process, right?
This should give Dao advantage over Ruby or Python which suffer from a global lock.
if the interpreter is compiled with multi-threading enabled.
seems to be a subset of what Dao provides, language wise. Maybe it is time to write a comparsion between Go and Dao...
傅兄辛苦了,Dao语言和那些库和其他库的绑定就是你一个人开发的?太不容易了!有你的邮箱吗?咱们交流下,呵呵~

Change picture:

Choose file:

12 3
456789 10
111213141516 17
181920212223 24
2526272829 30 31

fu: Many thanks (Jul.04,04:29)

klabim: fixed Hi, great, now my test works now :- ). (Jun.30,17:51)

Nightwalker: Few suggestions (Jul.03,14:37)

This site is powered by Dao
Copyright (C) 2009,2010, daovm.net.
Webmaster: admin@daovm.net