Prexonite standard repository finally released.

I just checked the collection helper functions I call Prexonite standard repository (psr) into SVN. As I am too lazy to create a full release, I will just supply you with a trac generated zip file.

Following is a short documentation (or rather an overview) of psr:

The Prexonite Standard Library is a collection of scripts that help in day-to-day hacking with Prexonite Script. This page shortly outlines the contents of each of the currently available files.

debug.pxs

Dependencies
none

The script enables special treating of the debug command using compiler hooks for increased performance. For each call to the debug command, it checks whether the function requests debugging (through the debugging MetaKey). Unless that is the case, the call will be removed. if-Blocks using debug as their condition will be evaluated at compile time in respect to the debugging key.

It is possible to use the debug command without including this script, in that case, however, your scripts will also contain calls to debug when not being debugged.

The actual functionality of this script has been moved to managed code inside the Prexonite.dll for performance reasons in #18. CompilerHooks have to be used with care. While the loss in compiler performance is barely noticeable with just one user defined CompilerHook, many of them can really slow the translation down. The managed implementation uses a shared CompilerHook to further save time, should Prexonite.dll ever include additional CompilerHooks

More »

Is Digital Distribution Flawed?

 

Coding Horror: The Sad State of Digital Software Distribution just opened my eyes.

Jeff Atwood writes about prices of digitally distributed software. Have you noticed, that digital versions normally cost as much as the physical ones? Also keep in mind, that the former actually comes with additional value in the form of a DVD box and a manual. Additionally, the digital version is often crippled with DRM, so shouldn’t those actually cost less?

Even worse: Jeff found occasions where the digital version is actually more expensive:

Instead, I find that download options for commercial software are quite rare. Even when the download option is available, you end up paying the same price as retail or even more. Here’s a typical example. I purchased Titan Quest: Gold from Steam about a month ago. I paid $29.95, which is the standard retail box price. But online discounters sell boxed copies of the very same game for $22.90.

Digital Distribution: $29.95
Retail Copy: $22.90

Titan Quest Gold: downloadable version, $29.95
Titan Quest Gold: retail version, $22.90

Selling directly to the consumer via download means bypassing the entire brick and mortar sales chain. This should result in cheaper prices than retail, not the same prices– and it should never result in higher prices. Paying a premium for the privilege of downloading software is complete ripoff, and yet it happens all the time.

Selling digital copies is very profitable as servers are normally cheaper than retail stores. Now imagine what distribution costs, if the publisher actually owns the online shop…

But is all that criticism really justified? Is there a compensation for the missing molecules in digital distribution? Normally, there is: You can (re-)download your games/software whenever you want, wherever you want. I don’t have to worry about scratching or loosing my Dongle (read DVD/CD).

However, this privilege is not necessarily restricted to digital versions. The retail version of Half-Life 2 is nothing more but a license key paired with a copy of the game. Something I really like, as I must confess that I have absolutely no clue where my Half-Life 2 DVD is. At the same time, I don’t really care because I can always get another copy via steam.

There is an additional advantage: I prefer to play games in their "native" language, should I know it, that is. In most cases, this is English, but not all developers / publishers ship multi-language editions of their games. Oblivion being one example.
With Half-Life 2, this was never a concern, as I just downloaded the english version instead of installing the german one from the DVD.

I suspect, though, that there might be a drawback to these privileges. Half-Life 2 resisted falling into the budget sector for over two years, which I think is remarkable. Valve dictated prices via steam and through constantly releasing new bundles, making it actually quite difficult to get Half-Life 2 alone.

Nonetheless, I strongly support Steam as I does not bind me to those fragile DVDs, though I do not normally buy my games via steam due to the lack of a credit card. It doesn’t have to be just Steam. Digital distribution is the future, especially when it comes to fighting piracy. I, however, will refuse to install an utility for each of the major vendors. Now its just Steam and EA Link, but I am sure, more will follow.

Creating a programming language

On October 31, I handed in a paper I have been working on for the past few months. It shortly outlines the process of creating a programming language with a focus on compiler construction:

Compilers

Since computers only process instructions that are part of their instruction set, programs written in programming languages have to be translated into functionally equivalent programs in machine language prior to their execution. This process is called compilation and is performed by compilers.

To cope with this task, the translation is commonly split up into multiple steps, also referred to as phases. A compiler starts with reading the input file byte by byte, character by character.

Like our eye splits up a text into individual words, the second step is to group meaningful characters together and remove those without meaning (e.g.,~whites paces). This step is called lexical analysis and results in a stream of tokens: short, categorized strings of characters.

In the next phase, the compiler determines the relationship between the tokens. It applies the syntax of the programming language and is therefor called syntactical analysis. It results in a tree structure that represents the program.

At this stage, some compilers apply additional transformations to the program to increase performance before finally generating code in the language of the target machine.

So, if you want to know how your favorite compiler works, have a look at “Creating a programming language” (PDF, 400KiB).