A language-agnostic language

Discussion in 'Java' started by Ed, Mar 24, 2006.

  1. Ed

    Ed Guest

    An unGooglable.

    Reading recent Eclipse posts, and hearing the contention between those
    using Java 1.4 and 1.5, let alone between Java and C++, I'd have
    thought that we'd have, by now, another layer of source code, beneath
    that which we construct in our editors, yet above any
    machine-executable.

    It shouldn't be impossible define an object-oriented language entirely
    in XML (for example). Thus, when your favourite editor opens a source
    code file, it could ask how you want this XML language
    human-interpretted (as opposed to machine-interpretted). You could, for
    example, have the editor display the code as Java. You'd then edit and
    update the code as Java, and compile it, and run the byte-code.

    Then later, a C++-fanatic colleague, could open the same XML file, but
    chose to view it as C++. The editor would take care of the translation
    (actually, "Translation," is a better word that, "Interpretted"), and
    present the code to him as pure C++, which he can then edit and update
    as C++, and he could think he's running and executing the native code,
    though the editor (having previously been configured so) would actually
    compile to byte code and run in a JVM (or vice-versa, a Javaer could
    update Java code which is then compiled to native from the ensuing
    XML). But that's not important to our C++er, he just wants to edit the
    code and run the results, and that's what he sees.

    Yes, there'd be library issues. Of course, java.util doesn't exist in
    C++; but there's no reason why an intelligent translation-editor
    couldn't be told the C++ library equivalents, so that they appear as
    normal to a Javaer. An specifically, there's no translation that
    couldn't be fully specified in XML.

    Essentially: your choice of source-code need not limit that of others
    working on the same code.

    Does anyone know if such an experiment/undertaking/instanity has been
    investigated?

    ..ed (listening to Coldplay's, "Yellow")

    --
    www.EdmundKirwan.com - Home of The Fractal Class Composition
    Ed, Mar 24, 2006
    #1
    1. Advertising

  2. This is somewhat similar yo .NET, in which several langauges (C#, VB.NET,
    managed C++, J#, etc.) are compiled into the same intermediate language
    (MSIL), and could in principle be decompiled into a different language than
    the original source. In practice, of course, it's somewhat trickier than
    that, since not all languages provide the same set of types and constructs.
    For example, what happens when your C++ buddy uses destructors, operation
    overloading, automatic objects, unions, etc. and now you want to display his
    code as Java?
    Mike Schilling, Mar 24, 2006
    #2
    1. Advertising

  3. Ed

    Roedy Green Guest

    On 24 Mar 2006 15:15:11 -0800, "Ed" <> wrote,
    quoted or indirectly quoted someone who said :

    >
    >Does anyone know if such an experiment/undertaking/instanity has been
    >investigated?


    see http://mindprod.com/projects/scid.html

    I see the future of language evolution more off as display rather than
    ASCII representation as a stream of characters.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Mar 25, 2006
    #3
  4. Ed

    JeffLowery Guest

    something like a XAML or XUL XSLT transform script to
    language-of-choice? That would only handle the UI, though... but would
    you really want to write logic in XML? Data structures are a little
    more palatable, and mapping languages in Castor/JAXB/JIBX etc. do
    something like this already.

    But logic statements in XML? Yuck!
    JeffLowery, Mar 25, 2006
    #4
  5. Ed

    JeffLowery Guest

    Holy crap! It's been done:

    <canvas>

    <simplelayout spacing="5"/>

    <class name="box" height="100" width="100" bgcolor="red"/>

    <class name="borderedbox" extends="box"
    onmouseover="this.changeSize(50)"
    onmouseout="this.changeSize(-50)">
    <attribute name="bordersize" value="3"/>
    <view bgcolor="yellow"
    x="${parent.bordersize}" y="${parent.bordersize}"
    width="${parent.width - parent.bordersize*2}"
    height="${parent.height - parent.bordersize*2}"/>

    <method name="changeSize" args="pixels">
    this.animate("width", pixels, 500, true);
    this.animate("height", pixels, 500, true);
    </method>
    </class>

    from OpenLaszlo. Although to my mind it's more of a language embedded
    in XML, not so much a language in XML syntax.

    So, how would this go? Lex/Yacc programming language X to agnostic XML
    representation Y using mapping M in XML mapping language Z (sub X)?

    There's no problem can't be solved by adding another layer of
    indirection.
    JeffLowery, Mar 25, 2006
    #5
  6. "Roedy Green" <> wrote in
    message news:...
    > On 24 Mar 2006 15:15:11 -0800, "Ed" <> wrote,
    > quoted or indirectly quoted someone who said :
    >
    >>
    >>Does anyone know if such an experiment/undertaking/instanity has been
    >>investigated?

    >
    > see http://mindprod.com/projects/scid.html
    >
    > I see the future of language evolution more off as display rather than
    > ASCII representation as a stream of characters.


    You mean like Labview?

    --
    LTP

    :)
    Luc The Perverse, Mar 25, 2006
    #6
  7. "JeffLowery" <> wrote in message
    news:...
    > something like a XAML or XUL XSLT transform script to
    > language-of-choice? That would only handle the UI, though... but would
    > you really want to write logic in XML?


    My experince with Ant suggests that the answer is "NO!!!!".
    Mike Schilling, Mar 25, 2006
    #7
  8. Ed

    Roedy Green Guest

    On Fri, 24 Mar 2006 18:12:36 -0700, "Luc The Perverse"
    <> wrote, quoted or indirectly
    quoted someone who said :

    >> I see the future of language evolution more off as display rather than
    >> ASCII representation as a stream of characters.

    >
    >You mean like Labview?


    I am not familiar with LabView. I see programming in future more like
    filling in dialog boxes and ticking things off. I also see people
    heavily customising the way they view the code, using dozens of
    different ways of looking at the same code depending on the current
    task, lots of ways of filtering out what is temporarily irrelevant or
    highlighting what is, making it easy to compare things that in current
    code are not adjacent.. The code becomes a structured graph of nodes
    in a database, not an ascii text string.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Mar 25, 2006
    #8
  9. Ed

    JeffLowery Guest

    I actually like ANT, but I have no explaination as to why. Maybe
    because I've stared too long a make files in the past.
    JeffLowery, Mar 25, 2006
    #9
  10. Ed

    JeffLowery Guest

    People have been anticipating that for a long time, though. Problem is,
    most businesses have really particular ways of doing things different
    from other businesses, requiring clever thought on the part of the
    implementor. I don't think outsourcing will go wholly overseas because
    of that: you almost have to coexist iwth a customer (or have a really
    good resident expert) to understand the unique aspects of business.

    (but I digress...)
    JeffLowery, Mar 25, 2006
    #10
  11. "Roedy Green" <> wrote in
    message news:...
    > On Fri, 24 Mar 2006 18:12:36 -0700, "Luc The Perverse"
    > <> wrote, quoted or indirectly
    > quoted someone who said :
    >
    >>> I see the future of language evolution more off as display rather than
    >>> ASCII representation as a stream of characters.

    >>
    >>You mean like Labview?

    >
    > I am not familiar with LabView. I see programming in future more like
    > filling in dialog boxes and ticking things off. I also see people
    > heavily customising the way they view the code, using dozens of
    > different ways of looking at the same code depending on the current
    > task, lots of ways of filtering out what is temporarily irrelevant or
    > highlighting what is, making it easy to compare things that in current
    > code are not adjacent.. The code becomes a structured graph of nodes
    > in a database, not an ascii text string.


    Ah - yes that is not quite like labview.

    I can't actually see where you are going with that any more than I can
    understand Aspect-Oriented Programming. I would just need to see it
    working.

    It would have to be very well done though. Most tools meant to simplify
    tasks merely hide information that I consider relevant. I am constantly
    peeved by windows and other microsoft programs doing this in its default
    options.

    If they could make innovations that didn't get in the way I wouldn't be
    opposed. But I've installed several GDE's that had "smart tabbing" which I
    think should be renamed to random tabbing - I have no idea where there
    cursor is going if I push tab.

    Labview on the other hand is a completely visual programming language in
    which data lines are represented as wires. (So your program is essentially
    a schematic.) Everything not directly defined as sequential is
    multithreaded. Labview is used for hardware integration - and it is an
    effective tool for many purposes. I had a data collection card in the
    computer, and I was able to make a program which turned it on, and graphed
    multiple data points in a matter of minutes.

    While the speed at which applications can be drafted up is amazing, it is
    virtually impossible to write a conventional algorithm using wires, and
    "LEDs" as booleans etc. I think the true power is in the device drivers and
    attention that has been put into easy hardware integration. They have a
    self branded "C-like" language which uses the same libraries - but I have no
    experience with that.

    --
    LTP

    :)
    Luc The Perverse, Mar 25, 2006
    #11
  12. Ed

    Roedy Green Guest

    On Fri, 24 Mar 2006 21:21:21 -0700, "Luc The Perverse"
    <> wrote, quoted or indirectly
    quoted someone who said :

    >I can't actually see where you are going with that any more than I can
    >understand Aspect-Oriented Programming. I would just need to see it
    >working.


    I have done a few simulations at
    http://mindprod.com/projects/scid.html

    IDEs such as Eclipse and IntelliJ are now doing many of the things I
    imagined SCIDs doing, like global rename, though they don't do it as
    accurately as a true SCID could.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Mar 25, 2006
    #12
  13. Ed

    Chris Uppal Guest

    Mike Schilling wrote:

    > This is somewhat similar yo .NET, in which several langauges (C#, VB.NET,
    > managed C++, J#, etc.) are compiled into the same intermediate language


    Someone once described the .NET MSIL as the world's first skinnable language.

    Technically that's not quite true (as you noted), but it's a good picture of
    what's inadequate about the idea of plugging different surface syntaxes onto
    the same semantics -- you /still/ have only the one semantics, and so you
    /still/ can only express things in one way, so having a choice of syntax
    doesn't actually buy you anything.

    Consider the mess that MS have inflicted on ECMAScript for instance. It
    doesn't and shouldn't have classes or protection, but because bloody .NET has
    these things, and is limited to working in those terms, they ended up grafted
    onto JScript.

    -- chris
    Chris Uppal, Mar 25, 2006
    #13
  14. Ed

    Timo Stamm Guest

    Mike Schilling schrieb:
    > This is somewhat similar yo .NET, in which several langauges (C#, VB.NET,
    > managed C++, J#, etc.) are compiled into the same intermediate language
    > (MSIL),


    What's the difference to the JVM?

    The following is a list of programming languages for the Java virtual
    machine aside of Java itself:

    http://www.robert-tolksdorf.de/vmlanguages.html

    There are even products that translate MSIL into standard java byte code.


    > and could in principle be decompiled into a different language than
    > the original source. In practice, of course, it's somewhat trickier than
    > that, since not all languages provide the same set of types and constructs.
    > For example, what happens when your C++ buddy uses destructors, operation
    > overloading, automatic objects, unions, etc. and now you want to display his
    > code as Java?


    I doubt that it has any practical value.


    Timo
    Timo Stamm, Mar 25, 2006
    #14
  15. Ed

    Timo Stamm Guest

    Roedy Green schrieb:
    > On Fri, 24 Mar 2006 18:12:36 -0700, "Luc The Perverse"
    > <> wrote, quoted or indirectly
    > quoted someone who said :
    >
    >>> I see the future of language evolution more off as display rather than
    >>> ASCII representation as a stream of characters.

    >> You mean like Labview?

    >
    > I am not familiar with LabView. I see programming in future more like
    > filling in dialog boxes and ticking things off.


    There are a lot of products working this way.

    You could program in Flash 4 using a graphical interface. AFAIK, Excel
    allows to do complex reports using dialog boxes. Automator lets you
    control Applications and Files using a GUI.

    But for me, x and y coordinates and three buttons simply can't beat a
    keyboard. This might only be true because I spend a lot of time in front
    of it.

    For casual users, a simple GUI interface is more convenient.


    > I also see people
    > heavily customising the way they view the code, using dozens of
    > different ways of looking at the same code depending on the current
    > task,


    "Debug perspective" vs. other "perspectives" in Eclipse.


    > lots of ways of filtering out what is temporarily irrelevant or
    > highlighting what is,


    There certainly are tons of ways to filter information in Eclipse.


    > making it easy to compare things that in current
    > code are not adjacent..


    Not sure what you mean, but the compare views of Eclipse are very
    useful. Organizing source into coherent domains is up to the programmer.


    > The code becomes a structured graph of nodes


    It already becomes a structured graph of nodes in Eclipse. The source
    text is parsed into an Abstract Source Tree. You can browse the tree of
    a class and you can browse entire inheritance and call hierachies.


    > in a database, not an ascii text string.


    This would be possible. But compilers, build tools, repositories, etc.
    would have to support it. Text is the common denominator.


    (I know that Eclipse is not the only IDE to do all that.)

    Timo
    Timo Stamm, Mar 25, 2006
    #15
  16. Ed

    Don Roby Guest

    JeffLowery wrote:
    > something like a XAML or XUL XSLT transform script to
    > language-of-choice? That would only handle the UI, though... but would
    > you really want to write logic in XML? Data structures are a little
    > more palatable, and mapping languages in Castor/JAXB/JIBX etc. do
    > something like this already.
    >
    > But logic statements in XML? Yuck!
    >

    Each to his own. I find the notion of having a full language expressed
    in the form of structured data appealing.

    This part of the idea has indeed been done (started anyway) in XML. See
    http://www.o-xml.org/. It has not been used as the basis for
    translation to other OO languages that I know of, but there are people
    doing transforms between o:XML code and XMI formatted UML.
    Don Roby, Mar 25, 2006
    #16
  17. "Timo Stamm" <> wrote in message
    news:44251b4a$0$17587$-online.net...
    > Mike Schilling schrieb:
    >> This is somewhat similar yo .NET, in which several langauges (C#, VB.NET,
    >> managed C++, J#, etc.) are compiled into the same intermediate language
    >> (MSIL),

    >
    > What's the difference to the JVM?


    That 90% (at least) of code run by JVMs is compiled Java, and you've never
    see changes made to the JVM standard to support any other languages, where
    VB.NET and C# are (roughly) equally popular, and MSIL was explicitly
    designed to support both of them as well as C++.
    Mike Schilling, Mar 25, 2006
    #17
  18. Ed

    Timo Stamm Guest

    Mike Schilling schrieb:
    > "Timo Stamm" <> wrote in message
    > news:44251b4a$0$17587$-online.net...
    >> Mike Schilling schrieb:
    >>> This is somewhat similar yo .NET, in which several langauges (C#, VB.NET,
    >>> managed C++, J#, etc.) are compiled into the same intermediate language
    >>> (MSIL),

    >> What's the difference to the JVM?

    >
    > That 90% (at least) of code run by JVMs is compiled Java, and you've never
    > see changes made to the JVM standard to support any other languages


    Yes, the JVM is java-centric. It would be very nice to see some support
    for other languages.

    Maybe sun is afraid of other languages taking over :)


    Timo
    Timo Stamm, Mar 25, 2006
    #18
  19. Ed

    David Segall Guest

    "Ed" <> wrote:

    >
    >Essentially: your choice of source-code need not limit that of others
    >working on the same code.
    >

    And when you have completed this project it is just a small step to a
    word processor that works in a human language-agnostic language so one
    person can edit the document in French and the next can use Italian.
    David Segall, Mar 25, 2006
    #19
  20. "David Segall" <> wrote in message
    news:...
    > "Ed" <> wrote:
    >
    >>
    >>Essentially: your choice of source-code need not limit that of others
    >>working on the same code.
    >>

    > And when you have completed this project it is just a small step to a
    > word processor that works in a human language-agnostic language so one
    > person can edit the document in French and the next can use Italian.


    Oui.

    I mean, si.
    Mike Schilling, Mar 25, 2006
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chakra

    Browser agnostic ?

    Chakra, Jun 14, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    2,523
    Chakra
    Jun 15, 2005
  2. Rasjid Wilcox
    Replies:
    4
    Views:
    561
    Brian Kelley
    Dec 4, 2003
  3. jorpheus

    Agnostic fetching

    jorpheus, Aug 2, 2008, in forum: Python
    Replies:
    4
    Views:
    259
    Michael Torrie
    Aug 2, 2008
  4. est
    Replies:
    1
    Views:
    206
  5. Gavri Savio Fernandez

    Loading configuration files in an OS-agnostic way

    Gavri Savio Fernandez, Dec 17, 2004, in forum: Ruby
    Replies:
    2
    Views:
    104
    Pit Capitain
    Dec 17, 2004
Loading...

Share This Page