Newsgroups: | comp.compilers |
From: | dbenn@leven.appcomp.utas.edu.au (David Benn) |
Organization: | University of Tasmania at Launceston |
Date: | Sat, 15 Aug 1992 03:00:47 GMT |
References: | 92-08-064 92-08-049 |
Keywords: | Basic, performance |
In the discussion about BASIC compilers thus far, a recurring theme seems
to have emerged, namely the problem of managing BASIC's run-time dynamics.
I have been writing a compiler based loosely on AmigaBASIC - a Microsoft
derivative - for the best part of a year now, and have naturally had to
deal with these kind of issues. Re: strings memory allocation, I have
compromised. Strings in ACE have a default length of 1K. Small, I know.
However, the programmer can optionally declare a variable of any type
including strings. The only non-optional declarations are for arrays. With
strings, the programmer can specify smaller (say 100 bytes or less) or
larger strings (limited only by available memory). For many applications,
1K is ample. Indeed, 512 bytes is often enough, and I may yet reduce the
default to that. I know that many of you are thinking, "geez what a waste
of memory." I concede that it is not by any means optimal, but it does
avoid having to worry about garbage collection. More importantly, it works
quite well!
By the way, if you are interested, I hope to have ACE in the PD sometime
in the next few months. It has everything from simple BASIC stuff to
structures, pointers, turtle graphics, powerful sound and wave statements,
case...end case etc.
Regards...
--
dbenn@leven.appcomp.utas.edu.au
David Benn - Applied Computing, University of Tasmania at Launceston.
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.