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. If you find Spray interesting, you might enjoy playing around with them too.
Out of curiosity, how does a 17-year-old attain that level of knowledge? Books, peers, programming clubs, parents who are programmers probably?
Raw curiosity & having "just access to the required hardware" (a huge "just") and a bit of books & magazines can take you a long way.
My parents were not programmers but my father bought computers early on (1984), and later brought compilers at home (via his work), e.g. TurboPascal, C++, and let me experiment.
I learned mostly via magazines & books, and later a bit of exchanges with peers (demomaking), and also via buying disks (https://fr.wikipedia.org/wiki/DP_Tool_Club) that contained documentation (such as https://en.wikipedia.org/wiki/Ralf_Brown%27s_Interrupt_List) and arrived via snail mail.
I "just" gradually iterated and coded small stuff, then gradually more complicated stuff (Windowing toolkit in CGA, a Tetris clone, a Bomberman clone, FFT software, and ultimately 3D realtime rendering without any FPU, only in software, with Phong rendering and such https://github.com/thbar/demomaking#obez-1995).
I was not an isolated case in the sense I ended up stumbling on other teenagers (via the demomaking world) who did exactly the same thing.
Today a curious kid can go probably much further, as long as curiosity is encouraged :-)
There's an excellent blog series linked at repo that guides you step-by-step.
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"?
Mentioning one's age screams insecurity (though to be fair, that is to be expected from teenagers). And as this comment chain illustrates it also partially derails the conversation to discussing his age, instead of his actual achievement.
OP, you'll do cool stuff. Your age, location,sex, etc... has nothing to do with it. A 60yr old hobo and a 17yr old kid who know nothing about programming are at an equal footing, what each accomplishes is the result of how much time and effort they put into it (not neccesarily the same).
If you were like a 5 year old that'd be noteworthy but reading, writing, knowing how to use a computer and time is all that is needed for coding, unless you are out there creating or implementing sophisticated algorithms that require background mathematical knowledge.
I'd love to be corrected on this but there isn't anything you learn in school beyond like the 6th grade that is needed to succeed as a coder (not SWE, just programming and creating cool stuff).
I hope you let the coolness of your work speak for itself in the future OP.
After a while it trains you to suppress your opinion/not speak up. Those who put us down the hardest will dominate and we'll give up + stay silent.
What will that lead to?
A chamber full of...
So yeah, being able to spend 6 month building such a nice piece of code is awesome and admirable, BUT ALSO being able to pull it off at this age is another accomplishment that should be applauded.
Let's support our young generation, don't do the same mistake than your older generation and don't be mad because you weren't receiving the same amount of support at his age.
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"?
In this case there are two interesting things: that they built a debugger and that they are 17. The latter information might also lead to more interesting helpful comments for the kid versus a "okay, and?" series of responses.
And at the end of the day, every Show HN has a bit of "hey, notice me!" in it - whether or not age or other identifying information is included. I don't think that's bad.
Gladly you got demoted from the position
This guy did it at an early age, showing great promise for the years to come.
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.
[1] https://rizin.re
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.
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.https://www.gnu.org/prep/standards/standards.html#Syntactic-...
> 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.
Thanks!
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.
So this is very impressive at that age.
Your post comes off more delusional (or just ignorant) than the OP ever came off as self-promotional.
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.
[1] http://rizin.re/gsoc/2023/
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...
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?
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.
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"
It is a bit oldie, but maybe interesting.
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.
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!
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.
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 :)
>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?
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.
I'm happy you found my articles useful :)
Awesome. That's the way it's done!
Be careful about leaning on your age/precociousness to get approval. It's not a long term solution.