19 ms·
Show HN: I spent 6 months building a C debugger as a 17-year-old
Hey HN my name is Thassilo, I'm a student and passionate programmer from Germany.
I want to showcase Spray, a small C debugger I've been working on for a few months now. Spray has a very simple and approachable interface. Its feature set is limited at this point, but it's already enough to tackle some basic problems. I stared to work on Spray because I was curious about how debuggers work. I am also trying to design Spray in such a way that it's easy to grasp and has a small mental overhead.
I'd love to get your feedback on Spray.
Email: d4kd (at) proton (dot) me
PS: I'm generally interested compilers and language tool chains, and I'm looking for similar-minded people to work and collaborate with. I have a few similar projects on my GitHub: https://github.com/d4ckard?tab=repositories https://github.com/d4ckard?tab=repositories. If you find Spray interesting, you might enjoy playing around with them too.
- 38 3y ago[flagged]
- arketyp 3y agoGive the guy a break.
- withinboredom 3y agoDude, what the hell. Yeah, I agree the person shouldn't be advertising themselves here (the project is different), but flagging it is a bit over-the-top. Good job at getting it removed from the front page . I guess.
- beebeepka 3y agoHaha, what? At least half the content here is blatant self promotion. Funny how you jump on the little guy
- D4ckard 3y agoI'm sorry, I misread what this is about. I removed the parts that I felt would be problematic.
- gumby 3y agoDebuggers are particularly tricky to write so this is quite good!
- D4ckard 3y agoThanks, it's been quite a struggle at times : D
- gumby 3y agoYeah, I started working on a pre-existing debugger around the same age as you (this was the ITS debugger DDT, so 40+ years ago) and boy, it was full of puzzling counterintuitive stuff. And it was just an assembly debugger so minimal debugging symbols. Merely reading some DWARF data is impressive enough. DWARF makes sense to me but that’s only because I worked with other debugging formats and compiler output of same, before and during the evolution of DWARF. I can imagine it’s hard to understand when you start cold with DWARF 5.
- D4ckard 3y agoDWARF 5 is truly ... special. My mind was blown when I understood that half of its data is encoded as instructions for full-blown stack-based VM.
- IamDaedalus 3y agoGGs dude I'm cloning the code and looking through tonight We share similar interests and I will try to make contributions to your project
- D4ckard 3y agoWow, this sounds great. Please hit me up at any time if you have questions about the code. I left behind comments most places, but I don't know if all of them are helpful.
- smithza 3y agoI want to only comment that your level of knowledge and maturity at the age of 17 is very impressive. The topics being investigated and exploited are expected at an undergraduate level and even then, this project would be in the Graduate level course. My hat is off to you and wish you a successful career.
- fuzzfactor 3y agoI'm impressed too, this is an excellent head start. Years later as a still-young technology enthusiast it would be likely that even more impressive projects will be accomplished. By then it may be largely unknown how advanced this was at this young of an age. Simply because there will be other sharp minds that do impressive stuff but only got started in their 20's, and reaching the same age they would be considered by most observers as peers. But this head start will be an unfair advantage that can be made to last forever anyway. Even if it does turn out to be kind of like a "secret weapon" after a number of years or decades.
- strikelaserclaw 3y agoif this were true then only old people would be discovering important stuff.
- fuzzfactor 3y agoI would agree, I think you're right, mainly innovators who are so old they are no longer teenagers ;) When an obvious outlier pops up, I really respect that can represent an alternative path which might be maintained without serious limitations imposed by mainstream momentum. Plus you have to figure, if you're going to discover anything at all before you're 20, you're going to need to start when you're still a teenager, or better yet a pre-teen. Why wait decades? OTOH, why not continue to be an outlier decade after decade and put the continuous improvement approach through a compounding effect? Kind of like you would do financially with compound interest where starting early has a clear mathematical advantage of its own.
- jacknews 3y agoVery well done, and I hope you build this out further, but please leave out the 'as a 17 yo'. I really don't think it's relevant and risks coming across as cloying - your work should (and does) stand on it's own.
- deleted 3y ago[deleted]
- raarts 3y agoAs a (former) employer I definitely think his age is relevant.
- jacknews 3y agoIt's maybe relevant on a CV, not so on HN, which is for 'look at this', not 'look at me'.
- InCityDreams 3y ago...remembering what i was doing at 17, it's relevant to myself, and i reckon future employers and also education establishments may find it relevant.
- raarts 3y agoSo you think employers don't look on HN?
- SushiHippie 3y agoI think it's okay, otherwise this wouldn't have landed on the front page (less likely at least). And it's only on HN and not on the GitHub repo. If it would be stated on GitHub, I'd agree with you.
- ricardobeat 3y agoIt could have easily landed on the home page without the age mention. There are 10-20k links on the front page every year.
- vpastore 3y ago[dead]
- MichaelRo 3y ago[flagged]
- white_beach 3y agoat least it is open source unlike some lame debuggers like remedybg
- sneed_chucker 3y agoImpressive work. Be careful about leaning on your age/precociousness to get approval. It's not a long term solution.
- koolba 3y agoFirst glance through the project and it seem well organized. Kudos! How long have you been programming and what languages did you start off with? I know quite a few developers decades older than you that still don't know how to write a Makefile [1]. What's the deal with the inline emojis in the source? Is that what all the cool kids are doing these days or does it just force you to be mindful of non-ASCII input? [1]: And even more that cannot write or understand dynamically generated targets...
- D4ckard 3y agoI started off learning Python and C++. At some point I got fed up with C++ and switched to C. Haha, the emoji thing was something I was doing for about a week or so. You see emojis used a lot more around Rust I guess. I never bothered to remove them. I think the bugs around the PID are fun. The ones in the comments might go at some point, though I didn't experience any problems with editors (Helix, Emacs, and VSCode all work) so far. Should I maybe disabled printing emojis to standard output in the REPL if terminal colors are disabled as well?
- koolba 3y ago> I started off learning Python and C++. At some point I got fed up with C++ and switched to C. How many years and hours per day? > Should I maybe disabled printing emojis to standard output in the REPL if terminal colors are disabled as well? I generally avoid anything that's not ASCII if it's possible. Tying it to terminal colors or terminal output (e.g. "if [ -t 1 ] ...") is common too. Though I'm not a big fan of things changing based on the runtime environment as it makes debugging annoying.
- trmpakufnfee 3y agoAwesome. I wish I had this level of dedication when I was young. I recommend you to participate in programs like Google Summer of Code, KDE Season of Code, Linux Foundation LFX, and X.org EVoC. There are some very interesting problems to solve. I wish I had known about them when I was student. Now I am working in Full time job, therefore have no time to contribute to open source. Keep up the good work.
- D4ckard 3y agoThanks for pointing me to those projects! I didn't know about any of them.
- xvilka 3y agoWe (Rizin and Cutter) usually participate in GSoC, so if we are accepted next year as an organization, you could apply. See our previous programs[1][2][3]. [1] http://rizin.re/gsoc/2023/ http://rizin.re/gsoc/2023/ [2] https://rizin.re/posts/gsoc-2023-announcement/ https://rizin.re/posts/gsoc-2023-announcement/ [3] https://rizin.re/posts/gsoc-2023-dwarf/ https://rizin.re/posts/gsoc-2023-dwarf/
- D4ckard 3y agoThanks the links : D
- pjmlp 3y agoCongratulations, good luck with your projects. Compilers was one of the first rabbit holes that drove my interest into computing. One of the books that I endless read multiple times, is nowadays available for free, and eventually interesting for your reading collection, even though it is about the compiler part not debugging. "Compiler Design in C" https://holub.com/compiler/ https://holub.com/compiler/ It is a bit oldie, but maybe interesting.
- D4ckard 3y agoThank you for the link. I'm always looking for books on compilers, but they can be hard to find. Many of them are every from the ivory tower-like unfortunately.
- junior44660 3y agoTry "crafting interpreters", it's very practical book.
- bluetomcat 3y agoLooks especially clean, consistent and well-modularised, tackling a problem that requires non-trivial knowledge about binary formats and kernel APIs. Many "senior" programmers would struggle to build something like this even at a conceptual level. The antithesis of "kids these days" :-) Out of curiosity, how does a 17-year-old attain that level of knowledge? Books, peers, programming clubs, parents who are programmers probably?
- JoeOfTexas 3y agoReminds me of that 15 year old who revolutionized modding for Half-Life games by creating Metamod. Some kids are crazy. I cried from frustration trying to learn C++ at that age.
- birdyrooster 3y ago[flagged]
- dang 3y ago> Autism isn't really something you can just replicate with books or anything like that, there are genetics, epigenetics, and other causes that aren't fully understood. We've banned this account for repeatedly breaking the site guidelines and ignoring our requests to stop. If you don't want to be banned, you're welcome to email hn@ycombinator.com and give us reason to believe that you'll follow the rules in the future. They're here: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html.
- D4ckard 3y agoIt's mostly books and blogs: I like to read a lot. Also, your guess is correct, my dad is a computer scientist.
- manicennui 3y agoReading books to increase your understanding puts you ahead of 90% of people who graduated from a CS program in the last 5-10 years from what I've seen. Several of my coworkers admitted to having never read a book on anything related to software engineering before and it shows.
- spiralx 3y agoNice one, I remember writing a 2D graphics library in Turbo Pascal using embedded hand-optimised assembly for the actual drawing code when I was your age, but that was back before I discovered the internet so it ended up being something I'd enjoyed writing but never did anything with, so well done on taking the next step turning it from a personal project to one that other people can see and maybe use themselves - it all looks very tidy, well-commented and the README is clear. Putting things out there for the world to see can be a scary thing, but remember that what people say is often as much about them than it is about your work, especially so when what they say is about you. PS I'm actually more interested in Motes than this myself, going to experiment with it now :)
- D4ckard 3y agoOh, I just noticed some bugs in the code while using Motes the other day. Expect some weirdness with the Emacs plugin. The scripts have been working flawlessly for me the past few weeks though. I hope you like them :D
- bregma 3y agoSo, only self-hosted debugging on x86_64 Linux. A good start. Now make it work for other common CPUs (aarch64, RISC-V). Make it work for other OSes (FreeBSD has ptrace, for example). Make sure it handles signal and thread trampolines, calls through the VDSO, and handwritten assembler that does not have function prologues. Handle C++ constructors and destructors of objects in static storage running before/after main(). Have it intercept signals. Have it follow the child or the parent after forking. Have it handle multiple threads. Make it work with coredumps. Make it work on core dumps from a foreign CPU architecture (big-endian PowerPC, for example). Make it work with debug symbols in separate files from the executable. Make it work with binaries compiled from languages other than C. You're going to be busy for the next 20 years or so.
- brancz 3y agoI just spent ~1.5 years of my life on various aspects of debuginfos and that even just for profiling where I only need line/column information. So I feel this comment through and through.
- D4ckard 3y agoYeah, I don't think so. It's x86_64 only, and C only too. Some points from your list make sense now, but most of it is simply not part of Spray's scope, and never has been ...
- thibaut_barrere 3y agoNot commenting on the debugger specifically, but: keep being curious & experimenting, it will go a long way :-) (I was in your shoes)
- lopkeny12ko 3y agoThe point the parent commenter is trying to make is that building a general purpose C debugger is not some kind of trivial exercise that can be shipped in 6 months, and claiming to have done so is disingenuous and pompous.
- 3y ago
- lopkeny12ko 3y agoWhat others need to understand is that, unlike the older generation, kids today have grown up in the era of easily accessible computing. Someone who is 17 today was born in the year the original iPhone was introduced. Computing literacy is not only required, it is expected from a very young age. What might have been impressive to us 20-30 years ago is not really the same as it is now. Cool project, but as other commenters have pointed out, the self-promotion of off-putting. Don't hold on to using your age as a qualifier to make you stand out in job applications or otherwise.
- vimy 3y agoIt’s the opposite. Computer literacy has gone down for gen Z, iOS and Android are too simple and locked down. So this is very impressive at that age.
- marcus0x62 3y agoDid you read the first paragraph after you wrote it? If you did, and then posted it anyway, I don’t really know what to say. But, in any case, “Computing literacy” != “wrote a debugger.” Your post comes off more delusional (or just ignorant) than the OP ever came off as self-promotional.
- lopkeny12ko 3y ago[flagged]
- Bombinator 3y agoIsn't that implying OP is a script kiddie? I don't think writing a debugger is a script kiddie project.
- deleted 3y ago
- dang 3y agoPlease don't cross into name-calling or personal attack, regardless of how wrong another comment is or you feel it is. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- zerr 3y agoAwesome! It might be boring for you, but accompanying that project with a "Let's write a debugger" tutorial would be very useful.
- gdcbe 3y agoSeems 17 year old kids do still know what cd’s are. The floppy disk save icon might not be deprecated after all :P
- MuffinFlavored 3y agoI always found this a bit weird. Why do you want everybody to know how old you are? It's kind of like... hey, I did this impressive thing, please give me credit, but also, just to give it some flare and kick it up a notch, I'm also super young making it that much more impressive! Why couldn't the title be > Show HN: I spent 6 months building a C debugger Why is your age relevant other than "wow factor"?
- codetrotter 3y agoIt’s very common for teenagers to do so. I did the same when I was their age. No reason to question why they do it, it’s just a thing teenagers do.
- MuffinFlavored 3y ago> No reason to question why they do it, No, then they'll never learn that it is received by "adults" as "unnecessarily extra-attention seeking". Most people who like to share stuff are seeking validation one way or another (myself included). It might be worthwhile for OP to step back and ask "why am I seeking validation from strangers online to find what I post impressive"?
- thibaut_barrere 3y agoMaybe he didn't come here to receive a therapy :-) Maybe it's just cool to connect with people similarly minded and share what everyone is doing, not necessarily for attention seeking, but because it improves everyone's situation by sharing extra knowledge? Just sharing what I did at a younger age brought me extraordinary connections at the time, some who still are friends 30 years later.
- deleted 3y ago[deleted]
- alex_lav 3y agoIt’s not random people’s job on the internet to coach kids like this. I also disagree with you entirely on the way “adults” will perceive this behavior, so clearly there are no unanimous perspectives on how others will interpret things. Maybe this will be a good moment of reflection for you, an “adult”.
- forgotpwd16 3y agoCool job. Grats! >Parts of the Spray frontend are written in Scheme Why you decided it do it that way rather fully in C or fully in Scheme?
- D4ckard 3y agoScheme doesn't work well for very low-level code, and C doesn't handle processing source code very well. For that I'd rather use a functional language. Also, I like using different programming languages (though not necessarily in the same project).
- cyberpunk 3y agoWhy do you put spaces between your function names and their arguments? I find it quite jarring, as someone who's spent a good 18 years reading C code :} return lookup_breakpoint (dbg->breakpoints, get_pc (dbg->pid)); vs return lookup_breakpoint(dbg->breakpoints, get_pc(dbg->pid)); Edit: I tend to lean towards the 'bsd' style, if you have an open or freebsd system, try 'man style' and try their rules on for size.
- valleyer 3y agoIt's GNU style, which some people prefer. https://www.gnu.org/prep/standards/standards.html#Syntactic-Conventions https://www.gnu.org/prep/standards/standards.html#Syntactic-...
- cyberpunk 3y agoDamn, I really have been in my cave for too long! Forgot all about their weird if {}. Thanks!
- darkwater 3y agoOff-topic but I can not avoid a tear of joy reading this: > In the Unix world, “portability” refers to porting to different Unix versions. For a GNU program, this kind of portability is desirable, but not paramount. The primary purpose of GNU software is to run on top of the GNU kernel, compiled with the GNU C compiler, on various types of CPU. So the kinds of portability that are absolutely necessary are quite limited. But it is important to support Linux-based GNU systems, since they are the form of GNU that is popular.
- eliben 3y agoReally nice work! I'm happy you found my articles useful :)
- SillyUsername 3y agoWell done. Achieving this at 17 is a rare feat even most supposed senior developers don't achieve and it ranks up there with writing an emulator. It was only in my late 20s I understood low level architecture enough to be able to do similar work, like you through passion, which I never had in my teens (I did start programming Pong like games at 8 years old and Tetris clones around 12/13 but that's hardly the same ;) ). Keep up the great work, it restores my faith that their are less code monkeys out their like me!
- silentsea90 3y agoI feel like a code sloth/donkey if you with your achievements are a code monkey. I think we need a hierarchy of animals here. I'll fit right at the bottom thank you.
- SillyUsername 3y agoNo big deal TBH. It was Pong in BASIC on a ZX Spectrum after understanding some simple max min bounds and then negating direction of a ball. For Tetris it was again BASIC, now on a graphical calculator, but while I was learning basic matrix operations such as rotate in school. I didn't learn better languages until I was 18 (Java and C). I'm no autistic savant, I just have cool sound bites lol.
- deleted 3y ago[deleted]
- demyinn 3y agoSuper awesome project!
- HybridCurve 3y agoI like reading young programmers' code: It's interesting to see how they design everything with a decently high level of knowledge, but not the years of experience. The author seems to be a fast learner, and this is a great result for 6 months of work.
- w4yai 3y agoThis is a very nice job. Please don't mind the jealous commenters telling you condescendingly that it's barely "good enough", if you wouldn't told them your age they wouldn't have told you that. It's actually an impressive piece of software and you can be proud about it. I love your coding style and I wish everybody could code with the same amount of dedication than you do, I can see your efforts through each line of your source code. If you like low level stuff, I encourage you to follow the path I did at your age, that is learning computer security. Specially reverse engineering. There are computer security challenges called "CTF" or "hacking skills challenges" [1]. If you weren't aware about them, they're filled with brilliant and very curious young people as you are. You could meet some and start wonderful projects you'd be proud of all your life. Generally speaking, I'd encourage you to find peers and start doing bigger things together, even though that being said, this is only an advice from a 32 years old dude that recognize himself through you, and what is the most important thing is to do what you prefer the most. Trust yourself you'll go far ! PS : if that is relevant, don't be worried about school. Focus on yourself and learn about your mental health. Many people developing an uncommon skill at young age may feel isolated, misunderstood, secluded, etc. Please make sure to be conscious about it and if that is relevant to you and if you need it, please seek help from a therapist, there's no shame about it at all. I'm purely speaking from experience without knowing anything about you, I'm just telling you what I wish someone could told me earlier. [1] https://www.root-me.org/?lang=de https://www.root-me.org/?lang=de
- D4ckard 3y agoThanks for your kind words, and also thanks for the link : D
- deleted 3y ago[deleted]
- WalterBright 3y ago> I stared to work on Spray because I was curious about how debuggers work. Awesome. That's the way it's done!