The Artima Developer Community
Sponsored Link

News & Ideas Forum (Closed for new topic posts)
Analyze this!

18 replies on 2 pages. Most recent reply: Jul 31, 2019 3:55 AM by guy hebert

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 18 replies on 2 pages [ 1 2 | » ]
Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Analyze this! Posted: Jun 9, 2003 2:11 AM
Reply to this message Reply
Advertisement
James Gosling says, "It's a very different world when a program is an algebraic structure rather than a bag of characters, when you can actually do algebra on programs rather than just swizzling characters around. A lot of things become possible."

Read this Artima.com interview with Java creator James Gosling:

http://www.artima.com/intv/jackpot.html

What do you think of James Gosling's comments?


Hristo Stoyanov

Posts: 5
Nickname: hristo
Registered: May, 2003

Re: Analyze this! Posted: Jun 9, 2003 12:02 PM
Reply to this message Reply
Thanks for the wonderful interview!
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.

Now James Gosling & Co are at it! Wow!

One thing, which makes these hyper-productive IDEs possible, is opening the compiler API and exposing the syntax tree as it is parsed. There are some incremental Java compilers out there that can provide this feedback to the IDE. I am not familiar with Eclipse's one, but I can testify the results of such an incremental compilation in CodeGuide. Not only CodeGuide does very robust refactoring, but it also provide expert advise to the coder "in real time", very similar to what James mentioned in the article!

On another related development: Sun's Neal Gafter is leading an effort to standardize the javac API through JCP. I wonder if this compiler API is only meant to help JSP compiling (and similar) needs for now or it has a broader reach?

I would like to use the opportunity to ask James Gosling about his thoughts on (the much hyped) AOP (Aspect Oriented programming) extensions to Java. Right now, there are 2 approaches to it (IMHO):

1. An AOP-enhanced compiler consumes the internal products of the standard java compiler to provide AOP extensions. This is the approach taken in Eclipse/AspectJ, I guess

2. A “bytecode weaver” alters the binary classes, well after the compiler has done its job. In doing so, the “bytecode weaver” resurrects many of the structures, which existed during the compilation process.

3. Limited AOP features are already provided in JAva with the Dynamic Proxy API

Thanks,
Hristo

Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

Re: Analyze this! Posted: Jun 9, 2003 10:54 PM
Reply to this message Reply
The LISP and Smalltalk people have been doing this forever. Gosling continues to remain willfully ignorant of what other people did 30 years ago.

As an aside, we did this last year for an api migration engine that failed to catch on in the market - no average java programmer could get his head around it.

Anyhow, I continue to be totally underwhelmed by Gosling's "work".

Tiago Antao

Posts: 26
Nickname: tiago
Registered: Feb, 2003

Re: Analyze this! Posted: Jun 10, 2003 5:57 AM
Reply to this message Reply
Wouldn't the world be wonderful if textual representations of programs were to be dumped for something more abstract? Your tool would represent the program in your favourite "syntatic sugar" way:

1. No more discussions about tabbing/versus spacing, you would choose your favourite representation!

2. Do you prefer a graphical view (UMLish?)? Or a text one with all the language keywords on your native language? Dislike { and prefer BEGIN? or blocking based on indentation?

3. Not to talk about the all the refactoring stuff that is spoken here

4. And version control? You could now have a structured vision of the diffs...

5. Ah... and no more syntatic errors to be presented to the compiler, the editor tool would correct this by definition because of the underlying representation structure.

6. And it would be very simple to switch from a low level (line of code view) to intermediate/higher level structured view of the whole application.

The possibilities would be endless.

Fortunately modern tools already approach part of this. I am thinking on, eg, Eclipse hints and code correction. I suppose other modern tools have the same kinds of advances...

Ed Smiley

Posts: 4
Nickname: hce
Registered: Jun, 2003

Re: Analyze this! Posted: Jun 10, 2003 2:30 PM
Reply to this message Reply
(((((((((((((((The LISP fans have been claiming this) forever))))))))

:)

Groove Monkey

Posts: 1
Nickname: gmonkey
Registered: Jun, 2003

Re: Analyze this! Posted: Jun 13, 2003 5:02 PM
Reply to this message Reply
Reading this article might lead you to believe that Mr Gosling is actually doing innovative research. Don't be fooled! Here are the original papers from the early 90's, and a fully implemented parse tree refactoring browser from the same time period.

http://www.refactory.com/Pub.htm#Refactoring

Stephen Silber

Posts: 1
Nickname: jsrs
Registered: Jun, 2003

Re: Analyze this! Posted: Jun 13, 2003 10:29 PM
Reply to this message Reply
First of all, this is all just based on Gosling's own work from 1989, in a little thing called Ace. All of you do yourselves a favor and go read the paper.

http://java.sun.com/people/jag/ace/ace.html

Second, to all you LISPers and SmallTalkers: can you <i>please</i> stop whining already? Most programmers like to use languages whose syntax makes sense in the everyday sense. Java, C, C++, are all languages for the masses. Yes, you smart guys are really smart. Wow, how smart you are. Well, take your smart languages (which yes, are very, <i>very</i> neat) and be quiet. The average IT programmer drone is simply not ready for metasyntactic languages, no matter how wonderful they are. Oh, and I don't know why you think Gosling ignores Lisp. He has stated publically, and on many occasions, that he uses and loves emacs. Do you <i>honestly</i> think he doesn't know and love Lisp?! Please remember, this guy is smarter than all of us put together.

Finally, to all you "refactor mercilessly" fundamentalists: please do the industry a favor and do the design work <i>before</i> you start hacking code. I've never seen such bad work as has come from "extreme" teams. We should be engineers, people; instead, most of us are hacks.

Kudos to Gosling for bringing Ace into the 21st century. I've been wondering when it would show up again! :-)

Tiago Antao

Posts: 26
Nickname: tiago
Registered: Feb, 2003

Re: Analyze this! Posted: Jun 14, 2003 2:51 AM
Reply to this message Reply
I will bite the flame...
I am entering rant mode... apologies in advance

> Second, to all you LISPers and SmallTalkers: can you
> <i>please</i> stop whining already? Most programmers like
> to use languages whose syntax makes sense in the everyday
> sense. Java, C, C++, are all languages for the masses.
> Yes, you smart guys are really smart. Wow, how smart you
> are. Well, take your smart languages (which yes, are
> very, <i>very</i> neat) and be quiet. The average IT
> programmer drone is simply not ready for metasyntactic
> languages, no matter how wonderful they are.

I am not a LISPer or Samlltalker, (As an european I am more of a PROLOGer) but I surely consider myself a smart programmer that has problems living with code drones (>50% in the industry?). Why must we have to downgrade our expectations, our productivity? Why do we have to abide to the rules of mediocrity ("what learn a new language? that is impossible, costs months" - this type of reasoning)? I am sick and tired of seeing our industry not going forward because of the need to spend energy with drones. Companies that have more test engineers than developers (developing not rocket science software)? People afraid of learning "new" things (I put new in " because most of the times the concepts behind are not new)? Emphasis on syntatic sugar rather than on new concepts/paradigms?

> Finally, to all you "refactor mercilessly"
> fundamentalists: please do the industry a favor and do the
> design work <i>before</i> you start hacking code. I've
> never seen such bad work as has come from "extreme" teams.
> We should be engineers, people; instead, most of us are
> hacks.

No I don't. I think a little bit about it, I code, refactor, refactor, refactor, and at the end produce design documents as documentation only. And I am very happy with this approach, BTW I think it models the universe very well: evolution, change, adaptation.
I think that, as fashionable buzzword compliance is very important in our industry, XP and agile-blabla is attracting a lot of drones which will produce bad things unless highly supervised.


> Kudos to Gosling for bringing Ace into the 21st century.
> I've been wondering when it would show up again! :-)

I am not interested in discussing individual people, I am not going that path.

And by the way, my main drive is lazyness (or productivity, its the same for me): I want to work the least possible, that is why I give imporance to meta-whatever, agressive and automated testing, commenting code and being able to discuss in a intelligent community like this one.

Sorry for the rant (don't take it personally, I am surely not putting you in the drone group), but I am tired of having to live by the rules of mediocrity.

Patrick May

Posts: 3
Nickname: pjmay
Registered: Jun, 2003

Re: Analyze this! Posted: Jun 14, 2003 3:37 AM
Reply to this message Reply

Second, to all you LISPers and SmallTalkers: can you please stop whining already? Most programmers like to use languages whose syntax makes sense in the everyday sense.


"Algol-like" and "makes sense" are not synonyms. Many of Lisp's greatest strengths stem from its syntax. You should understand this before criticizing it. The fact that the syntax is a representation of the tree makes the kind of features provided by Jackpot nearly trivial.

Rather than working so hard to demonstrate that Greenspun's Tenth Rule ("Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp.") applies equally well to Java, it would be more beneficial to combine the power of Lisp with the ubiquity of the JVM.

In short, the problem has already been solved. Why reinvent a pale imitation of the full solution?

Sriram Srinivasan

Posts: 3
Nickname: purdyhappy
Registered: Jun, 2003

Re: Analyze this! Posted: Jun 16, 2003 10:09 PM
Reply to this message Reply
I found jag's work interesting not because it is a new idea but because he wields considerable influence in the industry.

As pointed out by some people (to the irritation of others :), the lisp folks are so familiar with this idea that it is a design pattern. Those who think this pattern is not useful for "real-world" applications owe themselves a peek at the mathematical software Mathematica. This highly successful package used by more than a million users supports a functional language that, among other features, allows a program fragment's syntax trees to be pattern matched and manipulated. This makes transformation of symbolic mathematical structures very simple .. thus a command like "Simplify[x^2 + 2x + 1]" yields (1+x)^2 as the solution.

Another example of been there, said that: Charles Simonyi (ex-Microsoft, of OS/2 and hungarian notation fame) propounded the same idea some 8 years ago. He called it intentional programming. This project has been discontinued at MS, but I see it flaring up on the net occassionaly.

See the original paper: http://citeseer.nj.nec.com/simonyi95death.html

Tiago Antao

Posts: 26
Nickname: tiago
Registered: Feb, 2003

Re: Analyze this! Posted: Jun 17, 2003 2:21 AM
Reply to this message Reply
> I found jag's work interesting not because it is a new
> idea but because he wields considerable influence in the
> industry.

That is a very good point of view, IMHO.

> As pointed out by some people (to the irritation of others
> :), the lisp folks are so familiar with this idea that it
> is a design pattern. Those who think this pattern is not
> useful for "real-world" applications owe themselves a peek

This example and the intentional progamming one are also very good.

comment: # I suppose the simplify expression (or the derivate calculus) are the standard introductory examples in both the functional and logic programming worlds ;-) #

So: We have (from both the academic and clever industrial world) ways to go ahead, and make our industry, our work, advance. But, as the bulk of the work force in our industry is very poorly educated, the rate of adoption of some of this "things" is very slow. There is much energy being devoted in making things appear easy but very little in making them easier (more declarative).

Sriram Srinivasan

Posts: 3
Nickname: purdyhappy
Registered: Jun, 2003

Re: Analyze this! Posted: Jun 21, 2003 1:36 AM
Reply to this message Reply
> There is much energy being devoted in making things appear easy but very little in making them easier (more
declarative).

Yes. Apropos of that, there's a nice book coming out that
distills the basic concepts of programming very nicely.
"Concepts, Techniques, and Models of Computer Programming"
by Peter Van Roy and Seif Haridi."
MIT press is going to be out with it soon, but a near finished draft is available from http://www.it.kth.se/~seif

Functional programming, logic programming, dataflow and concurrency models are some of the few topics in this 1000 page tome.

Can't wait to get my grubby paws on a paper copy. This one's a keeper.

Tiago Antao

Posts: 26
Nickname: tiago
Registered: Feb, 2003

Re: Analyze this! Posted: Jun 21, 2003 3:39 PM
Reply to this message Reply
> distills the basic concepts of programming very nicely.
> "Concepts, Techniques, and Models of Computer
> Programming"
> by Peter Van Roy and Seif Haridi."
> MIT press is going to be out with it soon, but a near
> finished draft is available from
> http://www.it.kth.se/~seif
>
> Functional programming, logic programming, dataflow and
> concurrency models are some of the few topics in this 1000
> page tome.
>
> Can't wait to get my grubby paws on a paper copy.
> This one's a keeper.

I have read the draft. The book is amazing. One of the best cs books that I have ever read. I would recommend it to everybody: To self-made single language programmers that want to extend their knowledge a bit further. To CS BSc students (you hopefully should be learning what is in this book). To seasoned professionals with theoretical background...
It was really good to remind me of things that I have forgotten and that I should have not. Not to talk at the fresh and very interesting approach of several topics.

Celia Redmore

Posts: 21
Nickname: redmore
Registered: Jun, 2003

Re: Analyze this! - Part II Posted: Sep 20, 2003 10:54 AM
Reply to this message Reply
I have a philosophical difficulty with the approach of both James Gosling and Bill Venners. (I know that this is pure chutzpah: these guys are the experts). Java’s exception handling invites programmers to define everything that isn’t on the meticulously pure path as an exception. That can create extremely brittle code anywhere that the environment isn’t very strictly defined – as it would be, for instance, in an appliance. This characteristic of Java is, I believe, the core problem behind the whole conversation of Part II.

If almost everything that can happen in the real world of humans is an exception, then you really are stuck with either a mess of exception handling routines to cover every possibility, or a generic exception handler that spends most of its time blowing raspberries at the user. This is not a graceful response to a world where files are commonly not exactly where you thought you put them, and people (and their computers) don’t always immediately snap to attention when you call them.

Stephen Sommers

Posts: 1
Nickname: sstephen
Registered: Sep, 2003

Re: Analyze this! Posted: Sep 24, 2003 10:09 PM
Reply to this message Reply
1) This concept is very old.

2) I wonder who will be the target audience who will get benefitted by this

Because application programmers rarely need to make use of this API. why ? ***because there are already many tools which already does this stuff and does a really really good job of it *** .

Eclipse IDE - Refactoring, Code hints and correction and more
Intellij IDEA IDE - Refactoring, Code correction *AND* automatic analysis of code for bad programming idioms *and* correcting the bad code automatically [ which Jackpot claims ] and much much more

PMD (source forge project ) - Automatic analysis of code [ PMD is based on JavaCC/JJTree ]. With little effort you can write your own rules for code analysis

JavaCC/JJTree - Automatic parser generator + AST generator. Not only that you can analyse Java, if you have/write the grammar you can do the same for any programming language.

Visualisation tools - Already many are in the market. Though I have not used any of them extensively I know that there are some really wonderful tools.


3) I think only IDE writers, Visualisation tools generators , Refactoring tools writers will find this Jackpot interesting. That too I doubt because they will be deep compiler folks who will not need this API. They will write high performance proprietery code .

I am sure James Gosling is an expert in this field and maybe he is doing a right/great thing. But based on my knowledge this is nothing but "Old wine in new bottle" or "Reinventing the wheel".

Stephen

Flat View: This topic has 18 replies on 2 pages [ 1  2 | » ]
Topic: Are Two Monitors Better Than One? Previous Topic   Next Topic Topic: The C# Design Process

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use