I’ve been thinking a bit about what to do with spidey01.com, mostly about the implementation; I think usage is perhaps deserving of another entry, so as to keep this quickly written.

My host like many, focuses on PHP. Unless you specifically go somewhere that specializes in language xyz (such as a Engine Yard), every host does PHP—because that is what most ass clowns want. Now me, I know enough about PHP, that I have no desire to utilize it beyond running canned web apps written in it, such as stuff like Mantis or MediaWiki. In fact, I prefer to avoid even PHP powered web apps unless it is best of breed (Mantis yes, phpBB no, MediaWiki maybe). You can say there are three languages I don’t like the taste of: PHP, English, and Java; probably in that order. I have my reasons for each but that’s not the subject here.

Now, I am rather fortunate spider because my host provides a lot more than just PHP :-). I can’t say that I particularly care for the heavy weight frameworks some people use: Ruby on Rails, Pythons Jango, ASP.NET, or Java land in general. Something smaller like CherryPy is more my speed but I really don’t want to deal with that right now. In all probability I will likely try using Perl or C++. Why Perl, because I love it, or C++? Because I use it.

On the subject of Perl, most people will likely look at something like Catalyst or rely on the built in CGI module. Me, I would prefer something more like Dancer. Which is exactly the kind of web frame work that I like: small, concise, powerful. One that lets me focus on what the fuck I am doing and not how the framework decides things are stitched. Ever since I first bumped into Dancer, I have always wanted to try it but never had the website or the cause, hehe. Dancer+Moose sounds like a very good idea to power my website. I cannot think of a framework that would make me happier than something like Dancer, unless there is one that mind maps thoughts to implementation code, and then just makes it magically ‘go’ at deployment time.

I must be insane to be thinking of doing web development in C++ in 2011, but hey, why not? I assume that statically linking the (C/C++, and compiler) runtime libraries and any associated dependencies I may wish to link with, should be sufficient to deploy as a CGI program. This blog page suggests that it is more or less possible to do it easily enough, and the GCC manual suggests it should be O.K. for my deployment targets.

A little test on a Linux box:

    $ cat > s.cpp
int
main()
{
return 0;
}

$ g++ s.cpp -o shared-s
$ ldd shared-s
linux-vdso.so.1 => (0x00007fff4a9de000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f61fdead000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f61fdc28000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f61fda11000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f61fd67d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f61fe1da000)
$ g++ g++ -static -static-libgcc -static-libstdc++ s.cpp -o static-s
$ ldd static-s
not a dynamic executable
$

Never really have tried it for an experiment like this before but I assume that I can have the web server rewrite URLs in such a way that it passes them to my program or a script, which then processes them accordingly to a configuration file. The utility of dynamic languages is great but the usefulness of more staticly typed languages is not out weigh-able.

O.K. now back to getting crap done.