Soodocode: a runtime for Cambridge CS (9618) pseudocode syntax, written in Typescript.
Installation: npm i -g soodocode-cli
Usage: soodocode file.sc
- DECLARE, DEFINE, CONSTANT, Assignment, OUTPUT, INPUT, RETURN, CALL, TYPE
- IF, ELSE, FOR, FOR STEP, WHILE, REPEAT
- CASE OF statements
- Case branch with range
- FUNCTION, PROCEDURE
- CLASS, CLASS INHERITS, Class property, Class procedure, Class function
- or and equal_to not_equal_to less_than less_than_equal greater_than greater_than_equal not
- add subtract negate multiply divide integer_divide mod
- string_concatenate
- pointer_reference pointer_dereference access
- LEFT, RIGHT, MID/SUBSTRING, TO_UPPER, TO_LOWER, UCASE, LCASE
- NUM_TO_STR, STR_TO_NUM, IS_NUM, ASC, CHR, INT
- DAY, MONTH, YEAR, DAYINDEX, SETDATE, TODAY/NOW
- LENGTH() on arrays and strings
- RAND
- n-dimensional arrays
- Arrays with size determined by runtime-evaluated expressions
- Arrays with generic size
- in function arguments
- in function return types
- in class fields
- behind pointers
- Enums
- Records
- Pointers
- Infinite pointer types
- Recursive types
- Sets
- Set operations
- Integer range type (1..10, 200..250)
- Sound type system
- Type checking is partly done at compile time (class inheritance, type size check) and partly at runtime (everything else).
- Classes
- Public/private class members
- Inheritance
- SUPER in classes
- OPENFILE READFILE WRITEFILE CLOSEFILE statements
- READ WRITE APPEND file modes
- SEEK GETRECORD PUTRECORD statements, RANDOM file mode
- File GUI
- EOF() function
- Passing by value/reference for all variable types
- Shortened forms (for variable declaration and function arguments)
- Robust, hundreds of error messages
- Typo checking
- Error ranges (underline the exact cause of the error, highlight the area around it)
- Configurable
- Allows any words as identifiers (except pseudocode keywords), including
for
,__proto__
, andhasOwnProperty
- Minimalistic
- Create, view, edit, delete, upload, and download files
- All features accessible with only the keyboard
For a full list of features, see features.md
For some discussion of advanced language features, see notes.md