Breaking Eggs And Making Omelettes

Topics On Multimedia Technology and Reverse Engineering


Archives:

Custom Multimedia Programming Language

September 27th, 2005 by Multimedia Mike

This is what happens when you spend year in and year out thinking about the exact same topic… You start thinking about designing a new programming language!

What about a new programming language that is somewhat akin to (my limited understanding of) MATLAB in its capacity to handle data types like vectors? I am thinking of a seemingly simple language that has data types for handling vectors and bitstreams (any orientation), and associated operations like parallel vector math and bitstream extraction. Admittedly, I am only considering decoding at the outset but I suppose there is no reason that the language could not be designed for encoding as well by including a bitstream writer.

How would this language fit into the grand scheme of a multimedia application? I do not envision it would be used to write e.g., an entire multimedia playback application. It would be suited to writing something like a standalone video decoder. How would it interface to a playback application? Either the to-be-written language processing tool could analyze a program written in the language and output C code to be compiled by an ANSI C compiler. Or, the tool could transform the program directly into machine language and output a properly formatted object file that can be linked with an application. The former option would be at the mercy of the C compiler for its performance. Also, say goodbye to any CPU-specific SIMD optimizations unless the tool also output special ASM syntax which would limit it to specific toolchains. The latter option would limit the tool to certain supported CPUs.

A better solution would be a hybrid of the two approaches. Run the tool against a source file and specify the target CPU. The tool would use its knowledge (if any) of that particular platform to generate machine code optimized for that CPU. Otherwise, it outputs generalized C code for the task that can be fed into any C compiler (including self-contained data structure definitions for handling bitstreams, vectors, etc.).

As if this were not ambitious enough, I wonder if the language concept could be extended to cover common principles in the perceptual audio codec domain? A recurring theme in the world of audio codecs is: Fixed point or floating point? Generally, floating point implementations seem to be easier to create and work well on modern CPUs equipped with floating point units (FPUs). Fixed point versions are apparently more difficult to implement but desirable for slower CPUs and those not equipped to FPUs. I wonder if it is possible to produce a language definition from which either a fixed or floating point implementation could be generated?

Sounds like the perfect academic exercise that makes me wish, if only for a shimmering moment, that I was still in school.

It has been a long time since I have taken a survey of programming languages course. (Aside: For the uninitiated, this type of course seems to be pretty common in computer science curricula. Generally, you are thrust head-first into a brand new programming language every week and required to perform some programming assignment. I seem to remember exposure to Ada, PostScript, Scheme, and Prolog, among other languages.) Anyway, I have done a cursory internet search for programming langauge directories. This concept sounds impossibly niche and it is hard to imagine that there is already a language that implements these design goals. But due diligence, as well as the sheer effort that this undertaking would require, demands that I at least look for alternate solutions.

Posted in Outlandish Brainstorms | Comments Off on Custom Multimedia Programming Language

Comments are closed.