https://github.com/linqlover/simulationstudio
A growing suite of applications and tools using code simulation in Squeak/Smalltalk
https://github.com/linqlover/simulationstudio
code-simulation interpreter isolation meta-interpreter sandbox simulation smalltalk squeak
Last synced: 18 days ago
JSON representation
A growing suite of applications and tools using code simulation in Squeak/Smalltalk
- Host: GitHub
- URL: https://github.com/linqlover/simulationstudio
- Owner: LinqLover
- Created: 2021-03-05T18:15:50.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-01-03T03:53:32.000Z (4 months ago)
- Last Synced: 2025-02-11T12:19:34.781Z (2 months ago)
- Topics: code-simulation, interpreter, isolation, meta-interpreter, sandbox, simulation, smalltalk, squeak
- Language: Smalltalk
- Homepage:
- Size: 538 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SimulationStudio
[](https://github.com/LinqLover/SimulationStudio/actions/workflows/main.yml)
[](https://coveralls.io/github/LinqLover/SimulationStudio)A growing suite of applications and tools using code simulation in [Squeak/Smalltalk](https://squeak.org).
Code simulation is a technique in Squeak that reproduces the original VM interpreter for Smalltalk in the userland (i.e., implements it in itself), making the exploration and manipulation of its implementation much more immediate and enjoyable.
The foundation of this project is to extend the default code simulator with the ability to *control* and *modify* the execution.
For instance, we can disallow certain instructions, implement virtualization features by redirecting memory accesses, or trace the entire execution of a program (similar to bytecode instrumentation).
As one example, SimulationStudio implements a sandbox that can safely execute any code isolated from the remaining VM image.
On top of the sandbox, this repository also provides several tools that use *speculative code execution* to offer new ways for exploring objects and classes based on their behavior.For usage instructions, see the [installation](#installation) section below.
## Included packages
### `SimulationStudio-Base`
Provides abstract functionality for simulating stack frames by subclassing `SimulationContext` or `Simulator`.
### `SimulationStudio-Sandbox`
Execute Smalltalk code in an isolated environment without applying any side effects to the image.
```smalltalk
array := {1. 2. 3}.Sandbox evaluate:
[array at: 1 put: 10.
array first]. "10"array first. "1"
```### `SimulationStudio-Support`:
Contains several simulation goodies and examples:
- the `BenchmarkSimulator` for hardware-independent benchmark creation
- the `CoverageSimulator` for bytecode-precise code coverage analysis
- the `LimitSimulator` for hardware-independent calculation timeouts### `SimulationStudio-Tools`
Contains some programming tools that are implementation using simulation:
- the `SimulationMethodFinder` which searches for all methods that convert a given set of inputs into a given output by speculatively executing all methods ([screenshots](https://github.com/LinqLover/SimulationStudio/pull/61#issue-1379779606))
[](https://github.com/LinqLover/SimulationStudio/pull/61#issue-1379779606)- the `SimulationProtocolExplorer` which inspects an object and its protocol together with a speculatively evaluated preview of each message ([screenshots](https://github.com/LinqLover/SimulationStudio/pull/39#issue-1090737789))
[](https://github.com/LinqLover/SimulationStudio/pull/39#issue-1090737789)
- the `CoverageSimulator` also offers a GUI for browsing the branch coverage of methods:
[![`CoverageSimulator browseFor: [HtmlReadWriterTest suite debug] inClasses: {HtmlReadWriter. String. Text}`](https://user-images.githubusercontent.com/38782922/239919032-1145f08b-5f8f-47f2-8c81-ee470a7d01a0.png)](https://github.com/LinqLover/SimulationStudio/commit/6bcd9c070145609ff779ae251f16a2adce2c1282#commitcomment-114429989)
### `SimulationStudio-Tracing` (experimental)
Record and browse fine-granular stack traces. Integrates the [MessageSendRecorder](https://github.com/hpi-swa/MessageSendRecorder).
---
Check out the relevant classes for more details and usage instructions!
For more technical details, also read these announcement threads on the squeak-dev mailing list:
- [[ANN] SimulationStudio and sandboxed execution for Squeak](http://forum.world.st/ANN-SimulationStudio-and-sandboxed-execution-for-Squeak-td5127804.html)
- [News from SimulationStudio](http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-November/216964.html)
- [[ANN] News from SimulationStudio: Method Finder 2](https://lists.squeakfoundation.org/pipermail/squeak-dev/2022-September/222244.html)There is also a slide deck about the Sandbox and the Simulation Method Finder (German, translation will be provided upon request):
**[Finden statt Suchen: Der Method-Finder wird abgesichert](https://linqlover.github.io/LinqLover/slides/SqueakEv22%20MethodFinder2-de.pdf) (Don't Search, Find: Securing the MethodFinder). On [*Squeak Meeting 2022*](https://squeak.de/news/2022/10/21/squeak_treffen/), November 19, 2022. Squeak e.V., Potsdam, Germany.**## Installation
### ... as a precompiled bundle *(recommended for most visitors)*
Download the archived bundle from the [latest release](https://github.com/LinqLover/SimulationStudio/releases/tag/squeak61alpha-20230328-0018) and follow the instructions to open it. In the image, you will find further usage examples. Using the bundle is also the recommended way to browse the sources of the project.
### ... using [Metacello](https://github.com/Metacello/metacello)
For the [latest Squeak Trunk](https://files.squeak.org/trunk/):
```smalltalk
Metacello new
baseline: 'SimulationStudio';
githubUser: 'LinqLover' project: 'SimulationStudio' path: 'packages';
get;
load.
```LTS (long-time support) version for an [older Squeak release](https://squeak.org/downloads/#:~:text=History):
```smalltalk
Metacello new
baseline: 'SimulationStudio';
githubUser: 'LinqLover' project: 'SimulationStudio' commitish: 'squeak60' path: 'packages';
get;
load.
```- Currently supported LTS versions are: `squeak60`
To load a specific package, change the last line, e.g., `load: 'SimulationStudio-Base'`. See the [Metacello docs](https://github.com/Metacello/metacello/blob/master/docs/MetacelloScriptingAPI.md#load-options) for more options.
### ... as a dependency in your [Metacello baseline](https://github.com/dalehenrich/metacello-work/blob/master/docs/GettingStartedWithGitHub.md#create-baseline)
For the [latest Squeak Trunk](https://files.squeak.org/trunk/):
```smalltalk
spec baseline: 'SimulationStudio' with: [
spec
repository: 'github://LinqLover/SimulationStudio/packages';
loads: 'SimulationStudio-Sandbox'].
```LTS (long-time support) version for an [older Squeak release](https://squeak.org/downloads/#:~:text=History):
```smalltalk
spec baseline: 'SimulationStudio' with: [
spec
repository: 'github://LinqLover/SimulationStudio:squeak60/packages';
loads: 'SimulationStudio-Sandbox'].
```- Currently supported LTS versions are: `squeak60`
Depending on your needs, specify any other package(s) via `loads:`. See the [Metacello docs](https://github.com/Metacello/metacello/blob/master/docs/APIReference.md) for more options.
### ... using [Squot](https://github.com/hpi-swa/Squot)
Open a git browser, clone the repository, and check out the latest commit from the default branch or any LTS branch.
[Learn more](https://github.com/hpi-swa/Squot#getting-started-with-an-existing-remote-project) about using the git browser.## Users of SimulationStudio
As of today, the following projects make use of SimulationStudio:
- [TelegramSmalltalkBot](https://github.com/LinqLover/TelegramSmalltalkBot)
- [TraceDebugger](https://github.com/hpi-swa-lab/squeak-tracedebugger)
- [Sandblocks](https://github.com/hpi-swa/sandblocks)## Contribution and bug reports
... are very welcome! Please feel free to submit bug reports, discuss design changes, or propose new extensions!