Skip to content

Version 2.0

Techcraft7 edited this page Dec 25, 2020 · 11 revisions

Version 2.0

Optimizations and Fixes

  • New interpreter, builds a node tree of the program before running. Takes longer to run initially, but will be faster in the long run for long programs. (The old system ran everything from tokens)
  • Backend is more object-oriented, most code is abstracted into classes for easy maintainability
  • Libraries are imported while building the tree instead of when the import statement is reached in the code.
  • Way easier/faster to add more syntax! (So faster updates!)
  • Attribute based JSON docs
  • Enum-based expression types. Adding an expression type is just adding an enum field, and another case in two switch statements, and then the node class itself. See ExpressionType.cs and the _7Sharp.Interpreter.Nodes namespace for examples.

Manual

A built in system for viewing quick and simple docs on functions and more!

man command

Use man list for a list of topics Use man <topic> to view the topic page. All docs are based off JSON code in attributes in the code!

Shell plugins

See the "Creating a Shell Plugin" page to learn more!

Array Syntax

Warning: len([1,2,3]) will not work, due to the inability to customize the expression evaluator for custom array syntax

In other words, arrays cannot be directly used in functions, you must set a variable first!

Example!

array = [1,2,3];
loop (len(array)) {
    write(array[getLoopIndex()]);
}

Output:

1
2
3

New functions!

  • Trig functions (sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), atan2(x, y))
  • Degrees <--> Radians (deg2rad(x), rad2deg(x))
  • resetColor() reset console colors
Clone this wiki locally