programs will be stored as XML documents, so that programmers can represent and process data and meta-data uniformly
"I have a mind like a steel... uh... thingy." Patrick Logan's weblog.
Search This Blog
Wednesday, May 26, 2004
Subscribe to:
Post Comments (Atom)
Blog Archive
-
►
2011
(19)
- ► 12/04 - 12/11 (2)
- ► 08/21 - 08/28 (5)
- ► 07/17 - 07/24 (1)
- ► 04/03 - 04/10 (3)
- ► 03/27 - 04/03 (5)
- ► 03/20 - 03/27 (1)
- ► 03/13 - 03/20 (1)
- ► 03/06 - 03/13 (1)
-
►
2010
(2)
- ► 11/07 - 11/14 (2)
-
►
2009
(40)
- ► 06/07 - 06/14 (2)
- ► 05/31 - 06/07 (1)
- ► 05/17 - 05/24 (1)
- ► 04/05 - 04/12 (2)
- ► 03/22 - 03/29 (7)
- ► 03/15 - 03/22 (1)
- ► 03/08 - 03/15 (4)
- ► 03/01 - 03/08 (2)
- ► 02/22 - 03/01 (1)
- ► 02/15 - 02/22 (5)
- ► 02/08 - 02/15 (1)
- ► 02/01 - 02/08 (7)
- ► 01/25 - 02/01 (2)
- ► 01/04 - 01/11 (4)
-
►
2008
(402)
- ► 12/28 - 01/04 (12)
- ► 12/14 - 12/21 (3)
- ► 12/07 - 12/14 (10)
- ► 11/30 - 12/07 (14)
- ► 11/23 - 11/30 (7)
- ► 11/16 - 11/23 (14)
- ► 11/09 - 11/16 (7)
- ► 11/02 - 11/09 (11)
- ► 10/26 - 11/02 (14)
- ► 10/19 - 10/26 (10)
- ► 10/12 - 10/19 (11)
- ► 10/05 - 10/12 (16)
- ► 09/28 - 10/05 (26)
- ► 09/21 - 09/28 (16)
- ► 09/14 - 09/21 (3)
- ► 09/07 - 09/14 (9)
- ► 08/31 - 09/07 (8)
- ► 08/24 - 08/31 (10)
- ► 08/17 - 08/24 (12)
- ► 08/10 - 08/17 (4)
- ► 08/03 - 08/10 (5)
- ► 07/27 - 08/03 (10)
- ► 07/20 - 07/27 (6)
- ► 07/13 - 07/20 (7)
- ► 07/06 - 07/13 (3)
- ► 06/29 - 07/06 (8)
- ► 06/22 - 06/29 (6)
- ► 06/15 - 06/22 (5)
- ► 06/08 - 06/15 (10)
- ► 06/01 - 06/08 (4)
- ► 05/25 - 06/01 (5)
- ► 05/18 - 05/25 (6)
- ► 05/11 - 05/18 (3)
- ► 05/04 - 05/11 (7)
- ► 04/27 - 05/04 (7)
- ► 04/20 - 04/27 (7)
- ► 04/13 - 04/20 (6)
- ► 04/06 - 04/13 (9)
- ► 03/30 - 04/06 (7)
- ► 03/23 - 03/30 (5)
- ► 03/16 - 03/23 (15)
- ► 03/09 - 03/16 (7)
- ► 03/02 - 03/09 (5)
- ► 02/24 - 03/02 (4)
- ► 02/17 - 02/24 (2)
- ► 02/10 - 02/17 (3)
- ► 02/03 - 02/10 (1)
- ► 01/27 - 02/03 (8)
- ► 01/20 - 01/27 (4)
- ► 01/13 - 01/20 (3)
- ► 01/06 - 01/13 (7)
-
►
2007
(388)
- ► 12/30 - 01/06 (11)
- ► 12/16 - 12/23 (5)
- ► 12/09 - 12/16 (3)
- ► 12/02 - 12/09 (5)
- ► 11/25 - 12/02 (5)
- ► 11/18 - 11/25 (4)
- ► 11/11 - 11/18 (4)
- ► 11/04 - 11/11 (11)
- ► 10/28 - 11/04 (11)
- ► 10/21 - 10/28 (3)
- ► 10/14 - 10/21 (6)
- ► 10/07 - 10/14 (5)
- ► 09/30 - 10/07 (18)
- ► 09/23 - 09/30 (13)
- ► 09/16 - 09/23 (9)
- ► 09/09 - 09/16 (12)
- ► 09/02 - 09/09 (15)
- ► 08/26 - 09/02 (2)
- ► 08/19 - 08/26 (8)
- ► 08/12 - 08/19 (25)
- ► 08/05 - 08/12 (7)
- ► 07/29 - 08/05 (8)
- ► 07/22 - 07/29 (2)
- ► 07/15 - 07/22 (4)
- ► 07/08 - 07/15 (11)
- ► 07/01 - 07/08 (3)
- ► 06/24 - 07/01 (8)
- ► 06/17 - 06/24 (4)
- ► 06/10 - 06/17 (17)
- ► 06/03 - 06/10 (6)
- ► 05/27 - 06/03 (12)
- ► 05/20 - 05/27 (5)
- ► 05/13 - 05/20 (15)
- ► 05/06 - 05/13 (10)
- ► 04/29 - 05/06 (14)
- ► 04/22 - 04/29 (5)
- ► 04/15 - 04/22 (6)
- ► 04/08 - 04/15 (16)
- ► 04/01 - 04/08 (8)
- ► 03/25 - 04/01 (5)
- ► 03/18 - 03/25 (3)
- ► 03/11 - 03/18 (3)
- ► 03/04 - 03/11 (5)
- ► 02/25 - 03/04 (1)
- ► 02/18 - 02/25 (4)
- ► 02/04 - 02/11 (10)
- ► 01/28 - 02/04 (11)
- ► 01/21 - 01/28 (2)
- ► 01/14 - 01/21 (1)
- ► 01/07 - 01/14 (7)
-
►
2006
(261)
- ► 12/31 - 01/07 (7)
- ► 12/24 - 12/31 (13)
- ► 12/17 - 12/24 (6)
- ► 12/10 - 12/17 (7)
- ► 12/03 - 12/10 (6)
- ► 11/26 - 12/03 (1)
- ► 11/19 - 11/26 (5)
- ► 11/05 - 11/12 (2)
- ► 10/29 - 11/05 (4)
- ► 10/22 - 10/29 (5)
- ► 10/15 - 10/22 (2)
- ► 10/08 - 10/15 (3)
- ► 10/01 - 10/08 (9)
- ► 09/24 - 10/01 (8)
- ► 09/17 - 09/24 (1)
- ► 09/10 - 09/17 (5)
- ► 09/03 - 09/10 (6)
- ► 08/27 - 09/03 (2)
- ► 08/13 - 08/20 (9)
- ► 08/06 - 08/13 (6)
- ► 07/30 - 08/06 (6)
- ► 07/23 - 07/30 (6)
- ► 07/16 - 07/23 (3)
- ► 07/09 - 07/16 (2)
- ► 07/02 - 07/09 (2)
- ► 06/25 - 07/02 (10)
- ► 06/18 - 06/25 (9)
- ► 06/11 - 06/18 (10)
- ► 06/04 - 06/11 (6)
- ► 05/28 - 06/04 (9)
- ► 05/21 - 05/28 (9)
- ► 05/14 - 05/21 (3)
- ► 05/07 - 05/14 (4)
- ► 04/30 - 05/07 (10)
- ► 04/23 - 04/30 (1)
- ► 04/16 - 04/23 (2)
- ► 04/09 - 04/16 (4)
- ► 04/02 - 04/09 (4)
- ► 03/19 - 03/26 (9)
- ► 03/12 - 03/19 (11)
- ► 03/05 - 03/12 (1)
- ► 02/26 - 03/05 (5)
- ► 02/19 - 02/26 (14)
- ► 02/12 - 02/19 (2)
- ► 02/05 - 02/12 (1)
- ► 01/29 - 02/05 (1)
- ► 01/22 - 01/29 (2)
- ► 01/01 - 01/08 (8)
-
►
2005
(335)
- ► 12/25 - 01/01 (9)
- ► 12/18 - 12/25 (4)
- ► 11/27 - 12/04 (1)
- ► 11/20 - 11/27 (1)
- ► 11/13 - 11/20 (1)
- ► 10/23 - 10/30 (1)
- ► 10/16 - 10/23 (2)
- ► 10/09 - 10/16 (3)
- ► 10/02 - 10/09 (11)
- ► 09/18 - 09/25 (4)
- ► 09/11 - 09/18 (4)
- ► 09/04 - 09/11 (1)
- ► 08/28 - 09/04 (7)
- ► 08/21 - 08/28 (10)
- ► 08/14 - 08/21 (6)
- ► 08/07 - 08/14 (2)
- ► 07/31 - 08/07 (16)
- ► 07/24 - 07/31 (5)
- ► 07/17 - 07/24 (6)
- ► 07/10 - 07/17 (5)
- ► 06/19 - 06/26 (1)
- ► 05/29 - 06/05 (7)
- ► 05/22 - 05/29 (7)
- ► 05/15 - 05/22 (16)
- ► 05/08 - 05/15 (10)
- ► 05/01 - 05/08 (8)
- ► 04/24 - 05/01 (6)
- ► 04/03 - 04/10 (7)
- ► 03/27 - 04/03 (19)
- ► 03/20 - 03/27 (15)
- ► 03/13 - 03/20 (27)
- ► 03/06 - 03/13 (7)
- ► 02/27 - 03/06 (16)
- ► 02/20 - 02/27 (7)
- ► 02/13 - 02/20 (10)
- ► 02/06 - 02/13 (23)
- ► 01/30 - 02/06 (4)
- ► 01/23 - 01/30 (12)
- ► 01/16 - 01/23 (15)
- ► 01/09 - 01/16 (2)
- ► 01/02 - 01/09 (17)
-
▼
2004
(534)
- ► 12/26 - 01/02 (18)
- ► 12/19 - 12/26 (5)
- ► 12/12 - 12/19 (5)
- ► 12/05 - 12/12 (25)
- ► 11/28 - 12/05 (8)
- ► 11/21 - 11/28 (3)
- ► 11/14 - 11/21 (4)
- ► 11/07 - 11/14 (7)
- ► 10/31 - 11/07 (13)
- ► 10/24 - 10/31 (7)
- ► 10/17 - 10/24 (10)
- ► 10/10 - 10/17 (15)
- ► 10/03 - 10/10 (1)
- ► 09/19 - 09/26 (9)
- ► 09/12 - 09/19 (4)
- ► 09/05 - 09/12 (4)
- ► 08/29 - 09/05 (9)
- ► 08/08 - 08/15 (11)
- ► 08/01 - 08/08 (4)
- ► 07/11 - 07/18 (12)
- ► 07/04 - 07/11 (19)
- ► 06/27 - 07/04 (12)
- ► 06/20 - 06/27 (7)
- ► 06/13 - 06/20 (5)
- ► 06/06 - 06/13 (1)
- ► 05/30 - 06/06 (8)
-
▼
05/23 - 05/30
(27)
- What sells?
- Reading vs. Taking
- Is this ReST?
- The problem with Share Point (and most "portals")
- "Entity Aggregation" (i.e. data) and SOA
- We need a great utility player, not a specialist
- Why so late to the "table" (so to speak)?
- What a concept!
- TkZinc
- XAML as a document format --- might work
- WikiTravel
- Graham Glass on Programming Languages
- Belocolus
- "Nullable Types"
- Integration Databases
- Scheme SYNTAX-RULES How-To
- Improvements needed in VS Team Edition
- The Road from Genera to Longhorn
- Blogger Problems
- Smalltalk for Mobile Applications
- Longhorn is becoming a Pig Pile
- It's a Vendor Fest
- I am diabetic...
- Patents
- And it's just May
- WS-Wha?
- Movies
- ► 05/16 - 05/23 (16)
- ► 05/09 - 05/16 (36)
- ► 05/02 - 05/09 (31)
- ► 04/25 - 05/02 (13)
- ► 04/18 - 04/25 (25)
- ► 04/11 - 04/18 (15)
- ► 03/28 - 04/04 (9)
- ► 03/21 - 03/28 (12)
- ► 03/14 - 03/21 (9)
- ► 03/07 - 03/14 (7)
- ► 02/29 - 03/07 (16)
- ► 02/22 - 02/29 (11)
- ► 02/15 - 02/22 (6)
- ► 02/08 - 02/15 (8)
- ► 02/01 - 02/08 (9)
- ► 01/25 - 02/01 (18)
- ► 01/18 - 01/25 (12)
- ► 01/11 - 01/18 (14)
- ► 01/04 - 01/11 (14)
-
►
2003
(286)
- ► 12/28 - 01/04 (7)
- ► 12/21 - 12/28 (10)
- ► 12/14 - 12/21 (5)
- ► 11/30 - 12/07 (5)
- ► 11/23 - 11/30 (5)
- ► 11/16 - 11/23 (2)
- ► 11/09 - 11/16 (3)
- ► 10/26 - 11/02 (6)
- ► 10/19 - 10/26 (9)
- ► 10/12 - 10/19 (8)
- ► 10/05 - 10/12 (5)
- ► 09/28 - 10/05 (3)
- ► 09/21 - 09/28 (3)
- ► 09/14 - 09/21 (4)
- ► 09/07 - 09/14 (3)
- ► 08/31 - 09/07 (6)
- ► 08/24 - 08/31 (12)
- ► 08/17 - 08/24 (3)
- ► 08/10 - 08/17 (6)
- ► 08/03 - 08/10 (8)
- ► 07/27 - 08/03 (9)
- ► 07/20 - 07/27 (5)
- ► 07/13 - 07/20 (8)
- ► 07/06 - 07/13 (15)
- ► 06/29 - 07/06 (12)
- ► 06/22 - 06/29 (5)
- ► 06/15 - 06/22 (6)
- ► 06/08 - 06/15 (1)
- ► 06/01 - 06/08 (5)
- ► 05/18 - 05/25 (7)
- ► 05/11 - 05/18 (9)
- ► 05/04 - 05/11 (13)
- ► 04/27 - 05/04 (9)
- ► 04/20 - 04/27 (4)
- ► 04/13 - 04/20 (10)
- ► 04/06 - 04/13 (15)
- ► 03/30 - 04/06 (7)
- ► 03/23 - 03/30 (13)
- ► 03/16 - 03/23 (9)
- ► 03/09 - 03/16 (3)
- ► 03/02 - 03/09 (8)
About Me
- Patrick Logan
- Portland, Oregon, United States
- I'm usually writing from my favorite location on the planet, the pacific northwest of the u.s. I write for myself only and unless otherwise specified my posts here should not be taken as representing an official position of my employer. Contact me at my gee mail account, username patrickdlogan.
7 comments:
The XML thing is really a red herring; any serialisation format can be used: S-expressions, picked live objects, even a VBA-style script that generates the program structure directly.
The _real_ Big Idea is that programs will be created by directly manipulating the Abstract Syntax Tree, rather than by writing dumb plaintext source code that's transformed into executable bytecode/machinecode by some mystical process largely impenetrable to, and uncontrollable by, the common developer. Comparable to the popular shift from CLI to GUI, except without losing any advantages of the former.
Scads of benefits to this approach; for example: scriptable, extensible ASTs will give you all the benefits of Lisp macros, except in realtime and without actually having to use Lisp; "smart" programming tools will eliminate syntax/compiler errors and provide all kinds of ways to dynamically edit, view and analyze code; code refactoring will become highly automated and seamlessly integrated with the writing process; easier access to the weird-n-wonderful world of programming for the great unwashed masses; and no more vi-vs-emacs flamewars, ever.:)
Not a new idea, but hopefully one that's finally coming of time (see James Gosling's Jackpot project, for example).
without actually having to use LispNote sure this is a benefit.
In general, any tree has to be displayed somehow. Text has its advantages. I'm not searching for another format, but if a better one comes along, I'm open to it.
I won't be holding my breath in the mean time.
"In general, any tree has to be displayed somehow. Text has its advantages."
For input and representation, yes. Text is undoubtedly much more time- and space-efficient than point-n-click-driven icon displays, so I would expect AST editors to provide professional programmers with a keyboard-driven, text-based interface that looks, at least on the surface, similar to the tools they currently use.
The big difference is that these tools _won't_ be limited to crudely manipulating character streams. They'll have complete understanding of the language syntax, semantics and structural rules, and will be able to leverage that considerable knowledge to help the developer write programs much more quickly and reliably than they currently can.
A nice touch will be the ability to swap a text-oriented programming UI on-the-fly for [e.g.] a child-friendly graphical one, or one tailored specifically to disabled users, just by plugging a different View layer into the editor. Another cool trick will be the ability to embed live GUI widgets - buttons, checkboxes, input/display text fields, etc. - directly within a program's 'source'.
More practical benefits will be stuff like 'live' variable name/scope checking and editing. For example, the editor could put a squiggly underline under every undeclared variable in a program, much like Word puts one under every misspelt one, so no more waiting for the compiler/runtime to spew 'variable x not found' errors whenever you make a typo. Selecting a variable at any location within the program will cause the editor to highlight _every_other_ reference to that variable. An extra keystroke or right-click will let you globally or selectively rename that variable safely and automatically. A type inferencer component could be plugged into the editor to help write code and look for variable typing errors. Careless semantic errors such as typing '=' in situations where you meant '==' will often be flagged for attention immediately, as the editor will have good knowledge of which keywords, operators, etc. are legal in a given context and which aren't.
BTW, another interesting language-cum-environment to look at is Berkley's experimental "next-generation" Logo-like Boxer language (http://www.soe.berkeley.edu/boxer.html/). Doesn't seem to be in active development any more, but it shares some ideas with AST-based programming, particularly in its use of live, interactive, graphical boxes to denote block structures which is basically just a less granular version of the AST-based editor UI. I do recommend giving it a look if you're interested in all this stuff: there's some interesting reading material and a downloadable classic-compatible Mac executable available.
I'm not sure simply presenting a syntax tree differently will make programming easier for the newer developer, but if it does I am all for it.
In any case the following sounds kind of like the Smalltalk Refactoring Browser, which has been around form some years now...
They'll have complete understanding of the language syntax, semantics and structural rules, and will be able to leverage that considerable knowledge to help the developer write programs much more quickly and reliably than they currently can.
Note from the author: I don't actually say that XML is the right/best/most appropriate format; I say that its use is (now) inevitable. Most other document-based systems are migrating to XML for storage; tools are already ubiquitous (who _doesn't_ have SAX, DOM, or XSLT these days?); and programmers are meeting it earlier and earlier in their careers. Sure, it could all have been done with name-of-alternative-goes-here; my point is, it wasn't, and now it's too late for anything else to gain sufficient traction.
"Note from the author: I don't actually say that XML is the right/best/most appropriate format; I say that its use is (now) inevitable."
I'd agree only inasmuch as living, breathing and sweating XML is these days an essential requirement for full buzzword compliancy; about the only way to get the great unwashed masses to pay any attention to anything new and unfamiliar. (As long as you can "talk the talk", most couldn't tell you from the Ministry of Silly Walks. Nice serialisation format; damn shame about all the High Priests and Black Magic Conjurers it's sucked in like a magnet. Humbug.)
Unfortunately, I think any mention of XML, even as a trivial adjunct as it is in this case, distracts the average eye from the main argument, resulting in the whole lot being swiftly and ignorantly pidgeonholed as Yet Another Sparkly Fun XML Technology by the more casual reader. Which is a huge disservice to do to a technology that will do for programmers what the CLI-to-GUI revolution did for end users.
Incidentally, you might be interested in my own solution: serialising AST-based programs as Python scripts. Thus a simple program such as 'display 2 + 2' is serialised as the following Python script:
Command('display', Command('add', Literal(TypeNumber(2)), Literal(TypeNumber(2))))
Executing that script within the context of the AST editor will rebuild the original AST. Not the most aesthetic-looking program ever; but then it has no need to be, and will do its job just fine with the absolute minimum effort required.
BTW, I was going to use XML originally, then changed my mind to using a full-blown language syntax, then switched to S-expressions, and finally decided that all this stuff was a complete load of nonsense and total waste of time since my AST is supposed to be completely open and scriptable anyway. (I began my programming life as a casual Mac application scripter, pushing icons around my desktop with recorded scripts. Plus ca change, eh?:)
The only technical value I can see in using XML as the native serialization format is if the AST editor wants to lock its users out of manipulating the program object model directly. Which would fall somewhere between utterly clueless and completely self-defeating; the AST already contains all the domain knowledge needed to expertly manipulate the program structure. If users need to resort to manipulating the serialized form directly then the AST editor is not doing its job. (Though it would give the XML weenies a shiny new toy to despoil for a week, until they get bored and move onto screwing up something else...:p)
Do keep pumping the core concept though. It's a true Killer Technology in-waiting. You just have to break a few vi/emacs lovers' fingers to get there. ;)
"I'm not sure simply presenting a syntax tree differently will make programming easier for the newer developer, but if it does I am all for it."
Here's a really simple example: doing string substitutions. In Python, one writes stuff like:
'Hello, %s. The time is %s.' % (name, strftime('%H:%M:%S', t))
In an AST editor (with apologies for the lousy text-only mockup; it doesn't do it justice) the equivalent would be represented on-screen as something like:
[Hello, [name]. The time is [t as [h:mm:ss]].]
Superficially you may think "oh-ho, that's just like Perl string substitution", but it's not. First, try to visualise the [...] as being drawn on-screen as a a series of subtle, gently coloured boxes nested within one another, with additional styling applied to the text to indicate what each 'word' means. Now, each box represents an object within the editor application's object model; so in the above you're creating first a 'literal string' object containing a series of characters, and into that you're embedding a variable object and a command object; or any other arbitrary object that can evaluate to text.
The full AST representation would be rather more complex, of course, but the editor's graphical View would fine-tune the presentation as above to make it more palatable to the human eye (nothing as crude as Lisp parens here;).
Input constraint and context-sensitive help are a couple of other things I'm thinking of. My first 'programming' experience was on a ZX81, and there's something uniquely wonderful in having the entire language vocabulary printed beneath your fingertips where you can see it at all times, and just pressing the desired button being all it took to put a legal keyword into the right place. An advantage that's been lost somewhere in the transition from home micros to home PCs, and one I'd very much like to resurrect. The idea of having a floating window that displays a brief summary of the currently selected language structure is also highly appealing. Not only will it help new users get up to speed with language syntax and semantics; it can also be hyperlinked into deeper documentation on programming theory and how to use such structures more effectively, and into macro scripts that can physically show them how to use them by generating template code and examples before their eyes.
And these are probably quite trivial examples of what could be possible in such a system; I've been dabbling with ideas for the last few months and still don't feel like I've more than scratched the surface. (Probably a good indicator I should stop faffing about daydreaming and get on with actually implementing it...;p)
Not that you can't provide such services in other ways, of course, but I can't think of any other way that could do it with such simplicity, efficiency and grace.
...
"In any case the following sounds kind of like the Smalltalk Refactoring Browser, which has been around form some years now..."
Kind of. Except that refactoring browsers really get the cart before the horse; rather than create a general solution that can be customised to support all kinds of different - and often highly interactive - uses, they provide a highly specialised solution that solves only a single problem somewhat after the main event.
FWIW, I did think of drawing the comparison, but I didn't want to end up creating an "oh, another way to build a refactoring browser" misconception by accident. (Almost as bad as creating an "oh, another whizzy XML technology" one as the original paper's author seems to have made if the blog links I've seen to it are any indication of readers' [mis]perceptions.[grin])
But if it helps to think of it as taking the refactoring browser concept and completely generalising it, and then removing the original character stream-based source code from the equation and leaving the user to do everything by manipulating the browser DOM, then by all means go for it. I'm still struggling to find the perfect pitch myself (as you can probably tell;p), so if you can come up with one then by all means let me know. [grin]
...
Anyway, going to shut up now before I give away all me competitive h-h-h-advantages... but best of British to anyone fancies stealing the ideas given here, and I hope they've provided a useful little glimpse into what [I hope!] will be the future. ;)
Post a Comment