4 ms·
Way back, when Paul Graham first wrote "A plan for Spam", I was so intrigued upon first reading the article, that I jumped straight into coding. I happened to
by deepspace 6y ago
Way back, when Paul Graham first wrote "A plan for Spam", I was so intrigued upon first reading the article, that I jumped straight into coding.
I happened to be hosting my own mail server at the time, and I had previously implemented a crude spam filter, but the important part is that all my emails were already stored in a database and (crudely) classified as spam or ham, so I had a corpus available for training the classifier.
I spent a couple of hours in 'the zone', and wrote a Bayesian email classifier plus all the database management needed in a few hundred lines of C. The program compiled the first time - a first for me - and worked correctly the first time - another first. It did help that I had been heads-down in a complex project written in C for several months at that time, so my knowledge of the language and good design- and implementation practices were at an all time high.
That same program managed my spam pretty much unaltered for several years, until I switched to a commercial email host. Every few years, I still dig up that code as an example of good design and implementation.
- benwills 6y agoThis sounds awesome. C is my preferred language and I use it whenever I can and when it makes sense. I'd love to see this code. Is there a public repo for it?
- lanstin 6y agoTry go :) it's got the speed and "here's how the machine works" of C plus a) batteries included for all the modern things, and b) excellent multi-core scheduler. On the grandparent, I never much wrote a ton of C and then compiled, did more "skeleton of the app/lower level bits/stich them together" incremental stuff. So lots of compiling and testing along the way. Not quite Lispy but Lispy for C.
- benwills 6y agoI have, and I do use it for projects (and plan on using it for more). But I also need C for things that require certain performance I'm unable to get out of Go.
- wizzwizz4 6y agoUse Rust, then. Rust is like Go, except its binaries are small and fast (except string formatting, which is very runtime, horribly bloated and merely "fast-ish"). Anything C can do, Rust can do better (the string formatting excepted).
- benwills 6y agoWhat is it with people insisting on using something other than C? You don't know what I'm working on, yet you're insisting I operate completely differently? It's so weird to me.