Skip to content

Instantly share code, notes, and snippets.

View smarr's full-sized avatar
👨‍🏫
Researching and Lecturing

Stefan Marr smarr

👨‍🏫
Researching and Lecturing
View GitHub Profile
@smarr
smarr / 01-run.sh
Last active September 2, 2018 21:50
Optimization issues with latest Graak
git clone https://github.com/smarr/SOMns.git
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
smarr / note.md
Last active April 3, 2018 08:09
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
smarr / Race-in-object-model.patch
Created March 25, 2018 11:01
Debugging helpers code for race conditions in object model
From 0d1d5b9ebf01d65ecffc93c8425528be9e6d8e64 Mon Sep 17 00:00:00 2001
From: Stefan Marr <git@stefan-marr.de>
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
smarr / reduce.sh
Created March 15, 2018 16:54
Reduce Eclipse Release for to Code Formatting
#!/bin/bash
# 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
smarr / Makefile
Created February 15, 2018 13:49
Example Latex-MK
# This Makefile relies on LaTeX-Mk
# See: http://latex-mk.sourceforge.net/
NAME=paper
KNITR=$(wildcard sections/*.Rnw)
KNITR_TEX=$(KNITR:.Rnw=.tex)
KNITR_TEX=$(patsubst sections/%.Rnw,gen/%.tex,$(KNITR))
TEXSRCS=$(NAME).tex $(wildcard scripts/*.tex) $(wildcard sections/*.tex) $(KNITR_TEX)
USE_PDFLATEX=true
@smarr
smarr / MixinTests.ns
Created December 10, 2017 22:16
Mixin Issue Newspeak
class MyModule platform: platform = (
| private Transcript = platform squeak Transcript. |
) (
public class A new = () (
public mixinA = ( ^ #Amixin )
)
public class B new = () (
public mixinB = ( ^ #Bmixin )
)
@smarr
smarr / build.log
Last active November 7, 2017 08:31
Build Script: https://github.com/smarr/are-we-fast-yet/blob/master/implementations/build-topaz.sh
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
@smarr
smarr / NewspeakMain.diff
Created July 28, 2017 14:49
Newspeak Parser Incompatibilities
diff -r 38a47c705f1a Collections.ns
--- a/Collections.ns Tue Jul 11 19:25:43 2017 -0700
+++ b/Collections.ns Fri Jul 28 16:48:38 2017 +0200
@@ -49,7 +49,7 @@
binarySearchFor: el <EL>
between: start <Integer>
and: end <Integer>
-toCompare: compare <[:EL def:EL| Boolean]>
+toCompare: compare <[:EL def :EL| Boolean]>
^<Int>
@smarr
smarr / download-missing-bibentries.py
Last active May 13, 2017 13:55
Download missing bib entries from Bibsonomy
#!/usr/bin/python3
import re
import requests
bibkey_re = re.compile("Warning--I didn't find a database entry for \"(.*?)\"")
with open("paper.blg") as f:
content = f.readlines()
for line in content:
m = bibkey_re.match(line)
@smarr
smarr / SOMns-tmLanguage.plist
Last active December 21, 2016 15:12
SOMns Syntax Highlighting as TextMate Grammar
{ patterns = ( { include = '#module'; } );
repository = {
accessModifier = {
match = '\b(public|private|protected)\b';
captures = { 1 = { name = 'keyword.modifier.som'; }; };
};
assignmentOperator = {
name = 'keyword.operator.assignment.som';
match = '(?<!:):=';
};