A BASIC interpreter written in golang.
This release features a single bugfix, relating to handling newline-tokens after REM statements.
As part of that the CI process was updated to disable the use of the buildvcs flag.
This release features a few minor changes to our internals, and a single correctness fix:
Issues reported in the future will continue to be addressed, but otherwise I think this is a nice stable and complete point at which to leave the project so I don't anticipate making significant updates going foward.
The previous release, release-2.0, did not contain the associated binary resources.
This release fixes that problem. There are no functional changes.
This release features a small number of updates and new features, as well as improvements to the linting which is carried out via the Github Actions every time a pull-request is submitted or merged.
New features include:
SPC
primitive, in #104.LOG
as a synonym for LN
.PRINT "*" * 80
), added in #114.I've updated the installation instructions to work with newer releases of the golang toolset too.
This release contains no functional changes; it is being made solely to transition the testing and release process from TravisCI to github actions:
This release makes a small number of improvements to the interpreter:
LET
.
DATA
to be READ
into an array-variable.
READ
.DATA
and DEF FN
statements inside comments.
SWAP
primitive to allow exchanging two variable contents.
This release includes two minor changes:
GOTO
becomes optional in IF
statements:
The former change is the only user-visible one, and it allows the following two lines to be treated as identical:
10 IF A < 10 THEN GOTO 300 ELSE GOTO 400
10 IF A < 10 THEN 300 ELSE 400
This release focuses upon improvements to error-handling, and resilience, both as a result of extensive fuzz-testing.
I've successfully run fuzz-testing for 28 hours without a single error now - ignoring "crashes" which were the result of timeouts, due to infinite loops & etc:
2018/12/23 21:57:45 workers: 1, corpus: 456 (1h20m ago),
crashers: 292, restarts: 1/1213, execs: 7742522 (75/sec), cover: 2107, uptime: 28h42m
I don't believe there will be any user-visible changes except for the handling of GOTO/GOSUB statements that pointed to invalid lines. In the past this program would result in an infinite loop:
10 PRINT "Hello, Steve\n"
20 GOTO 2000
This was caused by the "GOTO
" statement looking for line 2000
, not finding it, and jumping to line zero. Now a GOTO
/GOSUB
statement which points to a missing line is a fatal error.
This release was primarily aimed at improving the correctness of FOR loop handling, with regard to the handling of the termination condition (#73).
In addition to the bugfix of looping we added the ability to initialize 1D and 2D arrays, via the new DIM
statement, this was implemented in #76, and the following example demonstrates their use:
10 DIM a(10)
20 LET a[3] = 3
30 LET a[4] = "steve"
40 FOR I = 0 TO 9
50 PRINT I, a[I], "\n"
60 NEXT I
2D-arrays are initialized as:
10 DIM foo(10,10)
And get/set works as you'd expect:
20 LET foo[3,3] = "*"
30 PRINT foo[3,3], "\n"
This release, once again, focuses upon implementation cleanups.
The code base now has 98% test-coverage! That doesn't mean the interpreter is bug-free, but it does mean that some kinds of errors should now be detected by me, before users.
STEP
token. For example:
FOR I = 0 TO 20 STEP 1 + 1
The New()
function, which is the constructor for the eval
package now returns a second value, which can be used to detect errors in parsing the program at load-time.
(Programs are parsed at run-time, before they're executed, to process DATA
and DEF FN
statements. It might be possible to call these at run-time, but it is preferable to catch errors sooner rather than later.)