So I found Mungi the other day. It has pretty much what I want out of a kernel - Persistence, a single 64 bit adress space, and capabilities. So instead of designing a kernel or hardware to support it, I've started concentrating again on the more important issue of actually using those things to make computing better. So I was thinking about ways of reusing and connecting objects.
I started thinking about programming, since that's probably the first thing I'd want to be doing inside the OS. So I thought about the demo of Subtext and thought that it might be cool if code were stored as a syntax tree instead of text. I was thinking that you could then have different renderers which would convert the code into text, and then you could view the same code with different syntaxes -- No more worrying about coding style, you just write the renderer for what you want to read! So then I was thinking that you could just edit this text with a regular text editing object, but then you have to have a parser for each different render.
Next idea: get rid of the parser. Again this is based off subtext. If we're already storing syntax, why not have the editors directly manipulate the syntax instead of going through text. So instead of writing a parser for each renderer, you'd write an editor. That may or may not be good. So then I started thinking about macros. How do you support macros with all these different renderers? Here's the beautiful part. Without a parser, macros are only for display. Since you never have to parse it, it can be as crazy as you want! Add another for loop, different kinds of quotes, whatever you want. And it doesn't make the compiler any more complicated, because it's only for display. Sure you'll have to have a different version of the macro for each renderer, but that's fine with me. You could show the expanded macro in some other color to let the user know that it is a macro. Besides, I don't really think multiple renders would be used that frequently.
Ok, it doesn't sound as amazing now that I write it down. But no parser solves so many of my syntax problems. I really like this idea. I've got to get my hands on a persistent system and start playing with this!
No comments:
Post a Comment