What can you do in 2k LOC of C?
h4ck3r.net
What can you do in 2k LOC of C?
1–10 of 110 posts
Re: What can you do in 2k LOC of C?
#2About 120 lines of C++ [see 1] that parses basic EXIF information out of a JPEG image. I found all the other EXIF parsing tools and libraries a little too heavyweight for something as simple as getting the date and time a picture was taken, or the f/stop or exposure time. It only uses string.h for memcpy and memset, and no other headers.
[1] http://code.google.com/p/easyexif/source/browse/trunk/exif.c... (note: Google's source view screws up my whitespace)
Re: What can you do in 2k LOC of C?
#3Adding support for indexing Unicode text, more configuration, composite search queries (A and B near C and not D), etc. will no doubt make the source expand a bit, but it's still pretty small.
If you're interested in trying it out once it's ready, contact info is in my profile. I'm shooting for within a week or two for a beta vulgaris. (Requires Unix. ANSI C, strung together with sh and/or awk to avoid dependencies.)
Re: What can you do in 2k LOC of C?
#4Re: What can you do in 2k LOC of C?
#5Anyone know how big nginx is? I wouldnt at all be surprised if its under 2k LOC.
Re: What can you do in 2k LOC of C?
#6Anyone know how big nginx is? I wouldnt at all be surprised if its under 2k LOC.
ansic: 82714 (99.68%)
perl: 124 (0.15%)
sh: 78 (0.09%)
asm: 48 (0.06%)
cpp: 17 (0.02%)
(for nginx-0.8.53)Re: What can you do in 2k LOC of C?
#7(Toy spreadsheet at https://github.com/darius/vicissicalc)
Re: What can you do in 2k LOC of C?
#8This is why 'modern' software can still manage to bring a 3GHz quad-core to it's knees, IMHO
Re: What can you do in 2k LOC of C?
#9It implements an efficient pattern matching system based on Parsing Expression Grammars (akin to CFGs, but without ambiguities). It consists of a Pattern/Grammar to bytecode compiler and a custom VM to interpret the result of the compiling phase.
Nice and clean.
Re: What can you do in 2k LOC of C?
#10If you think about it for a second, you realize that TrueType rasterization can't be that hard because printers were doing it long ago on crappy little embedded processors, but the default is just to fall back on the big ugly library, and then wrap it and pretend it's not there. How about instead, just write some good code? This is why 'modern' software can still manage to bring a 3GHz quad-core to it's knees, IMHO
(Though if you're trying to fit 8kb into 2kb and have to start doing voodoo, it's true the quality will suffer)