This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Common Protocol | |
(defprotocol IMutatingEntity | |
(eset! [this v e])) | |
;; Single entity object, tp is purely for debugging | |
(deftype Entity [tp mappings uuid state persister-fn] | |
ILookup | |
(-val-at [this k] (dget uuid state (k mappings))) | |
IMutatingEntity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Code: | |
(ns vararg-bench.core | |
(:require [criterium.core :refer [quick-bench]]) | |
(:gen-class)) | |
(defn varargs [arg1 & [arg2 arg3]] | |
42) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defexpr $when [test & body] | |
(if (eval test) | |
(eval (cons 'do body)) | |
nil)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def swap(ref, f, *args): | |
with atomic: | |
ref.val = f(ref.val, *args) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simplistic explination of Transducers: | |
# Map can be defined thusly: | |
def map(f, coll): | |
result = [] | |
for v in coll: | |
append(result, f(v)) | |
return result | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Delay(object): | |
def __init__(self, f): | |
self._f = f | |
self._evaled = False | |
self._val = None | |
def deref(self): | |
if self._evaled == False: | |
self._val = f() | |
self._f = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2132: i176 = getfield_raw_pure(i126, descr=<FieldS CIF_DESCRIPTION.exchange_size 64>) | |
+2143: guard_value(i176, 24, descr=<Guard0x105a86250>) [p0, i176, p1, p3, p4, i7, p12, p22, p25, p27, p31, p35, None, i165] | |
+2153: p177 = getfield_gc(ConstPtr(ptr77), descr=<FieldP pixie.vm.libs.ffi.FFIFn.inst__arg_types 8>) | |
+2166: i178 = arraylen_gc(p177, descr=<ArrayP 8>) | |
+2170: i179 = int_ge(0, i178) | |
guard_false(i179, descr=<Guard0x105a861e0>) [p0, p177, p1, p3, p4, i7, p12, p22, p25, p27, p31, p35, None, i165] | |
+2180: p180 = getarrayitem_gc(p177, 0, descr=<ArrayP 8>) | |
+2184: i181 = int_add(i126, 88) | |
+2188: i182 = getarrayitem_raw_pure(i181, 0, descr=<ArrayS 8>) | |
+2191: guard_value(i182, 16, descr=<Guard0x105a86170>) [p0, i182, p177, p180, p1, p3, p4, i7, p12, p22, p25, p27, p31, p35, None, i165] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defnmatch count | |
([x] | |
(count 0 x)) | |
([i [h & tail]] | |
(count (inc i) tail)) | |
([i nil] | |
i)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[p0, p1, p2] | |
p3 = getfield_gc(p0, descr=FieldDescr(<GcStruct pixie.vm.ast.Locals { super, vable_token, inst__names, inst__vals }>, 'inst__vals')) | |
p5 = getarrayitem_gc(p3, 0, descr=ArrayDescr(<GcArray of * GcStruct object { typeptr } >)) | |
p7 = getarrayitem_gc(p3, 1, descr=ArrayDescr(<GcArray of * GcStruct object { typeptr } >)) | |
p8 = getfield_gc(p0, descr=FieldDescr(<GcStruct pixie.vm.ast.Locals { super, vable_token, inst__names, inst__vals }>, 'inst__names')) | |
p10 = getarrayitem_gc(p8, 0, descr=ArrayDescr(<GcArray of * GcStruct object { typeptr } >)) | |
p12 = getarrayitem_gc(p8, 1, descr=ArrayDescr(<GcArray of * GcStruct object { typeptr } >)) | |
label(p0, p1, p2, p5, p7, p10, p12, descr=TargetToken(4912768184)) | |
debug_merge_point(0, 0, '<If object at 0x121f7b980>') | |
guard_class(p1, <AddressAsInt * struct pixie.vm.ast.SyntaxThunk_vtable { super=... }>, descr=<Guard0x124d2e448>) [p2, p1, p5, p7, p10, p12, p0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[translation:info] Error: | |
[translation:info] File "/Users/tim/oss-not-dropbox/externals/pypy/rpython/translator/goal/translate.py", line 316, in main | |
[translation:info] drv.proceed(goals) | |
[translation:info] File "/Users/tim/oss-not-dropbox/externals/pypy/rpython/translator/driver.py", line 539, in proceed | |
[translation:info] return self._execute(goals, task_skip = self._maybe_skip()) | |
[translation:info] File "/Users/tim/oss-not-dropbox/externals/pypy/rpython/translator/tool/taskengine.py", line 114, in _execute | |
[translation:info] res = self._do(goal, taskcallable, *args, **kwds) | |
[translation:info] File "/Users/tim/oss-not-dropbox/externals/pypy/rpython/translator/driver.py", line 276, in _do | |
[translation:info] res = func() | |
[translation:info] File "/Users/tim/oss-not-dropbox/externals/pypy/rpython/translator/driver.py", line 359, in task_pyjitpl_lltype |