IMPORTANT: There currently are no guarantees regarding the stability of the EndBASIC language definition nor the API exposed by this crate. Expect them to change at any time (especially the Rust API). Version numbers will not adhere to semantic versioning until 1.0.0.
IMPORTANT: Similarly, there are no guarantees that old releases will be able to talk to the cloud service. If you use the web interface, this should not be a problem, but if you use local builds, please try to stay on the latest release for the time being.
STILL UNDER DEVELOPMENT; NOT RELEASED YET.
-
Issue #153: Added support for labels and
GOTO. At this point, label names must be prefixed with an@sign to resolve parsing ambiguities with the:line delimiter. -
Modified the interpreter to parse the full program before executing it, which is a requirement for supporting
GOTOs 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 where the program would make progress until it hit the error. -
Fixed erratic insertion of newlines in existing text in the editor.
-
Issue #113: Added line and column tracking to error messages for parsing and execution errors. Also cleaned up Rust
Debugimpls that leaked into error messages for nicer errors. -
Added support for the exponent (
^) operator and theSQRfunction. -
Issue #114: Added transparent promotion from integers to doubles, and truncation (via rounding) from doubles to integers.
-
Issue #114: Removed the
DTOIandITODfunctions now that integers and doubles are automatically converted between them, and added theCINTandINTfunctions. -
Issue #114: Removed the
MAXD/MAXIandMIND/MINIduality in favor of simplerMAXandMINfunctions that can mix and match integers and doubles. -
Issue #114: Added support for doubles in
FORiteration, both to specify the loop range and the step. -
Changed the syntax of the
MOUNTcommand to take advantage of theASkeyword as an argument separator and thus be of the formMOUNT 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 theREADandRESTOREcommands. 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. -
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, which would result in a parse error. -
Renamed
DELasKILLto match QuickBASIC and avoid confusion with a potential futureDELETEcommand implementation. -
Rewrote the SDL console internals to use a separate thread that implements the SDL main loop. This might fix some rendering issues that have been previously observed with this implementation (or provide an easy way to fix them later if not).
-
Fixed
EXITso that it works in the context ofWHILEloops and so that no further expressions are evaluated inFORand `IF statements. -
Issue #111: Added support to interrupt running programs via
CTRL+C. -
Rewrote the execution interpreter to be based on an iterative loop over a simplified bytecode representation instead of walking over the AST.
-
Added support for
GOSUBandRETURN. -
Issue #121: Added support for catching errors via
ON ERROR GOTOandON ERROR RESUME NEXT, both of which are returned by a newERRMSGfunction with the details of the error that was caught. -
Issue #155: Added support for "line numbers as labels", just like QuickBASIC does, which permits running the traditional
10 GOTO 10program. Note, however, that these line numbers have nothing to do with the actual line numbers in the file and that's something I still would like to address somehow in the future. On this topic, also removed line numbers from the output ofLIST. -
Changed the syntax to call argument-less functions, such as
INKEYandPI, so that they do not accept(). This matches traditional BASIC implementations. -
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
INPUTso that the prompt is optional and thus things likeINPUT varwork as expected from traditional BASIC implementations. -
Extended
AND,NOT,OR, andXORto perform bitwise operations when operating on an integer context. -
Added syntax to specify integers in different bases, using forms like:
&b_1010,&d_1234,&o_750, and&x_12f. -
Issue #108: Added the
SCRROWSandSCRCOLSfunctions to query the size of the textual console and theGFX_HEIGHTandGFX_WIDTHfor the graphical console. -
Added the
GFX_CIRCLEandGFX_CIRCLEFcommands to draw circles. -
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.
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 theDIRandLOADcommands 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 form
https://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 form
cloud://username/pathgiven to the command line interpreter will fetchpathowned byusernameand 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 theendbasic-stdcrate leaner dependencies-wise and facilitates configuring the client.
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.
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
sdlfeature. 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_SYNCgraphics 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 use
xterm.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 that
LOAD,EXIT, andNEWcan 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-terminalcrate, 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.
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 form
DRIVE:/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.
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 newrpifeature 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 theFOR/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.
Released on 2021-01-25.
- Fixed the dependencies of the
endbasiccrate so thatcargo installworks as documented.
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.
Released on 2020-12-25.
New user-experience features:
-
Added support for built-in demo programs. These are loadable via the special read-only
DEMO:*.BASfiles. -
Added the
DEMO:GUESS.BAS,DEMO:HELLO.BASandDEMO:TOUR.BASbuilt-in demo programs.
New language features:
-
Added simple
FORrange loops with support for customSTEPs. -
Added support for calls to builtin functions within expressions.
-
Added string manipulation functions:
LEFT,LEN,LTRIM,MID,RIGHTandRTRIM. -
Added numerical functions:
DTOIandITOD. -
Added support to for random numbers via the
RANDOMIZEcommand and theRNDnumerical function. -
Added support for double-precision floating point numbers (
#type annotation). This feature is incomplete in many ways but is needed for random number generation. Notably, it is not possible to express some double values in the code (exponents, infinities, and NaNs), and there is no type promotion between integers and doubles. Use the newITODANDDTOIfunctions to convert between these two types.
Bug fixes:
-
Fixed the expression parser to properly handle subtractions where the first operand is a negative number.
-
Fixed the expression parser to detect and report unbalanced parenthesis.
Operational changes:
- Builds from
HEADare now pushed to a separate staging area to keep the official site pinned to the latest release. This is to make release numbers meaningful in the web context.
Released on 2020-11-29.
The highlight of this new release is a much improved interactive interface, as it gets rid of the line-oriented editor (which used meaningless line numbers) and replaces it with a full-screen interactive editor.
New features:
-
Turned the
EDITcommand into an interactive full-screen text editor and removed theLISTandRENUMcommands. -
Added the
CLS,COLOR, andLOCATEcommands for terminal manipulation. -
Added the
DELcommand to delete a saved program. -
Added a language cheat sheet via
HELP LANG. -
Added a barebones web interface.
Notable bug fixes:
-
Fixed arithmetic operators to capture overflow conditions.
-
Fixed
EXITto accept0as the exit code.
Structural code changes:
-
Split the language core (parser, interpreter, and command implementations) out of the
endbasiccrate and moved it to a separateendbasic-corecrate. This is to ensure that the language components stay free from heavy dependencies that assume things about the environment (like terminal or file system access). -
Made the language interpreter
async-compatible.
Released on 2020-11-29.
Broken build due to a bad merge from HEAD.
Released on 2020-05-07.
This is the first release with an interactive command-line interface (aka
a REPL). You can start this by simply typing endbasic without any
arguments. Once in it, the following features are now available:
-
The
HELPcommand to provide interactive information. -
The
CLEARcommand to wipe machine state (variables). -
The stored program manipulation commands
EDIT,LIST,NEW,RENUMandRUN. -
The on-disk program manipulation commands
DIR,LOADandSAVE.
Similarly, this is the first release that supports a nicer command-line invocation experience, including flag parsing. As a result:
- Added the
--helpand--versionflags to the command-line interface.
Finally, these are the changes to the core interpreter and language:
-
Added support for
:as a statement delimiter. -
Added support for
_in identifiers. -
Made
INPUTrecognizeyes/noandy/nanswers for boolean values on top of the already supportedtrue/falsevalues. -
Added the
MODoperator to compute the remainder of an integer division. -
Made
INPUTresilient to invalid boolean and integer answers by asking the user to input them again. The caller has no means of determining failure so we must do this (like other BASIC implementations do). -
Split the
INPUTandPRINTbuiltin commands out of the language's core and into their own module. This keeps the interpreter free from side-effects if the caller so chooses, which makes it ideal for embedding.
Released on 2020-04-22.
- Initial release of the EndBASIC project.