Assignment Versus Equality

Michael Torrie torriem at gmail.com
Sun Jun 26 17:28:44 EDT 2016


On 06/26/2016 12:47 PM, Christopher Reimer wrote:
> I started writing a BASIC interpreter in Python. The rudimentary version 
> for 10 PRINT "HELLO, WORLD!" and 20 GOTO 10 ran well. The next version 
> to read each line into a tree structure left me feeling over my head. So 
> I got "Writing Compilers & Interpreters: An Applied Approach" by Ronald 
> Mak (1991 edition) from Amazon, which uses C for coding and Pascal as 
> the target language.  I know a little bit of C and nothing of Pascal. 
> Translating an old dialect of C into modern C, learning Pascal and 
> figuring out the vagaries of BASIC should make for an interesting 
> learning experience.

Sounds like fun.  Every aspiring programmer should write an interpreter
for some language at least once in his life!

I imagine that any modern dialect of BASIC has a very complex grammar.
The syntax is full of ambiguities, of which the "=" operator is the
least of them.  In many dialects there several versions of END to
contend with, for example.  And then there are a lot of legacy
constructs with special syntax such as LINE (0,0)-(100,100),3,BF.

I have a soft spot in my heart for BASIC, since that's what I grew up
on. I still follow FreeBASIC development. It's a very mature language
and compiler now, though it struggles to find a reason to exist I think.
 It can't decide if it's C with a different syntax, or C++ with a
different syntax (object-oriented and everything) or maybe something in
between or completely different.




More information about the Python-list mailing list