Live data from Hacker News

Writing toy software is a joy

blog.jsbarretto.com

61–70 of 318 posts

Re: Writing toy software is a joy

#62

Waste of time, you wont impress anyone because there are no more software jobs left. Go to gym.

Who am I impressing at the gym? The weights have already been lifted

So you don't look like sh* that's more impressive than cranking out code that absolutely no one cares about. Especially things that have been done 100s of times.

Re: Writing toy software is a joy

#63
An anecdote about how a toy project _really_ helped me out:

I work on Dart professionally. I've also been tinkering on a toy programming language that may never see the light of day. My toy language has gone through several incarnations but a while back I was working on adding algebraic datatypes, pattern matching, and exhaustiveness checking to it.

The canonical algorithm for exhaustiveness checking is this paper by Luc Maranget: http://moscova.inria.fr/~maranget/papers/warn/warn.pdf

When I first started dabbling in programming languages over a decade ago, I tried to understand that paper for weeks and just could not wrap my head around it. I don't have much of a formal CS background and that paper was impenetrable to me.

So here I am tinkering on my toy programming language and I run into again. I give it another try and laboriously implement it in my interpreter, basically doing a straight translation. I don't understand the code, but it seems to sort of work. So then I start refactoring it a tiny bit at a time into a style that fits the way I think about code. Eventually the algorithm sort of folds into itself and before I know it, I finally understand how it works. The end result was only a page or so of code, but my toy language had real exhaustiveness checking work.

Meanwhile, at work, I am working on adding pattern matching and exhaustiveness checking to Dart [1]. Exhaustiveness checking here is a much harder proposition because Dart has subtyping, unlike my toy language and the ML languages that Maranget's paper works on.

I'd been hacking away at an exhaustiveness algorithm for Dart based on a couple of papers about Scala's approach but they were sort of approximative and inelegant (in my opinion, maybe they are a great fit for Scala).

But once I understood Maranget's algorithm from implementing it in my toy project, it finally clicked for me how it could be adapted to work with subtyping in a sound, coherent way. I wrote it up as quickly as I could and (with a lot of additional help from a teammate to handle generics), that became the algorithm we shipped:

https://github.com/dart-lang/language/blob/main/accepted/3.0...

It wouldn't have happened if I hadn't coincidentally been working on a toy pattern matching implementation at home.

[1]: https://dart.dev/language/patterns

Re: Writing toy software is a joy

#64
I've done a lot of these kinds of projects. I got really sucked into a rabbit hole with the parser/interpreter/compiler that I was stuck (happily) in "I need to understand this so I will build one" mode. I eventually built a database server and query language for it. (for a business) This was in 2009, but I highly identify with his method of learning by doing for fun!

Re: Writing toy software is a joy

#65
I agree. It’s fun to just write code to solve problems or even for fun. I love go (it’s the best all around language and it’s not even close) so for fun I wrote a game engine and a small game that I might try to turn into an actual game. It’s good to keep fresh. I’ve also tried to do llm free days

Re: Writing toy software is a joy

#66
Problem/Truth is that writing toy software is not profitable - that's not to say one must always work on profitable things; what i mean is that it's being kept unprofitable, because in a hyper-saturated monopolized attention economy, every piece of "toy" software that isn't a video game or a plugin to some proprietary app ecosystem is essentially an act of subversion, an attempted "theft" or piracy of what the Company considers its rightful property: the sum of all disposable human attention.

Re: Writing toy software is a joy

#67

> Perhaps you’re a user of LLMs. I get it, they’re neat tools. They’re useful for certain kinds of learning. But I might suggest resisting the temptation to use them for projects like this. Knowledge is not supposed to be fed to you on a plate. I get where this is coming from, and I even agree with it today, but I also want to tag it as "don't cache this opinion too hard". It's interesting to notice when and how our…

This is by far my most common usage of LLMs, and they’re good at it. Sometimes you have to be intentional about preventing it from being sycophantic and just telling you that you’re right, through a system prompt or by phrasing the question such that it’s comparing ideas neutrally instead of comparing “your” idea to some other idea.

It feels like Claude and ChatGPT have both become more sycophantic over the past months.

Re: Writing toy software is a joy

#68
>Perhaps you’re a user of LLMs. [...] But I might suggest resisting the temptation to use them for projects like this.

I agree. However: Your best bet is likely to build it by hand and then see if you can get an LLM to build it.

It is looking like we are living in a world where an important tool to have in your toolbox is going to be the skills and experience of working with the LLM/AI tooling. There are skills, knowledge, tools, tips and techniques that you need to develop to effectively use these tools, just like the honing you get from writing the code.

Over just the last half hour I did a brain dump of "hot tips" to a friend of mine who is just starting to use Claude Code to kick-start him.

The LLMs are REALLY good at writing small toy programs, and at the end of the day it's great to have little tools that you'll use every day.

Re: Writing toy software is a joy

#69
post #56
post #17

Reinventing existing software has 0 merit. If you cannot be creative enough to invent new things, you shouldn't bother working.

How are you supposed to learn to invent new things if you don't know how existing things work?

There's ZERO room for innovation in the projects suggested.

Wanna do some creative thinking? Read some books, learn how normal people think. Explore latest datasets. That's where the meat is. 98% of what you read online has been written by super uncreative(boring) people. They have no imagination whatsoever, IQ is well statistically speaking not too flattering.

Internet is ran by the bottom. It's slop by the bottom, for the bottom. So you need to hang out with creative people.

Tech people write the most boring blog posts because it's aimed at getting hired. Nothing of substance is shared. That's why gwern stands out like a sore thumb. The majority of human beings are incapable of creative thought.

Re: Writing toy software is a joy

#70
Possibly tangential, but I've really been enjoying writing software with very minimal tech stacks with no dependencies (or very few). Go works well for this, but really any language that lets you create a file and just start writing straightforward code is sufficient. As soon as I need to use some CLI to scaffold out a project with tens or hundreds of files, or pull in a ton of dependencies, I kind of check out. It's fine when you have a team and a big serious project, but in my free time I really just enjoy having a couple files of straightforward code and that's it.
Post reply on HN