TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Projects for learning a language?

76 pointsby drywater2almost 4 years ago
Hello HN.<p>I&#x27;ve read a few books for a couple of programming languages (go, rust), but I still need some kind of project to really see the big picture and think deeply.<p>What kind of project (besides some CHIP-8 emulator) would you recommend?<p>Thank you and I&#x27;m more than curious about your answers.

35 comments

soapdogalmost 4 years ago
The best strategy in my opinion is to build something that aligns with some of your hobbies or favourite things. Do not attempt to &quot;solve a problem&quot; or &quot;do generic exercises&quot;, build something that ties up with something you already enjoy.<p>For example, if you&#x27;re into some kind of sports, build a software that helps you keep track of it. If you like cooking, build a recipe tracker. You know the gist.<p>By building something that helps you with some of your passions, you&#x27;ll feel more connected to it and more engaged with the project.<p>This does not need to be a product, or something you&#x27;d try to sell or market. Build it for you. Share it with those people you like, if you feel like doing it, but build it for you.
评论 #27569628 未加载
skytreaderalmost 4 years ago
Games of course! Doesn&#x27;t have to be fancy with graphics at first but the beauty here is graphics&#x2F;frontend&#x2F;UI is definitely on the table if you want to pursue it later. In the same spirit, it&#x27;s very easy to add features&#x2F;mechanics to it. Get creative!<p>- Simplest game ever is a number guessing game. Obviously solvable by binary search on the player side. It&#x27;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.<p>- 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.<p>- For something more complex---and I think this is your level now---people might suggest a constrained DF&#x2F;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.<p>Happy hacking!
评论 #27569204 未加载
Zannialmost 4 years ago
I like Larry O&#x27;Brien&#x27;s three-part series, &quot;15 Exercises to Know a Programming Language,&quot; [1][2][3] mostly for the overall philosophy (&quot;should be tough enough to require problem solving: try to embrace the language&#x27;s idioms&quot;) and for the rationale that comes with each exercise (e.g. implement <i>this</i> to learn <i>that</i> about your chosen language). Note: the internal links between parts of the series are broken, so here are all three parts:<p>[1] <a href="https:&#x2F;&#x2F;knowing.net&#x2F;posts&#x2F;2006&#x2F;06&#x2F;15-exercises-to-know-a-programming-language-part-1&#x2F;" rel="nofollow">https:&#x2F;&#x2F;knowing.net&#x2F;posts&#x2F;2006&#x2F;06&#x2F;15-exercises-to-know-a-pro...</a><p>[2] <a href="https:&#x2F;&#x2F;knowing.net&#x2F;posts&#x2F;2006&#x2F;06&#x2F;15-exercises-to-know-a-programming-language-part-2-data-structures&#x2F;" rel="nofollow">https:&#x2F;&#x2F;knowing.net&#x2F;posts&#x2F;2006&#x2F;06&#x2F;15-exercises-to-know-a-pro...</a><p>[3] <a href="https:&#x2F;&#x2F;knowing.net&#x2F;posts&#x2F;2006&#x2F;06&#x2F;15-exercises-to-know-a-programming-language-part-3-libraries-frameworks-and-mashups&#x2F;" rel="nofollow">https:&#x2F;&#x2F;knowing.net&#x2F;posts&#x2F;2006&#x2F;06&#x2F;15-exercises-to-know-a-pro...</a>
评论 #27569054 未加载
mikewarotalmost 4 years ago
Advent of code is an interesting set of challenges, with a generally rising set of complexity. There are 6 years worth of 25 challenges.<p><a href="https:&#x2F;&#x2F;adventofcode.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;adventofcode.com&#x2F;</a>
评论 #27573289 未加载
评论 #27569689 未加载
评论 #27569091 未加载
imranqalmost 4 years ago
I would work backwards from why you want to learn a new language in the first place. Definitely spend some time on that. Usually the reason will lead directly to a project that you <i>want</i> to work on. Otherwise it will be hard to follow through.<p>Ex: I wanted to learn C, but my reasoning was only that it seemed like &quot;real&quot; programmers knew it. But that&#x27;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.
rvieiraalmost 4 years ago
It&#x27;s not the best project for your requirements (seeing the big picture and thinking deeply), but my go-to project for general-purpose languages is to implement a Markdown static site generator with a simple plugin system.<p>It 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).<p>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?)
BrandoElFollitoalmost 4 years ago
I usually rewrite software I use at home:<p>- 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?)<p>- 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)<p>- my note taking program, because the world absolutely needs one more<p>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.
tdfirthalmost 4 years ago
I always go for a simple lisp interpreter. I think this covers a good range of techniques and gives you a pretty good feel for what is&#x2F;isn&#x27;t ergonomic in the language.<p>I don&#x27;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&#x27;t take very long, and it can be broken up into a few fairly well defined evenings - e.g. lex, parse and eval.<p>One caveat is that if you haven&#x27;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&#x27;s easy though.<p>edit: grammar
cableshaftalmost 4 years ago
I made a Flash game way back in 2004 called Proximity[1] that was fairly popular. Whenever I want to learn a new language&#x2F;platform, I tend to port a new version of that game to that language.<p>I don&#x27;t always release it publicly, but it&#x27;s a &#x27;solved&#x27; program that I don&#x27;t have to spend time reworking how the core of it works (needs a hex grid with number tiles, mouse or keyboard input, a menu system, computer opponents, etc), although I might rework some things or add new features to it.<p>I&#x27;ve done this to learn C# (and XNA), Java (and J2ME), Objective-C (and OpenGL ES), Swift (and SpriteKit), and LUA (with Pico-8).<p>I&#x27;ve also made versions in Python (text console), for Kindle, and the original was in Flash, but I knew the tech ahead of time.<p>I recommend it. Can be anything relatively simple. Make a blackjack game, a version of tetris, a Todo app, a Sudoku solver, a web service, whatever seems interesting to you.<p>[1]: <a href="https:&#x2F;&#x2F;www.newgrounds.com&#x2F;portal&#x2F;view&#x2F;183428" rel="nofollow">https:&#x2F;&#x2F;www.newgrounds.com&#x2F;portal&#x2F;view&#x2F;183428</a>
评论 #27579361 未加载
atomashpolskiyalmost 4 years ago
For learning Rust I just picked a random, reasonably sized C++ project and spent a few weeks porting it to Rust. Was more than enough to get a grip on the core language features and tools and start receiving interview offers for a Rust position (though I ultimately decided to stay on the JVM track). The project was a face detection library: <a href="https:&#x2F;&#x2F;github.com&#x2F;atomashpolskiy&#x2F;rustface" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;atomashpolskiy&#x2F;rustface</a>
评论 #27576683 未加载
ksajalmost 4 years ago
I always thought of Make A Lisp (MaL) as a great way to learn two languages at the same time. And some of what you learn about Lisp in the process will rub off on your use of the language you are working with. Ie: It might trick you into being a better programmer than you expected.<p>There are a lot of MaL examples written in Lisp even, which initially sounds redundant, but gets new Lisp programmers to learn Lisp&#x27;s internals by writing them in the same language.<p>This is similar to the &quot;old days&quot; when people used to write a BASIC interpreter or C compiler to learn a new language (writing a compiler teaches you ASM programming, so it&#x27;s a good comparison with the dual nature of MaL)
评论 #27569409 未加载
b3moralesalmost 4 years ago
I&#x27;m not sure whether you&#x27;re looking for just an idea for a project or an actual walkthrough. But either way this index of &quot;Build your own X&quot; writeups should be useful: <a href="https:&#x2F;&#x2F;github.com&#x2F;danistefanovic&#x2F;build-your-own-x" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;danistefanovic&#x2F;build-your-own-x</a><p>Ideas include building a Git, shell, search engine, and of course compiler&#x2F;programming language.
thequantizeralmost 4 years ago
Depends on your skill level, the trick to a good practice project is that is big enough that you are learning the concepts about the language that will push your abilities forward. However, it also should be small enough that you don’t waste your time solving problems you don’t really care about and that are not increasing your skills. For me I am usually learning a language to take advantage of some feature that language has. I know Go makes it really easy to create and test web servers so if that is why you picked it up trying making and testing a simple API. Maybe one that just queries two other existing APIs on the internet and aggregates the results. Making an API in Go would be good because you will need to unmarshal the json from the other two public APIs and combine the object then marshal the object to json and return it to the user. Be sure to write unit tests.<p><a href="https:&#x2F;&#x2F;golang.org&#x2F;pkg&#x2F;net&#x2F;http&#x2F;" rel="nofollow">https:&#x2F;&#x2F;golang.org&#x2F;pkg&#x2F;net&#x2F;http&#x2F;</a> <a href="https:&#x2F;&#x2F;golang.org&#x2F;pkg&#x2F;encoding&#x2F;json&#x2F;" rel="nofollow">https:&#x2F;&#x2F;golang.org&#x2F;pkg&#x2F;encoding&#x2F;json&#x2F;</a>
cpachalmost 4 years ago
Cryptopals is loads of fun<p><a href="https:&#x2F;&#x2F;cryptopals.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cryptopals.com&#x2F;</a>
评论 #27568940 未加载
axegon_almost 4 years ago
I don&#x27;t think there&#x27;s a good universal project that you can keep reimplementing in different languages and getting a good grip of the language. In your paricular case, go is more of a general purpose language so anything that involves simple filesystem and network operations(cache, databases, apis and all that) would be fine. In theory rust can do the same things but it&#x27;s a systems language and trust me, it&#x27;s not suitable for such things at all: poor ecosystem, the help you will get online is not preally great: what you will commonly get when you hit a wall when playing with something like actix is &quot;this is bad practice&quot; responses without an example of good practices. With that said, I&#x27;ve been playing around with robotics in my spare time lately and even for a beginner, I think this could be a great choice: you can pick up a decent robotics kit for 20-ish bucks and a raspbberry pi and you will have tons and tons of fun, even if you&#x27;ve never touched rust before in your life. And even if you have, it&#x27;s still tons of fun.
mrmcsoftwarealmost 4 years ago
I don&#x27;t know if I would recommend it, but I&#x27;ve noticed that in the past, whenever I moved to a different type of computer&#x2F;OS (Amiga, MS-DOS, Windows, etc.) or language (Java, Javascript, etc.), I ported my biorhythm program to the new system&#x2F;language. It starts out simple - just strings, math, file&#x2F;screen input&#x2F;output, then progresses to graphical plotting of the biorhythm curves. It&#x27;s a simple algorithm. Disclaimer, I don&#x27;t know if I believe in biorhythms, it&#x27;s just something interesting and a flashback to my childhood in the 70s.<p>Basically, I would say the easiest way would be to choose something you&#x27;ve already conquered in a language&#x2F;system you already know. That way, you&#x27;re only tackling one new thing.<p>BTW, it wasn&#x27;t always biorhythms for me - I originally wrote my Mandelbrot program in Pascal, and taught myself C in order to convert it to C so it would run faster.
评论 #27573166 未加载
elias94almost 4 years ago
Checkout 7GUIs, is an interesting gym for an environment that provide a GUI.<p><a href="https:&#x2F;&#x2F;eugenkiss.github.io&#x2F;7guis&#x2F;tasks&#x2F;" rel="nofollow">https:&#x2F;&#x2F;eugenkiss.github.io&#x2F;7guis&#x2F;tasks&#x2F;</a>
ranuzzalmost 4 years ago
If you are looking for inspiration try &#x27;500 Lines or Less&#x27; [0]. It includes in-depth analysis of projects at hand and implementation. These are manageable project with a clear goal so you will complete them for sure.<p>[0] <a href="https:&#x2F;&#x2F;aosabook.org&#x2F;en&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;aosabook.org&#x2F;en&#x2F;index.html</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;aosabook&#x2F;500lines" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;aosabook&#x2F;500lines</a>
asicspalmost 4 years ago
Check out <a href="https:&#x2F;&#x2F;github.com&#x2F;tuvtran&#x2F;project-based-learning" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tuvtran&#x2F;project-based-learning</a>
ungawatktalmost 4 years ago
I have a &quot;standard&quot; project to work on for new languages, which has enough complexity to get me coding things idiomatically by the end, but since it&#x27;s something I&#x27;ve done before I don&#x27;t need to worry much about the topic at hand.<p>The project is a hurricane modelling and visualization program, which is pretty specific to my experiences, but having that to riff on has been my way of learning scala, python, c#, and (soon, in theory) Go.
评论 #27570840 未加载
psytrxalmost 4 years ago
For me, there is no single go-to project that fits all languages. Each language has it&#x27;s own purpose.<p>Go and Rust are fairly similar in terms of parallelization and performance. Both are general purpose languages and are great at solving system problems. Choosing a toy project that requires these perks will yield the most satisfying results and enables you to get a good grasp of why those languages exist, and where their differences are.<p>Both languages empower you to build inter-system applications, both languages are highly performant and both let you build safe and tested programs. A distributed ray tracing engine comes to my mind - it would allow you to let both languages collaborate, compare solutions to problems between the languages and get into the nitty gritty details of memory management, allocations, garbage collection etc.<p>This would probably be my pick, because you can build and improve it for years if you really want to put the effort in it.<p>Here&#x27;s a great primer on that topic - it&#x27;s still actively developed and made me look at modern ray tracing technology in awe.<p><a href="https:&#x2F;&#x2F;raytracing.github.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;raytracing.github.io&#x2F;</a>
Iasluharalmost 4 years ago
If it is helpful in anyway, I found this answer very interesting<p><a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;learnprogramming&#x2F;comments&#x2F;g98sn4&#x2F;spent_the_last_100_days_learning_to_code_and_told&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;learnprogramming&#x2F;comments&#x2F;g98sn4&#x2F;sp...</a>
Havocalmost 4 years ago
Build something that solves a problem you have right now. Even if it&#x27;s a trivial problem and nobody else will be able to use the solution except you.<p>That forces you to think real world usability etc
评论 #27569397 未加载
eatonphilalmost 4 years ago
If you&#x27;ve already been programming for a while then a great project is to reimplement the language in itself. You&#x27;ll reinforce a lot of aspects of the language while you do this (since you&#x27;ll be looking up what syntax exists and what it means exactly, all the time). Plus, building language implementations is always fun.
devoutsalsaalmost 4 years ago
Sometimes I’ll write a unit testing library with a terse syntax&#x2F;DSL to learn a new language. That pushes me to learn how to bootstrap tests to test the testing framework :) It usually helps me get into some of the more advanced language features. After that, most things I do in the language feel relatively easy by comparison.
brudgersalmost 4 years ago
Some famous programmer or another uses Conway&#x27;s Game of Life as an exercise for learning a new language.
johntashalmost 4 years ago
It&#x27;s been a few years, but every time I learn a new language, I like to try and make an IRC client or IRC bot in that language.<p>It gives you an idea of what the language can do and how to handle network connections with it.
brundolfalmost 4 years ago
A raytracer was a good early Rust project I did. I&#x27;ve also done a Lisp interpreter, a partial jq reimplementation, and Conway&#x27;s Game of Life. Go would probably also lend itself to these projects.
fish45almost 4 years ago
I almost always start with a few of the first eulers problems, followed by flappy bird and&#x2F;or a sudoku solver, and then a super simple interpreter
fruityrudyalmost 4 years ago
Build something for a friend’s problem. You then have a customer that is not you, and external motivation.
chrismsimpsonalmost 4 years ago
There’s nothing like <i>creating</i> a programming language to throw yourself in the deep end!
simongauldalmost 4 years ago
I’ve found Advent of Code to be great for learn a new language projects.
laserbrainalmost 4 years ago
A roguelike game.
aibalmost 4 years ago
A raytracer is simple enough and fun.
visoxalmost 4 years ago
i often did try to implement the minimax algorithm on tic-tac-toe. Its not too complicated.