Re: bytecode modules
Ben Urban <benurban <at> users.sourceforge.net>
2005-04-04 12:20:39 GMT
On Mon, 2005-04-04 at 09:58 +0200, simper-2 <at> student.ltu.se wrote:
> Hello,
>
> I'm writing to get some feedback on an idea that I came up with today.
>
> The reason why I've been thinking about it is because I think thin clients are
> pretty nifty things. But better software is needed to make them more useful.
>
> I see three options to get the look and feel of your desktop environment no
> matter what terminal you happen to sit in front of.
>
> * A VNC-like system plugged in as video and input driver.
> - Latencies. No better than X.
> + Pure plugin, doesn't require changes to the server.
>
> * Standalone clients for things that affect L&F (theme, wm...) communicating
> through proxy plugins or special method invokations in the Y protocol.
> - Latencies. No better than X.
> + Possible as pure plugin.
>
> * 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.
What a perfect job for Python! It's certainly a well-established
language, and it already uses bytecode.
>
> For security (and laziness) reasons the bytecode should only consist
> of instuctions that a theme, widget or window manager needs to use.
I'm not sure how security might work in Python. Perhaps someone else on
this list has some ideas about that? One thought would be to remove
access to any other modules. I'm not sure Python can do that easily,
but it's worth looking into. (Keep in mind that any other Python
implementation already on the system must still work as expected.)
>
> I'm guessing (very much guessing) performance wouldn't suffer all that much
> since the instructions would be on a very high level, e.g. drawLine(), and thus
> most execution would be native. Themes with thousands of putPixel() calls have
> themselves to blame...
Python works very well with native modules, so this wouldn't be a
problem.
>
> Being able to write widgets in bytecode would make life easier when a new
> version of Y contains a new widget. New apps could provide the widget
> themselfs if running on an old server lacking this widget. At least it's a
> better fallback than implementing the new one on a canvas.
>
> Artistic non-programmers would get an easier, dedicated language to write themes
> in.
>
> This solution removes (or at least decreases) the need for a stable internal
> api.
>
> A program drawing the desktop (root window) should be a client since it most
> probably will want to load images from remote harddrive.
>
>
> Curious to hear what people have to say about this.
>
> /Simon
>
>
>
Disclaimer: I love Python (can't you tell?)