Skip to content

SCSA Pseudocode v0.3

Choose a tag to compare

@SaintNong SaintNong released this 16 Jan 18:40
· 30 commits to main since this release
342da2c

New Language features

We aren't far from having almost all features implemented now, yay!

All New Standard Library!

Functions

  • I/O Functions
    • PRINT(...args): Now supporting any number of arguments, delimits with space.
    • OUTPUT(...args): Alternative to PRINT without trailing newline.
    • INPUT(prompt): Reads a line of input from the user with prompt.
  • Type conversion/utility functions
    • INT(value): Converts a value to an integer.
    • FLOAT(value): Converts a value to a float.
    • STRING(value): Converts a value to its string representation.
    • BOOL(value): Converts a value to a boolean.
    • TYPE(value): Returns the type of a given value as a string.
  • Utility
    • RANDOM(min, max): Returns a random integer between min and max.
    • TIME(): Returns current system time as a floating point, in seconds since epoch.

Strings and Arrays

  • Strings
    • string[i] Indexes into a string
    • string.length Returns the length of a string
    • string.slice(a, b) Returns the substring from index a to b (inclusive)
    • Strings are now iterable in FOR-IN loops
  • Arrays
    • array[i] Indexes into an array
    • array.slice(a, b) Returns a shallow copy from index a to b (inclusive)
    • array.append(x) Appends value to the end of the array
    • array.length Returns length of the array as an integer

The above were implemented using Native functions, since it's now very easy to implement new native functions.

Other changes

Support for Multi-Line statements in REPL

  • You can now type out long FUNCTION and CLASS declarations in REPL!

NOT keyword and != Operator

  • These work about as you would expect from any programming language.

Support for NO_COLOR

  • NO_COLOR environment variable is now supported in case you don't have a terminal with ANSI colours.

Integration Test Suite

  • Over 100 integration tests covering every error, and all features
  • Integrated into CMake for CI/CD, (Meaning it works on Windows!)

Pull Request Log

Full Changelog: v0.2...v0.3