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...
Showing posts with label robots. Show all posts
Showing posts with label robots. Show all posts
Friday, October 2, 2009
Wave compiler
While getting ready for work this morning I had Wave on the brain, And while thinking about the revision control idea, and how a robot might act upon the changes near-instantly, that got me thinking of other tools that might act immediately upon changes being made.
What if your code editor edited a Wave instead? Many code editors have the Intellisense idea, where it will help you out with the parameters in the function you just mentioned and automatically close your parentheses, brackets and curly-braces for you -- all features I personally hate. Some people like them, though, and you could have such functionality in a Wave robot, watching your edits as you go and helping out. If you pause after typing
MyFooFunction(
it might guess that you have completely forgotten the parameters for the function, and will attach a reply to that function, having the parameter values supplied underneath the line you're editing. As soon as you close the function, the robot would remove the hint and let you get on with your coding. It could also help out with the closing of the function call or a block of code...
In fact, it could be constantly compiling your code for you, checking for undefined variables, syntax errors, type mismatches...
It would have to be aware of where you are in your code, what you're currently writing; it shouldn't complain about half-written statements, unclosed code blocks, etc., if the user is still working on them, but lines that have been typed previously, finished with a definitive carriage return or semicolon, could be fair game for reporting errors. These errors might be represented as highlighted code using markup (colours, underlining, etc.) or with reply blips attached to the problem instruction, variable or statement. These markups would be removed as soon as the user goes to tend to them.
A full-fledged compilation system might maintain a different blip in the Wave where it dumps all compilation errors, lint warnings, etc., in case the user wants to tend to bugs that the compiler isn't brave enough to report quite yet, unsure if it's being too hasty. Hell, depending on the type of application, the output could, if the code successfully compiles, be placed within the Wave.
And none of this touches on the idea of multiple humans working on the code at the same time.
What if your code editor edited a Wave instead? Many code editors have the Intellisense idea, where it will help you out with the parameters in the function you just mentioned and automatically close your parentheses, brackets and curly-braces for you -- all features I personally hate. Some people like them, though, and you could have such functionality in a Wave robot, watching your edits as you go and helping out. If you pause after typing
MyFooFunction(
it might guess that you have completely forgotten the parameters for the function, and will attach a reply to that function, having the parameter values supplied underneath the line you're editing. As soon as you close the function, the robot would remove the hint and let you get on with your coding. It could also help out with the closing of the function call or a block of code...
In fact, it could be constantly compiling your code for you, checking for undefined variables, syntax errors, type mismatches...
It would have to be aware of where you are in your code, what you're currently writing; it shouldn't complain about half-written statements, unclosed code blocks, etc., if the user is still working on them, but lines that have been typed previously, finished with a definitive carriage return or semicolon, could be fair game for reporting errors. These errors might be represented as highlighted code using markup (colours, underlining, etc.) or with reply blips attached to the problem instruction, variable or statement. These markups would be removed as soon as the user goes to tend to them.
A full-fledged compilation system might maintain a different blip in the Wave where it dumps all compilation errors, lint warnings, etc., in case the user wants to tend to bugs that the compiler isn't brave enough to report quite yet, unsure if it's being too hasty. Hell, depending on the type of application, the output could, if the code successfully compiles, be placed within the Wave.
And none of this touches on the idea of multiple humans working on the code at the same time.
Labels:
compiler,
error checking,
Google Wave,
intellisense,
robots
Revision Control
One of the first Wave ideas I had, while watching Google I/O presentation on Google Wave was to use it as a revision control system, allowing for reverting through the playback mechanism of Wave, and for simultaneous editing if a Wave client was used as the code editor. Later in the presentation, they mentioned this idea, and I wasn't surprised that I'd be the only person to think of it.
It's still in mind though, because here at work, we have a host management system, written in XML/XSLT, created by me. This concentrated all of the various data associated with hosts (network addresses, hostnames, usernames, etc.) into a single place, instead of across a half-dozen files, in various directories, on various hosts. This system, too, lives under revision control, to ensure those who edit it aren't colliding their changes. Presently, I'm rewriting the system into a Python/YAML system, for reasons of speed, sustainability and readability.
But as Wave is opening up, I picture this system using it, where a single Wave contains all of the data about all of our machines: multiple users can be editing this data at the same time, seeing each others' "presence" in the Wave as we're doing it, and a robot could watch the Wave and crunch the data when it detects that things have changed, immediately.
Of course, I doubt I'll be able to push a Wave solution here at work, at least, not until Wave takes over the world, but it's a nice idea...
It's still in mind though, because here at work, we have a host management system, written in XML/XSLT, created by me. This concentrated all of the various data associated with hosts (network addresses, hostnames, usernames, etc.) into a single place, instead of across a half-dozen files, in various directories, on various hosts. This system, too, lives under revision control, to ensure those who edit it aren't colliding their changes. Presently, I'm rewriting the system into a Python/YAML system, for reasons of speed, sustainability and readability.
But as Wave is opening up, I picture this system using it, where a single Wave contains all of the data about all of our machines: multiple users can be editing this data at the same time, seeing each others' "presence" in the Wave as we're doing it, and a robot could watch the Wave and crunch the data when it detects that things have changed, immediately.
Of course, I doubt I'll be able to push a Wave solution here at work, at least, not until Wave takes over the world, but it's a nice idea...
Labels:
Google Wave,
host management,
Python,
revision control,
robots,
version control,
XML,
XSLT,
YAML
Subscribe to:
Posts (Atom)