Skip to content

Instantly share code, notes, and snippets.

View jyn514's full-sized avatar

jyn jyn514

View GitHub Profile
Exception in thread "main" java.lang.IllegalArgumentException: Multiple methods in multimethod 'simple-dispatch' match dispatch value: class babashka.process.Process -> interface clojure.lang.IPersistentMap and interface clojure.lang.IDeref, and neither is preferred
at clojure.lang.MultiFn.findAndCacheBestMethod(MultiFn.java:179)
at clojure.lang.MultiFn.getMethod(MultiFn.java:150)
at clojure.lang.MultiFn.getFn(MultiFn.java:154)
at clojure.lang.MultiFn.invoke(MultiFn.java:229)
at clojure.pprint$write_out.invokeStatic(pprint_base.clj:194)
at clojure.pprint$pprint_map$fn__11193$fn__11195.invoke(dispatch.clj:113)
at clojure.pprint$pprint_map$fn__11193.invoke(dispatch.clj:113)
at clojure.pprint$pprint_map.invokeStatic(dispatch.clj:112)
at clojure.pprint$pprint_map.invoke(dispatch.clj:106)
@jyn514
jyn514 / backtrace.txt
Created July 30, 2025 14:36
hiccup + SCI + clojure + graal syntax error
Exception in thread "main" clojure.lang.ExceptionInfo: Syntax error compiling fn* at (0:0). {:type :sci/error, :line 1, :column 1, :message "Syntax error compiling fn* at (0:0).", :sci.impl/callstack #object[clojure.lang.Volatile 0x71bca854 {:status :ready, :val ({:ns #object[sci.lang.Namespace 0x373a6109 "user"], :file nil, :sci.impl/f-meta nil} {:ns #object[sci.lang.Namespace 0x373a6109 "user"], :file nil, :sci.impl/f-meta nil} {:ns #object[sci.lang.Namespace 0x373a6109 "user"], :file nil, :sci.impl/f-meta {:name eval, :doc "Evaluates the form data structure (not text!) and returns the result.", :arglists ([form]), :sci/built-in true, :ns #object[sci.lang.Namespace 0x1562e300 "clojure.core"]}} {:line 1, :column 1, :ns #object[sci.lang.Namespace 0x373a6109 "user"], :file nil} {:line 1, :column 1, :ns #object[sci.lang.Namespace 0x373a6109 "user"], :file nil, :sci.impl/f-meta {:ns #object[sci.lang.Namespace 0x32eff675 "hiccup2.core"], :name html, :macro true, :doc "Render Clojure data structures to a compiled
@jyn514
jyn514 / const-if.md
Last active December 23, 2024 01:49
`const if`: type-checked conditional compliation for rust
@jyn514
jyn514 / unicode.diff
Last active September 27, 2024 01:47
input arbitrary unicode characters using right-alt + hex codes
diff --git a/src/config.c b/src/config.c
index de3be1c..d482e7c 100644
--- a/src/config.c
+++ b/src/config.c
@@ -17,6 +17,7 @@
#include <unistd.h>
#include <libgen.h>
+#include "config.h"
#include "keyd.h"
rustc src/main.rs -Ztreat-err-as-bug=3
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `borrowck_returned_lifetime_short`:
the fluent string has an argument `category_desc` that was not found.
help: no arguments are available
the fluent string has an argument `free_region_name` that was not found.
help: no arguments are available
the fluent string has an argument `outlived_fr_name` that was not found.
help: no arguments are available
', compiler/rustc_errors/src/emitter.rs:2397:77
stack backtrace:
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 5bc4d164265..211d45e022e 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -1939,6 +1939,17 @@ fn make_compile_args(
// Use a single thread for efficiency and a deterministic error message order
rustc.arg("-Zthreads=1");
+ // Hide libstd sources from ui tests to make sure we generate the stderr
+ // output that users will see.
@jyn514
jyn514 / time-passes.txt
Last active May 24, 2023 22:34
MAGIC_EXTRA_RUSTFLAGS=-Ztime-passes x check rustc_middle
Checking stage0 compiler artifacts {rustc_middle} (x86_64-unknown-linux-gnu)
Checking rustc_middle v0.0.0 (/home/jyn/src/rust/compiler/rustc_middle)
time: 0.635; rss: 51MB -> 310MB ( +259MB) expand_crate
time: 0.635; rss: 51MB -> 310MB ( +259MB) macro_expand_crate
time: 0.018; rss: 310MB -> 310MB ( +0MB) AST_validation
time: 0.127; rss: 312MB -> 346MB ( +33MB) late_resolve_crate
time: 0.011; rss: 346MB -> 346MB ( +0MB) resolve_check_unused
time: 0.021; rss: 346MB -> 346MB ( +0MB) resolve_postprocess
time: 0.173; rss: 310MB -> 346MB ( +35MB) resolve_crate
time: 0.011; rss: 346MB -> 346MB ( +0MB) complete_gated_feature_checking
#!/usr/bin/env python3
import re
import sys
def sizeof_fmt(num, suffix="B"):
for unit in ["", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi"]:
if abs(num) < 1024.0:
return f"{num:3.1f}{unit}{suffix}"
num /= 1024.0
return f"{num:.1f}Yi{suffix}"
@jyn514
jyn514 / git redesign.md
Last active April 27, 2023 04:28
vague scribbles about how to make git easier to use

Git redesign

  • all repos start with a blank initial commit, no more "does not have any commits yet" errors

  • git commit foo should just work for new files, no more making people run git add first lol

  • no fucking perl scripts lmfao

    • better perf
    • git on windows is less horrifically cursed
#!/usr/bin/env bash
set -x
error() {
echo "$@" >&2
}
usage() {
error "usage: $0 <src> <dest>"