news
Programming Leftovers
-
Anton Zhiyanov ☛ Porting Go's strings package to C
Creating a subset of Go that translates to C was never my end goal. I liked writing C code with Go, but without the standard library it felt pretty limited. So, the next logical step was to port Go's stdlib to C.
-
Rlang ☛ You can just build your own programming language
-
Robert Smith ☛ Idiomatic Lisp and the nbody benchmark
Now, there’s plenty of evidence online that Common Lisp has reasonably good compilers that produce reasonably good machine code, and so the question became more nuanced: Can Lisp be realistically competitive with C without ending up being a mess of unidiomatic code?
-
Python
-
Sean McPherson ☛ Python Reference
Category
-
Python Speed ☛ Timesliced reservoir sampling: a new(?) algorithm for profilers
Depending on what information you need, choosing a random sample of the stream will give you almost as good information as storing all the data. For example, consider a performance profiler, used to find which parts of your running code are slowest. Many profilers records a program’s callstack every few microseconds, resulting a stream of unlimited size: you don’t know how long the program will run. For this use case, a random sample of callstacks, say 2000 of them, can usually give you sufficient information to do performance optimization.
Why does this work?
-
-
Shell/Bash/Zsh/Ksh
-
[Old] Eric Bower ☛ zmx - session persistence for terminal processes: attach/detach functionality without tmux
Well, after using shpool for a couple of months, there were enough issues with it that I decided to try and build my own session persistence tool. I knew that libghostty was coming and that I could potentially integrate with it. So after reading that post I decided it was time to create my first project in Zig.
After a couple of months of R&D I finally reached a place with this project where I'm using it as a full-time replacement for what I would normally use tmux for: session persistence of terminal processes.
-
-
Java/Golang
-
Redowan Delowar ☛ What's the ideal dispatch mechanism?
A switch is fine as a starting point, and I’d start there. Once you hit 10-20 formats, it becomes a long, central piece of code that you keep touching every time a new format shows up. But I still wouldn’t change anything if maintaining a bunch of case arms isn’t actually causing problems.
-
-
Rust
-
Orhun Parmaksız ☛ 800 Rust terminal projects in 3 years
I have discovered and shared ~800 open source Rust CLI projects over the past 3 years.
-