The Simpler Direct-media Library (SDL) has proven more impressive then originally anticipated. I’ve downloaded the MinGW (GCC) and MSVC (V8.0/2005) development libraries along with the source code: much to my surprise, the Borland and Watcom compilers are also supported. While I’m using GCC for the unix side of things, I fully intend to make use of Microsofts compiler for the windows builds. My desktop system also has the OpenWatcom compilers installed on the Windows partition, never have used them, but they are available (I them installed ages ago, mainly out respect for the old watcom-c compiler). Since I need the DirectX SDK to compile SDL from source on Win32, and it is like a 512 meg download, it’ll have to wait a while lol. The binaries available are from MSVC8, so I really woul dprefer compiling SDL from source: not to mention feel more comfortable using the combination for projects, knowing it built well…. hehe.

I’ve been taking the effort to study the Visual Studio-style build system in preparation, it will get the job done. My desktop has the Express Editions of Visual C++ (V9.0/2008), C#, and Basic installed; along with MinGW and OpenWatcom, but I avoid C/C++ development under Windows as much as possible — just not a comfortable environment. If I ever opened a shop, I would probably nab a few copies of Visual Studio proper, and just use it for building stuff ^_^.

I’m accustomed to having an entire operating system as my integrated development environment, so I do not care much for traditional IDEs, they are just not my bag. Visual Studio (particularly the more professional oriented versions) however are one of the best as far as such things go; and perhaps the only Microsoft product that I have ever met, and did not *hate* eventually. The various Visual {lang} Express Editions are also sufficient for many things; I have them setup because it was the quick route of getting something that might come in handy later, and I have no need to buy VS Standard or Professional.

GCC for Unix and Visual C++ Express for Windows, will do fine for SDL, but I have yet to decide on an XML parser… The only XML parsing I’ve ever done in C++, has been done though the Qt toolkit. Normally, I would expect to use libxml++ for this, but using libxml under MSVC might be more annoying them I am willing to tolerate at compile/link time. Another option I reckon, would be to try out Xerces-C++.

All development is basically going to be done on a FreeBSD machine, as that *is* my concept of an IDE lol. The only interest I have in Visual C++, is to get the most ‘bang’ out of the Win32 builds. So with luck, I will never have to bugger with the S.O.B. beyond getting my project built, hehe.

more tpsh: control flow stuff

I’ve been trying to find a way of hooking in proper shell control flow keywords into tpsh, without uglifing the existing code. At the moment, tpsh understands executing singular command sequences, scripts, and a queue of command sequences. It’s fairly easy to modify the parsing/lexing portions to adjust the internal data structures IAW control flow keywords, the problem is how to handle execution phase.

Originally, I had in mind setting up nested data structures and doing a delayed execution: evaluate the control flow statement and modify the data, then execute the remaining commands (e.g. if CMD0; then CMD1; else CMD2; fi, would execute CMD when the statement needs to be evaluated at execution phase, then reshape the strucure so that only CMD1 or CMD2 remains, and then feed that back into the executor).

Last night, I had an interesting idea… on the case specific code generation.

Shell control flow basically amounts to very simple if, while, for, and case statements; and the more modern until and select statements. Normal execution patterns amount to using a single command sequence (e.g. cat f0 f1 f2 f3 | sort > f), or a queue of such command sequences. Why not replace that executor with a section of code, that understands how to handle those as well as control flow (etc), and then generate the desired code to execute the result.

Exempli gratia:

tpsh_cgen( ( [ 'if', 'test command' ],
[ 'then', 'other commands' ],
....
[ 'else', 'other other commands' ],
....
[ 'fi' ] )
)

might return something like:

sub { 
if (evaluate the 'test command' and test the exit status)
{
execute the 'other commands'
}
else {
execute the 'other other commands'
}
}

and so on and so forth; so that if we call the generated code ref, we have a set of code that will execute the correct commands, whatever they may be, and with quite a lot less fuss.

Something I would do just for fun ;)

Build a modernized Galaga like game, that is simple, fun, highly addictive, and could be played for countless hours until you forget what day of the week it is — without needing quarters xD. Most definitely one made for a fast pace and long-haul style of play, like old arcade games, hehe.

It would also be a fun way to learn a few libraries ^_^.

You know it’s time to take a walk when….

if (expr) {
do this only
} elese {
do this instead
}

executes both blocks, and it takes you a minute to realize, that despite using Perls strict and warnings pragmata, you are to tired to notice you wrote ‘elese’ instead of ‘else’

Oy vey, what a life.

http://haskell.org/haskellwiki/Shooting_your_self_in_the_foot

and http://www-users.cs.york.ac.uk/susan/joke/foot.htm

Interesting article

Bjarne Stroustrup on Educating Software Developers

A very good read; it also reminds me why most of the pe

One thing that especially stuck a cord with me:

Education should prepare people to face new challenges; that’s what makes education different from training. In computing, that means knowing your basic algorithms, data structures, system issues, etc., and the languages needed to apply that knowledge. It also means having the high-level skills to analyze a system and to experiment with alternative solutions to problems. Going beyond the simple library-user level of programming is especially important when we consider the need to build new industries, rather than just improving older ones.

For the love of Pete’s sister, the education system in America hasn’t been preparing the vast majority of people for jack shit, for at least the last 40 years, if not the last 120 years…. and with the way things are these days, I wonder how long until someone will write a song for Coneheads II, where s/high school/college/gi is applied ^_^.

I still meet people that struggle with literacy and logic, let along engineering. When it comes to CS majors that I’ve met, I usually see two major varieties: those that went through a decent course, and actually paid attention. And those that probably got the turn your head and cough treatment, or spent more time playing Counter Strike.

:-/

Random ideas: an ed in perl?

command line processor ->
[addr1 [,addr2] ] [ [ command ] [ flag ] ]

extract the address start / end range, look up the codref for command
and extract the flag if any.

Use defaults from the table if addresses are omitted / command omitted /
flags omitted / etc.

apply linear commands ->

$cmds{subsitute}->($line, $flag);

each command is applied to a string, $line, and passed any extracted
flag is passed as an option argument to the subref. (e.g. p,n,l, or g)

text marshal/serialize routines ->

if using tempfile:
extract line range into an array of lines

else using memory:
suck file into an array of lines

that array of lines is the text to apply the linear commands to.
the result is then used to update the buffer (array/tempfile)

I/O ->
truncate user file and copy buffer to user file

Bang escape ->
! can be implemented with the gx or `` syntax in perl

notes

pped / ed: if invoked as ed, turn on BRE support.
opts: -s, suppress diagnostics for scripts
-p, set prompt string to 'string'
--regex={basic,perl} set traditional or perl re's
-P set perl re's
-B set basic re's
-S, --map edit file in memory
-n, novice mode: same as 'H' command

doing files in memory sucks the file into an array of lines; basically
a pseudo-mmap. This simplifies the marshal/serialize code, and removes
the need for a temporary file, but causes memory usage to balloon in
proportion to the file size.


S[flag] [value]

set option flag to value; omit flag and value to print all options
P, ps prompt string (str)
B, re use basic regular expressions (int)
N, nl set 'n' marker for writing out lines (int)
H, he same as 'H' command