[antlr-interest] Antlr v4 - C++ target

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Thu Jan 12 10:40:36 PST 2012


On 1/12/12 8:07 PM, "Jim Idle" <jimi at temporal-wave.com> wrote:

Hi Jim,

> I do plan on doing that in fact. However I would like to respond to the
> criticisms here as follows:
> 
> 1) I wrote the C runtime in under two weeks because I needed it for a
> project and at that time ANTLR v3 was not released (beta).

Really great timing :)

But this also expose Jim, why  we did have so many pain porting
    v2 C++  to V3  C

Because there was no efforts to provide SMOTH switch.
Really who need this ?? :-)

> 5) All my tests and most everyone else finds the C v3 runtime to be faster
> than the C++ runtime, so I can only conclude that there is something
> different about one or two grammar files.

You mean you self did grammars for ANTLR v2 C++
And then compared grammar for v3 C?

Don't know, don't now ...

Speed is exactly the same ...
May be 5% only but this  not matters ...

We do not get x2 speed up


> 6) I did implement reuse other than for trees and that helps most of the
> use cases where the initial memory allocation takes time and so you don't
> want to tear it down and re-allocate it.

As I have told reuse() is NOT finished Jim.

It produce a lots of leaks.
I was able copied that idea of reuse to 2-3 other your classes.
And only after that  RAM is not eaten in our simple tests of SQL parser.

Unfortunately I have lost this changes "thanks to stupid XCODE mistake".
It have erase ANTLR folder ... And was no backup

So I need once again find day to recover that fix.
Only after that I will be able send you all this.


> 7) It is a lot easier to start with someone else's code than it is to
> start with vi and a blank screen. Where's the love?

I very love your code from point of view ... COOL CODE.
My personal opinion is that sources of PostgreSQL and your ANTLR3/C is may
be one of the best accurate code I have see in my life.


PROBLEM is that after huge our efforts from yet 2007 year,
When we have start step by step port v2 grammar,
Adopt code from C++ only  to  C++ called by C,
And so on ...

And this year from March 2011 to November 2011 was done also a lots of job
...

We have found leaks finally in working grammar,
And zero speed up and ....

Our product v5.0 next month still will use v2 ANTLR ..

Jim, it is not enough to create GREAT PIECE of software,
It really needs correct and complete docs to it ...

I don't know how other teams, but we have epic fail with
    ANTLR  v3  [C]    :-((((

At least one full developer-year spent, and ZERO bonus ... wow..

And yesterday Terrence expose point that ANTLR not try to be fast ... wow.


> 8) ANTLR is naturally more heavyweight than some other tools, but it is
> usually easier to use it.

ANTLR v2 C++ was easy, because it have VERY CLEAN defined API.

C was hard, because it is absolutely not clear what and when to call.
API was not well defined.


May be if we'd have docs, with 250 HOW TO questions, explained each by 10-20
lines of code life could be simpler  :*)


> 9) Why not wait for v4 where some of these things are addressed as a
> natural consequence of the design.

Well,  personally me, still will try fix back that leaks in v3.

Then I am going again spend time in profiler to see what can be improved yet
... But it seems to me in ANTLR code no way improve something ... Only may
be change our own code ... But then no matter v2 or v3


ALSO, wonder now is:
    what sense for EXISTED ANTLRv2 grammars to be ported to v3 or v4 ?

WHAT SENSE ??  What benefit?

I was in hope that v3/C will be x2 times faster:
    no STD strings,  memory pools, no exceptions ...

But speed same ...


Wait for v4? :-)
  We using v2 about 10 years ...
    We did wait 3 years for v3.4, while in July 2011 I have read about
implemented reuse() ...


Guys,  don't you think that it is strange that V3.0, 3.1, 3.2, 3.3,
did miss MAJOR feature of 2.x  ??   And 3.4 have leaks in this feature.

How this can be?

v4 again will drop 10-20% of major features of v3  ??

This not make porting as SMOOT as it must be ...

My 2 cents 


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the antlr-interest mailing list