What type of fun are you after?
Type 1 is probably python.
Type 2 is probably rust or c.
Type 3 is one of the esolangs. Uiua. Or assembly.
Ask the main part of your question in the title. This should be concise but informative.
Provide everything up front. Don't make people fish for more details in the comments. Provide background information and examples.
Be present for follow up questions. Don't ask for help and run away. Stick around to answer questions and provide more details.
Ask about the problem you're trying to solve. Don't focus too much on debugging your exact solution, as you may be going down the wrong path. Include as much information as you can about what you ultimately are trying to achieve. See more on this here: https://xyproblem.info/
Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient
What type of fun are you after?
Type 1 is probably python.
Type 2 is probably rust or c.
Type 3 is one of the esolangs. Uiua. Or assembly.
Haha thats great. Thanks for the taxonomy of fun. I have been trying to learn Rust but I find the payoff is still a ways away, so something to keep me going in the meantime would be good. So I guess 1 is the way to go, because if I want to keep going back then that's good motivation.
Go is probably the best in terms of time it takes to learn and building something fun. It replaced Python in that regard for me.
I'm curious what you mean by the payoff being a ways away. Do you feel you don't understand some aspect of Rust well enough to write anything in it?
As a tangent to that and your original question what languages do you already know? Understanding where your knowledge is lacking could help provide better answers as what languages someone enjoys learning/using tends to change a lot as they become more experienced and start to develop an appreciation for the more complicated problems more involved languages help solve.
I feel like the payoff is a ways away because, I write something that should work, but then I need to wrangle with the compiler for sometimes multiple days just to get it to work. To answer your second question, I know a very small amount of Python and some Typescript, but I'm mostly familiar with Javascript. I do think that is part of what's going on here. Javascript is super losey goosey and not typed. So then my brain translates Javascript code to Rust and it just leads to total chaos.
Aaaah, yeah. You're struggling with thinking in terms of types and scopes and probably also a tiny bit of stack vs. heap allocation. Javascript side steps most of the concurrency problems by having a single threaded runtime, and of course is a garbage collected language so you never really need to worry about memory management either.
Rust is a much more powerful language, but of course with power comes responsibility. The compiler believe it or not is actually helping you a lot even though it probably doesn't feel like it. In something like C you'd probably be able to successfully compile those programs that Rust refused to build but then you'd get crashes and weird bugs when you ran the program with very few clues on where you made a mistake.
Fundamentally here's the difference. Javascript is making the tradeoff that it will worry about a lot of the details for you, but it will get them wrong a lot and performance will suffer as a result. It also doesn't give you a lot of ability to express your problem well due to its incredibly primitive type system which will lead to a lot of bugs that are very hard to diagnose.
Rust on the other hand says you need to worry about the details but it will give you some tools to make managing them easier to the point where you can ignore them a lot of the time. E.G. most of the time you can just stack allocate your variables and not worry about heap allocation and the headaches that can introduce. But the tradeoff for that is you can get some of the best performance out there and its advanced type system lets you model problems in ways that make bugs far less likely and much easier to diagnose and fix.
Rust doesn't let you write code that works 90% of the time but fails 10% of the time, it forces you to write it in a way that works 100% of the time. This is particularly true for concurrent code where Rust prevents (mostly) race conditions that nearly every other language lets you write. If you're thinking some code that should work isn't compiling it's almost certainly because that code would fail with some kind of race condition under concurrency. The good news is once you start to understand where these problems crop up it's usually easy to resolve them by putting a Arc or RwLock wrapper around something or maybe just a simple .clone() if you don't mind the performance hit.
Type 3 is brainfuck.
I bet esoteric languages are fun, if you're the right type of person!
yeah, if you want something really esoteric check out piet. it doesn't even use letters or numbers, the code literally just looks like abstract art
I don’t need something practical. I just need something fun to keep me motivated.
People have already mentioned Lisps. So, I wont repeat that. So, let me tell you about this great one.
Forth. And the best way to learn forth is by implementing one for yourself. There are lots of forths out there, almost as many as prolific forth programmers, I suppose. You are supposed to find your own forth. Forth is one of those rare languages (along with Lisps) where you build the language upwards to fit the problem you aim to solve, than convert the problem down to code. Here's a blogumentary on forth for your perusal.
It is not an easy programming language to learn. The concepts you need to understand is quite low-level. "Real" forths are usually implemented in assembly. If this sounds fun to you and you have time and patience to take the challenge, have a try.
That blogumentary is quite a journey!
If you’re looking for something fun to write you might want Ruby. Literally built from the ground up with developer satisfaction as the primary goal.
Very expressive, plenty powerful. Not my absolute personal favorite but I can’t deny it’s satisfying to use.
Haskell or Clojure (or Common Lisp) if you want something weird but neat as alternatives.
People calling functional programming weird hurts me. It's just unfamiliar not weird.
Weird is subjective. If you’ve only ever done C++ style object oriented programming then jumping into a lisp or a pure functional language is absolutely weird.
I've seen a lot of technical recommendations, but what I found most fun to experiment with is visual/art/music stuff, so here are some recommendation if that's also your thing. It's not strictly programming, because most of it requires learning more skills than just that, but I see that as an advantage. YMMV, though.
The Book of Shaders is and extremely good introduction to some basic shader stuff. Especially thanks to the interactive editor they have in their tutorials, and web tools like Shadertoy, experimenting with shaders is easier than ever. It was the tutorial that made me finally get past the "super confused" part of learning shaders.
It's kind of math heavy, especially once you get into 3D stuff, but I find it fun to learn, plus it's a rabbit hole and you can do some pretty cool stuff once you get into it. In general, anything technical artist related is interesting.
Another thing I'd recommend is looking into Algoraves. Algoraves are live performances where both visuals and music is performed by people live-coding their tracks and projections in some kind of language that's made for the task. TidalCycles, one of the libraries/languages that's commonly used, has a web editor, and there's also Sonic Pi, although I've never tried that one.
Processing is another language/tool used for making visual art. It also has a web edittor (with a lot of tutorials), and can make some cool visual stuff that can be fun to learn.
And one last recommendation, this time not about art, but about learning/building your CPU, your own assembly language, and learning to do stuff in it! Turing Complete is a puzzle game, where you will learn how to build your own CPU, starting from a single NAND gate, slowly combining them into registers, memory, adders, ALU, up until you have your own, complete and working CPU. You then create your own instruction set and use your CPU to solve a few puzzles.
It's super fun and engaging, and I'd consider learning logic gates and building a CPU as kind of also programming.
since you mentioned Rust, it can also be a matter of how you approach learning it – maybe learning a game might be more comfortable – as an example, Reddit’s r/roguelikedev links to multiple tutorials in multiple languages (with at least three Rust based options):
So, I can't answer the question of "what's the most fun language to learn" because that's highly subjective and my answer almost certainly wouldn't align with your experience. What I can do though is share my thoughts about different languages I've used over the years (in no particular order).
Assembly: ... but it’s not hard in the “I don’t get it” way, so much as “oh god, that’s only 1% of what I need to do and it took me an entire day”. This is also a great way to develop a deeper understanding of pointers and memory management.
Well explained.
Although I understood memory beforehand, I found the little bit of Assembly I did pretty useful in getting a better understanding. This also ended up opening me to think of how multithreading worked underneath.
I found C pretty fun, but that might be my bias.
It was fun because it felt pretty close to hardware and let me understand how stuff can go wrong, without tripping me into it (the last part is subjective. I suppose most people would feel having been tripped, when using C).
C++ was fun and useful as long as I thought of it like C. Once I went into software development and had to make sure stuff worked out well on top of mistakes that might come out of collaboration, I had to start considering things like smart pointers almost all the time and it was no longer as much fun.
Rust is definitely not going to give the fun of C. Although it is more desirable for Software Development, when you start learning it, you will find quite a few blockers, that you might feel unreasonable. Me, even after having used C and C++ and realising the problems faced when making software and then having seen proper explanations of the features of Rust, still have a problem with the feeling of it.
Python: if you just want to do some mathematics on computers, this will be more desirable. The "fun" for this one is that you don't need to worry as much when doing some scratchpad stuff. Start going big though and it stops getting any fun, pretty fast.
take a look at one of the “fantasy consoles”, can do quick scripts and see results immediately:
for an actual language, don’t discount Lua – simple, fast, tiny – “real programmers” like to ridicule it, and yet it keeps turning up everywhere from video game scripting to text editor configuration to databases to web servers
Lua to me is the language JavaScript wishes it was. It's super minimal and actually designed reasonably well. It knows what it is and isn't trying to be something else. I wouldn't want to try to write an entire app in it, but for a scripting language embedded in something else there's not a lot of languages I'd rate higher.
Easy: CircuitPython running on an RP2040 or RP2350 microcontroller. Being able to write a simple bit of code and have it control something in the real world is sooooooo satisfying. OMG: You'll jump for joy the first time you get it controlling some LEDs, a display, a servo, a motor, etc.
Programming a microcontroller for the first time was definitely the most fun I ever had when programming. CircuitPython makes it so easy, too! Oh if only it had existed back when I started learning electronics.
100% agree! I write enterprise monsters for a living, in a bunch of different languages, and by far my favorite thing to do is make blinken-lights and other doohickies with my Arduino.
Doesn't have to be Python or even the Arduino subset of C++, though. I like to use Go (tinygo.org) for anything that it will compile on
My favorite these days for embedded stuff is Rust. It's soooooo nice.
Elixir. Especially with OTP to write distributed systems. Or with phoenix and liveview for web apps
It's a functional language based on Erlang with a nicer syntax
Learn what makes LISP LISP (lambda calculus), then start creating LISP-like interpreters in. every. language.
This video might pique your interest in the topic - William Byrd on "The Most Beautiful Program Ever Written" [PWL NYC] (tldw; he explains and shows how to build a LISP interpreter in LISP)
Probably Python. It’s very accessible.
I was looking for some 'Big Daddy-O' super-fun rando programming language that some guy wrote in C over the weekend in his garage, but Python should work too.
Lolcode:
HAI 1.2
HOW IZ I FIZZBUZZ YR INPUT
I HAS A RESULT ITZ A YARN
I HAS A FIZZ ITZ MOD OF INPUT AN 3
I HAS A BUZZ ITZ MOD OF INPUT AN 5
C and assembly if you like learning how computers work
Python and typescript if you want to make blinky lights
How does C compare to Rust? I've heard you can learn the syntax in a weekend, but you spend years trying to master it because of all the memory leaks and such that it leads to. Would you say that's accurate?
Python is like your automatic transmission. It handles a lot of work on the backend to make life easier, but the trade off is performance and control.
In C/C++, you’re reaching into the gearbox and moving it by hand. It doesn’t clean up anything for you and doesn’t prevent you from making dumb mistakes. In exchange, it can be wildly faster than Python.
In Assembly/Binary, you’re crafting the gears before you can even start the car.
Rust is close to C++, in that you get a lot of high level constructs to help you. C is very low level, and you can learn the syntax in a weekend, but you'll also have to learn memory management and implement advanced structures (linked lists, etc) yourself.
Memory management isn't too hard, it's mostly remembering who created what, who reads and writes to it, and who is responsible for cleaning up. With some additional comments as you go it's not too hard. Also, depending on what your doing, leaks may be acceptable. A short lived program can leak all it likes, and the OS will clean up for you ibthe end :D
So C is basically assembly with a bunch of syntactic sugar on top. It manages a lot of the book keeping and boilerplate, but at the end of the day there's not a ton of difference between them in terms of the abstractions it provides. If you know assembly learning C is a piece of cake. If you don't you're probably going to take a while to really wrap your head around pointers and the myriad ways C can use them for great and terrible things. Beyond pointers (and race conditions if you're crazy enough to do multithreading in C) the rest of C is super easy because there really isn't much else there.
Rust on the other hand is a much higher level language more comparable to something like Java, C++, or Python. It gives you a lot of tools to solve complicated problems but unlike Java and Python and like C++ it still gives you the option of working at a low level when you need to. The big advantage it has over C++ is that it learned from the many mistakes C++ made over the years, and the borrow checker really is a unique and powerful solution to both memory management but also crucially concurrency problems.
Interesting. I always assumed that Rust would be more similar to C since they are now using Rust in the linux kernel
No, for a good modern C alternative I'd look at Zig. The main reason C is used for the Linux kernel is because Linus hates C++ for a variety of reasons. For what it's worth I agree with him. Most other OS kernels are written in C++. Linus allowed Rust in because it demonstrated that it could provide the same power as C++ without all of C++'s problems (mostly that over the years it became a kitchen sink language, anything that anyone ever thought might be a good idea got rolled in even when it was incompatible with some other feature already in the language).
Somewhat. The issue isn't memory leaks themselves so much as learning project architecture, patterns, and generally how to do things without shooting yourself in the foot.
Rust has plenty of gotchas and unintuitive elements, so they're not too different in that sense. Though Rust is more likely to point out when you've done something wrong, where as C will exercise your debugging skills.
Modern C++ is also an option, and surprisingly easy to use. The only catch is that the errors can be very difficult to parse and it's hard to find modern best-practice materials to learn from since most of industry is quite far behind compared to where the language is.
One benefit Rust has is that it's quite new and niche, so the materials tend to be of fresh, without much legacy mindset, and of a relatively high quality. Tbh I'm not sure how Rust is for newbies, but it may be worth a shot. At the very least, the community is passionate and the errors will be readable...

If you really want to immerse yourself, also use it as the config. language for your Linux distribution.
Stretch your project legs with writing a simple web app. with it.
Explore the sheer joy and consummate beauty of minimal syntax.

Python is one of the more forgiving and extremely versatile.
I highly recommend checking out the game “The Farmer Was Replaced” on Steam as it might be the best way to introduce yourself to programming concepts outside of a classroom. (Not affiliated, just love the game XD)
Then in no particular order:
And as always - learning the anti patterns is more important than learning the patterns.
Hey thanks for the game recommendation. It's always nice to have some leisurely activity that is fun to do but you can feel productive doing anyway. Thanks for the language list too.
This might be a basic question but what do you mean exactly about 'learning the anti-patterns'? Can you expand on that?
I had the most fun learning Haskell. Mostly because it was so different from the languages that I knew. Also, learning Lean was fun. But I guess that's kinda niche since it's not very relevant for anything but pure mathematics.
Logo. Turtle graphics spirographs go weeeeeeee!
At least, that's the most fun I had programming as a kid. There might be other good options nowadays, like Scratch or whatever they use to program those Lego robots.
I am having the time of my life with Clojure. Lisps in general. They really change how you view software. I was showing how clojure works to my Java coworker and showing her the REPL and powers of Clojure, and we both almost teared up :)) It's tgat good.
The most fun languages to learn that I have learned so far, are Haskell, Factor, Prolog and Agda. Each are quite different from mainstream programming and each other, and it is really satisfying when concepts "click"
So, if you're brand new and want to learn concepts of how to write code, I might suggest a game. There are a lot of programming games. Obviously it's never a one to one about learning something useful, and a lot of them even make "bad" things useful (though not bad enough to think it's going to teach you bad habits you won't be able to unlearn). I really enjoyed Exapunks, but it's sort of unrealistic. The Farmer Was Replaced looks fun as well and uses a "simple Python-like" language, but I haven't played it.
If you sort of already understand the concepts and want to dive into a real language, well, it's hard to say what will be fun. Chase your fun. It might be easier to think about what's not fun and avoid languages at the start that deal with that. For example, if setting up an environment to code in is the problem, then maybe something like JavaScript would be a good place to start. It runs in your browser! Press F12, click "console", type alert("Hello, World!"), boom, done, you just did Hello World in JavaScript without downloading anything at all.