Toski is a prototype new debugging tool for Scheme.
It's a native Mac editor for Scheme: simply launch the app, write Scheme code, and run it.
Toski has a special debugging feature called preview execution. You can "preview" what the result of a section of code will be, without actually running it.
”Debugging is twice as hard as writing the code in the first place.”
-Brian W. Kernighan, 1978
In 2019, debugging still feels twice as hard. Toski introduces a new debugging technique called preview execution.
When reading or debugging code, you should be able to see what the code will do if you run it, without having to run it. That is, you should be able to see a preview of what part of your code might do.
With Toski, previewing your code is as easy as selecting a region of code.
Where Preview Execution is Useful
While Scheme as strong support for functional programming, state and mutation both exist and are common in Scheme programs.
Preview Execution is important in code that involves state or mutation of any kind. You might want to see what the result of a snippet of code is, without changing the state of the entire instance.
In Toski, if you highlight a section of code, it displays the output of the selected region. However, when you de-select that section, the Scheme instance is in the same state as it was before code was highlighted, even if the highlighted code involves state change.
How Preview Execution Works
Under the hood, preview execution works by using Scheme environments.
When code is highlighted, Toski duplicates the current environment and executes the code. Then, when the cursor is moved or the code is de-selected, Toski removes the new environment, returning the instance to the previous state.
Download latest version for macOS
This project is open source! You can check it out, fork it, or submit pull requests on the Toski GitHub Page.
Whay is Emacs called "Emacs"?. The Emacs editor was developed down the street from the Ice Cream store "Emack & Bolio's." And yet "Emack" was not the founder of the ice cream store.
Toski was developed down the street from the ice cream store "Toscanini's." And yet none of the founders were named Toscanini.
A cocky novice once said to Stallman: “I can guess why the editor is called Emacs, but why is the justifier called Bolio?” Stallman replied forcefully, “Names are but names, ‘Emack & Bolio’s’ is the name of a popular ice cream shop in Boston-town. Neither of these men had anything to do with the software.”
His question answered, yet unanswered, the novice turned to go, but Stallman called to him, “Neither Emack nor Bolio had anything to do with the ice cream shop, either.”
This project was originally a final project for Professor Sussman's class, 6.945 Large Scale Symbolic Systems (also known as Adventures in Advanced Symbolic Programming) during the Spring 2017 term.
This was a collaboration between Blake Elias, Jared Pochtar, and myself.
We wrote a report called Debugging, Better which describes the original motivation and implementation during the semester. At the time, we called the editor "Schemer." But it turns out everyone and their uncle who works with Scheme makes a project that they call "Schemer."