Releases: skx/gobasic
release-1.4
This release makes some minor improvements to the handling of FOR
-NEXT
loops:
- The increment of a loop can now be fractional as per #63:
FOR I=1 TO 2 STEP 0.1
- The termination condition uses a little rounding to mask float-based drifting.
As a result of fuzz-testing we've also improved the parsing of FN
, NEXT
, and STEP
tokens (#65, #66, #67).
Finally the PRINT
statement will accept ;
as being synonymous with ,
, which eases porting programs written for BBC BASIC.
release-1.3
This release makes minor tweaks to remove/fix warnings produced by golint
, go vet
& etc.
Nothing significant was changed, internally or externally, although a couple of our examples were given minor fixes and we've added a new graphics example (drawing a random number of randomly coloured lines.)
release-1.2
New Features
- We now support
DATA
+READ
.- See examples/35-read-data.bas for a simple example, and the HTTP-server example for more complete version which draws an image of a skull and bones!
^
can now be used to raise integers to an arbitrary power. (e.g. "2 ^ 3 => 8
".)- We support the
XOR
binary & logical operator. - We implemented support for the definition of user-defined functions
DEF FN
, and calling them viaFN
.- See examples/25-def-fn.bas for example usage.
- 100% test coverage of our builtin functions!
BugFixes
- SQR now errors, as it should, when given a negative number.
- Our string-primitives now support UTF8 input correctly
LEFT$
,RIGHT$
,MID$
,TL
, andLEN
.
Breaking changes:
- The API for embedding builtins changed, again, sorry. The first argument is now an
interface{}
, rather than instance of theInterpreter
.- See
embed/main.go
orgoserver/main.go
for updated usage.
- See
release-1.1
New Features
The IF
statement has been updated as a result of #42 to allow testing for non-zero, and non-empty strings. For example:
10 LET a = 3
20 IF a THEN PRINT "OK - a is not zero, or not an empty string"
BugFixes
- As a result of fuzz-testing several potential crashing-bugs have been prevented.
- The
PRINT
statement has been moved from the core of the interpreter loop tobuiltins.go
.- This improves the argument parsing such that
10 PRINT 3 + 4 * 5
works as expected. - This was as a result of #41
- This improves the argument parsing such that
Breaking changes:
- None
release-1.0
New Features
- Error messages will (largely) show the appropriate line-number at which they were encountered.
BugFixes
- Builtins are correctly handled when too few arguments are present.
- Builtins now receive the result of evaluating expressions, rather than being forced to do the work themselves.
- If a FOR loop is not terminated at exit-time that will be reported.
- The RND builtin will abort cleanly if given a number less than one.
Breaking changes:
- Due to the way arguments are evaluated it might be that some programs need to be updated.
For example this statement has been updated to add (
+ )
around a$
:
10 LET l = LEN(a$) - 1
release-0.9
New Features
- The new builtin
VAL
is available - The
gobasic
intepreter now has a-trace=[true|false]
command-line option.
Breaking changes:
- Our internal API has been updated to change the signature of the builtin-function.
- The example programs which embed the interpreter have updated to match (
embed/main.go
+goserver/main.go
).
BugFixes
- The
STR$
function has been updated to require only a single argument, previous two were required in error. - The handling of changed builtins is now significantly improved. For example see the chained calls here.
release-0.8
This release was all about error-detection:
- Now the interpreter will output error-messages in more places than in the past.
- Errors will be caught gracefully, and they will be returned to the caller.
- The gobasic-server benefits from this especially
- As it can now show errors, in addition to any output image you've created.
Otherwise the only real new feature was the update of the gobasic server to be standalone, and have a bunch of built-in samples. It also gained the ability to draw lines, via LINE
.
NOTE: release-0.7 was made in error - I forgot to git pull
before I ran git tag..
- so I've removed it.
release-0.6
This release updates the bundled goserver
command to be fully standalone, and relocatable, because the file that it servers is now embedded inside the binary via implant.
In addition to being relocatable the goserver
now also includes some simple example-scripts which make it easier to see how you might use it.
The core basic-interpreter gained the ability to use AND
and OR
inside conditional-tests, and also the ability to use AND
, BIN
and OR
as operators themselves. These are demonstrated in the examples:
There were some minor bugfixes made, for example in the case of a FOR loop where the starting index and terminating index are identical only one iteration will be made, rather than an infinite number. Handling GOSUB
inside an IF
statement also works correctly now.
release-0.5
New Features
- We've now implemented string support
- This is demonstrated quite well in examples/90-stars.bas
- String-specific functions are now present, and documented:
CHR$
CODE
LEFT$
LEN
MID$
RIGHT$
TL$
INPUT
now allows reading either a string or an integer.
Breaking changes:
- Our internal API has changed, since we support more than just integers.
- The example program has been updated to match.
- RND now requires an argument.
release-0.4
100% consistency in how custom-functions are handled vs. variables.
New release, even with just a single change, because the signature of the builtin-function has changed. Best get the pain over with before we're popular!