What was the last program that you wrote that wasn’t a game, or a utility or a tool, but just a toy – a little (or large) program that you wrote to play with something, either a language or a framework or a library, or anything?
I wrote an IRC bot in Go (nearly a year ago… Time flies) that would randomly respond to people saying “bitcoin” in the channel with “More like buttcoin, am I rite?!”
It has since evolved to do other stupid shit for no reason other than me finding it somewhat funny in the context of the channel. Oh… And it previews links, because why not…
Well, it’s mostly tailored to the ##crustaceans channel on Freenode. Source code here if you want to do anything to it: https://github.com/Brekkjern/buttsbot
If this happens fast enough, and the boxes are thin and long enough, it’ll look like the white space between the boxes is what’s moving. Can you picture in your head that animation? Will it be like a white bubble smoothly moving right, or a flickering jump, or what?
I don’t have a mental model for what it would look like, so I taught myself p5.js and animated it. It looks like a very wobbly line.
Man, this makes me feel sad. I haven’t had time to do anything “fun” in so long. I’m sad because this last week in Texas I had plenty of free time, but, you know…no electricity.
I suppose the last “toy” program I wrote was an operator-precedence parser in Rust, just to get a feel for the language. Of course, that evolved into the parsing component for my regex engine in Rust, so…now it’s not a toy anymore.
Hang in there. Ride and react to your high energy and low energy modes. Don’t beat yourself up in low energy states. Celebrate your successes by keeping a log of projects and notice how many completed ones you collect. This advice is aimed at the both of us. :)
And also recently modified the chrome dinosaur game to use a projector and webcam so that you play by physically jumping in front of a wall: https://github.com/veggiedefender/projectordino
I suppose (currently) rewriting last year’s Advent of Code counts. I originally solved it in Python and as I’m now working with Spring (Java) for the first time I’ve been using this. Less focus on the problems (only translating the easy ones) but more on the runner framework (old one: python day01.py 1, new one: curl http://localhost/day/1 and /perf/1/10000 to measure algorithm speed)
I am recurrently trying to build a minimalist LISP. I use it as a platform to try a few things like continuation-passing style, GC vs ARC, async vs MT, etc. It’s also a place of my own where I can be as anal about the code as I want to, some kind of engineering-oriented mental bachelor pad.
Usually my exploratory code doesn’t last long. I’ve got a folder of scratch Janet programs on my main laptop that’s currently collecting dust. I’ll often take C# code for a spin in LinqPad when I want to learn a new API.
PISC, overall, was kinda a toy. I built it to learn and play with stack parsing, and to see if I could make something interesting/useful.
A lot of my work of late, however, has been tools or utilities for myself, on one level or another. A kinda cool one (that I don’t have in the open yet), was called rgsets, written in Janet. What it’d do is take two ripgrep search strings, run them in parallel, only listing the files that hit those searches, and then do union/except/intersect on the resulting file lists, to see if two concepts appeared in the same file. It ended up not being super useful for what I was trying to understand, but it was a nifty idea, and a sweet spot for Janet’s event-loop+channel based async code.
I use Janet’s os/spawn a lot actually, it’s a really nifty tool for spinning up a lot of processes and then collecting the results into something useful.
Yesterday I came across Python’s Rich library again (probably here on Lobsters) and I’ve had my eye on it for a while. So I thought I’d try to use it from Common Lisp using the Py4CL bridge, which I had never used before either.
Py4CL appeared to be a pleasure to use and I ended up with this:
This surprised me, since if you use doubles, you have to convert two integers to doubles, do a division of 53-bit numbers (and some more stuff, but that’s not on the critical path), and convert the result back to an integer. This can’t possible be faster than a 32-bit division, can it?
And in my benchmarks, it isn’t. Using doubles is 2-5 times slower on my x86_64 machine. So I don’t know if Lemire is just wrong, or if it’s just the case on some particular machines or with a particular compiler or compiler options.
I wrote a raytracer in python, just for the heck of it. It’s not particularly fast or useful, I just wanted to see what type of performance I could get with some naive numpy code. I might try to speed it up at some point because it’s not as fast as I wanted it to be.
Similar to someone else in this thread, I’ve also got a toy IRC bot called Seabird with a bunch of inside jokes and random tools… it somehow evolved into a gRPC chat framework supporting Discord, IRC, and Minecraft with plugins which bridges channels (even across networks), show URL previews, add a bunch of usable commands, and includes a number of in-jokes.
I have a ton of toy projects though, that one is just the most developed.
Other projects:
go-gemini - a gemini server and client library. Currently working on porting my blog to also be served via gemini.
emacs-grayscale-theme - an experimental emacs theme with minimal colors (I’ve got a bunch of themes, but I’d consider this one mostly a toy)
Given an [i32; 2] point on a boxy spiral starting at [0, 0], I wanted to be able to: wind it to the next point on the spiral, unwind it to the preceding point on the spiral, get its index, and the position from an index. By printing out diagrams from under cargo watch, I was able to get instant feedback.
I somewhat swapped True and False in Python. Works worse than you might think sadly, due to True and False instances being stored in static locations and much of CPython checking truthiness by location.
I built a little CLI to convert Unix Epoch timestamps to RFC3339 format. Sure, there’s probably a tool for that already, but it was faster for me to write that little Golang glorified script than it was to search the man pages of however many programs that could potentially fill the role. It felt nice being able to write a program that I could easily define as “done”.
One toy project of mine involved games and came out of a game jam, but sweet-turnips was first and foremost an experiment in making a template for tiny games, something I and others could use to rapidly prototype games under very tight creative constraints. It was also an excuse to learn entity component systems and event-driven architecture hands-on.
I also slapped together a little weather report display for my Inky pHAT a couple days ago. Loved the process.
I tool that listens to udev USB events and executes actions when matching rules written in yaml. The rules allowed me to match on port, device, or event (connect/disconnect) or any combination of them.
To brush up on my Go skills I started writing a Chip8 implementation! Wound up writing an assembler too. It’s a super simple ISA and would be a great way to teach the basics of how processors work.
Two weeks ago I wrote a visual bloom filter, and this week I started on a duplicate file finder. My goal for the first is to keep up with the status of long running processes, the goal of the second is to improve my skills at using the transparent parallelism libraries in Haskell.
This past weekend I tried to hack up the QMK firmware for my moonlander keyboard to replace the NeoTrellis LED output for the visual bloom filter, but my C skills are weak, and I gave up after a solid two days of trying to figure out how to send RGB colors from the laptop to the keyboard.
I’m writing a toy AM synth. Quite fun and educational so far. I would eventually like to add an FM synth option as well, as I haven’t fully explored that concept yet. These have been bucket list items for quite a while.
I made a little toy script to make fzf descend directories when I pressed Ctrl-R, instead of automatically. It made me yearn for a real programming language:
When somebody types one of the dozen special words, like “plane” or “carrot” or “coffee”, with a few added conditions and if it hasn’t been typed chat-wide in the last few hours, then a high quality svg of the thing flies through the screen of all users in the room at the time.
Most recently was a Discord bot for my D&D group so we could play the Mistborn RPG (it has some weird dice mechanics and i didn’t want everyone to waste time in game handling them)
I wrote a raspberry pi router with a custom made captive portal, firewall rules to customize, tag and log traffic per user, and sign those logs using openssl. Ruby/Sinatra/Sequel/SQLite backend, JQuery/Bootstrap/Websocket frontend. I still go back to it from time to time to remember how to handle iptables, local dns, openssl, sinatra, sequel, etc.
A little menubar app (macOS) to quickly check word pronunciations via Forvo. Really helps me when studying a language and wondering about the rhythm or tone of a new word: https://github.com/martinrue/forvilo
I think it was playing around with Vulkan and GLFW, to see how well the Rust bindings held up. I stopped at getting a triangle on the screen, but it worked pretty well.
I wrote an IRC bot in Go (nearly a year ago… Time flies) that would randomly respond to people saying “bitcoin” in the channel with “More like buttcoin, am I rite?!”
It has since evolved to do other stupid shit for no reason other than me finding it somewhat funny in the context of the channel. Oh… And it previews links, because why not…
Bitcoin trolling sounds like a valid utility to me :)
Please make a Lobsters version /s
Well, it’s mostly tailored to the ##crustaceans channel on Freenode. Source code here if you want to do anything to it: https://github.com/Brekkjern/buttsbot
It’s an absolute mess, but(t) it’s there.
More like buttcoin, am I rite?!
Imagine you have a bunch of black boxes, each N pixels wide, like beads on an abacus:
You slide the first box into the open space, and then the second box, going all the way down:
If this happens fast enough, and the boxes are thin and long enough, it’ll look like the white space between the boxes is what’s moving. Can you picture in your head that animation? Will it be like a white bubble smoothly moving right, or a flickering jump, or what?
I don’t have a mental model for what it would look like, so I taught myself
p5.js
and animated it. It looks like a very wobbly line.(This was two days ago)
I love the instant gratification of p5.js coding, it’s addicting!
Man, this makes me feel sad. I haven’t had time to do anything “fun” in so long. I’m sad because this last week in Texas I had plenty of free time, but, you know…no electricity.
I suppose the last “toy” program I wrote was an operator-precedence parser in Rust, just to get a feel for the language. Of course, that evolved into the parsing component for my regex engine in Rust, so…now it’s not a toy anymore.
Seriously, I’m kinda sad now. All I do is work…
Hang in there. Ride and react to your high energy and low energy modes. Don’t beat yourself up in low energy states. Celebrate your successes by keeping a log of projects and notice how many completed ones you collect. This advice is aimed at the both of us. :)
I appreciate that, thank you.
This is wisdom. Life has seasons and acknowledging the more and less productive ones as equally valuable to your health is essential.
I wrote a script to let me type in morse code by opening and closing my laptop lid: https://github.com/veggiedefender/open-and-shut
And also recently modified the chrome dinosaur game to use a projector and webcam so that you play by physically jumping in front of a wall: https://github.com/veggiedefender/projectordino
For the dino game I also wrote a blog post about some of what I learned: https://blog.jse.li/posts/projectordino/
These are all absolutely phenomenal!
You’re hilarious. These are among the dumbest projects I’ve ever heard of. 10/10, following you on GitHub.
This is my kind of tech. Keep it up!
I suppose (currently) rewriting last year’s Advent of Code counts. I originally solved it in Python and as I’m now working with Spring (Java) for the first time I’ve been using this. Less focus on the problems (only translating the easy ones) but more on the runner framework (old one:
python day01.py 1
, new one:curl http://localhost/day/1
and/perf/1/10000
to measure algorithm speed)I am recurrently trying to build a minimalist LISP. I use it as a platform to try a few things like continuation-passing style, GC vs ARC, async vs MT, etc. It’s also a place of my own where I can be as anal about the code as I want to, some kind of engineering-oriented mental bachelor pad.
A Gemini server to play around with libtls. I started with LibreSSL’s version, then switched to libretls, a version for OpenSSL.
Usually my exploratory code doesn’t last long. I’ve got a folder of scratch Janet programs on my main laptop that’s currently collecting dust. I’ll often take C# code for a spin in LinqPad when I want to learn a new API.
PISC, overall, was kinda a toy. I built it to learn and play with stack parsing, and to see if I could make something interesting/useful.
A lot of my work of late, however, has been tools or utilities for myself, on one level or another. A kinda cool one (that I don’t have in the open yet), was called rgsets, written in Janet. What it’d do is take two ripgrep search strings, run them in parallel, only listing the files that hit those searches, and then do union/except/intersect on the resulting file lists, to see if two concepts appeared in the same file. It ended up not being super useful for what I was trying to understand, but it was a nifty idea, and a sweet spot for Janet’s event-loop+channel based async code.
I use Janet’s os/spawn a lot actually, it’s a really nifty tool for spinning up a lot of processes and then collecting the results into something useful.
Yesterday I came across Python’s Rich library again (probably here on Lobsters) and I’ve had my eye on it for a while. So I thought I’d try to use it from Common Lisp using the Py4CL bridge, which I had never used before either.
Py4CL appeared to be a pleasure to use and I ended up with this:
I wrote a program to test if division of doubles is actually faster then division of 32-bit integers as claimed on https://lemire.me/blog/2017/11/16/fast-exact-integer-divisions-using-floating-point-operations/
This surprised me, since if you use doubles, you have to convert two integers to doubles, do a division of 53-bit numbers (and some more stuff, but that’s not on the critical path), and convert the result back to an integer. This can’t possible be faster than a 32-bit division, can it?
And in my benchmarks, it isn’t. Using doubles is 2-5 times slower on my x86_64 machine. So I don’t know if Lemire is just wrong, or if it’s just the case on some particular machines or with a particular compiler or compiler options.
I took a stab at writing a toy concatenative language. Had a lot of fun learning along the way. https://github.com/wolfadex/bex
https://github.com/yacineMTB/isCoffeeGoodForYou
Some code that censors pornographic images off of 4chan
I wrote a set of DTrace scripts to export the chat history from the macOS client of WeChat, the de facto communication app in China.
I wrote a raytracer in python, just for the heck of it. It’s not particularly fast or useful, I just wanted to see what type of performance I could get with some naive numpy code. I might try to speed it up at some point because it’s not as fast as I wanted it to be.
Similar to someone else in this thread, I’ve also got a toy IRC bot called Seabird with a bunch of inside jokes and random tools… it somehow evolved into a gRPC chat framework supporting Discord, IRC, and Minecraft with plugins which bridges channels (even across networks), show URL previews, add a bunch of usable commands, and includes a number of in-jokes.
I have a ton of toy projects though, that one is just the most developed.
Other projects:
Given an
[i32; 2]
point on a boxy spiral starting at[0, 0]
, I wanted to be able to: wind it to the next point on the spiral, unwind it to the preceding point on the spiral, get its index, and the position from an index. By printing out diagrams from undercargo watch
, I was able to get instant feedback.I wrote a short script that, given a Python file, rearranges all the classes and functions alphabetically. (without modifying its functionality)
I somewhat swapped
True
andFalse
in Python. Works worse than you might think sadly, due toTrue
andFalse
instances being stored in static locations and much of CPython checking truthiness by location.I built a little CLI to convert Unix Epoch timestamps to RFC3339 format. Sure, there’s probably a tool for that already, but it was faster for me to write that little Golang glorified script than it was to search the man pages of however many programs that could potentially fill the role. It felt nice being able to write a program that I could easily define as “done”.
You are looking for
date
.One toy project of mine involved games and came out of a game jam, but sweet-turnips was first and foremost an experiment in making a template for tiny games, something I and others could use to rapidly prototype games under very tight creative constraints. It was also an excuse to learn entity component systems and event-driven architecture hands-on.
I also slapped together a little weather report display for my Inky pHAT a couple days ago. Loved the process.
I tool that listens to udev USB events and executes actions when matching rules written in yaml. The rules allowed me to match on port, device, or event (connect/disconnect) or any combination of them.
To brush up on my Go skills I started writing a Chip8 implementation! Wound up writing an assembler too. It’s a super simple ISA and would be a great way to teach the basics of how processors work.
https://github.com/jahzielv/hapax8.git
Two weeks ago I wrote a visual bloom filter, and this week I started on a duplicate file finder. My goal for the first is to keep up with the status of long running processes, the goal of the second is to improve my skills at using the transparent parallelism libraries in Haskell.
This past weekend I tried to hack up the QMK firmware for my moonlander keyboard to replace the NeoTrellis LED output for the visual bloom filter, but my C skills are weak, and I gave up after a solid two days of trying to figure out how to send RGB colors from the laptop to the keyboard.
I’m writing a toy AM synth. Quite fun and educational so far. I would eventually like to add an FM synth option as well, as I haven’t fully explored that concept yet. These have been bucket list items for quite a while.
http://noop.rocks/gdr/viewtopic.php?f=5&t=4
I made a little toy script to make fzf descend directories when I pressed
Ctrl-R
, instead of automatically. It made me yearn for a real programming language:Maybe not a toy, since I used it for a bit. But certainly ugly and prone to various data races.
I also used Go to script Go once: https://skuz.xyz/go-in-go.html I didn’t dig that deep but it’s not ready for use yet.
A strictly message-passing ObjC implementation of fizzbuzz.
This is awesome
Porting md5 sum, sudoku solver, and brainfuck implementations from C to Go for some micro benchmarks.
I’ve made UFO in a chat.
When somebody types one of the dozen special words, like “plane” or “carrot” or “coffee”, with a few added conditions and if it hasn’t been typed chat-wide in the last few hours, then a high quality svg of the thing flies through the screen of all users in the room at the time.
libgmp bindings to PicoLisp and test builtin bigmath.
A little Rust lambda calculus evaluator.
A tiny program to randomly colorize text.
I wrote a program to print “high quality” images on the dot-matrix printer from my childhood.
Most recently was a Discord bot for my D&D group so we could play the Mistborn RPG (it has some weird dice mechanics and i didn’t want everyone to waste time in game handling them)
The most long-lasting one (and continuously useful one) was my Pokemon Sword/Shield Helper App (GitHub) that I wrote when learning Elm.
I wrote a raspberry pi router with a custom made captive portal, firewall rules to customize, tag and log traffic per user, and sign those logs using openssl. Ruby/Sinatra/Sequel/SQLite backend, JQuery/Bootstrap/Websocket frontend. I still go back to it from time to time to remember how to handle iptables, local dns, openssl, sinatra, sequel, etc.
I wrote “Matchbox-Twelvy” which is a GAN that makes deepfake toy car images.
https://twitter.com/binarymax/status/1252728403712782338
Video of the training progression: https://www.youtube.com/watch?v=ai-pUTKEJG4 (video does not contain audio and is silent, but does have flashing images)
A little menubar app (macOS) to quickly check word pronunciations via Forvo. Really helps me when studying a language and wondering about the rhythm or tone of a new word: https://github.com/martinrue/forvilo
The last one I remember writing was a pomodoro timer – not to ever use, but to play with the logical structures of lua.
I am currently learning forth and doing the same.
[Comment removed by author]
[Comment removed by author]
I think it was playing around with Vulkan and GLFW, to see how well the Rust bindings held up. I stopped at getting a triangle on the screen, but it worked pretty well.