Re: bytecode modules

Phil <[email protected]> Wed, 06 Apr 2005 01:12:15 +0100
Newsgroups gmane.comp.graphics.y.devel
Message-ID <[email protected]>
[email protected] wrote:
> * Bytecode or script for L&F modules.
>   - Performance.
>   - Requires changes to the server and lots of work.
>   + No network latency.
>   + Security, no theme plugins with spy-ware or other crap.
>   
> Here I'm arguing that designing a bytecode for theme/wm/widgets modules is a
> good idea.

I would argue that graphic-drawing bytecode is a bad idea (I thought it 
was a good idea for a while last year, then I thought some more: it is 
possible I may change my mind again given compelling reasons).  I can't 
think of a suitable existing VM, and I don't think anyone wants to 
invest the time to try and design a perfect system from scratch.

I think Cg[1] is the way to go if we are to allow theme designers to 
create fast, portable, safe, complex procedurally-generated themes.  I 
am generally against the use of pixmap/textured themes if procedural 
calculation is at all possible, because I have never seen a pixmap theme 
which works well on both my >120dpi laptop screen and my (old) <80dpi CRT.

Cg is quick on hardware which supports it (and all new cards do); the 
spec is open; the compiler for nvidia targets is fairly freely 
available; and it looks as though most or all of the operations have a 
natural SSE/SSE2 implementation so the output of a compiler-to-software 
wouldn't be prohibitively slow.

Things which cannot be expressed in Cg could be implemented as callbacks 
to an external program.  I doubt there is much for which performance is 
import and Cg is inadequate.

While we're on the sunject: if you're interested in runtime compilation, 
and you should be if you're thinking of doing anything in this area, you 
should check out GNU lightning[2].  It allows you to generate machine 
instructions at runtime from the set of instructions which are available 
across the Sparc, PPC and x86 architectures.  It handles the differences 
fairly well, in my (limited!) experience.

Hope this helps,

Phil
-- 
[1] http://developer.nvidia.com/page/cg_main.html
[2] http://www.gnu.org/software/lightning/