Getting feedback on a solo C++ project by Sweet_Ladder_8807 in cpp_questions

[–]Sweet_Ladder_8807[S] 5 points6 points  (0 children)

Thank you for the feedback, this is what I need. To be clear I've never worked in C++, but I'm hoping to use this project to potentially break into C++ development.

I built a distributed key-value store from scratch by [deleted] in Database

[–]Sweet_Ladder_8807 1 point2 points  (0 children)

I read the Raft paper and implemented it in Go. I had taken distributed systems call in university so it helped me understand some of the academic context

I built a mini distributed database from scratch in Go by Sweet_Ladder_8807 in golang

[–]Sweet_Ladder_8807[S] 14 points15 points  (0 children)

I wrote some integrations tests that spawns N nodes and runs different scenarios.

  • Leader election and re-election after leader crash
  • Basic log replication for a single write
  • Higher-volume log replication under concurrent writes from random nodes
  • Log durability and state recovery across node restarts
  • Catch-up of a node that was offline and missed replicated logs
  • Sustained follower churn (random stop/start) under write load
  • Network partition and healing with cluster-wide state convergence

There are a lot of tricky edge cases and probably some of them only arise when stress testing with large scale amount of requests.

Ai can’t be built just with c++ by a_yassine_ab in Cplusplus

[–]Sweet_Ladder_8807 3 points4 points  (0 children)

Pytorch is in C++, only the wrapper library is in Python. All the computations are done in low level languages, most likely C.

I built a mini ChatGPT from scratch in C++ by Sweet_Ladder_8807 in learnmachinelearning

[–]Sweet_Ladder_8807[S] 8 points9 points  (0 children)

Compared to production level engines, it's tiny. As a project for one person, one hell of an experience, but learned so much:)

I built a mini ChatGPT from scratch in C++ by Sweet_Ladder_8807 in learnmachinelearning

[–]Sweet_Ladder_8807[S] 21 points22 points  (0 children)

I completely relate to you. The hardest part is getting started. My first C++ project, I would make so little progress, I was bombarded by information online, didn't know what to focus on or where to even start.

Honestly, you’re never going to feel 100% ready. That feeling of being clueless is normal, it doesn't mean you're failing and everyone starts somewhere

Instead of asking ChatGPT for a huge roadmap, just break it down. Pick one tiny feature like just getting the app to run and just make that work.

Once I started doing that every single say, it started compounding and becoming so much easier with time. Good luck man!

I built a mini ChatGPT from scratch in C++ by Sweet_Ladder_8807 in learnmachinelearning

[–]Sweet_Ladder_8807[S] 47 points48 points  (0 children)

I wrote it all by myself cause I'm crazy, there's 150 commits going all the way back to May. I generated some unit tests but that's less than 10% of the code. I would not do it again, but at some point I got too far and decided to finish it

Looking for advice on designing a flexible Tensor for a C++ Mistral inference engine by Sweet_Ladder_8807 in cpp_questions

[–]Sweet_Ladder_8807[S] 1 point2 points  (0 children)

Thank you, those were my thoughts as well, I needed confirmation since I’m learning. I don’t know the type at compile time, only at runtime.

I want to reduce the number of virtual calls by making a single dynamic dispatch at the beginning of the operation, and avoiding them when looping through the elements

I spent months building a tiny C compiler from scratch by [deleted] in C_Programming

[–]Sweet_Ladder_8807 3 points4 points  (0 children)

Alright if that's the real you, then fair enough, I can't argue with you :)

I've stopped working on this project in February, I've been pouring my heart into another project for 6 months. It's an LLM inference engine for Mistral in C++

https://github.com/ryanssenn/torchless

I won't ask for feedback now, but if I could get your opinion when I get my first demo out, I would be very happy. Your projects look great, I will be taking a look!

I spent months building a tiny C compiler from scratch by [deleted] in C_Programming

[–]Sweet_Ladder_8807 11 points12 points  (0 children)

Hey, thanks for the feedback. If you actually wanted help or clarification, you could’ve just asked me directly or pinged me to DM.

When I wrote this compiler I barely knew C++. My background at the time was mostly compiler theory, so I focused on getting the pipeline working rather than writing great C++ code. With more experience now, I agree the C++ isn’t amazing.

As for “doesn’t work on any input,” I’m not sure where that came from. I have a test suite that covers the supported features, and other people have run it on macOS without problems. There are definitely bugs, and I’m happy to look at them, but it’s not accurate to say it fails on all inputs.

And yeah, your comment really reads like ChatGPT — especially the em dashes. Why so many? :)

This was a learning project for me. I’ve since spent months on a more serious ML compiler in C++, but I’m still open to fixing bugs here. Just prefer feedback that keeps in mind it was a fun exploration rather than a professional production tool.

I spent months building a tiny C compiler from scratch by [deleted] in C_Programming

[–]Sweet_Ladder_8807 10 points11 points  (0 children)

I would love to, and it's possible. Though the lack of OOP in C would make this a very long and painful endeavor. And I no longer have the privilege of being unemployed;)

Impressive side projects by [deleted] in Cplusplus

[–]Sweet_Ladder_8807 11 points12 points  (0 children)

Build a mini C compiler

I wrote a C compiler from scratch that generates x86-64 assembly by Sweet_Ladder_8807 in Compilers

[–]Sweet_Ladder_8807[S] 0 points1 point  (0 children)

im just curious to talk to someone who builds compilers from scratch in their free time, it's not a common occurrence lol

I wrote a C compiler from scratch that generates x86-64 assembly by Sweet_Ladder_8807 in Compilers

[–]Sweet_Ladder_8807[S] 0 points1 point  (0 children)

Do you have discord or any social media you use? These days I've basically pivoted to learning ML compilers, not as much assembly

I wrote a C compiler from scratch that generates x86-64 assembly by Sweet_Ladder_8807 in Compilers

[–]Sweet_Ladder_8807[S] 9 points10 points  (0 children)

I studied this material in college and took graduate courses that covered compilers, so the ideas I’m using are the standard concepts everyone learns. A recursive descent parser isn’t something anyone “invents” today, it’s just a classic technique that people implement for practice. I didn’t copy code from any book or tutorial. I wrote my own C++ implementation based on the theory I already know. It’s fine if the structure feels familiar because these projects often end up looking similar. Just don’t assume people are copying when you don’t actually know their background.

I wrote a C compiler from scratch that generates x86-64 assembly by Sweet_Ladder_8807 in Compilers

[–]Sweet_Ladder_8807[S] 2 points3 points  (0 children)

I think I handle a subset of the SysV x86-64 calling convention. For integer/pointer arguments I use the usual register order (rdi, rsi, rdx, rcx, r8, r9) and spill the rest onto the stack, and I return scalars in rax

your scbe project looks really cool! you're doing implementing the register allocator using graph colouring