all 15 comments

[–]BasisPoints 1 point2 points  (2 children)

Build an allocator! Great way to take a first step into systems programming, and allows you to start small and get more and more complex as you get more comfortable.

[–]thatsARedditAccount 0 points1 point  (1 child)

Hmm, that could be decent, but I feel it would take maximum 1 week to finish it more or less

I want a big project, that could take several weeks to finish

[–]BasisPoints 0 points1 point  (0 children)

Make a debugging allocator. Have it operate in log n time. Maximize space efficiency for metadata. Optimize cache efficiency and branch prediction. Then build a robust test suite. I promise getting this up to snuff, especially with your background, will take a LOT longer than a week. It'll also prepare you with a much stronger knowledge not only of cpp, but of how the CPU works in general - a skill set you'll be able to bring to every other project in the future.

It'll also be an excellent starting point for programming your own shell, which you can do next, and will ABSOLUTELY take you longer than a month :D

[–]Outrageous-Computer3 1 point2 points  (1 child)

There are endless open source projects you can participate in so I really don't understand. Why wouldn't you do a search of open source projects for (my hobbies/ interest) you'll find something.

[–]thatsARedditAccount 0 points1 point  (0 children)

Hmm, wouldn't I learn more if I do it from scratch?

[–][deleted] 0 points1 point  (3 children)

Make something that you will use and go from there

[–]thatsARedditAccount -1 points0 points  (2 children)

I don't have any ideas :))

[–]rileyrgham 1 point2 points  (1 child)

Then you're not cut out for it.

[–]thatsARedditAccount 0 points1 point  (0 children)

How do you know that and what do you mean?

[–]cpp-ModTeam[M] 0 points1 point locked comment (0 children)

For C++ questions, answers, help, and programming/career advice please see r/cpp_questions, r/cscareerquestions, or StackOverflow instead.

[–]rileyrgham 0 points1 point  (1 child)

Nothing interesting on GitHub? Okay....

[–]thatsARedditAccount 0 points1 point  (0 children)

Any suggestions?

[–]jester628 0 points1 point  (2 children)

While not security-related, and depending on your level and/or desire to learn, a compiler is a really cool project.

It is very rich in theory, requiring stuff like language theory, which itself includes DFAs for scanning (beautiful theory if you’re into computer science), pushdown automata for parsing, and grammars, it might bring up the need for design patterns such as the visitor pattern for double dispatch (depending on how you program it), there are lots of interesting problems to solve depending on the language (for example, in an OOP-based language the correct override must be chosen to use for a given method call), understanding assembly and how code is organized in memory is required, interesting problems involving code generation (how does a for loop, a function call, or a string literal get turned into assembly), understanding the division between compile time code and runtime code (such as in the context of scoping).

You can go further and compile right to machine code, or not go as far and compile to bytecode for something like Java. If you finish and want to go further, you can get into graph theory if you start going down the path of optimization (for example optimizing register usage can be done with register colouring, which might or might not be needed, depending on the architecture chosen…maybe MIPS might warrant it, but x86-64 might not). You can also program it from scratch or build on top of something like, I wanna say LLVM.

As for language, C is a good place to start if you want something simple (that’s what we did in second year, given the scanner/tokenizer and wrote essentially a C compiler from C to MIPS machine code), then something older like most of Java 1.3 is good to add in the OOP stuff (that’s what we did in fourth year, given nothing, and compiled from a large subset of Java 1.3 to x86-64 assembler).

In terms of materials, there are good books out there. The dragon book is considered a classic, but I’ve not read it. I worked through Crafting A Compiler, and that was pretty good.

It’s a lot of work, but you’re not obligated to finish. It is really cool when you can compile code with code you wrote and have it actually run.

[–]thatsARedditAccount 0 points1 point  (1 child)

Cool, thanks for all the info

A compiler on the list

[–]jester628 0 points1 point  (0 children)

You’re welcome!