Output console

Help / Information

This slope console/interpreter is a port of the main Slope interpreter, which is implemented in the Go programming lanuage and is geared more toward CLI tools/programming, with very few web focused features. The goal of porting to JavaScript is to allow more graphical programming, games, and interactive programming that can be distributed easily to non-developers.

The console here is a proof of concept for using the interpreter code (and a way to debug it comfortably). In general, the interpreter is meant to be embedded into other applications. While using this console, it may be helpful to look at the procedure reference on the slope website. Not all procedures referenced in that reference have been implemented and some have slight differences in how they work, but it is the best way to learn for the moment.

To see a list of procedures available to the console, including so-called special forms, run (usage).

Online Interpreter Shortcuts

Shift+Enter
Submit all code in the input box to the interpreter for execution. The interpreter instance is ongoing, so if you define something and submit it, then submit again with changes (but without deleting the define statement) an error will result, because the item has already been defined. You may want to clear the input area after each submit.
Shift+Backspace
Clear the input console.
Escape
Close the help dialog (or other dialog windows for the console).

Differences From Slope

  1. Most things dealing with list or assoc types now make changes to the underlying objject rather than returning a clone
  2. Due to the above things like (equal? [1 2] [1 2]) will return #f. This is because they point to different memory and it was deemed too heavy in a web browser to deep copy all objects when they are used
  3. assoc is implemented as a JavaScript object under the hood (this may end up getting backported to the Go version, where a map would be used)
  4. There is now a short-hand to declare assoc type literals: {"key1" "value1" "key2" 22}
  5. At time of writing macros, symbols, and quoting are not available (but are planned to be in the future, they were skipped to simplify implementation). Namespaces are also not available (and likely will not be)

  6. There are some added procedures that exist solely for this version of slope (but are a part of the core interpreter). There is also lib code that will be unique to this version that gets written for any embedded use cases of the interpreter (for example, things to target an HTML canvas, or other similar use cases)