Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Are Extensible Programming Languages Coming? 838

gManZboy writes "Programming writer and instructor Greg Wilson is proposing that the next generation of programming languages will use XML to store not only such things as formatting (so you can see indentation your way, and I can see it my way, via XSLT) but even programmatic entities -- like: <invoke-expr method="myMethod"><evaluate>record</evaluate></invoke-expr>. Wacky, but perhaps wacky enough to be possible?"
This discussion has been archived. No new comments can be posted.

Are Extensible Programming Languages Coming?

Comments Filter:
  • Extensible? (Score:5, Insightful)

    by jawtheshark ( 198669 ) * <slashdot.jawtheshark@com> on Tuesday January 18, 2005 @06:50PM (#11402717) Homepage Journal
    My programming languages were always extensible. Be it over procedures or functions, objects and inheritance, fuck even the good old programmable interrupts did the job! Programming languages don't limit, they enable you to do what you want.

    Look, I can understand XML to convey data.... but honestly, you don't need to use XML for everything under the sun. Proven old good methods work just fine, thank you very much.

    • Re:Extensible? (Score:5, Insightful)

      by eln ( 21727 ) on Tuesday January 18, 2005 @06:53PM (#11402752)
      XML now is what OOP was 15 years ago: Useful for some things, but shoehorned into every possible application, whether it actually made any sense or not, and whether or not it made things easier or more difficult.
      • Re:Extensible? (Score:4, Insightful)

        by Anonymous Coward on Tuesday January 18, 2005 @07:05PM (#11402920)
        15 years ago? That's where OOP is now.
      • Re:Extensible? (Score:4, Insightful)

        by Cthefuture ( 665326 ) on Tuesday January 18, 2005 @08:46PM (#11403913)
        I could not agree more.

        At it's core XML is nothing. It's so generic, so basic, so flexible, whatever you want to call it, that it's completely pointless. Yes, you read that right, the structure is so flexible that it's not really structure any more.

        XML is just dumb in general. It's like saying: I've got this new, exciting, powerful data container called "The English language."

        Yeah, OK, whatever.
        • If you have XML you can suck it into a DOM parser and then do node walking. Then you can write the data from the nodes into structures in whatever language you have. And for this reason it makes a great way to feed data from one program to another.

          It is a very inefficient way to have the data for a program while the program is running.

          I agree that XML can be whatever you want it to be, and I agree that it is very over-hyped and the OOPSLA mongers, who make their money trying to confuse people into buyin
        • Re:Extensible? (Score:5, Insightful)

          by conradp ( 154683 ) on Tuesday January 18, 2005 @11:44PM (#11405018) Homepage
          XML has definite value, but that value has just as definitely been overhyped.

          I bet all of us have written code to save and restore configuration files or data files of some sort or another. You start with a flat file, if you're really dumb you store values implicitly by position, if you're a bit more clever perhaps you opt for using keyword/value pairs. Later you decide you want to allow newlines in the values and need to write special code for that, so you use double-quotes. Then you decide you need double-quotes in your values, and you invent an escaping mechanism. After some more development you realize that some subset of your keyword/value pairs has to be multiply-instanced, so you need some mechanism to have "objects" each with their own keyword/value pairs. And so on... Eventually someone on another project needs to read your file, and you have to explain all these idiosyncrocies to them so they can write some parsing code...

          XML simplifies all that by defining a common syntax in which you can encode your information. It's easy to gradually expand your format by adding XML fields, and if you show the file to anyone else they instantly get a pretty good idea of what the information means; plus they have access to a bunch of libraries to parse it (SAX and DOM) and there are predefined ways to escape newlines, quotes, braces, and so forth.

          Of course, XML is only a syntax. There are a billion other syntaxes that could probably accomplish the same things, but somehow XML became the standard; that in and of itself has value because everyone uses it and knows how to read and write it. But programs can't interoperate and read and write the same files until they agree on symantics, i.e. what tags will be where and what each field really means. I've encountered this several times, some customer says "write the data in XML format" and I have a hard time explaining to them that, yes, we can write it in XML, but that's not sufficient information to define the file format, that's really just the beginning.
          • Re:Extensible? (Score:3, Interesting)

            by Retric ( 704075 )
            Ok when your storing data files you might as well use a database vs XML. But, if your storing configuration files I like to use (int;name lenght) (name as an ascii str) (int; element id) (int; data type) (int; data size) (data)

            It's low over head and easy to parce so you can store a tun of data, simple or complex data, with ease. It's also easy to check the syntax so you know you did not mess up when writing or reading the data. It's also easy to store list's or nest data. Ok now if you tell me how XM
            • Re:Extensible? (Score:3, Insightful)

              by conradp ( 154683 )
              Thank you very much, I think you've just proven my point better than I ever could have!
            • Re:Extensible? (Score:3, Insightful)

              by Decaff ( 42676 )
              0 = new tree
              1 = string ASCII
              2 = String Unicode
              10 = signed int
              20 = unsigned int
              30 = floating point number (format 1) 31 = floating point number (format 2) ...
              I basicly keep aything under 10,000 as uneversal format's and use stuff over that for odd adhock stuff which I don't have time to deconstruct.


              If I had come across one of your configuration files, and did not have this key to the meaning, I would have had no idea how to interpret it.

              This is exactly the argument for using XML.
    • Re:Extensible? (Score:5, Insightful)

      by Umbral Blot ( 737704 ) on Tuesday January 18, 2005 @07:32PM (#11403231) Homepage
      I for one welcome new tools. Well that is if they are tools and not straight jackets. For example a new language construct (for eaxmple generic classes in Java 5) is an example of a good tool. You can use if if you need it, but you can also ignore it. Perhaps XML syntax might be useful in some areas (although I can't see how ...), but forcing the entire language to be in it seems too much like a straight jacket to me.
  • by FyRE666 ( 263011 ) * on Tuesday January 18, 2005 @06:51PM (#11402721) Homepage
    ...programmatic entities -- like: record. Wacky, but perhaps wacky enough to be possible?

    Hopefully, no. Christ almighty, why is there this surge in interest for pointless layers of abstraction on top of the code? It seems some people are desperate to do anything to avoid actual implementation (work?), prefering to dance around the periphery of a project, adding needless fluff and speedbumps. Honestly, will the addition of XML markup in source code REALLY help to advance a project, make the code more readable or avoid bugs?
    • by lukewarmfusion ( 726141 ) on Tuesday January 18, 2005 @06:56PM (#11402797) Homepage Journal
      No, don't you prefer this:
      <invoke-expr method="myMethod"><evaluate>record</evaluate></inv oke-expr>

      over this:
      someObj.myMethod(record);

      ? I, for one, welcome the obscuring verbosity. It's a challenge. It's exciting. It's job security.
      • by malakai ( 136531 ) * on Tuesday January 18, 2005 @07:13PM (#11403028) Journal
        From the article:

        We believe that next-generation programming systems will most likely store source code as XML, rather than as flat text. Programmers will not see or edit XML tags; instead, their editors will render these models to create human-friendly views, just like Web browsers and other WYSIWYG editors. For example, a program stored on disk like this:


        <doc>Only replace below threshold</doc>
        <cond>
        <test>
        <compare-expr operator="less">
        <field-expr field="age">
        <evaluate>record</evaluate>
        </field-expr>
        <evaluate>threshold</evaluate>
        </compare-expr>
        </test>
        <body>
        <invoke-expr method="release">
        <evaluate>record</evaluate>
        </invoke-expr>
        </body>
        </cond>

        would be viewed and edited like this: // Only replace below threshold
        if (record.age > threshold) {
        record.release();
        }

        Crucially, code will not be stored as uninterpreted CDATA within XML documents and programmers will not see (much less type in) XML tags. Such a representation would have all the disadvantages of JSPs, Ant, and other hybrid systems, without bringing any tangible benefits. Instead, XML will represent the program's deep structure. Only time and experimentation will tell whether this turns out to be something like an annotated syntax tree or something more abstract.


        It's not that big of a deal to implement. Just get the major IDE's to play along, all will no doubt retain the ability to persist or convert to ASCII tokens when needed. The benefit comes when your in a very large enterprise project and you want to write some automated code testing or style checking, or even security audits. Being abstracted from the specific languages TOKENS lets you write a relative language neutral code auditor with ease.

        I'd easily use XSL + XPATH to do some major change over using a big ass regex.
        • > We believe that next-generation programming systems will most likely store source code as XML, rather than as flat text. Programmers will not see or edit XML tags; instead, their editors will render these models to create human-friendly views, just like Web browsers and other WYSIWYG editors. For example, a program stored on disk like this:

          Slashdot: IT/Security: Tuesday, January 18, 2006:
          "New MyDOOM.OOP virus attacks programmers"

          A new virus has been unleashed against developers. The new virus ex

      • by Frank T. Lofaro Jr. ( 142215 ) on Tuesday January 18, 2005 @07:47PM (#11403387) Homepage
        And if it fails to help you keep your job, you have yet another XML item to add to your resume. :)
    • Actually, perhaps it might. Follow me here. Imagine being able to comment a chunk of code, but leave it invisible until the coder decides to review the comment layer. It sure beats polluting the codes readability, regardless of what other IDEs do to fold them. Imagine the possibilities with being able to lock certain areas of the code that you might have intimate knowledge of in a workgroup setting. Do you really want Fred touching that code? Would he even know better? If you were able to add explicit notes
    • No. This is just needless complexity. XML is great for some things, but it is not the silver bullet for every problem in the known universe!

      In this case, XML will probably make programming much more difficult and code far less readable -- to humans. The compiler might like it a little better, but the compiler is supposed to serve us, not the other way around. The tool serves us. At least in an ideal world.

      In the real world we use tools to get work done. If the tools are inconvenient to use or not suitab

    • by Jerf ( 17166 )
      Actually, this is a potentially good use of XML.

      Bear with me.

      The primary benefit of XML is that as a standardized language, standardized parsers can be made available that are reasonably easy to use.

      The primary "oversell" of XML is to extend that claim to cover semantics. Human readability is great and should not be underestimated in some uses, but should not be oversold either.

      So let's say you want to write a tool to validate that some Java code conforms to something or other. What's the hardest part o
      • The primary benefit of XML is that as a standardized language, standardized parsers can be made available that are reasonably easy to use.

        A lot of comments have suggested that encapsulating source code in XML would make it easier to parse languages in a consistent fashion, and thereby to write better code validators, formatters, style checkers, etc.

        This leads to a logical paradox: if programmers continue to write code in "plain" ascii format, how is it going to acquire the XML markup? Why, someone woul

  • shhhhh (Score:3, Funny)

    by Neil Blender ( 555885 ) <neilblender@gmail.com> on Tuesday January 18, 2005 @06:51PM (#11402726)
    Larry Wall might be listening.
  • by the_mad_poster ( 640772 ) <shattoc@adelphia.com> on Tuesday January 18, 2005 @06:52PM (#11402738) Homepage Journal
    Oh, that would be just wonderful. I was just thinking about how I could take my nicely modularized source files and bloat them into 450kb monstrosities without actually adding any value along the way.

    Wait, I have an idea, why don't we all just run this script before we start a new job and then paste bits of the junk output randomly throughout the source files?
    perl -e "print pack 'c*', rand(255) for(1..$ARGV[0]);" 2500
    Dumbest. Idea. Ever.
  • And really, it can be done right now with pretty much anything.

    Just run the code through the tokenizing phase of the compiler, and output it as XML. Teach the editors to work backwards that one step for display, and run forwards when saving, and you're done.

  • Programmable programming languages? I'm sure it'll make the lisp-macro master Paul Graham [paulgraham.com] smile.
  • Damn... (Score:5, Funny)

    by ackthpt ( 218170 ) * on Tuesday January 18, 2005 @06:53PM (#11402757) Homepage Journal
    They should have put the < and > keys in the middle of the keyboard.
  • There should be precisely the amount of syntactic sugar to consisely express a programming construct.

    Any more than that, and you're just typing because the editor is too stupid to do it for you - and you're making it harder to scan. ("Read" or "Grok")

    "begin" and "end" look pretty silly compared to { and }, and <bizarre-programming-construct-that-means-the-sam e -thing-as-an-open-paren> is retarded. Maybe as an intermediate language for easy translation, but not for my fingers to be typing or eyes
  • by Anonymous Coward on Tuesday January 18, 2005 @06:54PM (#11402760)
    <answer type=long>
    <content="N0!!!!!!!!!!!!!">
    </answer>
  • Microsoft is implementing an XML based language into Longhorn. I forgot what it is called though, but I can assure you it exists. I find it kinda funky myself, but maybe it works.
  • We all know how programmers like languages that require typing a lot of
    verbose and lengthy expressions. Y'ever notice how *popular* COBOL is?
    Did you notice how many more languages have copied Pascal's style of
    delimiters BEGIN/END versus the C style {/} or the lisp style (/), and
    how popular those languages are?

    It's different for data, because you don't type them in by hand most of
    the time; you write a program that generates them.
  • already have this (Score:3, Insightful)

    by CastrTroy ( 595695 ) on Tuesday January 18, 2005 @06:55PM (#11402777)
    Most good IDE's already support autoformatting a document to fit the indenting and bracketing to the user. I don't see how putting formatting as a core part of the language will really help the language at all.

    Not to mention the fact that programming languages (not assembly) by definition, are extensible. Most programming languages provide loops, if statements, and ways to define classes, methods, and variables. Some programming languages provide standard libraries so you don't have to do everything from scratch. I don't see anything new that this will offer.
  • I've always wanted my "Hello World" source to take 10k.
  • Yes, because it will be easier to sell a project to your boss:

    "Hey, it has XML!!"

    This will trigger memories from a IT management journal that your PHB read but didn't understand and will become enthused at the prospect of your product being even more buzzword compliant.
  • Silly article (Score:5, Insightful)

    by photon317 ( 208409 ) on Tuesday January 18, 2005 @06:57PM (#11402826)
    This article argues that next-generation programming systems can accomplish this by combining three specific technologies: -> Compilers, linkers, debuggers, and other tools that are frameworks for plug-ins, rather than monolithic applications. -> Programming languages that allow programmers to extend their syntax. -> Programs that are stored as XML documents, so programmers can represent and process data and meta-data uniformly.

    1 - Compilers with plug-in architectures - GCC anyone? I know, he probably means something quicker and easier than writing new front- and back- ends for the Gnu Compiler Collection, but the concept is already out there.

    2 - Just about any modern language does this to some degree depending on your definition. Under even the most rigorous definition of this, the good old language LISP does it with flair. Users can extend LISP syntax with ease, and user-added extended LISP syntax is virtually indistinguishable in style and functionality from the built-in elements of the language.

    3 - Since existing languages have a well-known syntax which is easily machine parseable (in fact, that's what the parser and compiler do every time you use them on your source code), existing computer languages are already in a format which allows easy conversion into other formats and representation, and the gathering of metadata. Converting semicolons, whitespace, and parentheses (or whatever your language of choice uses) to xml tags doesn't really change anything, except to make things uglier and harder to type.

  • ... and someone posed a very cool question that I had not thought of:

    "So, we're going to be making all of these neat components that people can use, right?"

    "Right."

    "And this will allow them to call our components from about any language that has a COM bridge, right?"

    "Right."

    "Um ... why do they get to have it so good?"

    (long pause)

    Regards,

    John

  • Heading 3 from the article: Programs as Data. Yep, lisp was doing that decades ago :P
  • XML has one serious disadvantage: It's awfully verbose. You may argue what is more readable,

    i++;

    or

    myIndex.math.increment();

    but it's hard to argue about

    <math operation="increment"><variable type="integer">i</variable></math>

    Sorry. I don't see future for that.
    Yes, writing your own syntax rules with XML, okay. But as an editable compiler abstraction layer. Not as a part of the program itself
  • XML has even less entropy (number of keystrokes required per statement) than COBOL. It's the anti-Perl. Good luck to anyone who chooses to write a program in XML. (Those of you with experience in XSLT already know what I mean.)
  • Seriously, what does this offer over current stuff? If I want to extend my application, I'll embed a script host. Extending the language just aadds the potential for the same code doing different things and giving rise to a whole new raft of bugs.

  • by ebunga ( 95613 )
    S-expr's and xml are interchangeable, for the most part. Congratulations, you can now be a total degenerate and program in xmlisp.
  • As far as web app development is concerned, XML is more and more present in the two domains, either natively or via open source projects.

    On the Java side, the struts framework [apache.org] provides logic to the front end so developers can use an XML style language to go through lists, create variables, set objects, etc. You can also make all your build scripts using ANT [apache.org], which allows for function calls, variable assignments, and other simple tasks.

    On the .NET side, ASP.NET pages are in the form of controls, which
  • As somebody who loves the speed and elegance of hand coding, the thought of having to hand-code XML is horrifying.

    When designing programming languages, try to relieve your users from carpal tunnel, not contribute to it.
  • Lisp.

    Heard of it before?

  • for all those yammering about the many brackets in lisp: how exactly is polluting your code with xml-tags better??

    LISP/scheme is an incredibly extensible language and after having spent the last days learning the basics of haskell, i really wonder how on earth an inferior language like "C++" could ever become this popular!

    for low-level stuff, C is a great language but when it comes to prototyping complex algorithms or simply trying out some whacky ideas, imperative languages like C++ keep your mind so ver
  • Ever heard of FORTH [forth.org]?

    Geez, it's only been around since 1970...

    And LISP has been around since the 1950s...
  • So we'd have...

    ... xmlns:Foo="urn:code:com/blah/Foo" ...

    Instead of...

    ...
    import com.blah.Foo;
    ...

    Big improvement.

  • by Daimaou ( 97573 )
    The first example in the Slashdot blurb would be the functionality of an editor or IDE, not a language. I can actually see this as being handy; especially if you are working with a bunch of other curly-brace-positioning zealots. The second example just looks stupid though.

    I use XML for some things and it is very useful in some cases, however, I find it more a pain than it's worth in most situations.

    XML has its uses and has its place, but I don't think this is it.
  • ...they want to take Lisp and replace all the parenthesis with < and > symbols?

    The article itself clearly states: "Yes, this could all have been done 20 years ago using s-expressions."

    C'mon, LISP has already done this stuff and then some. This "new" idea deserved a publication on ACM AND front page Slashdot? If everyone flocks to this because of s#(#<#, etc. it will be a sad day in programming language history.

  • by Mirk ( 184717 ) <[ku.gro.rolyatekim] [ta] [todhsals]> on Tuesday January 18, 2005 @07:11PM (#11402993) Homepage

    Three and a bit years ago, as a satire on the absurd over-enthusiasm for all things XML that was then taking over the world, I invented a parody language, XMC. Guess what? The over-enthusiasm for XML has continued unabated and now has taken over the world. And so life imitates art.

    Herewith, a sample XMC program:

    <?xml version="1.0" encoding="ISO-8859-1"?> <program language="c" xmlns="http:miketaylor.org.uk/xms/1.0/"> <include type="sysfile">stdio.h</include> <function type="int" name="main"> <params> !-- No parameters --> </params> <statement> <expression> <fncall fnname="printf"> <arguments> <argument> <constant type="int" value="0"/> </argument> </arguments> </fncall> </expression> </statement> <statement> <return> <constant type="int" value="0"/> </return> </statement> </function> </program>

    Exercises for the reader:
    1. What does this do?
    2. Is it easier to read than the corresponding C program?

    • by Piquan ( 49943 ) on Tuesday January 18, 2005 @07:16PM (#11403056)

      At a guess, it segfaults when printf tries to read its formatting string and gets (on most platforms) a null pointer instead.

    • by Anonymous Coward
      I think just about all the posters on this thread are mostly missing the point. The goal is not to have programmers writing XML. The goal is to provide a "programmer -level" -language-independent way to represent programs in both conventional (brittle) languages like C++, and in extensible languages like Lisp.

      Why would anyone want to do this? Programmer A writes a piece of code that has a confusingly-named identifier, say xglorp. Programmer B, doing maintenance on that code, wants to do a global search
  • ASN.1 and XML (Score:5, Insightful)

    by Anonymous Cowherd X ( 850136 ) on Tuesday January 18, 2005 @07:11PM (#11402998) Journal

    Programs are written by humans and they should stay easily legible and comprehensive to humans. Going to such extremes as to use XML as the author of the article suggests would defeat that purpose, it's a common trap that people who get too deeply involved with something fall into - they want to make everything use the object of their obsession. I don't recall any ASN.1 zealots trying to push for something that extreme, but with XML there are more and more people who are pushing for XML to be where it should not.

  • by shapr ( 723522 ) on Tuesday January 18, 2005 @07:14PM (#11403030) Homepage Journal
    This is a standard paradigm in the Haskell [haskell.org] world. You write a new language that fits the problem domain. These are called Domain Specific Languages [yale.edu]
    For example, Simon Peyton-Jones wrote a combinator library to describe financial contracts [microsoft.com] and used it to describe the collapse of Enron. (With fascinating conclusions!)
    Paul Hudak has written Dance [yale.edu] and Haskore [haskell.org]. Dance is a language that describes dance choreography, with a handy OpenGL viewer. Haskore is a music scoring language where code looks like:
    > cMajScale = Tempo 2
    > (line [c 4 en [], d 4 en [], e 4 en [], f 4 en [],
    > g 4 en [], a 4 en [], b 4 en [], c 5 en []])
    Languages, spoken or programming, or any other means of expression is most efficient when it fits the problem domain.

    If this sort of thing interests you, Lambda The Ultimate [lambda-the-ultimate.org] is a good forum to learn more.
  • zerg (Score:5, Insightful)

    by Lord Omlette ( 124579 ) on Tuesday January 18, 2005 @07:16PM (#11403053) Homepage
    Reading the article, I don't think anyone would ever actually see the XML unless they edited the file w/ their own text editor. I think the point is that the editor adds and parses the XML for its own benefit. See, our text files were written in ASCII, now Unicode. Therefore, the evolution to a higher representation is (supposedly) logical. The best way to reason about it is a /. post I saw many moons ago, something like: "You wouldn't put ASCII on your résumé, would you? So why would you put XML?"

    If I'm wrong, then this might be slightly more interesting in the long run than, say, Cyclone [att.com], where you have to learn a tiny amount more of additional syntax to mark that "this pointer was meant to point to data, not code", "this pointer should not write beyond this boundary", "this function has no business mucking up its stack", etc.

    Alternatively, look at Visual Studio.NET.
    /**
    * @author Lord Omlette
    * zOMG WTF
    */
    vs.
    /// <comment>
    /// <author>Lord Omlette</author>
    /// zOMG WTF
    /// </comment>
    The latter is a bit more readable but more annoying to write. Better we have tools to generate this stuff for us.

    And then someone will come out of the woodworks to say "Knuth had Literate Programming back in the 80s, why the fuck aren't we using that?" but that's another rant altogether.
  • by marciot ( 598356 ) on Tuesday January 18, 2005 @07:17PM (#11403069)
    I personally do not understand what the entire hype about XML is, or even specifically what problem it is supposed to solve. My understanding is that there was a big push for XML because of a perceived need for open document formats. The idea being that binary formats were proprietary, closed and non-portable.

    If this is the problem XML intends to solve, then I feel it is a miguided effort. Binary formats are "closed" only in so far as we do not have access to the source of the program that created them. Once that source is available, binary file formats are open, portable, and a hell of a lot more space efficient than XML. JPEG is a binary file format, yet we have open standards and the committee who designed it released open source reference implementations of the decoder and encoder. Hence, JPEG is an open format and nobody goes around trying to stuff pixels in XML files.

    I really think XML is a solution to the wrong problem. The problem is closed source software, not binary files.

    -- Marcio

    • by dvdeug ( 5033 )
      My understanding is that there was a big push for XML because of a perceived need for open document formats.

      The advantage of XML is that you can use an off the shelf parser for every language instead of writing a new parser for each language. Let someone else handle the parsing and you handle only what you have to.

      As opposed to computer languages now, where most modern languages (LISP-family excepted) have context-dependent grammars that are incredibly hard to parse correctly and each language has to hav
      • No; they stuff pixels in PNG files and TIFF files and PNM files and GIF files and a dozen other formats that need to be parsed by completely different parsers.

        You say that like its a bad thing.

        png is good for icons and webpage graphics (unless your target is IE). Its compresses well, is lossless, and has good transparency

        tiff is a good choice for very large, very high color images, such as producing for poster prints

        pnm are an excellent format for doing batch transformations (such as sticking together
  • Repeat with me: (Score:4, Insightful)

    by Zangief ( 461457 ) on Tuesday January 18, 2005 @07:20PM (#11403097) Homepage Journal
    -XML is not the panacea.

    -XML was made for comunication between different programs, not for humans to write or think in.

    -This was done before in LISP.

    10 times each morning. If in a week you are still thinking about this, call me back.
  • by Piquan ( 49943 ) on Tuesday January 18, 2005 @07:21PM (#11403103)

    If you think that extensible programming languages aren't already here, then read On Lisp [paulgraham.com] (some familiarity with Lisp is necessary).

  • by Tom7 ( 102298 ) on Tuesday January 18, 2005 @07:23PM (#11403123) Homepage Journal
    Why do people love to use XML for all sorts of inappropriate things?

    XML does not make data immediately understandable. All it does is remove one parsing problem, leaving the much more important problem of understanding the meaning of the tags, data, and their combination.

    XML might make sense as a compiler intermediate format, or even as a source archive format, but it has essentially nothing to offer in tems of extensible syntaxes (except for reminding us that the surface syntax of a programming language and the abstract syntax it represents can be as independent as we choose) or semantics in programming languages. (By the end of the article, this is essentially the point he comes to, with the only argument for XML being that it is popular.)
  • by ZiZ ( 564727 ) * on Tuesday January 18, 2005 @07:24PM (#11403138) Homepage
    <rant><invoke-slashdot cliche="overdone-parody">
    <do-in-order type="step">
    <step order="1"><pontificate subject="programming languages"/></step>
    <step order="2"><ellipsis/></step>
    <step order="3"><invoke-slashdot cliche="list-of-steps">profit!</invoke-slashdot></ step>
    </do-in-order>
    <forget-formatting/>
    <welc ome-overlords type="needlessly complicated, obfuscated, and wordy"/>
    </invoke-slashdot>
    </rant>
    <remark type="obligatory-attempt-at-wit">But it could be worthwhile.</remark>
    </type>
    </comment>
    <sig>
  • XPP (Score:3, Interesting)

    by lonedfx ( 80583 ) * on Tuesday January 18, 2005 @07:36PM (#11403269)
    I didn't really want to post anything about it so soon, given that it's not quite ready for prime time (ie, lack of documentation among other things), but XPP [bluemars.org] might be of interest to some of you. It does some of what this guys proposes, although it's not quite a "next generation programming language", more like a pre-processor on top of C++. It allows you to use external XML templates (to describe automatically written pieces of code based on the rest of your program) and inline XML comments in the cpp source (to perform higher level macros, like, for instance, calls that morph depending on the rest of the code).

    It's been used in a pretty big project from a well known company we all like to hate, though unfortunately the project itself has been cancelled. Hopefully it does mean that it's useable and could be useful to others as well. I had been waiting on a rework of the site w/documentation before drawing any more attention to it, but given this article, this is as good a time as any.

    Cheers,
    lone.
  • Subtext (Score:5, Insightful)

    by Earlybird ( 56426 ) <{slashdot} {at} {purefiction.net}> on Tuesday January 18, 2005 @08:04PM (#11403568) Homepage
    What's coming isn't languages where you edit XML -- because XML has too much syntactic overhead -- but languages which aren't text based -- languages like Subtext [subtextual.org] (the screencast demo [subtextual.org] is essential).

    Languages need to evolve out of the pure text medium. This has been happening as incremental hacks to classic languages through code folding editors and AST-aware, intelligent IDEs like Eclipse [eclipse.org], literate programming and Python's doctest module. High-level development tools like Delphi were early adopters of the philosophy that code doesn't need to be visualized as text when it's better to visualize it graphically.

    The next step is to store not text but structure. For example, why shouldn't I be able to comment on -- annotate -- a specific number in a mathematic formula in my code? With current text-based languages this would be a headache:

    double phi = 1 - 1 / (1 + Math.exp(-(cv * /* weight */ 0.3 - range) / sigma));

    Instead, I could just select the value in my editor, click on the annotate key, and enter (in nice WYSIWYG HTML or whatever) my comment there. As a result, the editor will show a tiny icon next to the number, or perhaps in the margin, indicating that there's an annotation.

    And why are formulas like that represented with such a poor syntax? Why can't I easily use proper Greek letters and standard math notations such as dots for multiplication, a horizontal line for divisions/fractions, etc.? Why can't I insert images into the source file which illustrate the concept it implements?

    What I'm talking about isn't just "rich source code", which Donald Knuth's literate programming concept covers to some extent. Languages will experience a revolutionary leap when they start treating language elements as flexible blocks of content as opposed to tokens in an AST. Consider internationalization; instead of looking up a string from a language-specific message table, your source code can include the string in every possible language, hidden away in a single visual representation -- it might look something like:

    showDialog("File not found" [English, Swedish, (8 more languages)]);

    where "English ..." is a link that opens up a nice GUI letting you change the strings in different languages. The logic to select the string to choose at runtime exists in the string "component" itself.

    A common problem in dynamically-typed language is that it's hard to implement optional static typing [artima.com] at the language level. It adds a lot of noisy syntax, and unless you add a lot of syntax, it's hard to solve many ambiguities and special cases. With a rich source format, you can hide away the details, similar to my annotation example.

    Unix geeks typically balk at non-textual files, but I blame it on a fundamental lack of imagination. You can have both! Rich source code can be represented as text -- it's just not convenient to edit it like text. Instead, you add intelligence and convenience to your tools. You don't edit your PNG files with Vi -- you use a tool like GIMP or Photoshop.

    • Re:Subtext (Score:5, Informative)

      by groomed ( 202061 ) on Tuesday January 18, 2005 @09:33PM (#11404266)
      Unix geeks typically balk at non-textual files, but I blame it on a fundamental lack of imagination. You can have both! Rich source code can be represented as text -- it's just not convenient to edit it like text.

      A format which is as flexible and comprehensive as you describe is not convenient to edit period. The problem is that every tool which wants to edit a small part of it needs to understand (or at least be aware of) all of it.

      Want to calculate a line number? Have to parse and render the entire document. Want to generate a diff? Have to parse and render the entire document. Want to translate a string? Have to send the entire document to the translator and wait for it to come back. Want to post a code snippet for discussion? Have to create a new file, paste the code snippet, then upload the file, meaning all discussion gets separated from the code. Unless every browser/mail reader/whatever is changed to understand the format, but this just reiterates the point made above.

      This is not to say that it wouldn't have its uses, but they'd be rather specialized, and you'd probably end up with only 1 or 2 programs which can actually fully understand the format, somewhat similar to the current situation with Flash and Squeak.

      There are very good reasons why we have the functional decomposition we have today. It makes it easier to work with other people.
  • ...I just want to say:

    Congratulations!

    You are now on step 1 on a long and tedious journey to building a poorly-designed lisp dialect!

    Other posters have already made this case well enough that there's not much point in me elaborating! :)
  • Grammar (Score:3, Interesting)

    by Hard_Code ( 49548 ) on Tuesday January 18, 2005 @09:22PM (#11404194)
    Don't most programming languages already have formal grammars? Why would you need to mark them up.
  • by Anonymous Coward on Tuesday January 18, 2005 @09:28PM (#11404233)
    <response language="English">
    <exclamation tone="sarcastic">
    <word partofspeech="adjective" syllables="1">
    <character encoding="ascii">W</character>
    <character encoding="ascii">h</character>
    <character encoding="ascii">a</character>
    <character encoding="ascii">t</character>
    </word>
    <word partofspeech="indefinite article" syllables="1">
    <character encoding="ascii">a</character>
    </word>
    <word partofspeech="adjective" syllables="1" emphasis="true">
    <character encoding="ascii">g</character>
    <character encoding="ascii">r</character>
    <character encoding="ascii">e</character>
    <character encoding="ascii">a</character>
    <character encoding="ascii">t</character>
    </word>
    <word partofspeech="noun" syllables="1">
    <character encoding="ascii">i</character>
    <character encoding="ascii">d</character>
    <character encoding="ascii">e</character>
    <character encoding="ascii">a</character>
    </word>
    <punctuation>
    <character encoding="ascii">!</character>
    </punctuation>
    </exclamation>
    </response>
  • by Paolomania ( 160098 ) on Tuesday January 18, 2005 @11:39PM (#11405000) Homepage
    Maybe too much schooling has made me a stodgy young academic, but didn't LISP provide us with extensibility and everything else XML cuold possible offer, in a much cleaner and more elegant syntax?

"Being against torture ought to be sort of a multipartisan thing." -- Karl Lehenbauer, as amended by Jeff Daiell, a Libertarian

Working...