MODE_W - a minimal desktop in javascript

by david 5. October 2012 09:14

I decided that since I've been writing my new H2D2 programming language, it would be good to have some kind of web-based environment to run some H2D2 programs in. So I started writing something in javascript to try and do that. I started calling it MODE (Minimal Operation Desktop Environment) but then I decided to add 'W' for web as well, so I'm naming it mode_w for the moment.

The main idea was for it to be minimalistic - so it's a character based system only. I always remember thinking that the work Microsoft did with MinWin was cool, so that's one of my influences. I always remember that Windows flag logo animated from ASCII characters...

Since I wanted to be able to run several things at the same time, I built a primitive window based environment - but one that works with keyboard control only, and in a browser.

Already I've got something which can move, resize, open and close windows. Everything is simply rendered into a <pre> tag with a monospace font, so theres no mucking about with <div> blocks or anything, just an array of strings that represent the screen - one string for each line on the screen.

Each 'window' draws its own content (which scrolls when it runs out of space) and this means that I can do different things in different windows. So each window becomes a kind of widget, in a text-only kind of way.

I have also allowed character input into each window which can post back a command to a webservice, and this means you can have a command processor running as a web service somewhere else. Of course, different windows could point to different command processors, so a variety of tasks can be done from the one environment.

Here's a screenshot of how it looks so far:

So before I get H2D2 running in mode_w I'm building a few experimental widgets, like the google search widget, just to see how well it works and to iron out any issues. The google search widget allows you to type in a search term and see the top matching URLs.

And maybe I'll build an expression parsing widget which could also be used as a calculator. But after that I will try and get it to host some H2D2 programs, since that is why I made it in the first place...

About the author

David

I'm a C# developer having worked with .Net since it was in beta.  Before that I mainly worked in C and C++.  I have been developing commercial software for more than 20 years.  I also mess around with microprocesors, but that's just for fun.  I live near Cambridge, England and work for one of the departments at Cambridge University.

Tag cloud