this page is about a project that i have been dreaming of for years. i was struck down the last 2.5 years (its now sept 2011) and i was given blindness. sight was taken away and i was given blindness. the pertinent point is that i did not pursue this quest for glory and instead followed mammon leading to my predictable demise. predictable if you read fiction and have a well-developed empathic sense from following your favorite fictional characters for years, ultimately basing your own personal life on theirs.
firstly i would like to say that i bloody love this font, linux libertine, it is a free font as in freedom to be free you free your mind freedom, and my god it is so beautiful i have actually put aside my semi-pirated font Georgia and use this. its that good. i am actually going to install this on other OS's that purport to ship 'better' fonts but instead ship crap in a pixel box. oh and btw everything on OS X looks like blurry shit.
i have been programming high-level, or in more accurate words, writing shitty code, for years. i have had little control over the platform i was on, and depended on others, the good graciousness of others to write high-level languages and systems and maintain them for long enough that i could get my programs done. or semi-done. or at least give up on them after much pain and agony and declare them given up on.
years ago i started with perl. i was a wee sprat, just hatched and enamored with anyone who would tell me how to program correctly. well of course i joined the linux hordes just starting to creep out of the underworld at that time to spread mordor to all corners of our fair land. i installed linux on my best machine, which was about 200 mhz and had been running win98. Well it was amazing to have redhat 5.1 installed, and more amazing to see the crapiness of fvwm. But i digress. i started with perl.
i have a great quote from someone on the net who likens getting used to programming in perl to getting used to swimming in a river of shit. at the beginning oh god its hard, it stinks, it makes no sense why you are swimming in a river of shit, but after some time, enough time has passed that you start to enjoy it, and oh god how can you give up this wonderful breast stroke that you've so painfully mastered. i dont even smell anything anymore, do you?
of course i cant find the quote, i save snippets from the net and cant find anything. this is the ludicricity of our computer life, machines so well-made for remembering yet unbridled and unharnessed
anyway. i started with perl but gave up on it because it didnt have a graphical interface, well it did, it has perl/tk, which is actually an even grosser example of the problem im describing. not only do you have the limitations of a highlevel cross-platform graphical toolkit Tk, but you have an ill-specified second-hand toolkit that is badly documented, out of date, and in fact bundles tcl right into the extension to actually get Tk working. without Tcl, you dont get Tk. So you get a bundled language within a graphical toolkit extension. Same thing with python and Tkinter, which is what I used next. Oh and I also did python with wxwindows.
bundling a language into a graphical extension, to be able to use that graphical extension, is amazing in a horrible sense. whats more amazing is that not only is it accepted, but its pretty much the only way to get a gui going in perl and python. sure python has gtk bindings now. but this is 10 years later. and what drawbacks are there to that, i wonder? god's truth that you will have incomplete access to the gtk api that C programs have, in effect you are a second-class citizen. this is getting closer to the issue at hand now.
i ended up going with tcl/tk. what sold me was that it had access to the complete Tk api, because it had been built for it. It was also great to be able to generate standalone executables for windows using freewrap at the time and tclkit now. It's a great thing to have an interpreter in one megabyte. put it this way, compared to the options, its a great thing. so here i was with a nice gui toolkit, a cross-platform language, and i could make standalone executables that didnt require virtual machines, or special interpreters or packages to be installed to run what i made. life was good.
10 years pass.
looking back on it, there have been some really great times with Tcl/Tk. i have written some interesting programs, and have been able to move back and forth from windows and linux at times depending on my needs. there have also been some very bad times, and the limitations of a cross-platform high-level language that does not have deep enough bindings to the host OS, or fast enough performance to write some interesting programs has painfully scarred me. in some ways i am a burnout now.
you start to think about what extensions are available. are they precompiled, or will you have to fight with a compiler to get them working, will you have to cajole autotools to generate the binary, will 'make' work, will the configure script that ships with it be out of date so that you have to edit a multithousand line shell script to comment out lines that do checks that are irrelevant on your install. these are the things nightmares are made of. you end up with a loadable shared object, a dll, a binary finally, and things sort of work, and you 'win', but what an empty victory.
on perl i remember i needed a hash extension, i used cdb which is a hashtable extension to tie perl's arrays to a constant database to do fast key-value lookups from a file that doesnt change, hence the name constant database. i tried many other databases and used many different ones like sleepycat's db and others but man, i remember trying out way too many.
so you end up pouring energy into compilations and dont think so much as wrestle with a pig of a build system, or wrestle with your OS install and get libraries going and god forbid youre doing windows compilations and your fighting with mingw and setting up tool paths all day so directories with headers can be found. i mean this is all 'work' and somewhat productive, but at what cost? are you thinking, is your brain really crunching down on imaginative problems or do you end up like me 10 years later, a burnout sick of these make work shit work things that suck the fun out of life and age you.
this is what the web is all about, for me. the interesting problems are always put off because youre just trying to get things working, to get pages to load on browsers that are just plain old differently implemented with different engines that expect different control codes to do different things. you end up with 6 virtual machines that have a load of old browsers to test shit, that at the end of the day, doesnt even matter. websites and webapps go up and down and disappear like so much ether down a glib piehole.
different css box models, different javascript engines (thankfully not so different now), different dom models, and then piles of other people's huge crappy libraries that you somehow have to interface with. jquery, mootools, im looking at you.
and then, as someone who knows and realizes and feels on a visceral muscular level the power of these thinking machines, these tools for thought, these xanadu capable ted nelson computational imaginational world builders, well you think wtf is the web and do i even give a flying fuck?
i made money. i made some money. i saved some money. i saved money. yes, now i sit at starbucks and type on my netbook and dont do shit. i do nothing. i drive an eleven-year old car, but young women still look at me. so i dont feel so bad.
the cool shit needs fast calculations. it needs you to be able to use the machine at a deep level, reach down into platform-specific syscalls and twiddle some nasty bits that arent exposed in high-level fruity languages du jour, or decade-old languages maintained by volunteers, who do an amazing job, but still, limit you.
tell me does perl python ruby php tcl ocaml elisp give you good working libraries to do drag and drop on windows, to do unix domain sockets properly with callbacks that dont block on linux, to do dns lookups that dont block your gui when your dns server sits there contemplating life, that allows you to even think about working on the n-body problem because it has fast enough math? in short, can you really use your machine or are you the equivalent of a microsoft office user, forever constrained to trying to do everything in excel macros?
on the web the issue is the same. are you a goober writing yet another javascript library to encapsulate some browser nastiness, or maybe youre the guy like me who discovered specific error conditions for xmlhttprequest (ajax) in internet explorer 5.5 for win98. how do you feel now? how do i feel? like killing myself maybe.
so you pull out a compiler, or the compiler, maybe gcc, and start writing code. then you dump out your executable and it works, but there are some weird errors so you throw your executable at gdb and all of a sudden you burst into tears as you realize that you dont understand assembly at all and can only work at a superficial debugging level because youve been sold a lie a bill of sale that is full of shit and rats live in your bed and gnaw on your nipples. your collective nipples.
you cant do shit when youre just playing with C and a superficial understanding. theres a reason kids dont understand function pointers and its because they dont understand the machine. start them off with java and believe me they will amount to nothing until maybe they discover the lord of code, the god of code, and he grants them a moment of clarity, a vision.
i was granted such a moment. first i was made to suffer. i was blinded for 2.5 years. i was literally blind and could not see newspaper headlines, watch tv, read anything, use a computer. i sat on a lazyboy in the dark listening to the radio for 6 months. radio is not that good.
what im talking about is being able to create things, make things, write programs as a single person a single man, to boldly go where no man has gone before, somehow alone, without being limited. when you spend a week fighting with a makefile, believe me, you are being limited.
chuck forth aka charles moore has some philosophy about this that i read avidly when i was trying to get my head around the possibilities, 10x code he called it, the fact that you get a 10x speedup in every way, time to write the code, time for the code to run, size of the code, when you throw out the libraries and write shit yourself.
a guy named bart at a linux meeting told me once that the first 20% of the mac interface is very polished. then you try to do something that isnt so polished and all hell breaks loose. try to export your original photos in iphoto and you will see what i mean. you end up with a finder window full of autogenerated directories where you manually have to select the photos to copy, choosing from an ill-sorted hierachical tree list where you cant easily see what's what.
code libraries are like that. they let you do things fast, like maybe load a jpg up, or load a png, or pull some text out of a pdf. then you want to do something a little different, and boy you're suffering. if youve done any amount of programming you know what i mean. maybe youve struggled with the limitations of a 3D game engine that was supposed to do everything for everyone. or maybe you wonder why youre fighting with sql when all you want is a straight up storage file on your local machine. or maybe youve used an http library that breaks on some sites and you dont know why, or doesnt do gzip out of the box and youre burning bandwidth, or you are reading the manual to curl and holy shit there is everything there but my god is a lot of shit broken, or at least the shit you want to do.
or maybe you havent and youre satisfied with hello world ad nauseum.
sdl is limited to single toplevel windows, meaning you can only have one window per process that has a fast buffer to draw into. one window. to get a fast drawable frame is not a big deal on any system, if youre working at a lower level. maybe on windows you use the old directdraw interface. on linux you might use the X "mit" shared memory extension. its doable. and you get more than one toplevel window to do it in.

what do i propose, or what is my idea, or what im doing with my life

as you can tell im a frustrated man. a very frustrated man. not sexually, but programatically. its worse.
i tried a few times to get into x86 asm over the years, but was stymied by the demands of work and making money, blinded by mammon, and was also focused on growing my family and procreating for fun and pleasure. there was the additional problem that there just isnt that much information about it, hardly anything, considering that it is the root of the machines that have taken over this planet. there are probably more x86 chips that are powered-on right now on this planet than humans with beating hearts. people keep saying that x86 is going bye-bye, but it has been going bye-bye for dogs years. its still growing. so you tell me.
im a big believer in scaling down the problem. i dont think a single person can do much of anything when you chain yourself to the conventions of what we consider to be complete programs, to be good code. a good example is option processing for command line programs. if you look at the source for 'ls' for example, gnu's version, well you will know what i mean when i say that apart from the incredible option processing code that takes man months to get right, you are also witnessing a veritable forest of ifdefs. cross-platform even across unices costs real time and effort.
learning git, learning cvs, subversion, takes time. learning autotools is probably something you go into a monastery for, something you tinker with forever. if you have even fought with tabs in makefiles, well thats the tip of the proverbial iceberg.
i zip things up. yes, i zip up my programs. its old-school, wastes disk space, but i zip it all up like a surgeon sewing up his patient with all the tools inside and send that zip on its way to where its going. it works.
do you know the size of an int on every platform? i dont. i never could learn it all. why bother when really there is a 32bit field on a 32bit x86 computer, the registers just plain old are 32bit. no surprises, and 32bit code has been running for years and will run for years. im writing this on a netbook, a 200$ acer netbook with 6hours of battery life, running debian on it and its got a solid gold 32bit processor (64bit capable). this is the future. cheap and i can make things with it, not just watch shit on it.
its important to mention the tablet craze. how much shit can you watch, how much can you read without wanting to write, wanting to create? want to make a nation of bums, crack addicts, and useless gabbers, then yeah, give em all tablets and fuck the real computers. fuck the creation urge. better yet get that loud electric buzzer going that never lets us finish a thought to make us all equal like in ayn rand's anthem. oh wait a sec, my buzzer is going, my bitch is sexting me. brb.
first you need something to build on. some specifics, some concrete things, hopefully documented, or at the very least, unchanging in a large way, so you can build for years and create and not have the foundation for what youre building crumble, or be forever patching patching patching as new versions come out that change things.
i remember xmms. do you? it was a clone of winamp that worked perfectly, that used the gtk toolkit, version 1. well it doesnt even compile anymore, and even binaries wont run because no one ships gtk1 anymore, because gtk 1 is 'deprecated'. fuck deprecated. some cunt took a long time to write it, and a lot of other cunts enjoyed it. the worst part is that you cant even run the existing binary. its there sitting on disk staring at me in the face, but it wont ever start again.
i think win32 is a good base. those bastards at redmond are very much supportive of backwards compatibility. but their programming tools suck, and well, how much devil cock do you want to worship anyway by selling your life and mind for such a low price. winamp 2.5e from 1999 still works on my winxp sp2 install, yes im still running that on some machines, i havent tried vista or win7 and neither care to, i have interesting shit to do with my time, not goofball make-work. the point is, winamp 2.5e still runs, installs perfectly, and plays my mp3s like its 1999. its fast light and i know the interface. why should i change. ive tried foobar2000 but i keep going back for day to day playing of music to winamp. sometimes you just get it right and there is no point changing things.
the core has to be linux. it has to be x86 32-bit. you can call kernel calls with int80 that dont change. the elf executable format is documented. binaries could be made to work for years. its possible but you have to give up the libs and the dynamic binding to them.
on linux you get gdb. you get all sorts of wild utilities like readelf. most programming tools on win32 are payware or badly supported, or very niche. no source, almost ever. complex hard-to-understand source is bad, but no source is worse. ollydbg is a great debugger on windows. theres not much graphical debuggers on linux.
insight is a perfect example. the great duntemann wrote his 3rd edition linux programming book and references this tool, 'insight'. this tool does not compile does not ship and is buggy even when you do get the incantations right and get an executable to run on your box by finding the one UK chap who supplies an ubuntu installable package. its a sad state of affairs.
but we have gdb. and we have a manual. and we have years of existence and the same kind of rabid fanaticism that has allowed the romans to maintain their godking pope for so long. theres something to be said for applied fanaticism towards an end you can get behind.
i remember meeting rms back in 98. he wont remember me, i was a pissant and still am. so is he. but the point is that i told him i was planning on being a lawyer. he told me i would probably end up a parasite. i didnt end up a lawyer.
i like linux because this shit has improved. graphical installers. wireless that works. ssds that work. gnome that is passable on atom. X works ok. ubuntu is pretty cool actually, i run it on my media pirate living room computer. it plays everything out of the box, including flash youtube and video and audio codecs play. vlc is cool. shit works. i dont use it on my working computer (this atom netbook) because i like debian. but man this shit has improved. the linux guys and the gnu guys are good.
i cant see 32bit x86 linux going away in the next 10 years. it gives me a good window of working time before the rug gets pulled. the rug always gets pulled. 10 years is good. i'll be 41 by then. even if x86 32bit is niche, in 10 years i could stomach moving to x86 64bit. i need 10 years to build some skill. skill takes time. you cant keep bouncing around platform to platform OS to OS api to api language to language if you want to reach mastery.
mastery takes time.
first you gotta generate binaries yourself. executable binaries. you have got to be able to write elf. and write the bytes that is the machine code that goes in the elf. there are some sections of the elf that are complicated, especially sections to do with dynamic relocation and dynamic loading. if you ignore those sections i dont think its so bad. i made some stripped binaries with nasm and ld and then ran strip on them to get very tiny 200 byte binaries with a few opcodes in them. im pretty sure i can generate binaries like that, simple executable binaries. theres a guy who has done a whirlwind tour of elf binaries where he makes the smallest tiniest elf binaries that will load and run. i dont think you have to go that far, you just have to generate binaries that dont try to link in with the C runtime or need to load your program up.
making system calls with int80 isnt accepted by unix fetishists, but i will tell you what, if the developers of wordperfect 8 for linux had not depended on any part of linux except for the kernel their app would still run. sadly, very sadly indeed, their app stopped running on distributions within a few short years. i would say that about 3-4 years later you could forget about running wp8 on a linux install. hows that for binary portability, or for respecting the work people put in to create a software program. at least run the damn thing.
its not the fault of any particular distribution in my opinion that wp8 stopped running, rather the natural outgrowth of how the linux system is put together. libs come and go and what is prized is source portability, not binary portability. so your C program should still be compilable 10 years later, much less chance if you use a windowing toolkit that doesnt exist anymore, to say the least, like gtk 1. the linux herd prizes source, and even if it takes a shedload of work to compile it on a new system, it should be possible. in my experience compilation and building software is one of the most time-intensive and least rewarding tasks, not to mention least interesting. so when you generate a binary executable, you should be able to throw away the source and have a good shot of running the program 10 years from now. of course having the source is very fucking helpful.
i have a different opinion, source is all well and good, but authors lose interest, or die, and programs live a whole lot longer. especially when they are good programs. look at proxomitron for windows, the wonderful http proxy that was originally made to strip ads from webpages like adblock, but much much faster. adblock plus has one advantage, its cross platform, available for all firefoxen, and maintained. scott lemon, proxomitron's esteemed author, is now hacking in the next life. good thing his shit still runs. ive used it to relay requests from virtual machines to the hosting os, oh and to watch http traffic for years. it puts me to sleep.
you can statically compile the C runtime into your C programs using special arcana passed to gcc and the linker, but even that is frowned upon by the sourceaholics. they maintain that this is just plain old Wrong and they want the power to change the C runtime and your apps should pick up those changes, the example i remember is if the resolver code now starts using a new codepath like talking to yp or something like that, then your network C app should pick that up. if you bundle the C runtime, that wouldnt work. strange case to say the least.
i spent a lot of time once compiling a copy of ffmpeg with xvid, lame, yasm, and some other libs enabled in the compile. i compiled this on a virtual machine running debian lenny (old version) specifically so that it would bind to an older version of glibc so that it would necessarily not be bound to newer glibc symbols, to ensure it would run on relatively old installs and all newer glibc installs. it was a righteous pain in the ass. i ended up encoding an LD_RUN_PATH (sp?) into the binary so that it would look in relative directories for the xvid, lame, and libavcodecs, without binding to the system ones if they existed at runtime. This is fucking insanity.
that utter insanity was done specifically so that i could use the ffmpeg binary to encode videos on any distribution with a known-good binary. known-good-binaries are a very underappreciated term in the linux world, where theoretical goodness recompilable from source always outweights concrete known-good binaries. what i mean is that when you do a recompile you can embed new errors into the executable by virtue of the state being different. different libraries and different compilers and different tools generate necessarily, quite provably different binaries. this is of utmost importance and deserves all caps, it is a very underappreciated fact of life.
i had an issue with ffmpeg where the same line with a --threads argument would make a file that wouldnt play on my set-top divx box anymore. if i removed the threading arg from the command line, the same file with all the same options with the same binary on the same computer, would make a file that would play on my set-top divx player. you fucking explain that to me. obviously there was an error in ffmpeg when threading was enabled. if that doesnt even work, why would anyone think that a new compile, even of the same source, but with different tools and linked to different libraries, would work the same way every time?
binary portability or rather the lack of it also very much limits commercial development on linux, not that anyone gives the tinyest shit.
neither do i
i want my shit to run. i know how hard it is just to get something working, let alone to make something interesting. the practice and act of prayer that is communion with the universe that we term programming requires a sacrifice of blood and tears. look at any programming team after they build a product. there is blood on the keyboard and living breathing human wreckage. people pay for bytes with blood.
so generate the executables completely. dont use special complicated parts of the x86 instruction set that is too hard to get right or just arcane. dont use special sections of the elf. use gdb. talk to gdb with its machine interface, 'mi2'. use my hard-won programming knowledge to build tools to do this.
should be a start.
SDL uses a shared memory extension on X windows to get a fast box to draw into, unless you've specified to use the opengl interface.
X applications communicate with the X server using unix domain sockets when you run locally which is almost always now since the network transparent part of X has passed into almost obscurity if not unusability (see dbus etc).
I will bypass xlib completely, and xcb too and talk the X protocol raw via the unix domain socket. A subset of the X protocol that still gives me the mit-shm mit shared memory extension to get a fast buffer should be enough. As above, when you use a subset you can get things done with minimal pain and as a lone programmer. try to do everything or to the letter of the spec and youre doomed. time is a killer.
of course no gtk, qt, or tk. kinda goes without saying if youre bypassing xlib.
unix domain sockets are a two-way pipe between processes with a similar api as tcp sockets.
The app opens a unix socket to the X server. Then it mallocs a chunk of memory for the screen buffer. Then you tell X over the unix socket to use this shared memory buffer for your toplevel. That's how you get a fast drawing window, like sdl, without the baggage that is sdl.
If you stick to a subset of everything, x86 opcodes, elf binaries, x server protocol, you can do it all, from the bottom to the top.
I will use other people's libraries from a different process. This way I get the benefit of their libs now while i work on replacements without complicating my executable or the generation of it.
the development of the tools to bootstrap this vision is done with tcl/tk because thats what im best with.
it is very important to mention, or reiterate the truth of my life. i was blinded and struck down for my folly. I tried to live a life where i ignored the reality of what it means to be alive, to live and breathe code, to program in my dreams, to be defined by it and to define it for myself. i tried to use my skills to make money and i made money. there is nothing wrong with that but when you ignore the soul, the crux of yourself, of your code interior, then it all falls apart. blindness is the result and i am now grateful for it. those years 2.5 years opened my eyes in a way that they would never otherwise. i would be consulting even now and earning 75$/hr like before working on shit that doesnt matter for people who dont mean anything to the universe. i would be getting fatter and fatter and more out of shape and dumber and dumber until all i had in my head was the IE6 css rules and web arcana that pays dollars but leaves you impoverished spiritually. this is very much a spiritual and matter of reality. the only fantasy is the shared delusion that i lived and now have given up on. this is why i am moving to a place where my dollar stretches further and will take my wife and children there too, and i will teach my children to commune with the great code spirit and contemplate the secrets of the code. we are on a spiritual quest, and i take it as seriously as the crusaders took the crusades. hopefully, with more mirth and less tears.

you can see my programs and demos and more on my youtube page

fantasy is my reality