Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > simpler over view on dao: a functional logic solver with builtinparsing power, and dinpy, the sugar syntax for dao in python

Thread Tools

simpler over view on dao: a functional logic solver with builtinparsing power, and dinpy, the sugar syntax for dao in python

Simeon Chaos
Posts: n/a
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:

code repository:

dao groups on google:, Removed)

old stuffs:, deprecated)

google+ pages:

Dao has the features such as

* lisp style programming:

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

* function and macro;

* eval, so called meta circular evaluation.

* prolog style programming:

* logic variable and unify;

* backtracking;

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

* cut.

* many other useful builtins that simulate lisp and prolog

* some builtins that cooperate with python.

* builtin parser, which is the most powerful parser I have seen, it
support the features as below:

* paramater grammar, similar to DCG( definite clause grammar),
but more flexible
* dynamic grammar,
* left recursive
* memoriaziont parsing result
* many builtins, include terminal and cominative matchers.


Dinpy: a child language born and live in python.

Dinpy can be looked as the syntax sugar for dao in python. A piece
of code in dinpy is listed as below:

parse_text(char(x1)+any(~char('b')+some(char(x1))) +eoi,

let( i<<0 ). do[ repeat, prin(i), ++i, iff(i<3).do[fail] ],

letr( a << fun(x) [ and_p(b(x),c(x)) ]
[ d(x) ],
b << fun(1) ['b1']
(4) ['b4'],
c << fun(4) ['c4'],
d << fun(3) ['d3'],
a(x), prin(x) ],


i << 0,
loop[ i << i+1, prin(i)].when(i==3),



Some Chinese documents for dao is written, 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.


* 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

* 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

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax sugar: method[](...) => method(...) Erwin Abbott Ruby 3 07-10-2007 04:52 AM
Strange syntax sugar aalfred Ruby 5 04-26-2007 03:24 PM
syntax sugar: treating an object like a method Eric Mahurin Ruby 8 05-19-2005 04:24 PM
Syntax sugar idea for loops Ruby 0 03-30-2005 06:28 PM
@decorator syntax is sugar, but for what exactly? Bengt Richter Python 37 08-13-2004 07:15 AM