Skip to content

jfhbrook/matanuska

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Matanuska BASIC

Matanuska is a BASIC dialect designed for use as a shell. It asks what it would've been like if the classic 80s BASIC was better able to rise to the occasion when it came to disk features and/or competing with DOS.

Matanuska is still in development, and needs a lot of work before it's ready for regular use.

Install

There currently aren't any installable packages for Matanuska. If you would like to try it today, follow the instructions for development.

Development

Matanuska BASIC uses npm for all of its tasks. Refer to package.json for details.

ADRs

Architectural decisions are documented in ./adrs. Notes on future decisions I haven't made yet are in ./adrs/draft.

Current Status and Next Steps

The interpreter can run "hello world" in a REPL and evaluate simple expressions. Now is time to add some basic features and button up a few gaps.

Prioritized Backlog

  • Native commands
    • jobs ADR
    • parse native commands
    • clean up disk command tokens
    • create jobs table abstractions
    • test jobs table abstractions
    • develop runtime instructions for managing jobs
    • use jobs to implement pwd
    • support \j in prompt rendering
    • ./adrs/draft/processes.md
  • Fully featured cd command
  • Revisit draft ADRs
    • ./adrs/draft/end-keyword.md
    • ./adrs/draft/peek-poke.md
    • ./adrs/draft/stack-effects.md
    • ./adrs/draft/sigil-typecasting.md
    • ./adrs/draft/registers.md
  • Fully featured cd command
  • Functions
    • Function syntax ADR
    • Add keywords to tokens/scanner
    • Add support to parser
    • Parser tests for functions
    • Add new op codes
    • Add support in runtime
    • Add support to disassembler
    • Add support to compiler
    • Compiler tests for functions
    • Runtime tests
    • Examples
    • Native function support
  • Tests for InstrShifter in editor
  • Support entering multiple lines in REPL
    • ADR
    • Probably a Reader class that handles readline stuff
    • Probably track block nesting
  • PS1/PS2 support
    • SET PS1 and SET PS2?
  • Runtime tests for Jump and Loop
  • STDIO and Background Control
    • |, & and stream redirection
  • Spike on ^Z, ^Y and fg
  • Spike on Rust Jobs Implementation
    • Use neon
    • Potentially implement process groups

Up Next

  • User cmdlets
    • Dust off ./adrs/draft/cmdlets.md
    • Import cmdlets from some directory
    • Probably move .matbas_history and existing files
  • Closures
    • Closures ADR
    • ???
  • More robust citree parser
    • Setting defaults in List instr is no bueno
  • Complete Print/Format syntax
    • ./adrs/draft/print-statement.md
    • Support ECMA-55?
    • Complete ADR
    • Print can take a channel config
  • Shell variable export
  • Date/Time/Duration/TZData types
    • Core library
    • Host support
    • (Language support can come later)
  • Consider using end keyword as general purpose block end keyword
    • Finalize ADR
  • Support next and continue keywords in loops
  • Support for HISTSIZE and HISTFILESIZE
  • Telemetry improvements
  • Pipes support
  • GOTOs
    • Probably a second pass on the chunk
    • Probably need to enforce being within current block/scope tree
    • Will need to close appropriate scopes
  • Type-checking compiler
    • Implement type analogues to operations
    • Simulated stack in the compiler
  • Add trace events to parser and compiler
  • Audit/document OTEL environment variables
  • Add tflint and terraform validate
    • entrypoint
    • fireball
  • Split matanuska into modules
  • grabthar improvements
    • swc cli build option
    • automatically update package.json
    • lint-staged and husky support
    • grabthar clean
  • Assert module
    • Wrap 'node:assert'
    • Throw RuntimeFault
  • Investigate Node.js inspector
  • Escaped newlines
  • Arrays
    • Including array literals - BASIC assigns each index one at a time, or uses the data command
    • Consider using eigen
  • Environment info in runtime fault outputs
    • envinfo for inspiration
    • OS
    • CPU
    • Memory
    • Build tool versions (cmake, make, etc) if compiling native code
    • Will need to scrub from format test snapshot
  • Implement Acey Ducey
    • center$(n)
    • rnd! (random) function
    • If/then/goto
    • functions
    • no-arguments print
    • end command
  • Hashes
  • Date/time language support
  • Exception language support
  • Test harness
    • test and assert commands
    • Runtime "test mode" and entrypoint subcommand
    • Reporter, possibly based off node-tap
  • File I/O
  • Research garbage collection
    • TypeScript is obviously garbage collected
    • But the architecture may hang onto references I don't want
  • Tab-complete support in the REPL
  • Starship support
  • Stream/pipe support
  • Break-in
    • MSX BASIC uses the stop and cont commands to control break-in behavior
    • Will need to intercept and handle ctrl-c from readline (ctrl-stop in MSX BASIC)
  • Symbol dump
    • ./adrs/draft/symbol-dump.md
  • Profiling
    • ./adrs/draft/profiler.md
      • Revisit in light of recent opentelemetry features
    • Line-based for users
    • Opcode-based for me
  • Performance tests
    • Benchmarks
    • Profile slow benchmarks
  • Text Editor plugins
  • Generated "exceedingly large" script tests

The Future

  • Optimize identifier constants - see ADR 019
  • Reimplement citree in Rust and chumsky
  • String templates
  • Module system
  • Package manager
  • Partial rewrite in Rust and/or C/C++
  • Implement entry point in Rust or C/C++
  • Port to bun?
    • Nice FFI
    • Support for bundled executable
  • Object support
  • Vector/matrix support for 1D/2D integer/float arrays
  • Assembler mini-language
  • Stack trace tests robust against different node versions

Resources

About

A chill BASIC to shell to πŸ’ƒ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published