Slashdot Mirror


Jackpot - James Gosling's Latest Project

Pete Bevin writes "Artima has a fine interview with James Gosling, creator of Java, about his latest project. It's called Jackpot, and it treats the parse tree as the program. This makes refactoring much, much more intuitive. The article has some good insights into code visualization, technical writing, and making your programs more understandable."

21 of 208 comments (clear)

  1. It's the Matrix! by greg_barton · · Score: 3, Funny

    So you can write what is kind of like a reverse grammar, where you associate structural patterns with what you can think of almost as TeX descriptions of how to represent the patterns graphically. What you see on the screen has been generated from this pattern matching. So we can, on a user chosen basis, turn various program structures into all kinds of visual representations.

    Why, methinks he's reinvented the Matrix. :)

  2. Re:Here are the tips by Anonymous Coward · · Score: 3, Funny

    Always document your code so that a mentally retarded 6 year old can understand what you mean.

    I learned that when doing math proofs. It it wasn't written so retarded 6 year old can understand it, the TA took off marks.

  3. Interesting by The+Bungi · · Score: 5, Interesting

    I don't know much Java, but .NET has an entire CodeDOM namespace that can be used to generate assemblies and code on the fly. DOM being the keyword - it presents C# code as a parsed object tree. I haven't played with it beyond generating simple assemblies but I wonder if it could be somehow cajoled into creating a tree representation that also understands flow. That would be a neat thing to play around with.

  4. java < emacs by dankelley · · Score: 4, Insightful

    "Creator of Java"? What's that? How about "the creator of Gosling Emacs"?

  5. "treats the parse tree as the program"? by Ducky · · Score: 5, Insightful

    I've heard that somewhere before...

    Oh yeah. In my ANSI Common Lisp book. Something about the real power of Lisp being that everything, including the program itself is just a tree structure.

    I guess programming languages really are slowly merging. Java isn't getting macros now, but I suspect in another 5 or 10 years it'll be something else Java will do. =)

    -Ducky

    1. Re:"treats the parse tree as the program"? by Shackleford · · Score: 4, Insightful
      I've heard that somewhere before... Oh yeah. In my ANSI Common Lisp book. Something about the real power of Lisp being that everything, including the program itself is just a tree structure.

      Well, actually, there seems to be more to Jackpot's methods of code visualization than that. Lisp code can be thought of as having a tree-like structure, but it may not be as clear as what Jackpot's visual representation my be. What Jackpot would do is show the annotated parse tree, so it can give much information about how it is constructed. It would be a useful graphical representation that appears to go beyond what Lisp code would show, and with that representation and the source code, you can get the best of both worlds.

      Anyway, they also mention that you can implement a "reverse grammar" that would take data formed in parse trees and make code more readable. For example, you can have Greek letters and other mathematical notation such as the square root symbol. If you have long equations in your program, this could be very useful in making your code readable, and thus understandable.

      So what Jackpot seems to be is a way of giving different ways of viewing the code you write, which, IMHO, can go a long way in solving problems with it and simply improving on it.

  6. Aw, crap. by Qweezle · · Score: 3, Funny

    Does this mean it will be any easier for me to learn Java? Probably not. Will I ever learn Java? Of course. Let's be honest, Qweez No. Probably not.

  7. IntelliJ by MaxTardiveau · · Score: 4, Interesting

    Isn't that what IntelliJ does already? I use it as my main IDE, and it has an amazing understanding of Java -- it allows you to refactor just about anything.
    When working in it, you feel like you're not just editing Java -- you're editing the fully integrated structure of your software.

    1. Re:IntelliJ by SpryGuy · · Score: 3, Informative

      No, it is not free nor is it open source. You do, however, get what you pay for. The cost is a factor, though, so it may not be for you.

      It's supremely configurable, very keyboard friendly, and has more and better features than its rivals, and runs faster with a better UI.

      I personally have not used Eclipse, so I cannot make the judgement myself, but I've read threads debating the merits of the two, and IntelliJ's IDEA seems to come out ahead in the end.

      Personally, I like the ease of use and intuitiveness. You don't need to work 'its way', but the more you use it, the more features you learn about, and many times the reward is big enough to warent changing long-time habits. One example:

      Type out the word 'new' and the first few letters of the class you want. Then hit the 'code completion' key, and then hit 'introduce variable'. Wham. It completes the entire line, declaring the variable in line. You save a vast amount of typing. Or you can 'program by intention'... just start typing code. If you type a method name or variable that doesn't yet exist, just hit Alt-Enter and it'll let you create it. A simple 'back' button and you're back where you were to continue coding.

      Code inspections find potential Null Pointer Exceptions and other common issues and errors; never worry about managing imports again; fold away code you don't want to see; automatically detects out of date or erronious javadocs and flags them; incredible refactoring support (rename variable, method, class; push method or varible up or down the inheritance hierarchy; introduce methods and variables; extract methods from inline code; inline methods; change method signatures; etc); real-time syntax checking and error/warning highlighting (see at a glance if you have any unused variables, private methods, typos, etc); awesome code completion; great code navigation (jump to implementation/declaration, forward/back); intelligently "find usages" of specific variables or methods; call and inheritence hierarchy trees; ....

      I could go on forever. Plus, if there's anything you think is missing, or don't like, you can easily write a plug-in to add it or modify the behavior. Many people have. IntelliJ even has a WIKI site for users to post their own plug-ins. They also have an excellent bug reporting system, and they're very responsive.

      --

      - Spryguy
      There are three kinds of people in this world: those that can count and those that can't
  8. Re:Here are the tips by skepton · · Score: 3, Funny

    Hey this is my first post. I have angry half-baked opinions tho. I find that commenting for a retarded 6 year old makes code unreadable. Have you ever tried to find anything in the apache tomcat sourcecode using only notepad? Why is there a comment on "getInfo()" that says "Returns the info."??? Some classes I was trying to understand I just went through and deleted every comment so I could read the damn thing. Turns out the class was only like 12 lines of code. It was like shaving a cat.

  9. Modified Godwin's Law by MagikSlinger · · Score: 4, Funny
    Oh yeah. In my ANSI Common Lisp book. Something about the real power of Lisp being that everything, including the program itself is just a tree structure.

    As a Slashdot thread on a programming language progresses, the probability of someone claiming that "Lisp already does that" approaches unity.

    --
    The bitter lessons of a veteran coder: http://bitterprogrammer.blogspot.com
    1. Re:Modified Godwin's Law by MeerCat · · Score: 4, Flamebait

      As a Slashdot thread on a programming language progresses, the probability of someone claiming that "Lisp already does that" approaches unity.

      If I had mod points I'd mark you up as funny - but have you read and grokked the Meta Object Protocol ?? Because much as I hate Lisp at the lower syntactic levels, I keep on finding that features I like in other languages were actually present in the MOP and similar. That's not to say that other languages don't present the ideas in better and easier-to-use ways, but it still pisses me off that those beardie-weirdie Lisp blokes had already thought of it so much earlier...

      We kill what we fear, and we fear what we don't understand....

      --

      --
      I spent a lot of money on booze, birds and fast cars. The rest I just squandered. - George Best
  10. Re:I almost laughed out loud at this line... by MeerCat · · Score: 4, Insightful

    Ditto.

    "Complexity is in many ways just evil. Complexity makes things harder to understand, harder to build, harder to debug, harder to evolve, harder to just about everything." -- Gosling

    Software entities are more complex for their size than perhaps any other human construct because no two parts are alike. If they are, we make the two similar parts into a subroutine - - open or closed. In this respect, software systems differ profoundly from computers, buildings, or automobiles, where repeated elements abound. -- Fred Brooks, Jr.

    Which quote tells you more ? Which quote has more insight ? Which quote came 30 years earlier ?

    Here's a clue - complexity in software doesn't usually vanish at some magical point, we just aim to achieve a position where our view of inherent complexity in a problem becomes optimally manageable. As the fundamental point of interest within a problem domain changes over time, so will the optimal viewpoint. The point of re-factoring is to move our viewpoint according to what we want to do now, not what we wanted to do when the code was written.

    Gosling is talking techno-babble... tell him to draw a parse tree of any meaning in his jargon.

    --
    I spent a lot of money on booze, birds and fast cars. The rest I just squandered. - George Best
  11. Sounds vaguely functional by Larne · · Score: 4, Interesting
    Some of this is reminiscent of things the functional programming language folks have been doing for a while. In particular the parse tree concept sounds a bit like graph reduction, which runs programs by repeatedly simplifying the graph which it (where the graph is a generalization of a parse tree). One of the things you can do with such a system is "common subexpression elimination" where common subtrees are moved to single point, ensuring they're evaluated only once. Sounds like a specialized form of refactoring, doesn't it...?

    Of course all this is easier in functional languages, because you don't have to worry about state, identical trees will always evaluate to the same value. Not so in Java, if any of the nodes refer to global data.

    I wonder how often Gosling talks with Guy Steele, who was pivotal in the development of both Scheme and Java. I'd love to see what they'd come up with if they put their brains together.

  12. babblefish translation please by frovingslosh · · Score: 3, Funny

    OK, I read the article. What the hell are they talking about?

    --
    I'm an American. I love this country and the freedoms that we used to have.
  13. LISP, the religion by melquiades · · Score: 5, Insightful

    Yes, yes, I had to deal with all the "Lisp did it first" comments when Eidola was on Slashdot.

    While it's true that the program is the parse tree in Lisp, that's not a very strong statement. Lisp's elegance comes from the fact that there are so few constructs in the language, and basically everything is a list -- even your programs. But they're basically just lists, that's all. So you have this wonderful flexibility, but the parse tree doesn't actually tell you very much about the program; you have to "parse the parse tree" to recognize higher-level constructs.

    Now languages with lots of language-level constructs -- like strong static types, objects, access modifiers, etc. -- tell you a whole lot about high-level structure with their parse trees. (And, for those following along at home, Lisp is not such a language -- not that that's a bad thing, but it isn't. Lisp builds these high-level constructs out of a very few language-level atoms.) To my knowledge, applying the "language is the parse tree" principle to non-functional languages is still largely the domain of research projects like Jackpot, Eidola, and Intentional Programming, and visual languages.

    Moral: Lisp is very, very, very cool, but it has not already done everything every other language is doing. So yes, it may sound familiar from you Lisp book, but it's not the same.

    1. Re:LISP, the religion by __past__ · · Score: 5, Interesting
      Lisp's elegance comes from the fact that there are so few constructs in the language,
      There are 978 symbols defined in the ANSI Common Lisp standard, some of which concurrently name types, classes, functions and declarations.
      and basically everything is a list
      .. except arrays, symbols, objects, structs, characters, numbers, pathnames, streams, packages...

      (OK, that's enough to prove I'm a SmugLispWeenie, I guess ... ;-)

      But they're basically just lists, that's all. So you have this wonderful flexibility, but the parse tree doesn't actually tell you very much about the program; you have to "parse the parse tree" to recognize higher-level constructs.
      No. You can parse the parse tree to reason about or modify programs. You can as well use higher-level constructs, for example asking for the class of an object and manipulate it, the declared types of variables and functions, etc. The whole metaobject protocol is about giving you an object-oriented interface to your program internals, and the same style shows in various other places. Basically, a lot of what is lost at compile-time in most other languages is a live first-class object in Lisp - for a simple example, you can get the package of a symbol, see what other packages it imports, change its name, and make some symbols in it not being exported.

      Moral: Lisp is very, very, very cool, but it has not already done everything every other language is doing. So yes, it may sound familiar from you Lisp book, but it's not the same.
      Indeed. But Lisp is the only language so far that allowed adding new concepts in portable ways, without having to modify the underlying implementation. CLOS, the object system, is basically a bunch of functions and macros, and if you don't like its class/generic-function based approach, just load a package that implements a prototype-based one and use that. An implementation of Eiffel-style design by contract is about two screenful of code, adding final and abstract classes is less.

      Are these additions "language-level constructs"? Hard to tell. The syntax the programmer deals with is just as if it were, even if everything eventually gets expressed in lower-level terms. The distinction is just not meaningful in Lisp - there just is no hard barrier between the language designer and the user, Lisp users design their language all the time.

  14. Just Great by sammyo · · Score: 4, Funny

    When you googled for something *java* it was anoying enough to deal with stupid $tarbuck$
    links, with 'Jackpot' an unlucky click and it might take 20 min to undo the popdowns, offers for the *best internet casino*... and oh my gawd, add to the wrong mail list!

    (I was going to add an example link but I wouldn't do that to my worst enemy)

    1. Re:Just Great by rsborg · · Score: 3, Insightful
      'Jackpot' an unlucky click and it might take 20 min to undo the popdowns

      Chuckle... my poor friend, why don't you just upgrade to the lizard? :-)

      --
      Make sure everyone's vote counts: Verified Voting
  15. Gamma and OO by schouwl · · Score: 3, Informative

    For me as along time programmer this feels like moving from C to C++. You can discuss your program on a whole other abstraction level.
    GREAT.
    Things are getting very interesting in the field of improving the coding process. I still remember Sniff C++ started by Eric Gamma in the early 90-ties. This was the first product to visualize/navigate over large C++ projects that blew me away. One can certainly see this approach in Eclipse - one of the latest projects of Eric Gamma.
    A few very smart IDEs appeared - CodeGuide, Eclipse, IDEA.
    Eric Gamma was working in an IT research lab in the UBS in Zurich in Switzerland before he became really famouns with his GoF book.
    Lars

  16. Re:java emacs by 73939133 · · Score: 3, Interesting

    Yes, and do you realize the significance of Gosling Emacs? It was its proprietary nature. Gosling Emacs was what finally got GNU Emacs off the ground as a successful open source Emacs implementation for UNIX systems.

    Gosling has been hostile to open source from day one. He created NeWS and tried to kill off X11, and he was probably partially behind keeping Java proprietary.