Friday, October 2, 2009

Wave language

Of course, after thinking about a Wave compiler, I started thinking about what language might be interesting to try this with, trying to think about how you would handle code across multiple source files (is a Wave a source file, a Workspace or a Project?), and how difficult different languages would be to implement. But what if, instead, you designed a new language (because you can never have enough), one that was designed to be written within a Wave, designed to run within a Wave, and was Wave aware?

Not having looked into the Wave protocol yet, I don't know how references to different blips inside a Wave work, nor how references to a Wave is done in general. But if blips were functions, or code blocks, contained within other blips that were modules, a Wave compiler for this language would inherently understand the layout of the code within the Wave.

I would expect that a language that lived within a Wave would be a very "web" language, one that used Waves as core data structures, that output HTML, used CSS, and was DOM-aware in the language. In fact, the execution environment might be a Wave itself, which is seeded with the initial code and then the Wave itself is both the execution environment and the input/output environment. It would be a terrific environment for self-modifying code.

It's likely this language wouldn't have a Wave compiler so much as a Wave interpreter, something that read and executed the Wave on the fly instead of actually outputting anything in p-code, byte code, or machine code. This would be, in the Wave way, a robot which was part of the Wave, keeping track of its own "program counter" but letting the Wave environment keep track of data. The types of applications that this language would allow ... well, I'm not sure: it allows for "multiplayer" (not meaning to necessarily imply a game) applications where the users can "catch up" to what's happening at any time just by looking at the Wave, since it will present the current state of the application at any time.


Of course, a lot of the ideas that come to mind for collaborative applications -- a calendar, say -- are also doable with a Gadget inside a Wave, and don't require Yet Another Programming Language, nor a robot to help. But ideas like these aren't borne of necessity, they're a technical exercise that, perhaps, get turned into something useful.

Now I wonder if I could turn this into a Master's thesis...

No comments:

Post a Comment