I found a review of DrJava today. It is in Spanish, and I believe the author liked DrJava:
DrJava, una forma muy fácil de aprender a programar en Java (Google translation to English)
I found a review of DrJava today. It is in Spanish, and I believe the author liked DrJava:
DrJava, una forma muy fácil de aprender a programar en Java (Google translation to English)
Tonight, a very packed ten days ended. It was fun, but I’m looking forward to sleeping in.
March 10: Flight to Milwaukee, SIGCSE 2010 conference
March 12: Conference talk at SIGCSE 2010 conference
March 13: Flight to Indianapolis
March 15: Talk at Purdue University
March 16: Flight to Houston
March 18: Houston Symphony
March 19: Houston Ballet
March 20: Beer Bike, Houston Symphony
Now I don’t have any more concerts or theater performances for four weeks, and no more traveling for six weeks.
This is my second day back from my talks at SIGCSE and Purdue, and I’m already wanting more. We’re finalizing our Mint paper for PLDI, and I’m thinking about a nifty assignment for the SPLASH/OOPSLA Educators’ Symposium.
I couldn’t really find a lot of information about the Educators’ Symposium on the SPLASH/OOPSLA website, except that Educators’ Symposium submissions are supposedly due next week, on March 25.
Fortunately, symposium chair Ed Gehringer told me the Call for Participation will be released within the next two weeks, and that there will be 2.5 to 3 months after that to the submission deadline. Maybe it will coincide with the June 24 deadline for SPLASH posters, demonstrations, submissions to the Doctoral Symposium, Onward! films, and Student Volunteers.
I’m really quite happy about the Mint talk I just gave at Purdue University. As a recurrent theme, I could have used a bit more practice, but it went a lot smoother than I would have expected, after just having presented at SIGCSE.
The best part were really the questions and comments I got. There were questions about reducing code duplication, whether we mostly see a kind of fold
behavior for staged programs (this occurs in accumulators, but we can do much more), and much more.
Luke also had three crucial pieces of advice:
power
function to a specialized power17
function and giving performance figures like 41 ns and 9 ns was weak. This ends up defining MSP and our work, and if we lose the audience’s interest here, we probably won’t get it back. We really need to open with a bang. A short opening statement about what MSP is would have been good too.Thanks for the opportunity, Purdue CS, and thanks for organizing this for me, Jan and Luke.
Purdue University
Computer Science Colloquia
Mint: A Multi-stage Extension of Java
(PowerPoint, PDF, view embedded)
Mr. Mathias Ricken
Rice University
LWSN 3102 A/B
Monday, March 15, 2010
3:30 p.m. – 4:30 p.m.
Complete Description:
Abstract:
Multi-stage programming (MSP) provides a safe way of generating code at run-time. In mostly-functional languages like MetaOCaml, this has been used to reduce the performance penalties of abstractions such as loops, recursion or interpretation. The main advantage of MSP compared to other techniques, such as string or LISP quotations, is that MSP guarantees type safety for the generated code statically, at the time the program is compiled.
Unfortunately, MSP is difficult to combine with imperative features found in most mainstream languages like Java. The central problem is “scope extrusion”, which may accidentally move variables outside the scopes in which they are bound, leading to run-time errors in the generated code. This problem can be prevented if code in escapes (or “anti-quotes”) is “weakly separable”, i.e. the computational effects occurring inside an escape that are visible from the outside do not involve code.
We have formalized a type system, based on Lightweight Java, that uses weak separability to prevent scope extrusion, and we have proved that the type system is sound. We have also developed an implementation called Mint to demonstrate the expressivity of the type system and the performance benefits MSP can provide in an imperative setting. Since our implementation extends the Java language, our work is accessible to mainstream programmers.
This talk is based on work will be presented at the Conference on Programming Language Design and Implementation (PLDI 2010). More information is available at http://mint.concutest.org/
Bio:
Mathias Ricken is a doctoral candidate in the Programming Languages Team at Rice University and one of the principal developers of the DrJava integrated development environment. His research interests include concurrent programming, extending the Java language, and computer science education. He is the developer of the Concutest concurrent unit testing framework and has created various experimental extensions of Java to address, for instance, programming with meta-data. Currently, Mathias is contributing to Mint, a multi-stage
extension of Java that allows safe and expressive statically typed program generation and specialization in an imperative language setting.
Faculty and students wishing to speak privately with Mr. Ricken should contact Jan Vitek at jv@cs.purdue.edu.
Corky and I had our presentation today, and it went well. I wish I had had some more time to practice, but that just wasn’t possible, since we decided to add something to it just yesterday. We got some good responses, though, and had a couple of controversial discussions afterwards.
SIGCSE has been fun so far. I’ve met some cool new people and said hi to some great folks that I’d met at SIGCSE conferences in the past. It’s wonderful to be somewhere where even I know someone (and someone knows me).
Test-First Java Concurrency for the Classroom
(PowerPoint, view embedded)
Where: 41st Technical Symposium on Computer Science Education (SIGCSE 2010)
When: March 2, 2010
Concurrent programming is becoming more important due to the growing dominance of multi-core processors and the prevalence of graphical user interfaces (GUIs). To prepare students for the concurrent future, instructors have begun to address concurrency earlier in their curricula. Unfortunately, test-driven development, which enables students and practitioners to quickly develop reliable single-threaded programs, is not as effective in the domain of concurrent programming. This paper describes how ConcJUnit can simplify the task of writing unit tests for multi-threaded programs, and provides examples that can be used to introduce students to concurrent programming.
I’m visiting my friend Luke at Purdue after SIGCSE, and we arranged for me to give a talk to the CS department.
If you have the chance, come grill me on Monday, March 15, 2010 at 3:30 PM.
Computer Science Colloquia
Mint: A Multi-stage Extension of Java
Mr. Mathias Ricken
Rice University
LWSN 3102 A/B
Monday, March 15, 2010
3:30 p.m. – 4:30 p.m.Complete Description:
Abstract:
Multi-stage programming (MSP) provides a safe way of generating code at run-time. In mostly-functional languages like MetaOCaml, this has been used to reduce the performance penalties of abstractions such as loops, recursion or interpretation. The main advantage of MSP compared to other techniques, such as string or LISP quotations, is that MSP guarantees type safety for the generated code statically, at the time the program is compiled.Unfortunately, MSP is difficult to combine with imperative features found in most mainstream languages like Java. The central problem is “scope extrusion”, which may accidentally move variables outside the scopes in which they are bound, leading to run-time errors in the generated code. This problem can be prevented if code in escapes (or “anti-quotes”) is “weakly separable”, i.e. the computational effects occurring inside an escape that are visible from the outside do not involve code.
We have formalized a type system, based on Lightweight Java, that uses weak separability to prevent scope extrusion, and we have proved that the type system is sound. We have also developed an implementation called Mint to demonstrate the expressivity of the type system and the performance benefits MSP can provide in an imperative setting. Since our implementation extends the Java language, our work is accessible to mainstream programmers.
This talk is based on work will be presented at the Conference on Programming Language Design and Implementation (PLDI 2010). More information is available at http://mint.concutest.org/
Bio:
Mathias Ricken is a doctoral candidate in the Programming Languages Team at Rice University and one of the principal developers of the DrJava integrated development environment. His research interests include concurrent programming, extending the Java language, and computer science education. He is the developer of the Concutest concurrent unit testing framework and has created various experimental extensions of Java to address, for instance, programming with meta-data. Currently, Mathias is contributing to Mint, a multi-stage
extension of Java that allows safe and expressive statically typed program generation and specialization in an imperative language setting.Faculty and students wishing to speak privately with Mr. Ricken should contact Jan Vitek at jv@cs.purdue.edu.
I’m a bit relieved that the sentence “He also has a weakness for Lady Gaga videos.” was left out of the bio.
MacOS 10.4-compatible programs really are a dying breed. First, VLC stopped supporting 10.4 in new versions (last 10.4-compatible version is release 0.9.10), then Eclipse stopped supporting 10.4, and now VirtualBox has dropped support for 10.4 as well (last 10.4-compatible version is 3.0.12). I guess it’s high time for a new MacBook (Pro), but I want to wait for the next update.
You may ask why I don’t just install MacOS 10.5 or 10.6. As I explained before, because Apple doesn’t support Java 6 on 32-bit Macs. I have a first-generation Intel MacBook (Core Duo, not Core 2 Duo), and I need Java 6.
I found a nice review of DrJava today, written by Julian Jaic.
DrJava is a simple and light IDE for Java development. It is a free, open source IDE primarily designed for students. But it also includes powerful features for more advanced users. It has integrated debuggers, support unit testing with Junit and tools to generate javadocs. DrJava is available for multiple platforms, including Windows, Linux, and Macintosh.
DrJava is an ongoing project at Rice University, Texas, developed and maintain by students. DrJava shares the goal of providing a preparatory training environment that decreases the fear factor experienced by beginning students. This project provides an interface that is simple, interactive, and with a focus on the language.
REPL – Read Eval Print Loop
The eminent feature of DrJava is the ‘interactions pane,’ a ‘read-eval-print loop’ (REPL) for evaluating Java expressions and statements interactively. Functional languages such as ‘Scheme’ have long used Read Eval Print Loop. That make easy program development. Users experiment with Java constructs by typing an expression or statement will compile immediately without having a complete java code. REPL makes it possible to completely avoid the difficulties of Java I/O at the introductory level by using parameters and function return values. The interface is text based, and does require using Java syntax. This design was deliberately chosen so that only a single medium is required for dealing with program development, in contrast to the combination of UML and Java source code. Interactions can easily process graphic objects.
User Interface
DrJava keep up a focus on Java and it gives two components, a definitions pane and an interactions pane in a ‘single window environment’. In definitions pane, when a class is compiled, it is directly available in the interactions pane for another uses. The Read Eval Print Loop features of the interactions pane boost understandable functional programming in association with the object-oriented model. The interactions pane keeps a history for comfortably recollecting the already inserted commands. This decreases the typing needed when going for experiential evaluations.
A Lift Current Interaction to Definitions command copies an interaction into the editor. This gives a comfortable way to move experiential tests into a JUnit test to make them repeatable. Since each class method can be executed independently, the interactions pane is an impressive tool for small testing and troubleshooting. It also contains a debugger that helps adding breakpoints and explaining watches. In debug mode when execution is break up at a breakpoint, the interactions pane can be used to check or modify state variables using Java statements and expressions. Again the design approach was to maintain an easy and steady interface throughout. It’s compiler shows all syntax errors by parsing the file. Clicking an error message highlights the error in the source code.
Dr.Java’s editor supplies automatic braces /parenthesis matching, comment /quotation highlighting and indentation that is refreshed in every keypress. A complete Java class can properly formated by an ‘Indent lines’ command. The editor supports several documents but does not arrange files into projects. To organize files, it is necessary to use the operating system’s file management facilities. Another features of DrJava contain built-in support for JUnit test cases creation of javadoc and it’s preview.
DrJava’s developers suggest that the IDE is useful beyond the beginner level, and cite advanced courses at Rice University that feature projects for extending the tool. One such project produced a DrJava plugin available for the Eclipse IDE that should ease the transition to the more powerful features of a professional IDE.
IDE’s are very important tools for easing the entry of students into software development courses. Dr.Java serve easy interfaces especially designed for teaching. It encourage cumulative development and associative experimentation, which will possibly the most important feature of this IDE. DrJava provide excellent options for simple entry level software development in Java. DrJava has a cleaner and easier interface that manages a focus on the Java language.
Julian is a professional content writer on software development and now working at Telious Technologies.
Article Source: http://EzineArticles.com/?expert=Julian_Jaic
Thanks, Julian! Actually, DrJava does have a project facility.
I received a message from Danny Dig, the project lead of the ReLooper project. ReLooper is a refactoring tool that enables Java programmers to parallelize loops over arrays or vectors using Java’s upcoming ParallelArray
framework. I assume Danny searched for all Java projects on SourceForge and contacted all “expert programmers” of those projects.
I know Corky received the message, too, and we both came to the conclusion that there
aren’t many parts suitable for this kind of optimization. It would be nice if indenting and “Find All” were the operations could be sped up.
With indenting, there is the problem that indenting one line depends on how the previous lines were indented. I’m not sure how this would be split up and parallelized. “Find all” is in theory easier to parallelize, but right now, it is tied very much into our single-document model. Changing this would be a good thing — it would allow us to cancel a “Find all” operation, too, — but it is a delicate task.
From what I understand, ReLooper transforms ASTs in Eclipse. It also seems like it needs an array to work on (at least automatically). I don’t know if it is able to cut through classes like ArrayList
to the underlying array. The string representation in DefinitionsDocuments
may be suitable, but then again the list structure in the reduced model is connected to it.
ReLooper evokes a similar response in me as Dave Patterson’s talk did: This may work in many programs that really crunch data, but I expect will break down when those algorithms need to be tied together and connected to a GUI.
I just gave my talk Testing Concurrent Programs, A 7-Minute Jargon-Free Introduction to the students of the Thesis Writing Seminar of the School of Engineering here at Rice. It went very well, but I’ve got to say that this was probably the most difficult talk I’ve had to prepare.
It is a 7-minute talk to an audience of smart engineering graduate students who generally are in all kinds of different fields. You can’t really use jargon or assume too much background knowledge and be too technical, otherwise you might lose your audience. You also can’t spend too much time explaining concepts. And at eight minutes, you get cut off.
I’ve really had to cut the number of slides down, gloss over a few things, and unfortunately also ignore some achievements that I think are really cool, like the reachability check of the join graph, which prevents “lucky” threads. Because of the extremely short time, practicing the talk pays off a lot, because your explanations just have to work. You don’t have time to start over.
The talk went very well and received unanimously positive feedback. What people liked the most was that it was virtually jargon-free, that the animations were simple and helpful, and that I was able to simplify the concepts and make them accessible to non-computer scientists without talking down to them.
Again, I finished working on the presentation only an hour before the talk, and my delivery definitely could have benefited from more time to practice. I also still haven’t figured out how to take a sip of water while giving a talk, but seven minutes fortunately were not long enough to develop a serious case of dry mouth.
Interestingly, Rui Zhang’s talk about software transactional memory was next, and my talk served as a good introduction.
Testing Concurrent Programs, A 7-Minute Jargon-Free Introduction
(PowerPoint, view embedded)
Where: Rice University School of Engineering, Thesis Writing Seminar
When: February 25, 2010
A 7-minute jargon-free introduction to the problems of testing concurrent programs, and a proposal for a solution, with non-computer science engineering graduate students as intended audience.
Java’s latest version, JDK 1.6.0 Update 18, seems to have fixed the most frequent DrJava bug report, which Corky determined to be Sun’s problem (Oracle’s problem now). We have been filing all of the bug reports as duplicates of bug 2831821″Caret updating is broken”.
So far, there hasn’t been a single bug report describing the same symptoms that used 1.6.0_18. Here are links to SourceForge tracker searches:
That covers all 35 duplicate bug reports we have received.
It’s difficult to definitively check that a bug that only happened sporadically has indeed been fixed, and fixed by someone else without any involvement by us, but I think I’ll close the bug report.
I just created a new release of Mint and DrJava with Mint: February 17, 2010 (r15116). The release is available from the Mint implementation page:
There were some small changes in the approximation of weak separability to make the implementation match improvements in the paper more closely. It also disallows stitching in a Code>
as a statement, because we can’t statically know if we have to discard the result in a statement context or not.
(Re-posted from The Java Mint Blog.)
Question: In which thread does <clinit>
run?
Answer:
is being executed in whatever thread uses the class first.
package testers;
import java.awt.EventQueue;
public class CLInit {
public static void main(String[] args) throws Exception {
new CLInit2().doSomething();
EventQueue.invokeAndWait(new Runnable() {
public void run() {
new CLInit2().doSomething();
new CLInit3().doSomething();
}
});
new CLInit3().doSomething();
}
}
class CLInit2 {
static {
System.out.println("CLInit2.
}
public void doSomething() {
System.out.println("CLInit2.doSomething");
}
}
class CLInit3 {
static {
System.out.println("CLInit3.
}
public void doSomething() {
System.out.println("CLInit3.doSomething");
}
}
produces the output
$ java testers.CLInit CLInit2.<CLInit>: Thread[main,5,main] CLInit2.doSomething CLInit2.doSomething CLInit3.<CLInit>: Thread[AWT-EventQueue-0,6,main] CLInit3.doSomething CLInit3.doSomething
As you can see, the class initializer for CLInit2
is run in the main thread, but the one for CLInit3
is executed in the event thread.
The implication of this is that class initializers may run in the event thread (or auxiliary threads) and therefore have to be considered when I compute the methods that are reachable in auxiliary threads or the event thread.
I had no idea that the following code was allowed:
public class AICSurprise {
public static void main(String[] args) {
new Object() {
public void foo() { System.out.println("foo"); }
}.foo();
}
}
I thought foo()
could not be accessed from outside the class, because the class was an anonymous extension of Object
. That’s demonstrated here:
public class AICSurprise {
public static void main(String[] args) {
Object o = new Object() {
public void foo() { System.out.println("foo"); }
};
o.foo(); // error
}
}
Note that Object
is the most precise type we can give for o
. Somehow there are special rules for accessing an anonymous inner class directly when it is being created.
Did you know this? After working with Java for nearly ten years, I still didn’t.
A few days ago, I changed the Mint compiler to allow non-void code objects to be spliced in where statement form is required:
Code
Code
This essentially generates the code below, which allows the 1
to be discarded:
<| { { Object temp = 1; } } |>;
Eddy pointed out that there is still a problem: Since I do a static type check on the type argument of Code<T>
, the proper form cannot be determined if there is a wildcard Code<?>
. We can check at run-time whether a code object is in statement form or whether it is an expression whose result needs to be discarded, but we cannot simply write an if-statement, because one of the alternatives would always be syntactically incorrect:
<| { if (c.isStat) {
`c; // already in statement form
} else {
Object temp = `c; // expression, discard result
} } |>;
If c.isStat
is true, then the else-branch is syntactically incorrect; if c.isStat
is false, then there is a syntax error in the then-branch. Eddy pointed out that we can handle the Code<?>
case, though, because the two branches are in future-stage code. That is, we can turn
<| { `(c); } |>
into
if (c.isStat) {
<| { `(c); } |>
} else {
<| Object temp = `c; |>
}
Unfortunately, this gets more complicated if there is more than one Code<?>
being escaped in. We would have cases, where
is the number of
Code<?>
objects being stitched in:
<| { `(c); `(d); } |>
would have to be turned into
if (c.isStat && d.isStat) {
<| { `(c); `(d); } |>
} else if (c.isStat && !d.isStat) {
<| { `(c); { Object temp = `d; } } |>
} else if (!c.isStat && d.isStat) {
<| { { Object temp = `c; } `(d); } |>
} else {
<| { Object temp = `c; } { Object temp = `d; } |>
}
I think for now I will change the compiler so that escaping a Code<?>
in as a statement generates a compiler error. It seems like this is an unimportant corner case, and I don’t want to spend my time on something that is rarely beneficial. Again, this only happens for Code<?>
, and only when escaping into bracket with a code block where statement form is required by Java rules.
Corky just informed me that there is a talk by Daniel L. Schuster at SIGCSE 2010 about Java, games, and the Free Java Book. I’ll definitely check out the talk and the book. I’ll also examine how concurrency is handled in the ACM Java Library.
Daniel is kind enough to state the following in his book:
Dr. Java is the preferred development environment for the Free Java Book. It is an easy to use but powerful editor and development environment. It is available via download and is free. Free as in $0.00! It is available for Windows and Mac.
Thanks! I added a link to the Free Java Book to the list of DrJava user sites.