overview on dao

S

Simeon Chaos

Dao is a a functional logic solver (similar to lambdaProlog, Curry)
written in python. The links related to dao are here:

pypi distribution and document: http://pypi.python.org/pypi/daot
code repository: https://github.com/chaosim/dao
dao groups on google: Group name: daot, Group home page:
http://groups.google.com/group/daot, Group email address:
(e-mail address removed)
old stuffs: http://code.google.com/p/daot(old, deprecated)
google+ pages: https://plus.google.com/112050694070234685790

Dao has the features such as

* lisp style programming:

* call/cc, block/return-from, unwind-protect, catch/throw;

Dao is implemented by continuation passing style, so it is
natural to implement such stuff. And I have some little improvement to
the trampoline technology because I need it coexist with the
technology of using yield statement to implement unifying and
backtracking. The code for evaluating lisp style expression is
borrowed from the book "Lisp in Small Pieces" wrote by Christian
Queinnec and Ecole Polytechnique.

* function and macro;

The concept of function and macro in dao become more general
than in lisp, because we can define them with multiple rules and take
advantage of unifying and backtracking.

* eval, so called meta circular evaluation.

* prolog style programming:

* logic variable and unify;

* backtracking;

* findall, repeat/fail, call, once, and so on;

* cut.

At first, unify is implemented by using exception, and
backtracking by using two continuations(succeed continuation and fail
continuation) technology, borrowed the code from pypy prolog. Now, the
fail continuation is removed, and both unifying and backtracking is
implemented by using 'yield' statement, which I learned from
YieldProlog (http://yieldprolog.sourceforge.net). Dao run faster than
before by using yield statement, removing class definition of
continuation, and not boxing atomic and list values(compare to pypy
prolog without translation or jit). Up to now I do not use the pypy's
translation or jit feature to speedup, and all of the tests in dao
0.7.3 run in about two minutes.

* many other useful builtins that simulate lisp and prolog
primitives.

* some builtins that cooperate with python.

* builtin parser, which is the most powerful parser I have seen.

The parser in dao is basically a recursive decent parser with
backtracking, but It also support direct or indirect left recursive
rules by using memorization when needed. The programmer can toggle
memorization of any command that is not left recursive. the grammar in
dao is some similar to DCG(definite clause grammar), but is more
flexible than DCG. It have the expressive power beyond context free or
sensitive grammar, parsing expression grammar. Dao can be used to
parse any object, not limiting to text. Many builtin terminal and
combinative parsing primitives are provided.

In dao, I have found and implemented the unrivalled technology to
uniting parser and evaluator by the meta circular evaluation. So Dao
can be used to implement a programming language in which the syntax is
dynamic, that is to say, the syntax can be defined on the fly by the
programmer easily. A little sample to demonstrate this technology is
given in the files dao/samples/sexpression.py and dao/dao/tests/
testsexpresson.py.

-------------------------------------------------------------------------

Dinpy: a child language born and live in python.

Dinpy can be looked as the syntax sugar for dao in python. It arises
accidentally when I wrote tests for dao. A detailed introduction is as
follows: I hate the too many parentheses when I wrote tests for the
'let' statement of lisp, so I replace embedded tuples with dict for
the bindings, and after the spark of inspiration, the door to dinpy
was open. I learned a new method for inventing a new language from it:
use the syntax based on the operator of the mother language for
building the child language.

--------------------------------------------------------------------------

I have written some Chinese documents for dao, but few English. The
Chinese document is not complete yet. With the functional logic
programming and dynamic grammar on the shoulders of the great python,
many possibilities arises with dao, such as parsing, inventing
embedded DSL with operator syntax, independent domain specific
language or general language, text processing, natural language
processing, expert system, artificial intelligence, web application,
and so on.

Now:

* I hope more people know and use dao. Or maybe something wrong in dao
prevent it being used in real application, and I hope to know what it
is.

* Maybe anyone have interest and time to join in developing dao or
writing some documents or articles?

* More tests are needed always, and I hope to get some bug report from
any other people.

* the benchmarks of the dao, comparation with similar package, and so
on.

* I have a long todo list, I hope someone else can join in dao project.
 
D

Dennis Lee Bieber

Dao is a a functional logic solver (similar to lambdaProlog, Curry)
written in python. The links related to dao are here:
Unfortunately the name is in conflict with M$ DAO (Data Access
Objects), the precursor to ADO. Every time I see "Dao" my mind goes "JET
database".
 
S

Simeon Chaos

        Unfortunately the name is in conflict with M$ DAO (Data Access
Objects), the precursor to ADO. Every time I see "Dao" my mind goes "JET
database".

Yeah, here "dao" is from The book of Dao" by Laozi, means the way of
the world go.
 
P

Prasad, Ramit

Perhaps you should call it "LaoZiDao".
I just prefer shorter name.

DAO as Data Access Objects is a common acronym in several languages (i.e. Java),
so you will continually have this naming conflict. Just be aware that this
conflict will happen frequently in the minds of many programmers.

Ramit

P.S. I votefor PyLaoziDao :p


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
 
M

MRAB

DAO as Data Access Objects is a common acronym in several languages (i.e. Java),
so you will continually have this naming conflict. Just be aware that this
conflict will happen frequently in the minds of many programmers.

Ramit

P.S. I vote for PyLaoziDao :p
Just don't confuse it with PyDao, which is already taken. :)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top