Re: CASE...ENCASE Query...
- From: Richard Russell <news@xxxxxxxxxxxxxxx>
- Date: Sat, 10 Jan 2009 08:38:52 -0800 (PST)
On Jan 10, 2:57 pm, Rob Kendrick <n...@xxxxxxxx> wrote:
No, you use the same compiler for EVAL.
[snip]
Once you've got one compiler and semantic checker, you reuse it.
Probably not, in practice. A 'syntax and semantic checker' designed
for use at the 'compilation' stage will have very different design
considerations from one which has to be part of the 'run-time engine'
and which therefore has a direct bearing on executable size and
execution speed.
The former would want to be as thorough as possible, given that
execution time and code size are (substantially) irrelevant. The
latter would need to be as compact and fast as possible, and would
probably carry out only the minimum amount of checking necessary to
prevent a crash.
To me, the later of these is more obviously solvable, and yet is
the one that generates the error.
In processing a constant (quoted) string BBC BASIC copies each
character from the string into some buffer and stops when it
encounters the 'closing' quotes. In the event of the closing quotes
being missing, it could in principle keep going indefinitely, until it
encounters 'unreadable' memory and crashes catastrophically.
Therefore a test of some kind is essential, and once the test is in
place reporting an error is the obvious course of action.
Once you include all this, as well as unwinding the stack etc, it's
more overhead than none. No?
You've forgotten what you once knew about BBC BASIC! There is no
'unwinding of the stack' when an error occurs (except in the special
case of ON ERROR LOCAL). Anyway, nobody was talking about the
overhead of *processing* an error, but the (claimed) overhead of
*checking for* the (assumed non-existent) error.
What I meant was that Moshen's compressed hardest, but most of the time
I used !BC, which didn't crunch as well, but it was a lot faster, and
had an excellent syntax checking system in, thus letting you discover
bugs before you even run the program.
An offline syntax checker would definitely be an asset to BBC BASIC.
I've put a hook into the latest version of the BB4W IDE so that if
anybody cares to produce one it can be integrated into the package.
Richard.
http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.
.
- Follow-Ups:
- Re: CASE...ENCASE Query...
- From: Rob Kendrick
- Re: CASE...ENCASE Query...
- References:
- CASE...ENCASE Query...
- From: usenet
- Re: CASE...ENCASE Query...
- From: Ste (news)
- Re: CASE...ENCASE Query...
- From: malshayef
- Re: CASE...ENCASE Query...
- From: Rob Kendrick
- Re: CASE...ENCASE Query...
- From: malshayef
- Re: CASE...ENCASE Query...
- From: Rob Kendrick
- Re: CASE...ENCASE Query...
- From: malshayef
- Re: CASE...ENCASE Query...
- From: Rob Kendrick
- Re: CASE...ENCASE Query...
- From: malshayef
- Re: CASE...ENCASE Query...
- From: Rob Kendrick
- Re: CASE...ENCASE Query...
- From: malshayef
- Re: CASE...ENCASE Query...
- From: Rob Kendrick
- Re: CASE...ENCASE Query...
- From: Richard Russell
- Re: CASE...ENCASE Query...
- From: Rob Kendrick
- CASE...ENCASE Query...
- Prev by Date: Re: CASE...ENCASE Query...
- Next by Date: Re: Unknown SWI
- Previous by thread: Re: CASE...ENCASE Query...
- Next by thread: Re: CASE...ENCASE Query...
- Index(es):
Relevant Pages
|