A standard piece of advice is that every developer should do a major project in every big language family. A Lisp, an OO language, a functional language, Prolog, VHDL or Verilog, a Forth, et cetera. They'll all make you think differently and teach you lessons you will use outside of the family.
My favorite side quest that I definitely recommend. Physical parallelism is so fun to reason about.
I had the advantage of sitting next to a proper professional to bounces questions off of, so I was able to get an SPDIF decoder to work in about a week! It was a very interesting lesson in the costs of abstraction, and why you will never really find abstraction layers in hardware.
It's just a shame that (System)Verilog is such an awful awful language. And we're basically stuck with it, at least for ASICs, despite the availability of alternative HDLs that compile to SV.
I worked for a couple of years in a SystemVerilog compiler, and I couldn't agree more with your sentiment.
From the compiler construction standpoint, it's grossly underspecified, to the point that our customers' designs were way more expressive than the spec.
And from the users' perspective, it's confusing, quite limited, and you end up having to resort to hacks to achieve what should be part of the language... Fortunately I can't remember any particularly bad examples, it's been 15 or so years since I left for greener pastures.
Still, I sometimes wonder, how much of HW design is influenced by the language decisions, these ugly hacks, and the emerging (System)Verilog design patterns? Could it be measurably better in a different world?
Yeah, using (system)verilog is essentially a process of "think of the digital circuit you want, then figure out how to write it as a 'sequential' process so that the compiler can then generate the circuit you want". The way it works feels quite clever when you first learn about it but the way it works in practice is bizarre.
but then you suffer from working in places where people only knew one language, because they won't grasp your code or ideas and you will have to live in their limited conventions
I had so much fun with Lisp and Scheme at uni that it makes me sad to have never coded professionally with them. On the other hand, I have written PostScript for money, which was completely unexpected.
I've seen Lisps used by contractors for small-team sized projects, but it's pretty rare. Clojure is probably the most popular Lisp in common use, but I think its popularity has been fading (unfortunately).
Both Scheme and CL suffer really badly from a lack of modernization primarily in their stdlibs (or equivalent SRFIs) that tend to make them poor choices for most new professional projects IMO. Great for side projects though. I really wish the next generation of Scheme would take a page from Clojure's book and rework all the SRFIs and bake in immutability as a core requirement.
I have applied this for decades, with multiple languages under my belt, and multiple million-dollar projects on my CV, and meanwhile I have found another similar rule that I think also sharpens a developers mind:
Put Lua in things.
Now, before you anti-Lua types start jumping on that 0-indexed down-vote, let me explain. Its not just about the language, its about the "thing" you're putting it in, its about using the VM effectively, its about planning and using the stack properly. It's about using one language to leverage the strengths - and discover the weaknesses - of other languages, runtimes, ABI's.
Putting Lua in things is easy - and it is hard. It teaches you how to treat other things with respect, and it teaches you how to disregard other things and "Just Use Lua™".
You can learn the language - multiple variants of it. You can learn the 'things' you're putting it in. You can learn how a VM works, what byte code is, how it can be used effectively - and how it can be used counter-productively, too.
It will teach you the limits of a language - Lua, and C - and it will teach you the strengths of both (as well as Rust, and all the other things you can get an FFI scaffolding built around).
You can use Lua to produce your own domain specific language. You can use it to (almost, or indeed completely) replace whatever other language the "thing" is using. You can use it to minimize the impact of a VM and scripting and byte code - you can learn how to maximize these things as well. You can learn byte code and you can leverage that understanding to learn machine language - two ends of a very similar (yet vastly different) spectrum.
You can learn how slow/fast pieces of the system interact productively and effectively - you can learn how things get mightily messed up, also, if you use the wrong lubricant.
In the end, you may not even end up using it for productive things - but you might also do something extremely powerful. (I have.) Either way, by applying this maxim and applying the skills needed to master doing it (or screw it up entirely), you can learn pretty much everything interesting there is to learn about software (besides LLM's) in today's modern stack madness .. and then some.
Seriously, give it a try.
The other one of these developer-tuning activities (there are a few), is to do a Linux From Scratch session at least twice a year. Do it this year, but plan on doing it again next year as well. Do it a few more times this decade.
This. It's not Rust in the author's case. It's being exposed to a language that's enough different from what they're used to that it affects their big picture.
A common example I give is a basic chat client/server, to learn how networking code feels, especially nonblocking IO. Especially if you're implementing the same protocol in the different languages since it means you won't necessarily be as biased by what protocol patterns are easy to implement in one language.
I think the advice works well for projects that are on the order of 10k lines of code. "Major" is subjective, but that's big enough to be non-trivial yet small enough not to be a huge time investment.
I don't know if it counts as "major" to the OP, but early in my career, I wrote a Sudoku solver in several languages as part of learning them. It was just complex enough of a problem that I got a glimpse into the patterns that succeed or fail for different languages, especially when it comes to things like optimization, which is sometimes hard to observe in business applications.
Just yesterday I finished my small sudoku "game" including generator in Odin and it was such a fun project. Not major by line count but optimizing it to generate a new puzzle in <100 ms was a fun exercise.
For anyone curious, I generate the sudokus by first randomly filling an empty grid in a way that follows the sudoku rules, then emptying random cells where doing so doesn't make the solution ambiguous (a sudoku has exactly one valid solution). The first step to fill the grid works almost exactly like a normal backtracking solver but going through the cells in random order, and for a major speed boost the backtracking is far more aggressive (always resetting half the progress so far instead of just going back one step).
Checking if a sudoku has multiple solutions is again normal backtracking but only exiting at the second time it finishes or after going through all combinations. The rest is modern computers being fast and limiting the number of iterations to avoid the super slow worst cases.
At the beginning of my university studies (second or third semester), one of the homework assignments was to write a Sudoku solver. I spent a lot of time on it, prototyping it with JS and HTML so that I could visualize step by step how to solve Sudoku in general, implementing the techniques in code that I had previously been doing by hand when doing Sudoku puzzles in the past.
I am not sure if everyone else looked up techniques online or what for how to do it, or if they skipped that assignment, or made a very simplified solver that only handled some basic techniques. We hadn’t really learned much of anything yet in any of the classes of the course that would be useful for making a general solver. I thought I was supposed to figure it all out on my own, and that it should be able to handle any Sudoku puzzle that a person could solve. And in the end, despite many, many hours of working on it over many days it was still far from a complete solver. And I also didn’t have time to write it in the programming language we were using in the course. I was prototyping in JS and HTML because I wanted to see visually the sudoku puzzle and be able to switch between having the computer find next number and clicking on the number myself, to discover in detail how I was thinking when I was solving Sudoku puzzles, so that in turn I could implement those techniques in code.
I lost a little bit of motivation for the class with that, and dropped out of the class soon after because I found the class to be generally uninspiring and hard to stay motivated for, in spite of being interested in programming in general and having learned programming languages and made little programs of my own already since High School. Later I dropped out of the whole study, as I was struggling to study across most subjects and wasn’t passing enough classes to be able to continue.
My interest in programming continued, however, and I’ve been developing software both professionally and as a hobby with sometimes pretty good results during the years since, and having done so for companies both small and big, and in multiple different programming languages.
But I think the way I handled trying to implement the Sudoku solver is a way of working on things that I already had since before then and that I continued also later, and that that is also part of the reason that things go wrong for me when they do. Both professionally and also elsewhere in life.
The last job I had, I was laid off for not performing well enough. And I think in part I was still working on tasks at that job in some sort of wrong way all these years later, that may be similar in some ways to what I may have done wrong with for example that Sudoku solver assignment. And probably in many other cases too both before and after.
And now that AI is here I’m not really sure how to land a new job as developer at all. Even though I would like to. Combined with the sense that there is too much ups and downs in success rate of what I’ve been working on over the years to be able to present myself in an impressive manner to employers. I value honesty and integrity, and I find it difficult to really imagine that I could sell myself well at this point when I look back at my life so far, in spite of sometimes doing things well, because of the times that projects have not gone well.
Depending on what kind of concepts you want exposure to.
If you just want generic pure computation: write an interpreter for a toy language. If it’s too large, write a macro expander that can handle C style or TeX style macros.
If you want events and concurrency: write a tmux clone that can work with multiple terminals.
If you want IO but specifically networking: write a toy HTTP server that only supports 1.0.
I suppose but I was thinking take a path that derives from one path or the other. Like start with Von Neumann derived ones or Alonzo Church. Since there’s so much overlap, that’s the start of the families right? Just trying to give more structure to what you’re suggesting.
At the heart of it all it’s just math and logic, and that’s where the different thought studies happen, regardless of which language quirks are navigated.
> It's like saying a novelist should write a major novel in every important spoken language.
No, it's not. It's more like saying a writer should try their hand at different styles and formats of writing. So a novelist who periodically writes non-fiction essays or journalistic content or poetry (whether intended for publication or as a writing experiment), and that practice can in turn inform their writing as a novelist.
Besides, learning programming languages is much easier than learning natural languages. Most experienced programmers today know multiple languages, and most college grads in CS and Software Engineering graduate having used at least 5 or 6 languages if their school is halfway decent.
Actually, many of my favorite novelists have done a lot of translations, so that tracks. You probably become a better writer by extending your brain in that direction too. (But they tend to translate to their native language of course.)
At first glance this seems like a invalid analogy because spoken language didn't exist to suit a specific domain just like some programming languages (lua for scripting, Pascal for teaching, Rust for systems programming..).
But there are example of "dead" languages whose everyday usage have devolved to only lithurgical functions like: Latin (Catholicism), Pali Cannon (Buddhism) and Sanskrit (Hinduism).
One of the things that I think makes Rust unique is that it acknowledges the possibility of human error. I think it’s also one of the most controversial too: there are certain people who get an ego hit at the insinuation that they ever could have written C code with mistakes.
Instead of hoping you remember to check for NULL, Rust forces you to make a decision on how to handle the possibility of failure. Sure, you can still pick a bad decision (unwrap) but that is at least a specific decision and you can’t forget to do it.
You can take it even further with things like the newtype pattern. If you have lots of numeric IDs (project ID, user ID, etc) you can give them distinct types so you don’t mix them up.
So Rust taught me I can program defensively against my own brain, which sometimes gets tired or lazy or distracted.
This was always the same thing that Unit tests were trying to bring, defend against your own errors and try to get the most quality out of the tools as possible. A lot of language progress has been exactly this over the years, from removing goto and introduction of for/if/while to constraining types and everything since. As an industry we could do with more of this mindset in general, just use everything we can to try and catch bugs earlier when they are cheaper to find and fix and avoid them happening at all.
Null should not exist, and Optionals are an anoying workaround/hack to it. Old languages like Tcl eliminated it, (every object has an initial value, it is never null).
It creates an interesting problem, as sometimes you want to know the absence of value. Usually done with the empty "" string.
The other way to handle is that every Object is initiated (pointing) to an starter initial value. (prototype based languages).
Sometimes you do want to represent the concept of “this whole datatype OR nothing”. How do you suggest this is modelled? I think optionality is pretty fundamental. What’s wrong about classical null is that it ascribes optionality to all types regardless of whether they need it.
Being forced to represent optionality with a “special” default is terrible design IMO - see the recent SSH RCE on Musl, largely due to the poor choice of indicating “crypt failed”. Default values can be quite dangerous. Sometimes the domain you are modelling supports such a value, but having “default value” be the default (and not a choice) is a similar evil to default null.
I don't see how initial values solves for much, or how an Optional constitutes a workaround; if anything, I see initial/null values being a hack to get around Optional, which is an explicit declaration of what possibilities exist.
Initial values, like null, is an attempt to smuggle the "unset" case into the type without declaring it. And like null, the defensively written logic should prefix every single usage with a check for validity.
Optional is just a natural subset of the generalization that multiple possible states exist; in this case, just the two, and sum types to properly handle bigger sets.
Initial/null never admit more than 2 possible states, and also believe everything is always in one of those 2 states.
yes i love rust because i acknowledge my own limitations as a programmer. compare that to c/zig devs handwaving away vulnerabilities as "skill issues", any serious engineering discipline eliminates the possibility of human error wherever possible.
It's ironic that these are the times of safety, but when C was getting popular in the 80's, it was the times of power. I clearly remember C was touted as being "so powerful that it lets you do anything without any checks". You were responsible to wield that power properly unlike more strict languages like Pascal, COBOL, or Fortran at the time, yet way more expressive than Assembly of course. Now, the pendulum seems to have swung to the other end.
Rust enums conflate the tag type with the union type that uses it. These should be separate things. In the example here, you can see that Rust gives no way to represent the tag type `{Human, Cat}`. In Zig there is an enum which is a set of tags, and a union which is backed by that enum and can have fields. It is obviously better to have these as separate concepts rather than conflating them. You often want the kind without the data, and Rust gives you no way to represent it. I'm not sure why I am bothering to rant about this but it's one of my biggest annoyances with the language.
Sure you can, bringing data along for the ride is optional in Rust. Nothing is forcing you to use it like a tagged union, it’s an optional (but useful) feature.
If you want specific values (integer or otherwise) associated with specific variants (i.e. Human = 1, Cat = 4) you can do that too. Use the #[repr(T)] or impl the From / Into traits yourself.
As someone who hasn't used Rust enough, and not knowing Zig but it appears Zig does something similar to Ada which I do know, how would you use the same discriminant across multiple Rust enums and guarantee that you implemented variants for each discriminant value?
In Ada, if I use an enum (carrying the example from a link I used in a cousin comment):
type Expr_Kind_Type is (Bin_Op_Plus,
Bin_Op_Minus,
Num);
Variant records using this enum have to implement the variant for each element of the enum. If I, for some reason, have multiple records using the same discriminant I can know that each one implements it for each value of the discriminant. Does Rust have a way to synchronize your enums similar to that?
Why do you need to do that? You can't be generic over "any enum using this tag" anyway (in Rust, at least). If you just want to make sure you make no mistake, you can use a dead match from the tag to the enum, or automate it with a macro, and the compiler will enforce exhaustiveness (though not on both sides, unless you use a macro).
If I'm building up a type checker and an interpreter, I very well could (continuing that example) end up with different data structures using the same discriminant (but containing different data about the system). In Rust I'd have to do something like:
And I'd have to hope they were both complete and match (at least according to what I know now, that's why I'm asking). If I go back in to the Parser enum and add a `un_minus`, then I have to also go into the Typer enum (apologies for the bad naming, I'm at work and commenting between my way too many meetings) and manually add it. I have no compile time guarantee that both are complete and synchronized. In Ada, I modify the existing enum and both will fail to compile until I add in the variant for `un_minus`. One edit, multiple failures distributed across the code base as a result telling me all the places where I have to add in a new code branch or new variant.
Yes, there is something you can do with separate types. You can name a variant without having a value of it. `discriminant` only works on an existing value, so to refer to "cats" you'd have to build a dummy `Cat`, and the result is opaque. You can't match on it, iterate over it, or create one from a byte you parsed off the wire. This is so obviously worse, I can't believe you bothered to ask.
This is a minor advantage (but is an advantage) and when needed (rarely) you can usually workaround with a different fieldless enum and potentially a proc-macro to autogenerate it.
It's not at all minor. Sometimes the tag enum already exists. Rust can't build a data enum on top of it: a derive macro only sees its own enum, so it generates a new tag enum instead. Now you have two tag enums to keep in sync by hand. Proc macros are always used to resolve deficiencies in the rust language, and they always lead to greater complexity and longer compile times.
Instead of just getting one type that includes the discriminant and records, Zig and Ada have a tag of some type whose value determines which variant is being used, and then the union (Zig) or record (Ada) is its own type.
Because sometimes you just want to talk about the types of variants without having to construct a value. But, you probably don't want to manually maintain a separate enum just for the discriminants. Nor do you want to manually maintain the mappings between the original enum and the discriminant-only enum.
I've had it come up when dealing with ASTs, although I don't recall the specifics. This is a problem that's certainly pretty easy to solve with macros. I'm pretty sure last time I ran into this I used `strum` [1] and its `EnumDiscriminants` macro to handle this.
Such enlightenment was a common read back in the glorious days of before 2023.
But reading this in 2026, when the entirety of the profession has changed (for better or worse) due to LLMs, seems strange.
Like someone writing how some new preservation method for making food last longer revolutionized how they manage their pantry, shortly after the invention of the fridge.
I like the post - it's just sad how many will not have these epifanies anymore, or they wont mean anything, and how many starting today would already just say "how quaint" and move on.
I learned how to calculate the square root using pen and paper, and it was fun, but... I am not going to write blogs about how it made me a better person and why everyone should do this. There are so many cool things one could do, and people have different hobbies and preferences; what is fascinating for me is not necessarily so for someone else, and vice versa.
Ugh. Swap out LLMs for formal logic, mathematical proofs, the calculator or the printing press if you want.
You're just getting older and times change. Your adolescence wasn't any more pure than the kids today.
One could argue you've frittered away your life fiddling bits around instead of becoming a thespian, writer, or musician. Alas, the epiphanies you could have had.
A standard piece of advice is that every developer should do a major project in every big language family. A Lisp, an OO language, a functional language, Prolog, VHDL or Verilog, a Forth, et cetera. They'll all make you think differently and teach you lessons you will use outside of the family.
> Verilog
My favorite side quest that I definitely recommend. Physical parallelism is so fun to reason about.
I had the advantage of sitting next to a proper professional to bounces questions off of, so I was able to get an SPDIF decoder to work in about a week! It was a very interesting lesson in the costs of abstraction, and why you will never really find abstraction layers in hardware.
It's just a shame that (System)Verilog is such an awful awful language. And we're basically stuck with it, at least for ASICs, despite the availability of alternative HDLs that compile to SV.
I worked for a couple of years in a SystemVerilog compiler, and I couldn't agree more with your sentiment.
From the compiler construction standpoint, it's grossly underspecified, to the point that our customers' designs were way more expressive than the spec.
And from the users' perspective, it's confusing, quite limited, and you end up having to resort to hacks to achieve what should be part of the language... Fortunately I can't remember any particularly bad examples, it's been 15 or so years since I left for greener pastures.
Still, I sometimes wonder, how much of HW design is influenced by the language decisions, these ugly hacks, and the emerging (System)Verilog design patterns? Could it be measurably better in a different world?
Yeah, using (system)verilog is essentially a process of "think of the digital circuit you want, then figure out how to write it as a 'sequential' process so that the compiler can then generate the circuit you want". The way it works feels quite clever when you first learn about it but the way it works in practice is bizarre.
Will I have the same learning effect if I use https://github.com/clash-lang/clash-compiler instead of straight verilog, or is the language a necessary part of it?
It's awful by design! Do you know how much Cadence, Synopsys, and Siemens profit off of the bloated LRM?
This sounds quite interesting to me, if you have the time, could you please elaborate a bit on the cost of abstraction?
100% agree with this.
Elixir was somewhere between my 12th-14th language and nothing changed my perspective so much as understanding why the BEAM works the way it does.
The BEAM is so underrated
but then you suffer from working in places where people only knew one language, because they won't grasp your code or ideas and you will have to live in their limited conventions
Advent of Code is coming in two weeks, I highly recommend completing 12 challenges in 12 different languages!
I had so much fun with Lisp and Scheme at uni that it makes me sad to have never coded professionally with them. On the other hand, I have written PostScript for money, which was completely unexpected.
I've seen Lisps used by contractors for small-team sized projects, but it's pretty rare. Clojure is probably the most popular Lisp in common use, but I think its popularity has been fading (unfortunately).
Both Scheme and CL suffer really badly from a lack of modernization primarily in their stdlibs (or equivalent SRFIs) that tend to make them poor choices for most new professional projects IMO. Great for side projects though. I really wish the next generation of Scheme would take a page from Clojure's book and rework all the SRFIs and bake in immutability as a core requirement.
I have applied this for decades, with multiple languages under my belt, and multiple million-dollar projects on my CV, and meanwhile I have found another similar rule that I think also sharpens a developers mind:
Put Lua in things.
Now, before you anti-Lua types start jumping on that 0-indexed down-vote, let me explain. Its not just about the language, its about the "thing" you're putting it in, its about using the VM effectively, its about planning and using the stack properly. It's about using one language to leverage the strengths - and discover the weaknesses - of other languages, runtimes, ABI's.
Putting Lua in things is easy - and it is hard. It teaches you how to treat other things with respect, and it teaches you how to disregard other things and "Just Use Lua™".
You can learn the language - multiple variants of it. You can learn the 'things' you're putting it in. You can learn how a VM works, what byte code is, how it can be used effectively - and how it can be used counter-productively, too.
It will teach you the limits of a language - Lua, and C - and it will teach you the strengths of both (as well as Rust, and all the other things you can get an FFI scaffolding built around).
You can use Lua to produce your own domain specific language. You can use it to (almost, or indeed completely) replace whatever other language the "thing" is using. You can use it to minimize the impact of a VM and scripting and byte code - you can learn how to maximize these things as well. You can learn byte code and you can leverage that understanding to learn machine language - two ends of a very similar (yet vastly different) spectrum.
You can learn how slow/fast pieces of the system interact productively and effectively - you can learn how things get mightily messed up, also, if you use the wrong lubricant.
In the end, you may not even end up using it for productive things - but you might also do something extremely powerful. (I have.) Either way, by applying this maxim and applying the skills needed to master doing it (or screw it up entirely), you can learn pretty much everything interesting there is to learn about software (besides LLM's) in today's modern stack madness .. and then some.
Seriously, give it a try.
The other one of these developer-tuning activities (there are a few), is to do a Linux From Scratch session at least twice a year. Do it this year, but plan on doing it again next year as well. Do it a few more times this decade.
Iterate. Extend. Ignite.
Lua variant used in Roblox is a great example of how it can be used effectively and powerfully.
This. It's not Rust in the author's case. It's being exposed to a language that's enough different from what they're used to that it affects their big picture.
Yes, especially since many of the type system features younger devs assign to Rust, are present in most Standard ML derived languages.
It is a scale, and there are other languages that go beyond Rust, with dependent types, effects, capabilities, linear types, formal profs,...
Well, different in a good way. There are plenty of different and worse languages.
Even minor projects can have great impact when developed using different paradigms.
https://webperso.info.ucl.ac.be/~pvr/VanRoyChapter.pdf
Agreed 100%. This is the single most useful thing I experienced in my career.
What counts as a major project?
Could be lots of things.
A common example I give is a basic chat client/server, to learn how networking code feels, especially nonblocking IO. Especially if you're implementing the same protocol in the different languages since it means you won't necessarily be as biased by what protocol patterns are easy to implement in one language.
I think the advice works well for projects that are on the order of 10k lines of code. "Major" is subjective, but that's big enough to be non-trivial yet small enough not to be a huge time investment.
I don't know if it counts as "major" to the OP, but early in my career, I wrote a Sudoku solver in several languages as part of learning them. It was just complex enough of a problem that I got a glimpse into the patterns that succeed or fail for different languages, especially when it comes to things like optimization, which is sometimes hard to observe in business applications.
Just yesterday I finished my small sudoku "game" including generator in Odin and it was such a fun project. Not major by line count but optimizing it to generate a new puzzle in <100 ms was a fun exercise.
For anyone curious, I generate the sudokus by first randomly filling an empty grid in a way that follows the sudoku rules, then emptying random cells where doing so doesn't make the solution ambiguous (a sudoku has exactly one valid solution). The first step to fill the grid works almost exactly like a normal backtracking solver but going through the cells in random order, and for a major speed boost the backtracking is far more aggressive (always resetting half the progress so far instead of just going back one step). Checking if a sudoku has multiple solutions is again normal backtracking but only exiting at the second time it finishes or after going through all combinations. The rest is modern computers being fast and limiting the number of iterations to avoid the super slow worst cases.
At the beginning of my university studies (second or third semester), one of the homework assignments was to write a Sudoku solver. I spent a lot of time on it, prototyping it with JS and HTML so that I could visualize step by step how to solve Sudoku in general, implementing the techniques in code that I had previously been doing by hand when doing Sudoku puzzles in the past.
I am not sure if everyone else looked up techniques online or what for how to do it, or if they skipped that assignment, or made a very simplified solver that only handled some basic techniques. We hadn’t really learned much of anything yet in any of the classes of the course that would be useful for making a general solver. I thought I was supposed to figure it all out on my own, and that it should be able to handle any Sudoku puzzle that a person could solve. And in the end, despite many, many hours of working on it over many days it was still far from a complete solver. And I also didn’t have time to write it in the programming language we were using in the course. I was prototyping in JS and HTML because I wanted to see visually the sudoku puzzle and be able to switch between having the computer find next number and clicking on the number myself, to discover in detail how I was thinking when I was solving Sudoku puzzles, so that in turn I could implement those techniques in code.
I lost a little bit of motivation for the class with that, and dropped out of the class soon after because I found the class to be generally uninspiring and hard to stay motivated for, in spite of being interested in programming in general and having learned programming languages and made little programs of my own already since High School. Later I dropped out of the whole study, as I was struggling to study across most subjects and wasn’t passing enough classes to be able to continue.
My interest in programming continued, however, and I’ve been developing software both professionally and as a hobby with sometimes pretty good results during the years since, and having done so for companies both small and big, and in multiple different programming languages.
But I think the way I handled trying to implement the Sudoku solver is a way of working on things that I already had since before then and that I continued also later, and that that is also part of the reason that things go wrong for me when they do. Both professionally and also elsewhere in life.
The last job I had, I was laid off for not performing well enough. And I think in part I was still working on tasks at that job in some sort of wrong way all these years later, that may be similar in some ways to what I may have done wrong with for example that Sudoku solver assignment. And probably in many other cases too both before and after.
And now that AI is here I’m not really sure how to land a new job as developer at all. Even though I would like to. Combined with the sense that there is too much ups and downs in success rate of what I’ve been working on over the years to be able to present myself in an impressive manner to employers. I value honesty and integrity, and I find it difficult to really imagine that I could sell myself well at this point when I look back at my life so far, in spite of sometimes doing things well, because of the times that projects have not gone well.
Depending on what kind of concepts you want exposure to.
If you just want generic pure computation: write an interpreter for a toy language. If it’s too large, write a macro expander that can handle C style or TeX style macros.
If you want events and concurrency: write a tmux clone that can work with multiple terminals.
If you want IO but specifically networking: write a toy HTTP server that only supports 1.0.
That is up to you to decide
One that has expanded enough to be able to read email.
"Show HN: I wrote my own kernel in [insert niche language here], here is what I learned"
If you could maybe reduce that down a bit that would be great. No one in their right mind has the time for major projects in all of those.
Another way to do it would be the standard low->high level and then one based on lambda calculus. Von Neumann and Church.
Assembly, C, Java, Clojure.
Assembly, C, C#, F#.
Assembly, Fortran, Rust, Rust, Brainf*ck.
I've been programming for about 40 years now, so I've had time. You will too, eventually.
I should have made the list bigger, not smaller. I missed assembly and Erlang.
I suppose but I was thinking take a path that derives from one path or the other. Like start with Von Neumann derived ones or Alonzo Church. Since there’s so much overlap, that’s the start of the families right? Just trying to give more structure to what you’re suggesting.
At the heart of it all it’s just math and logic, and that’s where the different thought studies happen, regardless of which language quirks are navigated.
It's like saying a novelist should write a major novel in every important spoken language.
> It's like saying a novelist should write a major novel in every important spoken language.
No, it's not. It's more like saying a writer should try their hand at different styles and formats of writing. So a novelist who periodically writes non-fiction essays or journalistic content or poetry (whether intended for publication or as a writing experiment), and that practice can in turn inform their writing as a novelist.
Besides, learning programming languages is much easier than learning natural languages. Most experienced programmers today know multiple languages, and most college grads in CS and Software Engineering graduate having used at least 5 or 6 languages if their school is halfway decent.
Actually, many of my favorite novelists have done a lot of translations, so that tracks. You probably become a better writer by extending your brain in that direction too. (But they tend to translate to their native language of course.)
It's like saying a novelist should write a story (not necessarily a book) in every important genre, which is, excellent advice.
At first glance this seems like a invalid analogy because spoken language didn't exist to suit a specific domain just like some programming languages (lua for scripting, Pascal for teaching, Rust for systems programming..).
But there are example of "dead" languages whose everyday usage have devolved to only lithurgical functions like: Latin (Catholicism), Pali Cannon (Buddhism) and Sanskrit (Hinduism).
At the very least, a short story.
One of the things that I think makes Rust unique is that it acknowledges the possibility of human error. I think it’s also one of the most controversial too: there are certain people who get an ego hit at the insinuation that they ever could have written C code with mistakes.
Instead of hoping you remember to check for NULL, Rust forces you to make a decision on how to handle the possibility of failure. Sure, you can still pick a bad decision (unwrap) but that is at least a specific decision and you can’t forget to do it.
You can take it even further with things like the newtype pattern. If you have lots of numeric IDs (project ID, user ID, etc) you can give them distinct types so you don’t mix them up.
So Rust taught me I can program defensively against my own brain, which sometimes gets tired or lazy or distracted.
This was always the same thing that Unit tests were trying to bring, defend against your own errors and try to get the most quality out of the tools as possible. A lot of language progress has been exactly this over the years, from removing goto and introduction of for/if/while to constraining types and everything since. As an industry we could do with more of this mindset in general, just use everything we can to try and catch bugs earlier when they are cheaper to find and fix and avoid them happening at all.
Null should not exist, and Optionals are an anoying workaround/hack to it. Old languages like Tcl eliminated it, (every object has an initial value, it is never null).
It creates an interesting problem, as sometimes you want to know the absence of value. Usually done with the empty "" string.
The other way to handle is that every Object is initiated (pointing) to an starter initial value. (prototype based languages).
> Optionals are an annoying workaround/hack to it
Sometimes you do want to represent the concept of “this whole datatype OR nothing”. How do you suggest this is modelled? I think optionality is pretty fundamental. What’s wrong about classical null is that it ascribes optionality to all types regardless of whether they need it.
Being forced to represent optionality with a “special” default is terrible design IMO - see the recent SSH RCE on Musl, largely due to the poor choice of indicating “crypt failed”. Default values can be quite dangerous. Sometimes the domain you are modelling supports such a value, but having “default value” be the default (and not a choice) is a similar evil to default null.
1. Have declared nullability (e.g. `String? foo` / `val foo: String?`)
2. Use null coalescing (e.g. `foo?.bar?.baz`)
Languages such as Kotlin and C# support this style o programming.
The thing that I don't like about Optional types (in e.g. Scala or Java) is that they are too verbose. For example, instead of:
you have something like: This is even harder to read if you have more complicated logic, requiring implicit lambdas and other machinery.Both variants are just different syntax for the same thing.
I don't see how initial values solves for much, or how an Optional constitutes a workaround; if anything, I see initial/null values being a hack to get around Optional, which is an explicit declaration of what possibilities exist.
Initial values, like null, is an attempt to smuggle the "unset" case into the type without declaring it. And like null, the defensively written logic should prefix every single usage with a check for validity.
Optional is just a natural subset of the generalization that multiple possible states exist; in this case, just the two, and sum types to properly handle bigger sets.
Initial/null never admit more than 2 possible states, and also believe everything is always in one of those 2 states.
"Always has a value" just creates an in-band signaling problem, where the "absense of value" overlaps with the valid values.
yes i love rust because i acknowledge my own limitations as a programmer. compare that to c/zig devs handwaving away vulnerabilities as "skill issues", any serious engineering discipline eliminates the possibility of human error wherever possible.
fwiw john carmack agrees with me
It's ironic that these are the times of safety, but when C was getting popular in the 80's, it was the times of power. I clearly remember C was touted as being "so powerful that it lets you do anything without any checks". You were responsible to wield that power properly unlike more strict languages like Pascal, COBOL, or Fortran at the time, yet way more expressive than Assembly of course. Now, the pendulum seems to have swung to the other end.
Rust enums conflate the tag type with the union type that uses it. These should be separate things. In the example here, you can see that Rust gives no way to represent the tag type `{Human, Cat}`. In Zig there is an enum which is a set of tags, and a union which is backed by that enum and can have fields. It is obviously better to have these as separate concepts rather than conflating them. You often want the kind without the data, and Rust gives you no way to represent it. I'm not sure why I am bothering to rant about this but it's one of my biggest annoyances with the language.
Sure you can, bringing data along for the ride is optional in Rust. Nothing is forcing you to use it like a tagged union, it’s an optional (but useful) feature.
If you want specific values (integer or otherwise) associated with specific variants (i.e. Human = 1, Cat = 4) you can do that too. Use the #[repr(T)] or impl the From / Into traits yourself.
The function you seek already exists before you: https://doc.rust-lang.org/std/mem/fn.discriminant.html
Is there anything you can do with separate types for the tag and the union that std::mem::discriminant and pattern matching can't do?
As someone who hasn't used Rust enough, and not knowing Zig but it appears Zig does something similar to Ada which I do know, how would you use the same discriminant across multiple Rust enums and guarantee that you implemented variants for each discriminant value?
In Ada, if I use an enum (carrying the example from a link I used in a cousin comment):
https://learn.adacore.com/courses/intro-to-ada/chapters/more...Variant records using this enum have to implement the variant for each element of the enum. If I, for some reason, have multiple records using the same discriminant I can know that each one implements it for each value of the discriminant. Does Rust have a way to synchronize your enums similar to that?
Why do you need to do that? You can't be generic over "any enum using this tag" anyway (in Rust, at least). If you just want to make sure you make no mistake, you can use a dead match from the tag to the enum, or automate it with a macro, and the compiler will enforce exhaustiveness (though not on both sides, unless you use a macro).
If I'm building up a type checker and an interpreter, I very well could (continuing that example) end up with different data structures using the same discriminant (but containing different data about the system). In Rust I'd have to do something like:
And I'd have to hope they were both complete and match (at least according to what I know now, that's why I'm asking). If I go back in to the Parser enum and add a `un_minus`, then I have to also go into the Typer enum (apologies for the bad naming, I'm at work and commenting between my way too many meetings) and manually add it. I have no compile time guarantee that both are complete and synchronized. In Ada, I modify the existing enum and both will fail to compile until I add in the variant for `un_minus`. One edit, multiple failures distributed across the code base as a result telling me all the places where I have to add in a new code branch or new variant.EDIT: Run on sentence broken up.
yeah, but fortunately strum exists.
I have found it quite useful to be able to generate a dedicated SomeEnumDiscriminants enum for SomeEnum, using the following derive:
https://docs.rs/strum/latest/strum/derive.EnumDiscriminants....
Yes, there is something you can do with separate types. You can name a variant without having a value of it. `discriminant` only works on an existing value, so to refer to "cats" you'd have to build a dummy `Cat`, and the result is opaque. You can't match on it, iterate over it, or create one from a byte you parsed off the wire. This is so obviously worse, I can't believe you bothered to ask.
This is a minor advantage (but is an advantage) and when needed (rarely) you can usually workaround with a different fieldless enum and potentially a proc-macro to autogenerate it.
It's not at all minor. Sometimes the tag enum already exists. Rust can't build a data enum on top of it: a derive macro only sees its own enum, so it generates a new tag enum instead. Now you have two tag enums to keep in sync by hand. Proc macros are always used to resolve deficiencies in the rust language, and they always lead to greater complexity and longer compile times.
> proc-macro to autogenerate it.
https://docs.rs/strum/latest/strum/derive.EnumDiscriminants....
i dont understand what rust doesn't give you that zig does?
https://zig.guide/language-basics/unions/ - Seems like it's more similar to Ada's variant records: https://learn.adacore.com/courses/intro-to-ada/chapters/more...
Instead of just getting one type that includes the discriminant and records, Zig and Ada have a tag of some type whose value determines which variant is being used, and then the union (Zig) or record (Ada) is its own type.
why would you ever need them to be seperate?
Because sometimes you just want to talk about the types of variants without having to construct a value. But, you probably don't want to manually maintain a separate enum just for the discriminants. Nor do you want to manually maintain the mappings between the original enum and the discriminant-only enum.
I've had it come up when dealing with ASTs, although I don't recall the specifics. This is a problem that's certainly pretty easy to solve with macros. I'm pretty sure last time I ran into this I used `strum` [1] and its `EnumDiscriminants` macro to handle this.
[1] https://lib.rs/crates/strum
ahh ok ive run into this before, yes either strum or i assumed i was doing something non-optimal if i had to talk about types like this
I still don't get it. Is it like a Rust enum, but worse, because you can accidentally only detect the problem at runtime?
Someone told me once, the spoken language you think in limits your thinking.
Guess it also applies to computer programming and hardware description languages.
Linguistic relativity: https://en.wikipedia.org/wiki/Linguistic_relativity
Such enlightenment was a common read back in the glorious days of before 2023.
But reading this in 2026, when the entirety of the profession has changed (for better or worse) due to LLMs, seems strange.
Like someone writing how some new preservation method for making food last longer revolutionized how they manage their pantry, shortly after the invention of the fridge.
I like the post - it's just sad how many will not have these epifanies anymore, or they wont mean anything, and how many starting today would already just say "how quaint" and move on.
Agreed. My first thought reading this was “does this really matter anymore?”
As someone who enjoyed learning advanced derivation and integration by hand despite also owning a TI-84+ at the time: yes, it still matters.
This is not like that at all
I learned how to calculate the square root using pen and paper, and it was fun, but... I am not going to write blogs about how it made me a better person and why everyone should do this. There are so many cool things one could do, and people have different hobbies and preferences; what is fascinating for me is not necessarily so for someone else, and vice versa.
Yikes. I hope the second thought was more insightful..
Let them eat PHP.
Ugh. Swap out LLMs for formal logic, mathematical proofs, the calculator or the printing press if you want.
You're just getting older and times change. Your adolescence wasn't any more pure than the kids today.
One could argue you've frittered away your life fiddling bits around instead of becoming a thespian, writer, or musician. Alas, the epiphanies you could have had.
"A Person is either a human or a cat" -- Good article, but please use examples that makes sense.
I suspect it's a reference to catgirls, an old joke about Rust. In fact: https://crates.io/crates/catgirl-engine
Sapir-Whorf hypothesis
you guys are still coding by hand?? wild.
You cannot fix what you did not understand.
You do not understand what you did not create.