Kay Röpke wrote:
> Hi!
> 
> On Aug 4, 2008, at 12:27 PM, Daniel Fischer wrote:
> 
>> With antlr, I'd assume? You should use it to replace drizzle's parser,
>> so we can get query rewriting on the AST level ;-)
> 
> 
> The secret plan :)
> 
> In fact, I fully plan to do just that. For a long time now, I wanted to
> have the opportunity to modularize the parser code so we can have
> multiple ones:
> One for raw speed, one for funky things and most importantly one which
> is not SQL ;)
> 
> The first step here would be to make a clean API out of the current
> (YACC-)action-based calls to the items classes and then separate the
> parser out into a module.
> 
> It goes further than that, of course. With a little work the protocol
> can be extended to request a certain parser for a request which would
> greatly enhance the flexibility of drizzle (and MySQL of course, too).
> 
> This is also the way I intend to bring back "prepared" statements, but
> on the client:
> Parsing happens on the client and all that gets sent is a flattened
> tree. Much simpler to parse because there are no string operations
> involved. The downside is that validating a parse tree can be tricky and
> allowing it is possibly a security risk. Much easier to provoke crashes
> by sending a faulty tree than a faulty string. We'll see.

Nice to see that come around, I think it is a great idea!

> I've also wondered about the merit of using a bytecode format for
> statements instead of a parse tree, but that's even further down the line.

At one time, I was considering using FORTH as "bytecode": it has all
that is needed to and can easily be extended. :)

It is also so compact that it readily fits into the cache of a modern
CPU, which does wonders for speed. The only drawback is that it is a
stack-oriented machine, and I think that a register-oriented machine
would prove to be significantly more efficient on CPUs with pipeline and
cache.

Also, one disadvantage is that FORTH is postfix, and it is easier to
work with a prefix format when it comes to trees (hence also expressions).

/Matz

> 
> cheers,
> -k


-- 
Mats Kindahl
Lead Software Developer
Replication Team
MySQL AB, www.mysql.com
begin:vcard
fn:Mats Kindahl
n:Kindahl;Mats
org:Sun Microsystems
adr;quoted-printable:;;Tegv=C3=A4gen 3;Storvreta;SE;74334;Sweden
email;internet:[EMAIL PROTECTED]
title:Lead Replication Software Developer
x-mozilla-html:FALSE
version:2.1
end:vcard

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to