Releases: endbasic/endbasic
EndBASIC 0.11.1
Released on 2024-09-14.
- Issue #246: Fixed double keyboard input on the Windows console.
EndBASIC 0.11.0
Released on 2024-07-19.
Language changes:
-
Issue #112: Added support for user-defined functions and subroutines via the
FUNCTIONandSUBcode blocks. The newDEMOS:FIBONACCI.BASdemo program
demonstrates how they work. -
Issue #112: Added support for global variables via
DIM SHARED. -
Added the
DISASMcommand to show the disassembled version of a compiled
program. -
Made the
CLEARcommand be only available in the interactive interpreter
given that it cannot clear compilation state. -
Fixed the
MIDfunction so that thelength%parameter is actually optional
as the documentation claimed. -
Changed the way integers with explicit bases are parsed so that they can
express integers with their highest bit set. For bitmasks, this is needed.
Console improvements:
-
Improved support for narrow consoles: trimmed the width of the welcome
banner, fixed the editor's status line handling, madeDIRprint a
concise directory summary, madeLOGINskip the server'smotd, and
fixed handling of line input in prompts. -
Modified commands that print many lines (
DIR,HELP, andLIST) to
paginate their output so that they are usable in short consoles. Also
applies to the newDISASMcommand. -
Added the new console
st7735sfor the Raspberry Pi. This backend uses the
ST7735S 1.44in LCD for the console output and the terminal console for input,
but also recognizes the hat's buttons and injects them as keyboard events. -
Issue #110: Homogenized the implementation of the SDL and web consoles to
guarantee consistent behavior and to have indirect test coverage of the
web console.
Compiler and virtual machine changes:
-
Rewrote the expression evaluator to be bytecode based. This is in service of
supporting user-defined functions and adds the ability to interrupt functions
as they execute. -
Many errors that were previously discovered only at runtime (such as undefined
variables) are now caught during the compilation stage. This means that bad
programs abort earlier instead of half-way during execution. -
Major performance improvements: type checking now happens at compilation time
and the interpreter checks for interrupts more rarely now. -
Reverted integer-only operations to not perform automatic upgrades to
doubles on underflows, overflows, and other error conditions. This behavior
was previously added in 0.10.0 but has become problematic with the new type
propagation during compilation as it pushes too much responsibility to the
runtime. -
Homogenized the handling of command and function arguments into a single
parser. The user-visible effects of this change are that all syntax
definitions thatHELPprints now follow a consistent pattern and that such
help strings truly match what the commands and functions expect.
Cloud service changes:
- Fixed JSON requests to the service to properly set the correct
Content-Typeheader.
EndBASIC 0.10.0
Released on 2022-12-27.
This is a huge release that focuses on extending the capabilities of the core
language so that non-trivial programs can be written in it.
Language changes for better control flow:
-
Issue #153: Added support for labels (identifiers prefixed by an
@sign)
andGOTO. -
Issue #155: Added support for "line numbers as labels", just like
QuickBASIC does, which permits running the traditional10 GOTO 10
program. Note, however, that these line numbers have nothing to do with
the actual line numbers in the file. To minimize confusion, line numbers
have been removed from the output ofLIST. -
Added support for
GOSUBandRETURN, which provides a rudimentary
mechanism to reuse code within a program. -
Issue #121: Added support for catching errors via
ON ERROR GOTOandON ERROR RESUME NEXT. Captured error messages are exposed to the user via
a newERRMSGfunction. -
Replaced the
EXITcommand with theENDkeyword. -
Added support for
DOloops with optionalUNTIL/WHILEpre- and
post-guards andEXIT DOearly terminations. -
Added support for uniline
IFstatements. -
Added support for
SELECT CASE. -
Fixed
ENDso that it works in the context ofWHILEloops and so that
no further expressions are evaluated inFORand `IF statements. -
Rewrote the execution interpreter to be bytecode based instead of walking
over the AST.
Language changes for better numeric handling:
-
Issue #114: Added transparent promotion from integers to doubles and
automatic rounding of doubles as integers. -
Issue #114: Added support for doubles in
FORiteration, both to specify
the loop range and the step. -
Added support for the exponent (
^) operator and theSQRfunction. -
Added syntax to specify integers in different bases, using forms like
&b_1010,&d_1234,&o_750, and&x_12f. -
Extended
AND,NOT,OR, andXORto perform bitwise operations when
operating on an integer context and added the<<and>>bit shift
operators.
Standard library changes:
-
Issue #114: Removed the
DTOIandITODfunctions now that integers and
doubles are automatically converted between them, and added theCINTand
INTfunctions. -
Issue #114: Removed the
MAXD/MAXIandMIND/MINIduality in favor of
simplerMAXandMINfunctions that can mix and match integers and
doubles. -
Changed the syntax of the
MOUNTcommand to take advantage of theAS
keyword as an argument separator and thus be of the form
MOUNT target$ AS $drive_name$. -
Fixed
PRINTso that, if the statement ends in a comma or in a semicolon,
no newline character is printed. Useful to construct output lines in
multiple steps and matches the behavior of other BASIC implementations. -
Issue #154: Added support for the
DATAstatement and theREADand
RESTOREcommands. Booleans, numbers, and strings are supported, but
strings must be double-quoted (as opposed to other BASIC implementations
where the double-quoting is optional). -
Added the
ASC,CHR, andSTRfunctions. -
Renamed
DELasKILLto match QuickBASIC and avoid confusion with a
potential futureDELETEcommand implementation. -
Fixed
INPUTso that the prompt is optional and thus things like
INPUT varwork as they do in traditional BASIC implementations. -
Issue #108: Added the
SCRROWSandSCRCOLSfunctions to query the size
of the textual console and theGFX_HEIGHTandGFX_WIDTHto query the
size of the graphical console. -
Added the
GFX_CIRCLEandGFX_CIRCLEFcommands to draw circles.
Usability improvements and fixes:
-
Issue #113: Added line and column tracking to error messages for parsing
and execution errors. Also cleaned up RustDebugimpls that leaked
into strings to provide nicer error messages. -
Issue #111: Added support to interrupt running programs via
CTRL+C. -
Extended the builtin language documentation to explain in detail every
statement type.HELP "LANG"now displays a collection of topics to
choose from, instead of a one-page cheat sheet. -
Added the
PALETTE.BASdemo, which is a little tool that renders the
full color palette. -
Changed the syntax to call argument-less functions, such as
INKEYand
PI, so that they do not accept(). This matches traditional BASIC
implementations. -
Fixed erratic insertion of newlines in existing text in the editor.
-
Modified the
HELPcommand to only accept a string as its argument
instead of also recognizing a bare word. The latter was only approximate
and would cause confusion when typing something likeHELP DATA, as this
resulted in a parse error. -
Rewrote the SDL console internals to use a separate thread that implements
the SDL main loop. This fixes some rendering issues and crashes that have
been previously observed with this implementation. -
Modified the interpreter to parse the full program before executing it,
which was a requirement for supportingGOTOs and features likeDATA.
As a side-effect of this change, any syntax errors now cause the
interpreted program to not run at all, as opposed to before when the
program would make progress until it hit the error.
EndBASIC 0.9.0
Released on 2022-06-05.
The primary goal of this release is to support major changes in the EndBASIC
cloud service, which has a completely new account signup and authentication
flow that allow unauthenticated users to load publicly shared files. These
changes, combined with the in-interpreter account signup flow, fulfill the
vision of the cloud service interactions.
Cloud service changes:
-
Updated
LOGINto deal with the new version of the EndBASIC cloud service
that does not use Azure AD for authentication. This new command is faster
and simpler. -
Added the
SIGNUPcommand to create cloud accounts right from the REPL.
Having this command in the interpreter had always been the goal, but it
was not possible to implement it due to Azure AD authentication flows. -
Added support to access files without logging in first. The
cloud://
file system scheme can now be used before usingLOGIN, and theDIRand
LOADcommands will work on the mounted drive as long as there are public
files within it. -
Added the
LOGOUTcommand. As a side-effect of this, it is now possible
to useLOGINmultiple times within the same interpreter session. -
Issue #131: Added support to auto-run programs from the cloud to the web UI:
a URL of the formhttps://repl.endbasic.dev/?run=username/pathwill load
the interpreter, fetchpathowned byusernameand run it. -
Added support to auto-run programs from the cloud to the CLI, to mimic the
changes done to the web UI. A path of the formcloud://username/path
given to the command line interpreter will fetchpathowned byusername
and run it. Due to various limitations, this is only available when the
interpreter is launched with the--interactiveflag. -
Parameterized the cloud service to talk to. In the CLI, the new
--service-urlallows overriding the default, and in the web, the staging
site now points to the staging service.
Usability fixes:
-
Issue #161: Fixed input methods (line input in the REPL and the full-screen
text editor) to properly accept UTF-8. -
Issue #163: Fixed backspace handling in the the web and SDL consoles so
that the previous character is not left behind the cursor. The problem was
visible in the web UI where the semi-transparent cursor would show the
previous letter.
Internal changes:
- Added a new
endbasic-clientcrate to assimilate all of the funcionality
and commands required to talk to the cloud service. This helps to keep the
endbasic-stdcrate leaner dependencies-wise and facilitates configuring
the client.
EndBASIC 0.8.1
Released on 2022-01-29.
-
Issue #136: Fixed handling of key presses on the web interface so that they
don't interfere with browser shortcuts. This prevents Tab from stealing
focus from the terminal, the arrow keys from doing strange things when
"caret browsing" is enabled, and the slash key in Firefox from triggering a
search on the page. -
Issue #148: Fixed interactive line edits so that moving up and down through
history doesn't leave old characters behind when the cursor is in the middle
of a line (not at the end). -
Replaced the use of Google Analytics in the web interface with EndTRACKER,
my own experiment at site statistics. If you are curious, this service's
code is a direct fork of EndBASIC's cloud service--hence the name.
EndBASIC 0.8.0
Released on 2021-11-11.
The main purpose of this release is to bring you the new hybrid graphics/text
console in the form of a feature preview. This feature brings EndBASIC closer
to its original secret goal, which is to become a platform with which to write
simple retro-looking games.
Please be aware that the new console is still quite rudimentary. There are
many missing drawing primitives, and performance isn't great yet. Fixing these
might require changes in the APIs so any code you write might need to be updated
in the future. But, remember that the same is true for all of EndBASIC right
now given its 0.x state.
This release lines up with the Handmade Seattle 2021 conference, during which it
was first announced.
Graphics support and related console changes:
-
Added a graphical console based on SDL2 behind a new optional
sdl
feature. This is to support graphics on all desktop platforms and has been
confirmed to work on FreeBSD, Linux, macOS, and Windows. -
Added the
GFX_LINE,GFX_PIXEL,GFX_RECT,GFX_RECTF, andGFX_SYNC
graphics commands. -
Added the
INKEYfunction. This is especially useful to implement event
loops in graphical applications. -
Fixed
LOCATEso that the first argument is the column number and the
second argument is the row number. It should always have been this way
(in fact, this is the syntax exposed by Locomotive BASIC), but this is now
necessary to match the ordering of the coordinates in all graphics commands
and avoid confusion. -
Modified console facilities (including
PRINTandINPUT) so that they do
not clear lines up to the right margin. I had originally added this as a
feature so that changing the background color in the REPL caused all
subsequent lines to be formatted consistently, but this prevented composing
overlapping text (with or without graphics), which is a necessary thing to
do when rendering UIs. -
Rewrote the web frontend from scratch to support graphics rendering. This
implies that we do not usexterm.jsany more and instead use a
custom-built console implementation. Beware of new bugs. -
Issue #67: Keyboard input on Android should now work when using a soft
keyboard. This isn't perfect due to limitations in the Android web APIs
but should do the trick for simple uses.
General command changes:
-
Extended the
CLEARandNEWcommands so that they reset various
properties of the machine, not just variables. This includes the state of
the console, whose color and video syncing bit are reset, and the GPIO
pins, which are set to their default state. -
Modified the
RUNcommand to issue aCLEARupfront. Maintaining the
previous state of the machine was just too confusing and error-prone due
to side-effects causing execution failures. -
Added the
MIND,MINI,MAXD, andMAXIfunctions. -
Added the
DEGandRADtrigonometric commands and theATN,COS,
PI,SIN, andTANfunctions. These are often needed to render
graphics.
Interactivity improvements:
-
Added support for the Home, End, Page Up, and Page Down keys in the text
editor. -
Made the Backspace and Tab keys aware of indentation in the editor.
-
Added support for the Home and End keys in text input fields.
-
Modified the storage commands to keep track of the currently-loaded program
path so that the editor can display it, so thatLOAD,EXIT, andNEW
can warn about unsaved changes, and so thatSAVEcan reuse the current
filename.
Internal changes:
-
Refactored the
endbasic-stdcrate to minimize optional features in
library crates by moving the textual console into a newendbasic-terminal
crate, the SDL console into a newendbasic-sdlcrate, and the Raspberry
Pi support into a newendbasic-rpicrate. -
Added a new
endbasic-replcrate to assimilate all of the features and
code that are specific to the REPL. This finally breaks the dependency
of theendbasic-webcrate on theendbasicCLI crate, which required
optional features to work.
EndBASIC 0.7.0
Released on 2021-07-03.
This is a huge release and its primary goal is to offer integration with the new
EndBASIC cloud service. To reach that goal, this release adds disk drives, new
commands specifically for cloud interaction, and comes with various usability
improvements to make the whole experience better.
Support for disk drives:
-
Added support for storage drives. All file commands now take a path to a
file of the formDRIVE:/PATHwhere the drive part and the slash are
optional. By default, three drives are available:MEMORY:, which is a
trivial memory-backed drive;DEMOS:, which contains the read-only demo
files; andLOCAL:, which points to local storage (either a local directory
or to the web browser's local storage). -
Added the
CDcommand to change the current drive and thePWDcommand to
print the current location. -
Extended the
DIRcommand to take an optional path to the directory to
show. -
Added the
MOUNTandUNMOUNTcommands to inspect and manipulate the
mounted drives. Note that this now allows users to mount arbitrary parts
of the external file system within the EndBASIC namespace, when in theory
it wasn't possible to escape the programs directory before. This is
intentional, but if there is a need, we can put restrictions in place
again. -
Renamed the
--programs-dirflag to--local-driveand removed the special
handling of the:memory:value. Instead, this can now take arbitrary URIs
to refer to drive targets.
Support for the EndBASIC cloud service:
-
Added the
LOGINcommand to authenticate against the EndBASIC service and
to mount the user's own drive. -
Added a new
cloud://mount target scheme to specify the drives of other
users. -
Added the
SHAREcommand to set reader ACLs on files hosted in the
EndBASIC service, allowing users to share files among themselves.
Usability improvements:
-
Refactored the
HELPcommand to only print a summary of topics by
default. As part of this, topics can now be looked up using prefixes of
their names. -
Made the output of
HELPfit within the screen for easier readability
instead of allowing long paragraphs to wrap at unpredictable points. -
Added input history tracking to the REPL interface.
Miscellaneous additions:
- Added the array functions
LBOUNDandUBOUND.
EndBASIC 0.6.0
Released on 2021-02-19.
Summary: support for (multidimensional) arrays and support for GPIO on the
Raspberry Pi.
New standard library features:
-
Added basic support for GPIO via the new
GPIO_SETUP,GPIO_CLEAR,
GPIO_WRITEcommands and theGPIO_READfunction. These symbols are
always available, but at the moment, they are only functional on the
Raspberry Pi. Support for this platform must be enabled via the new
rpifeature because therppaldependency does not compile on all
supported platforms. -
Added the
SLEEPcommand to pause execution for a certain period of time. -
Readded the
LISTcommand to dump the stored program to the console. This
was removed in 0.3 with the addition of the full-screen text editor, but
having quick access to the program's contents is useful to showcase both
code and output at once. -
Modified
INPUTso that it autodetects the target type of a variable when
the variable is already defined, instead of assuming the integer type for
unqualified variable references.
New command line features:
- Added the new demo program
DEMO:GPIO.BASto accompany the new support
for GPIO.
New language features and bug fixes:
-
Added support for the
DIMstatement to define variables and arrays. -
Added support for multidimensional arrays.
-
Replaced
END WHILEwithWENDas the earlier BASICs did. We could
probably support both, but for now, sticking to the simpler world of a
different keyword per statement seems nicer (and this matches what the
FOR/NEXTpair do). -
Fixed the expression parser to properly handle symbol names that appear
immediately after a left parenthesis. This broke with the addition of
function calls. -
Fixed the definition of variables so that their names cannot shadow
existing functions. -
Refactored the internal representation of symbols (variables, arrays,
functions, and commands) for a more uniform handling. As a side-effect, it
is now an error to have two symbols of any kind with the same name.
EndBASIC 0.5.1
Released on 2021-01-25.
- Fixed the dependencies of the
endbasiccrate so thatcargo installworks as documented.
EndBASIC 0.5.0
Released on 2021-01-24.
This is primarily a quality-focused release. Most of the work since 0.4.0 has gone into fixing long-standing issues in the codebase (particularly around internal testability), but a lot of these have also had end-user impact.
New user-experience features:
-
Added support to load an
AUTOEXEC.BASfile at REPL startup time. -
Made file names in the web UI case-insensitive. Any pre-existing files will be renamed to have an all-uppercase name to support the new semantics.
-
Added support for an in-memory store when running the REPL by specifying the
--programs-dir=:memory:flag. -
Added support to run scripts as if they were run in the interactive REPL by passing the
--interactiveflag.
Bug fixes:
-
Fixed the
EXITcommand so that it doesn't terminate the REPL when it is part of a script run viaRUN. -
Made the web interface not restart the machine on an exit request (such as a call to
EXIT) so that any state is not lost. It's too easy to hit
Ctrl+C by mistake, for example.
Major internal API changes:
-
Split the language and standard library into two separate crates: the existing
endbasic-corecontinues to provide the language interpreter and the newendbasic-stdprovides the standard library. -
Added a public
testutilsmodule within thestdcrate to offer test utilities for consumers of the EndBASIC crates.