Ask HN: Projects for learning a language?
11–20 of 61 posts
Re: Ask HN: Projects for learning a language?
#12I don't generally bother with features like macros etc, I just get enough going to define and evaluate functions in a repl. When you keep the scope small like this it doesn't take very long, and it can be broken up into a few fairly well defined evenings - e.g. lex, parse and eval.
One caveat is that if you haven't written a toy interpreter before then it will take you a bit longer. Once you know a little about the common techniques and patterns it's easy though.
edit: grammar
Re: Ask HN: Projects for learning a language?
#13It allows me to test a few things I care about: filesystem operations, templating engine, reflection (or lack of), string parsing, testing, build systems. It also gives me a feel on the ecosystem (e.g. how many good quality Markdown parsers? Do I have to write my own).
Also, because I have a few of them I can make something of a comparison between languages for this particular use case (how long did it took me? how fast does it process the sources?)
Re: Ask HN: Projects for learning a language?
#14Re: Ask HN: Projects for learning a language?
#15Re: Ask HN: Projects for learning a language?
#16- Simplest game ever is a number guessing game. Obviously solvable by binary search on the player side. It's like an exciting counterpart for Fibonacci for learning PL flow-control structures. Additional features: limit number of guesses, make players guess floats instead of just ints. Latter will obviously teach you about FP handling in your language of choice.
- Next up, make that two dimensional, so the player is now guessing coordinates instead of numbers. Needs more math, you will definitely implement the distance formula. You can add a backstory if you like (are you bombing enemies in stealth perhaps?) and add mechanics based on that backstory.
- For something more complex---and I think this is your level now---people might suggest a constrained DF/Rogue-like. But me, that always grows more complex than a pedagogical device when I do it. So I stick to boring text games, sometimes inspired by game shows. Quizmaster-types (ala Who Wants to be a Millionaire), hangman-types (ala Wheel of Fortune), would force you to create structures for abstraction, all staying within complexity budget.
Happy hacking!
Re: Ask HN: Projects for learning a language?
#17https://www.reddit.com/r/learnprogramming/comments/g98sn4/sp...
Re: Ask HN: Projects for learning a language?
#18- a monitoring system for my home automation devices, the checks go from generic (is the site up?) to specific (are the water leak sensors up?)
- a program to keep track of the chores my children are supposed to do (a backend with an API, a mobile application and a hook into the home dashboard)
- my note taking program, because the world absolutely needs one more
I use a bus for communication (MQTT) but also APIs, so the rewrite quickly brings me into the technicalities of the language as I do not have th reinvent how the programs work. On the other hand, these rewrites led to plenty of improvements.
Re: Ask HN: Projects for learning a language?
#19Ex: I wanted to learn C, but my reasoning was only that it seemed like "real" programmers knew it. But that's not a good reason. Instead what I really wanted was to get closer to hardware and build software that did low-level operations. So I learned objective C and build audio-processing software for iOS that I actually wanted to work on. So I was able to learn a bit of the language and a bunch of other cool things that I still use today.
Re: Ask HN: Projects for learning a language?
#20Cryptopals is loads of fun https://cryptopals.com/
I always turn to Cryptopals when kicking the tyres on a new language.