About The Contest

The first ever Olympiad of Misguided Geeks contest at Worse Than Failure (or OMGWTF for short) is a new kind of programming contest. Readers are invited to be creative with devising a calculator with the craziest code they can write. One lucky and potentially insane winner will get either a brand new MacBook Pro or comparable Sony VAIO laptop.

Navigation

Advertisements

Entry #100074: APLPCOLPISC: The Arbitrary Precision, Lexing, Parsing, Compiling, Optimizing, Le xing, Parsing, Int

by Todd Neal
* Gui is written in pure Xlib and resembles Windows Calc.exe

* ...using only arcs,lines, and rects

* ...and only means "only" (Who needs fonts? Check out Util.h)


* Hand implemented lexer and recursive descent parser for arithmetic
expressions

* Arithmetic expressions are compiled to assembly for a non-existent
CPU

* This assembly is then optimized with a peephole optimizer

* Since the CPU doesn't exist we need an emulator for it, so the
emulator is provided in a lispy language (source in CPU.cpp)

* Since gcc unfortunately doesn't provide a frontend for "Todd's m

Download0 Comments