Slashdot Mirror


Tim Bray On The Origin Of XML

gManZboy writes "Queue just posted an interview with XML co-inventor Tim Bray (currently at Sun Microsystems). Interestingly enough the interviewer is none other than database pioneer Jim Gray (currently at Microsoft). Among other things, in their discussion Tim reveals where the idea for XML actually came from: Tim's work on the OED at Waterloo."

1 of 218 comments (clear)

  1. Re:Please explain by Anonymous Coward · · Score: 5, Informative

    johannesg writes: "I've heard this quote in relation to XML before, and I don't get it. LISP is a programming language. XML is a method for storing data. About the only relation between the two that I can find is that both use nesting. So, why does this get brought up whenever XML is being discussed?"

    Lisp source code is first parsed into S-expressions before being compiled. The programmer can manipulate these S-expressions to generate new programming constructs.

    S-expressions are nested lists of dynamically typed data. The compiler turns these nested lists into bytecode or assembly code. But before this happens you're able to manipulate a well defined, concise and platform independent data format. The format is so useful that it is also used to store and transport non-code.

    Here's a Lisp function call nested within another function call:

    (/ (+ 1 2 3) 6)

    [i.e. add 1, 2, and 3 together and then divide by 6] Let's first give different names to the function operators:

    (divide (plus 1 2 3) 6)

    Now introduce redundancy by duplicating the opening function names:

    (divide (plus 1 2 3 /plus) 6 /divide)

    Translate the dynamically typed integers to explicit type indentifiers:

    (divide (plus (integer 1 /integer) (integer 2 /integer) (integer 3 /integer)) (integer 6 /integer) /divide)

    Now convert the parentheses and spaces to angle brackets to generate XML:

    <divide>
    <plus>
    <integer>1</integer>
    <integer>2</integer>
    <integer>3</integer>
    </plus>
    <integer>6</integer>
    </divide>

    Lisp S-expressions are a method for storing/expressing data AND code. They have less overhead than XML, solve more problems than XML (comfortably human readable programming languages can also be written in S-expressions, e.g. Scheme and Common Lisp) and they were invented decades earlier.

    Regards,
    Adam Warner