Skip to content

implementation of the lox language described by craftinginterpreters.com with some additional language features

License

Notifications You must be signed in to change notification settings

freneticmonkey/sox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sox

variation of the implementation of the sox interpreter as described on http://craftinginterpreters.com

Build Status

Platform Build
Ubuntu Build

Tests TODO:

  • Run each script in the scripts folder without errors
  • Script output validation
  • Globals
  • Locals
  • String operations
  • Math operations
  • Invalid + - / *
  • invalid assignment - 3 * 4 = 12
  • local var aliasing across scopes
  • duplicate variable definition
  • File parsing

Future Language features

  • Defer
  • replace fun with fn
  • remove semi-colon line ending
  • bracketless expressions
  • optional main entrypoint
  • Switch statements
  • impl break
  • impl continue
  • argc / argv parameters to main
  • unit test functions
    • assert keyword + functionality
    • benchmark option
  • native container implementations
    • table
    • list / slice
    • helper functions
      • pop/push
      • len
      • range -> for in range
  • for-in container iteration
  • run scripts from repl
  • default parameter values
  • remove global variables
  • multi-line comment blocks
  • load multiple scripts / modules
  • Bytecode scripts

Advanced language features

  • interfaces
  • coroutines
  • Debugger?

Things to better understand

  • Rule parsing - precidence logic
  • max number of up values (256) - per function or program?

About

implementation of the lox language described by craftinginterpreters.com with some additional language features

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages