Skip to content

Instantly share code, notes, and snippets.

Researching and Lecturing

Stefan Marr smarr

Researching and Lecturing
Block or report user

Report or block smarr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
smarr / fib.S
Created Nov 6, 2019
8-bit implementation of a recursive fibonacci
View fib.S
; Fibonacci
; executable with
; Result is in register A
JMP .start
; fib(n) <- n is in register A
CMP A, 1 ; compare n to a
JE .fibReturnOne
JB .fibReturnZero
smarr / somns-trace.tcl
Created Aug 12, 2019
SOMns Trace file Binary Template for Hex Fiend
View somns-trace.tcl
## Binary Template for Hex Fiend
## This gives a very basic way to navigate through a trace file
set event_types [dict create \
smarr / SOM.g4
Last active May 20, 2019
A Grammar for SOM
View SOM.g4
grammar SOM;
/* Not maintained here, but complete and accepts all SOM code in the core-lib and are-we-fast-yet benchmarks. */
/* This parser accepts valid programs adhering to the following grammar. Comments
and white space are not dealt with in the grammar. Names of non-terminals begin
with a lower-case letter; terminals, with an upper-case one. */
Identifier Equal superclass
smarr /
Last active Sep 2, 2018
Optimization issues with latest Graak
git clone
cd SOMns
ant compile -Dskip.graal=true
./debug -i -vv -t1 -EG core-lib/Benchmarks/AsyncHarness.ns Savina.TrapezoidalApproximation 25 0 100:1000000:1:5
smarr /
Last active Apr 3, 2018
Specializations, Types, and subsumption

Truffle Specializations do not automatically have exclusive semantics. Instead, the rules of the Java type system apply.

Let's take the following node with three specializations as example. Note, I return an int here, usually you'd return a boolean, but the int allows me to get the point across more precisely in the later tests.

@NodeChild(value = "e", type = ExprNode.class)
public abstract class IsNumberNode extends Node {
smarr / Race-in-object-model.patch
Created Mar 25, 2018
Debugging helpers code for race conditions in object model
View Race-in-object-model.patch
From 0d1d5b9ebf01d65ecffc93c8425528be9e6d8e64 Mon Sep 17 00:00:00 2001
From: Stefan Marr <>
Date: Sat, 24 Mar 2018 16:24:23 +0000
Subject: [PATCH] Race condition in object model, further debugging needed
This debugging code helps debugging a race condition in the object model.
This seems to be observable rather reliably with accesses to cached class fields.
Specifically, we can see that in Parser.ns, we read the slot `R`, and retrieve an `A class` instead of `R class` rather reliably.
smarr /
Created Mar 15, 2018
Reduce Eclipse Release for to Code Formatting
# Manually remove the product setting from configuration/config.ini
echo Manually remove the product setting from configuration/config.ini
# delete sources jars and other things
find ../eclipse -name "*.source*.jar" -delete
find ../eclipse -name "*.html" -delete
find ../eclipse -name "*.bmp" -delete
rm ../eclipse/icon.xpm
smarr / Makefile
Created Feb 15, 2018
Example Latex-MK
View Makefile
# This Makefile relies on LaTeX-Mk
# See:
KNITR=$(wildcard sections/*.Rnw)
KNITR_TEX=$(patsubst sections/%.Rnw,gen/%.tex,$(KNITR))
TEXSRCS=$(NAME).tex $(wildcard scripts/*.tex) $(wildcard sections/*.tex) $(KNITR_TEX)
smarr / MixinTests.ns
Created Dec 10, 2017
Mixin Issue Newspeak
View MixinTests.ns
class MyModule platform: platform = (
| private Transcript = platform squeak Transcript. |
) (
public class A new = () (
public mixinA = ( ^ #Amixin )
public class B new = () (
public mixinB = ( ^ #Bmixin )
View build.log
Build Script:
Topaz|STD:Build Topaz
Topaz|STD:~/builds/5be4c5b4/0/stefan.marr/awfy-runs/awfy/implementations ~/builds/5be4c5b4/0/stefan.marr/awfy-runs/awfy/implementations
Topaz|STD:Load ./Topaz
Topaz|STD:Synchronizing submodule url for 'Topaz'
Topaz|STD:~/builds/5be4c5b4/0/stefan.marr/awfy-runs/awfy/implementations/Topaz ~/builds/5be4c5b4/0/stefan.marr/awfy-runs/awfy/implementations ~/builds/5be4c5b4/0/stefan.marr/awfy-runs/awfy/implementations
Topaz|STD:Collecting invoke
Topaz|STD: Downloading invoke-0.21.0-py2-none-any.whl (154kB)
Topaz|STD:Installing collected packages: invoke
You can’t perform that action at this time.