If one knows C++ then Peter Shirley's https://raytracing.github.io/books/RayTracingInOneWeekend.ht... is a pretty nice raytracer one can type in any language.
Ask HN: What is the coding exercise you use to explore a new language?
11–20 of 73 posts
Re: Ask HN: What is the coding exercise you use to explore a new language?
#12I write a bittorrent node. It goes over many topics I'm interested in: potrntially low-level networking, storage, bits and bytes fiddling, concurrency. The protocol is shockingly simple, and the end result is both easily testable and actually useful.
Re: Ask HN: What is the coding exercise you use to explore a new language?
#13I work through a good portion of the Crafting Interpreters tutorial (you create an interpreter for the toy Lox programming language). https://craftinginterpreters.com/contents.html
Gives me a chance to learn the new language with a project that's decent in size, without it being debilitating. Plus, it is fun writing an interpreter.
Re: Ask HN: What is the coding exercise you use to explore a new language?
#14I commonly build a name generator based on travesties or Markov chains. I can write a simple version of it in a few minutes in a familiar language, but it exercises file IO, some simple data structures, string operations, and some randomization. Gives me a good first general idea of what it will be like to work with a new language.
Re: Ask HN: What is the coding exercise you use to explore a new language?
#15My go to is solving problems from Project Euler. Have learnt a few languages this way.
https://projecteuler.net/
Re: Ask HN: What is the coding exercise you use to explore a new language?
#16I want an official certification of 140 IQ and your comp sci degree from everyone posting here. Otherwise do fizz buzz and go do some easy level problems on code wars. Much more makes little sense when you don't even know the array initialization syntax yet.
Re: Ask HN: What is the coding exercise you use to explore a new language?
#17If the language isn't well represented yet on rosettacode.org I like to learn about a language by implementing rosettacode examples in it: https://github.com/eterps/odin_rosettacode
Re: Ask HN: What is the coding exercise you use to explore a new language?
#18I use Advent of Code every year to improve my understanding/facility with some language that isn't a strength of mine. The benefit of doing that is that it's well-paced and interesting to me. The downside is that at least 35% of AoC is algorithmic and once you discover the "trick", redoing that AoC puzzle in a new language is less interesting (though it will still drive understanding of the new language).
If you wanted smaller exercises, you could take some of the leetcode exercises and grind through them on your own (outside of the leetcode framework if your language isn't represented there; if it is represented there, the Leetcode easy and medium are pretty good and there's loads of them).
Re: Ask HN: What is the coding exercise you use to explore a new language?
#19I do a plain http server. String munging and sockets are pretty core to everything I do.
Re: Ask HN: What is the coding exercise you use to explore a new language?
#20John Carmack re-implementing Wolfenstein 3D to learn Haskell comes to mind.