comp.lang.ada
 help / color / mirror / Atom feed
From: geert@fozzie.sun3.iaf.nl (Geert Bosch)
Subject: GNAT Executables: How low can you go?
Date: 1996/04/13
Date: 1996-04-13T00:00:00+00:00	[thread overview]
Message-ID: <4kmq7a$egm@fozzie.sun3.iaf.nl> (raw)

Boring stuff
~~~~~~~~~~~~
Last week I've done a rewrite of a full featured regular expression 
matcher (the one that comes with EMX) for Ada. The C-version was awkward
to use because of the need of a terminating NUL character, bad error 
handling and use of global variables which makes tasking nearly 
impossible. The final RE matcher is 55 kB of source (I guess just 15% 
comments) and 1600 lines and doesn't need dynamic memory allocation. 

This is better...
~~~~~~~~~~~~~~~~~
Using GNAT v3.01 for OS/2 and default compilation, but with optimizations
on and checks suppressed resulted in an executable of 114 kB which ran about
3 times as slow as the C version. Now with some tweaking the source has 
changed a little (about 20 lines were modified) and now the code is
just 15-20% slower than the C version which is not bad considering the
extra robustness and safety. 

And now the GOOD news!
~~~~~~~~~~~~~~~~~~~~~~
The complete application which also produces debug information about
the regular expression and which dumps the complete statusmachine in
human-readable format is only 11616 bytes in size!!! I really didn't
know GNAT executables could be this small and I even used string
slices, exception handlers, discriminated records containing
variable-sized arrays and text-io on integers, booleans and enumeration
types. There was no 'dead' code in the source and all generated code 
and message strings are in the 11616 byte executable.

Of course I'll explain the tricks later but it's already late now.
I just had to let you know how great GNAT really is. ;-) ;-)

Regards,
   Geert Bosch
-- 
E-Mail: geert@sun3.iaf.nl     *** As far as we know, there have not been ***
 Phone: +31-53-4303054        ** any undetected failures in our software. **




             reply	other threads:[~1996-04-13  0:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-13  0:00 Geert Bosch [this message]
1996-04-13  0:00 ` GNAT Executables: How low can you go? Robert Dewar
1996-04-16  0:00   ` Geert Bosch
1996-04-16  0:00     ` Theodore E. Dennison
1996-04-16  0:00       ` Robert Dewar
1996-04-18  0:00         ` Theodore E. Dennison
1996-04-18  0:00           ` John Howard
1996-04-19  0:00             ` Robert Dewar
1996-04-18  0:00           ` Robert Dewar
1996-04-19  0:00             ` Theodore E. Dennison
1996-04-17  0:00       ` Geert Bosch
1996-04-17  0:00         ` Michael F Brenner
1996-04-18  0:00           ` Geert Bosch
1996-04-18  0:00           ` Theodore E. Dennison
1996-04-19  0:00             ` Robert Dewar
1996-04-19  0:00             ` Geert Bosch
1996-04-26  0:00             ` Richard A. O'Keefe
1996-04-29  0:00               ` Theodore E. Dennison
1996-04-30  0:00               ` mjp
1996-04-26  0:00           ` Geert Bosch
1996-04-18  0:00         ` Theodore E. Dennison
1996-04-18  0:00           ` Robert Dewar
1996-04-19  0:00           ` Norman H. Cohen
1996-04-19  0:00             ` Theodore E. Dennison
1996-04-19  0:00               ` Robert Dewar
1996-04-20  0:00           ` Al Christians
1996-04-22  0:00             ` Theodore E. Dennison
1996-04-19  0:00         ` Fergus Henderson
1996-04-17  0:00 ` Cordes MJ
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox