Releases: sugarlabs/musicblocks-v4-lib
Releases · sugarlabs/musicblocks-v4-lib
v0.2.0
Enhancements
- (#118) Added validations in specification functions for registering and unregistering syntax elements.
- (#119) Added function to specification snapshot.
- (#122) Added provision to provide initialisation values in snapshot of data elements for syntax tree generation.
Fixes
- (#121) Removed custom type reliance for syntax element name (
TElementName
).
Chore
- (#120) Updated package dependencies.
v0.1.0 (Initial Release)
Adds 3 categories of components: Syntax Representation, Execution Engine, Library
Syntax Representation
- Adds Element API: represents syntax elements — the atomic constructs for building programs. There are 2 kinds of syntax elements:
- Arguments which return values. These are of 2 types:
- Data which return a value inherently and without operating on other provided values
- Expression which return a value after operating on other provided values
- Instructions which perform a task. These are of 2 types:
- Statements perform a single task
- Blocks encapsulate statements and generally set some states or control the flow to them
- Arguments which return values. These are of 2 types:
- Adds Specification component: maintains a table of concrete syntax elements which can be used to build programs.
- Adds Warehouse component: maintains a table of instances of syntax elements registered in the specification. It can also generate statistics about the instances.
- Adds Syntax Tree component: represents the abstract syntax tree or AST by maintaining interconnections between syntax elements.
Execution Engine
- Adds Symbol Table component: maintains tables of dynamic global variables and states which the syntax elements can use during execution.
- Adds Parser component: parses the syntax tree in a postorder sequence, and maintains call frame stacks and the program counter.
- Adds Interpreter component: fetches elements from the parser and executes them.
There are 2 special constructs: Process and Routine. These are special block elements. Routines encapsulate instructions that can be executed by multiple processes. Processes encapsulate independent set of instructions, and multiple processes can run concurrently.
There is an additional terminology called crumbs which are sets of connected syntax elements not part of any process or routine.
Library
- Adds basic Concrete Syntax Elements
- Values
- Represent stored values
- Supports
boolean
,number
,string
data-types
- Boxes
- Represents variable values
- Support
boolean
,number
,string
,generic
data-types
- Box Identifiers
- Represents variable identifiers
- Supports
boolean
,number
,string
,generic
boxes
- Math Operators
plus
,minus
,times
,divide
,modulus
operators
- Conditionals:
if
- Loops: generic
repeat
- Program:
process
androutine
- Miscellaneous:
print
- Values
- Adds a specification of the above syntax elements