Good project ideas for beginners

@kristoff Mentioned in his live today that learning Zig by making a web service it’s not the best place to start development with Zig, because it’s kinda boring and you can do that with other languages easily, and that would be missing the point of using Zig.

Thinking about that, do you folks have any suggestions or particular ideas for projects to have fun and learn about Zig? I’d love suggestions!

4 Likes

Build something that you enjoy.
It might be a game, like tic-tac-toe or hangman.
It might be blinking a led with a microcontroller.
If you like math you might start here: https://projecteuler.net/

2 Likes

A parallel question is “what would be a fun project to build in C” or another low level language.

I find it fun to try going in both directions. Find something that you can try to express with nothing but the baseline primitives and then try to do the same thing only using standard utilities.

I agree! But I’d like to have named ideas as well in this post, something that you think is an interesting project and that you’ve tried and learned a lot from. I think the best thing is really to combine what you’re learning with something you like or need, but this is also a dangerous path, because while being a newbie you may not understand the size of your idea, how huge it is -“Wow I would love to make a GTA 6! I already know how to define a Player struct”, which can bring frustration and make you give up for trying to make something too big right from the start, It can also be a bit difficult to put together things you like with your learning, so solid ideas would also be good!

If you pick really small and simple little ideas, you can finish them quickly and I think that way it is easier to pick an idea for the next project.

Personally I think games are a good target if you want to explore a lot of things, but I think it is important to keep things practical and get going / actually work on it, instead of just accumulating more and more ideas.

Because that practical experience allows you to gauge which ideas you could quickly realize and which ones are manageable vs too big.

Well you always could start with something more like GTA1/GTA2 ;), or if you want something simpler you could create a Bulletheaven/Vampire Survior type of game (or anything else you find interesting).

Then break that down into even simpler parts:

  • open a window and have something rendered
  • add some keyboard controls to change what is rendered
  • move the camera
  • have some player entity
  • make it shoot a bullet
  • add an enemy
  • make bullets hurt entities
  • pick up an item

I think over time you will naturally have more and more ambitious ideas for what you want to add / improve about the game and that will lead you down specific topics like how to do spatial partitioning (e.g. via a grid) so you can avoid slow collision checks etc.

I might be biased, but my short answer is start with raylib and get stuff on the screen, get it to move, load and play sounds, then try to find something that is fun and iterate on that. Raylib example using the package manager

2 Likes
  • I always find writing an interpreter or simple compiler (lexer, parser, vm) for a simple language to require learning a lot of the fundamental components of a programming language. I specifically enjoyed the Thorsten Ball books on this. They’re for Go, but porting them to Zig isn’t that hard.
  • A simpler version of the interpreter idea would be a calculator.
  • An old-school text based adventure game would be cool.
  • Converters for different units of measurement.
  • File format parsers. Markdown, YAML, INI. Bonus points if you convert from one to another. :^)
  • Invent your own compression format. It doesn’t have to beat zstd or brotli but just making you analyze the problem space and work a solution can be a great learning experience.
5 Likes

I’d like to point out that doing something that isn’t straight up wed development doesn’t mean that you must avoid it entirely.

As one example I think that a TUI twitch chat client like bork could be a fun project that has in it a good variety of subtasks:

  • terminal ui design and implementation
  • opening a tcp connection to speak IRC with a server
  • parse IRCv3 messages
  • OAuth, which includes spinning up a local webserver to capture the token
  • serialization and parsing of config files
  • unix sockets for remote control of the application
  • multithreading for concurrent rendering of the application / networking / remote commands
  • websockets for twitch new follower notifications

So don’t fully discount web-related stuff, but yes, I do stand by my take that picking up Zig just to do pure webdev stuff that you were already doing in, say, Go, won’t give you the best overview of what you can do with Zig.

1 Like

Lots of fun ideas! I’m certainly going to give some of them a try, and get inspired to create things based on them, hopefully other newbies will be able to feel motivated by them as much as I do. :laughing:

I’ll leave this post open in case more people want to share their thoughts and ideas, thank you everyone! :orange_heart:

3 Likes

The answer will be different for everyone. What kind’s of projects have you enjoyed in the past? Are there particular areas that sound interesting/exciting to you?

One of the projects that I started with Zig was doing basic compression/decompression. Specifically I started with huffman encoding/decoding and am trying to build up to doing a naive implementation of the DEFLATE rfc which includes Lempel-Ziv77 encoding. It’s been just fun to try out different implementations and to just see the difference in performance. It also taught me just how useful Finite-State machines are and is a good lesson in understanding performance (cache coherency, instruction level parallelism, etc) and memory management.

2 Likes

I started with almost no Zig knowledge and I wanted to make use of Zig’s low level things, so I started developing a (currently progressing) operating system.
The project (an operating system) is a really long task, but that way you will keep improving your Zig code. Start with a small one (just a bootloader that loads a “hello world” kernel), extend it with time.

Do you have any resources about this? For those who are interested in developing their own simple operating system but don’t know where/how to start.

Hi, here’s a list of mostly uni courses, but there’re some practical beginner guides, too. Poke around, see if you like anything:

I guess the most up-to-date and high quality resource there is this Rust tutorial. In fact, I’ve seen people start Zig ports of it like this one here.

5 Likes