Red Hat Uncloaks 'Java Killer': the Ceylon Project
talawahdotnet writes "Gavin King of Red Hat/Hibernate/Seam fame recently unveiled the top secret project that he has been working on over the past two years, a new language and SDK designed to replace Java in the enterprise. The project came out of hiding without much fanfare or publicity at QCon Beijing in a keynote titled 'The Ceylon Project — the next generation of Java language?'"
Am I the only one who read, "Cylon"?
Do they have a plan?
There is no "I disagree" mod for a reason. Flamebait, Troll, and Overrated are not substitutes.
Already taken by the javascript "extJS" framework.
It will be interesting to see if it is very similar to C#/Mono or something fairly different.
Sounds attractive but very ambitious.
aren't enough (damn subject would have dropped the 'h' and that would have made me cry).
We need yet another JVM language to 'kill' Java. Epic. Brilliant.
The other languages were developed much more openly, not dropped like an MS product. Get real, Red Hat.
this is a non-java-based java killer :)
We already have a Java killer; his name is Larry Ellison.
There's no -1 for "I don't get it."
A "Java killer" that relies on the JVM to run sounds like it's in for an uphill battle.
Writing an SDK from scratch in a homebrewed language that does everything the Java SDK does? Well, good luck anyway.
Breakfast served all day!
Do they have a plan?
1. Create awesome programming language that kills Java
2. ???
3. Profit
sysadmins and parents of newborns get the same amount of sleep.
They are proposing a new language, with new syntax, requiring new libraries... that runs on the JVM.
Since Oracle owns the JVM and is trying to find ways to extract money from it, a new language that requires the JVM seems pointless.
If you just want better syntax, why not use one of the existing JVM languages such as Scala?
If you are pioneering a completely new language, why not pioneer a new virtual machine, and lawyer up and make sure Oracle doesn't have any grounds to sue you?
steveha
lf(1): it's like ls(1) but sorts filenames by extension, tersely
":=" as the assignment operator is a case of back to the future. Pascal uses it, and for anyone who's mistakenly typed "=" rather than "==" in C/C++ it can only be a good thing.
Why don't we just move Linux kernel development to the ADA language, before it's too late?
1. Put these guys, Walter Bright, and a few other folks (Alexandrescu? a couple of the best folks from the Java and C# camps?) in a building.
2. Lock the doors from the outside and guard the building until they've come up with the One True C++ Successor (both compilable to native code and a good target for a JIT) and the basic design for its standard library.
3. Profit^H^H^H^H^H^H End the ridiculous situation we have where systems-level programming is held back by 40-year-old braindead technologies like the C preprocessor while the dominant business programming languages are controlled by corporations with terrible track records.
Let's see, C, C++, C#, Java, Python, Perl, Ruby, F#, VB, Fortran and even Ada still lurking about.
We need another "language" like we need a hole in our collective heads. Like others have pointed out another language to sit on top of a JVM, meaning it will generate byte code but is it really better? I guess only time will tell.
Harrison's Postulate - "For every action there is an equal and opposite criticism"
My number 1 missing feature in Java is the ability to set object references to be 'copy on write'.
I'm doing numerical/scientific programming. Say I have an object which contains an array, and a 'get' function to return that array. Currently I have two choices: I can return a pointer to my object's array, or make a copy of the array and return that.
Returning a pointer is very fast, but now my class is at the mercy of callers which might write into my array. Returning a copy is safe, but so long as the callers behave themselves and don't try to write to it, is a waste of time and memory. If I could return a "copy-on-write-reference" to my array, I'd get the best of both worlds.
Any reference reached via a copy-on-write-reference would also need to be copy-on-write. If you make copy-on-write a qualifier on a variable, this could be all enforced by the compiler.
Are there any languages which do something like this?
Quattuor res in hoc mundo sanctae sunt: libri, liberi, libertas et liberalitas.
:= was originally an ALGOL 58 feature, but I digress. The real problem is not with operator ==, but with C allowing assignment in the conditional part of if statements.
The thing with the confusion about equality vs. assignment operator is a valid concern, but the := operator doesn't really appeal to me (initially).
Because the bugs associated with mistakenly using = vs. ==, I always put the constant value being compared on the left. That, of course, can't be assigned to, and the compiler will catch your error if you use =.
if (SOME_FLAG = this.x) //compiler flags this
if (SOME_FLAG == this.x)
Same goes for other languages with this syntax (PHP, Javascript, C/C++).
I'm not a lawyer, but I play one on the Internet. Blog
It is built to run on the JVM, uses static typing, and supports high while maintaining a strong focus on being easy learn and easy to read.
Supports high what? Does it just support being high?
Don't thank God, thank a doctor!
As long as it runs on the JVM, it's still stuck without support for unsigned data types. Not interested.
I do not fail; I succeed at finding out what does not work.
modern languages like C#?
You, sir, have a perverse definition of 'modern'.
There are at least two ways to interpret your comment:
1) C# has been around about 10 years and is too old to be considered 'modern'
2) C# is not characteristic of the state-of-the-art.
Required reading for internet skeptics
Don't forget all the other important languages!
* brainfuck
* whitespace
* piet
* INTERCAL
* false
* befunge
* malbolge
and, of course (last but not least!)
* LOLCODE
It's easier to be a result of the past, but more fun to be a cause of the future! http://www.spacefinancegroup.com/
Made me laugh! Thanks!
-kgj
Ah, at least one voice of reason
Ahh, SNOBOL. I'm getting misty-eyed ... those were the days, my friend ....
-kgj
So I guess Redhat is going to be popular with some folks in the right-wing of US political spectrum?
Make sure everyone's vote counts: Verified Voting
C# already exists for the JVM: http://code.google.com/p/stab-language/
Mod me down, my New Earth Global Warmingist friends!
Fuck that. I want an OS written in PHP3. Why have the odd security hole, make an OS that's nothing but security holes!
That's like trying to build the hull of a sea freighter out of cheesecloth.
I can name at least dozen "scripting" languages that run atop the Java Runtime Environment. About half of them have been around for nearly a decade. The most popular non-Java scripting languages (e.g. Ruby, Python) started creeping into the enterprise by way of their JRE implementations (e.g. JRuby, Jython). Nevertheless, apparently the ultimate "Java Killer" is going to be... yet ANOTHER language running atop the Java Runtime Environment! Developed by the company behind the JBoss, one of the top-5 Java application servers. And Seam, one of the top-5 Java application frameworks. Apparently, Java "dies" in the same manner as Dr. Who...
I get it. I understand why these posts are so popular, and why Slashdot runs at least one per week. Compared to Ruby on Rails or whatever... Java is relatively verbose, and it's more cumbersome for newbies to write their first Hello World app. Of course when you're working on real-world enterprise projects, with large developer teams and significant codebases, then much of that cumbersome stuff makes life a lot easier. But many people online are closer to that Hello World end of the spectrum, so a language's "Hello World experience" drives message board mindshare. Plus, there is the evil-Oracle thing on top of that. So Java sucks. Java's dying. I get it.
Except that it's not. At least not anytime soon, and not until you can show me a credible replacement that doesn't have "Runs On The JRE!" as its main selling point. I'm sure that something will come along eventually, but hell... in the realm of core business logic, Java only just surpassed "legacy" languages such as COBOL and C++ within the past few years! Moreover, the best contenders for "Next Big Thing" are JRE-based languages such as Scala, for which fundamental Java knowledge makes you more productive. Hell, even *off* the JRE, I would argue that being a top-class Ruby or Python developer requires as much computer science knowledge as with Java. Once you get beyond the Hello World stage, the idea that "scripting" languages are easier to learn is a fairy tale.
All that being said... I'm poo-poo'ing the hyperbole in the title, and not the content itself. It's nice to see another strongly-typed language on the JRE besides Scala. From what I see in the slideshow, this Ceylon thing looks like a "me too!" version of Scala, which has an 8-year head start. However, the Seam framework from RedHat has always been a rather "me too!" competitor to Spring also. Even though I've worked more in the Spring camp, I've still benefited from Seam because it pushes Spring to stay ahead. Maybe Scala can benefit from this competition also.
Scala is a good language, but it is too featureful to be a good "enterprisey" language. It's awesome if you grok all the powerful stuff like closures and currying and path-dependent types; but, consequently, when you start writing code using all that, Joe Schmuck, who had only coded Java before, is going to cry when he sees it because it's about as readable to him as a snippet of Emacs Lisp. And there are many more Joes out there than there are people who know how to use Scala and the likes.
It's the only logical outcome of assignment being a value-returning operator. Of course, in C it is further compounded by the fact that all primitive types are permissible in boolean context.
Compared to Java, C# is a shining definition of a modern language. Hey, at least it's got closures!
If you have programmed in C++ (and I mean C++, and not "C where you can write // comments and 'class' instead of 'struct'"!), then Java seems anything but slick. In fact, it seems more lobotomized than anything.
Considering how all programming languages that use := are hated with a passion, I would say that a swastika would make a better assignment operator by now.
Contrary to the popular belief, there indeed is no God.
Sorry but that is absolute garbage, lots of languages are currently way ahead of Java, especially C#. Java's advantage at this point is purely in the JVM where their cross platform strategy quite often make it the more sane choice regardless of the shortcomings of the language.
Scala.
Why is that language designers feel they must come up with gratuitous differences to differentiate their babies?
I'm talking about where keywords are used in the same (or much the same) way, but they've come up with something different after spending some time with a thesaurus:
E.g., instead of Java "implements" for interfaces, you get "satisfies".
abstract is replaced by "formal"
"actual" means "override"?
"public" -> "shared" : what's the value-add?
"var" -> "local" : var types much easier.
I'm not a lawyer, but I play one on the Internet. Blog
Great, I expect a email from a recruiter tomorrow wanting someone with 10 years of production Ceylon experience.
Got Code?
No, Java's syntax is a problem. Not as big as the other problem you mention, but it's still a problem.
Closures has been available in good languages since essentially the egining of time. That it is now a "modern" feature only reflecs the fact that languages mostly suck...
We need another "language" like we need a hole in our collective heads.
In a way, yeah. In that regard, the good news is that most people will never use most of these languages.
However, what I see happening is a desperate effort to improve the state of the world. The good thing about Java is that it broke open the field of programming languages. If we can get industry to switch to Java, we should be able to switch it to better languages, too. So now groups from around the world are trying to make that happen.
Please correct me if I got my facts wrong.
I use Python for everything. But I'd take C++ over Java any day. Don't even list it on my resume.
93rd rule of Slashdot: No matter how obvious my sarcasm is, my comment will be taken seriously by someone.
There are many language features that have been available for ages, especially in various Lisps. The problem is always getting those features into mainstream. Arguably, closures only got there with JavaScript, and even then it took a while for people to actually notice they're there. The first mainstream language which not only had them, but actively advertised it, with standard library build largely around the concept, was Ruby.
(One could argue that in both cases it was rather Smalltalk, but I think that it is a matter of debate whether it was sufficiently mainstream. There's certainly no doubt with JavaScript.)
Java needs to be replaced. I have taught Java for years, because many colleges think it is a good first language to learn. Only recently have I actually attempted to develop commercial quality applications in it. Frankly, Java sucks big green ones. Generic types (with type-erasure) are a total hack, denying the running code valuable information. Abstract classes are only half-implemented, since you cannot have abstract static methods (e.g., factory methods). Meta-programming in Java is extremely limited - Reflection covers a few aspects, but even these are very awkward to use. Exception handling is awkward, there is no multiple inheritance, not all types are objects - hacked with boxing and unboxing. And so on, and so forth, and so on...
The chances of this language going anywhere are small. Anyone who has enjoyed studying compilers has written (or at least imagined) their own language. Creating new languages is fun, lots of people do it, and mostly - even if they are good - the languages disappear down a deep, dark hole. Success for a language requires a lot of support from many different parts of the IT community: lots of libraries, job prospects, more libraries, books, courses, real world applications, and did I mention code libraries? There are zillions of languages out there, many of them better than Java. Unfortunately, none of them to date have gotten the necessary support. What are the chances that this language will be different?
Enjoy life! This is not a dress rehearsal.
Oh look, another language that's practically identical to 99% of other languages in syntax, features, etc.
What an innovation! Time and money well spent by the folks that developed it.
(See: masturbation. "Look, we can recreate C++/Vala/Java/C#/etc. too! Just like everyone else has!" And this is why programming sucks. Only fringe academic groups are trying to take programming languages anywhere interesting.)
What about Aspect Oriented Programming? It seems like an attempt to resurrect multiple inheritance.
Ummmm... WHY?
If I want a 'better' Java, I'll use Scala. Problem solved.
OK, so I'm intrigued but, nowhere in this series of tubes we call the Internets can I find a reference to a project web site or anything about where to find early adopter tools.
As Dr. Evil said... "Throw me a frickin' bone here!"
My office has been taken over by iPod people.
CFLAGS += -Wall -Werror
problem solved
factor 966971: 966971
In recent history, we have seen the automobile and Windows "take over." There are many other "better things" out there but nothing seems to be compelling enough to make changes. "Better" by itself is not good enough.
Java, is what it is and there are also lots of better things. But Java is pretty well entrenched in the areas it is strong. So what can displace it?
Better by itself is not enough. It has to be better, of course, but it also has to fill a need that the contender is unable to meet. And this need has to be really important to the users or to manufacturers/suppliers before change can take place. And of course, if there is a "work around" or some sort of adaptive middleware, that could also prolong the life of the contender long enough that "something better" will never take off.
Changing and retooling is annoying to the point that people don't even want to consider it if they don't have to.
This is [partly] why we still have gasoline burning cars instead of more efficient systems. This is why Windows is still ruling the desktop instead of using more client-server technologies which could make Windows irrelevant. And this is why the words "Java Killer" don't strike me as likely to be a claim that can come true.
But back to Windows... we have all been watching the markets change in directions that Windows cannot go; netbooks, tablets and phones. Without anyone having to state the obvious, this is exactly the sort of thing that can bring an end to Microsoft Windows dominance. Making something "better" isn't enough. But when needs change while the usual tools are unable to adapt, then you have a problem waiting for another solution to come into play.
OMG the java killer finally!! Wait...
You sound like it's 1996? There have been many before Java..
Pascal was the rage in the 80s... Who uses that now? Okay, then there was Delphi (Pascal based) but that was probably the largest commercial distribution of it. Does anybody really use Pascal anymore?
Ada is still in use, Federal Government mostly and that is a huge time waster.
PL1? Anybody remember that? RPG is still around in whatever variant it's at. COBOL is definitely still around.
LISP. Oh and let's not forget the most cryptic piece of crap to ever traverse a keyboard... APL.. I took one course in that back in the early 80s and hated every minute of it. The hell it brought just in learning the damn keyboard symbols. I still would like to string whoever came up with that pile of crap by their short hairs from the nearest tree!
There was PL6 which ran on Honeywell DPS Mainframes (which begat the Xerox Sigma Series CP5)
It goes on and on. The IT Highway is littered with the corpses of dead languages. It always seems that somebody has a bright idea about how they can improve upon the programming paradigm, commercial success is another thing. It's great to have "research" languages to be sure, something that pushes the boundaries certainly can be afforded but not some "Hey we have a XYZ killer here." It's such a conceded thought and it definitely shows that whoever is making that statement doesn't have a clue.
Harrison's Postulate - "For every action there is an equal and opposite criticism"
I hear that argument often enough. What I never heard of is someone who consider himself one of these "Schmucks" -- the Schmucks are always "others".
In fact, it's my belief they don't exist. Not that there aren't bad programmers who write bad programs in any language they come in contact with -- just that there really isn't this mythical threshold beyond which some programmers can't write any program at all -- instead of just producing the bad programs they have always written.
And to write any enterprise Java program nowadays means a knowledge of application servers, annotations and annotation processors, JNDI, and, more likely than not, half a dozen frameworks such as hibernate, a web framework, testing framework and mocking library. Compared to learning all that, closures is a non-issue, currying and currying a curiosity. Path dependent types might be equivalent magic to stuff such as GUICE dependency injection -- something to be repeated by rote learning instead of truly understood (and one is way less likely to stumble on a path dependent type than on a smart annotation).
Much on the contrary of what is claimed here, Scala gains ease acceptance on Java shops that try it out. Take a look at INFOQ's recent interview about The Guardian's introduction of Scala for an example of that.
I have only ever heard of two persons who tried out Scala and didn't like it, one of whom was as much turned off by a bad experience with IDE support than anything else.
(8-DCS)
Unless you mean decaffeinated coffee, no. A typical cup of coffee should have around 100mg of caffeine in it. Black tea has (as I recall) around 50-60mg normally, and green tea a mere 15mg or so.
This isn't to say that you can't MAKE a cup of black tea with more caffeine than typical coffee. I've never personally developed a taste for coffee, so when I have a craving for hot caffeinated beverage I tend to make triple-strength black tea. Mmmmmm, polyphenols.
Hacker Public Radio is our Friend
Yeah, you're right. Almost all ethnic jokes are generic, and with only a rinse, they can be re-used for many other nationalities, religions, colors, or whatever. I miss the days when I was young, in a city roughly divided into four parts - the whites, the blacks, the Italians, and the Slovaks. We insulted each other, but we worked hard to be original. You KNEW that you were cool if you came up with something of your own, and the following week all four groups were using it to bash each other.
Oh yeah - my tribe is definitely superior. There are only two kinds of people in the world, after all. Us Polskis, and all the rest of you who wish you could be Polish!
"Windows is like the faint smell of piss in a subway: it's there, and there's nothing you can do about it." - Charlie Br
Next thing you're going to say is that they let you declare variables just about anywhere. Kids these days, such fantasies!
Now get off my lawn.
Assignment could be a left arrow (←, U+2190), as in Smalltalk. Now that we have UTF-8 text files and Unicode fonts we wouldn't even need to play around with character substitutions. Of course, we'd need to fix Slashdot's handling of simple printable Unicode characters at some point...
"The state is that great fiction by which everyone tries to live at the expense of everyone else." - Bastiat
They're attempting to replicate C# 5's feature set, and using a reasonable timeline it won't be ready until C# 6 is released. FOSS is going to fall victim to NIH syndrome, or more specifically, NIBM (Not invented by Microsoft) syndrome.
Similes are like metaphors
I hear that argument often enough. What I never heard of is someone who consider himself one of these "Schmucks" -- the Schmucks are always "others".
The reason why you don't hear anyone calling themselves that is because most people who are like that are blissfully unaware that there's anything beyond what they already know.
Nonetheless, it's a real issue. The awareness of it has appeared much earlier in .NET land, because there language evolution has been much less restrained. When .NET 3.5 came out, with LINQ (and its lazy evaluation) and lambdas and whatnot, suddenly you had a lot of people complaining that they couldn't make any sense out of it. Anyone who hanged out at, say, StackOverflow (or any other large community hub) can attest to that. Quite a few coding shops have established guidelines which practically banned the new features outright, to retain the Javaesque "every line of code means exactly what it looks like" feeling. This worked for some time, until new stock libraries caught up with the language.
And to write any enterprise Java program nowadays means a knowledge of application servers, annotations and annotation processors, JNDI, and, more likely than not, half a dozen frameworks such as hibernate, a web framework, testing framework and mocking library.
Yes, someone has to really understand all of the above. They're usually also people who don't have a problem with Scala (or at least don't have a problem understanding it; liking is another issue). But then, how many "enterprise" applications have you seen where e.g. dependency injection is used as a kind of magic incantation, with person writing it just copy/pasting code straight from the Net, without actually understanding what it does, and very puzzled when they need to make some changes to do something they want?
Unfortunately, a lot of that kind of programming has evolved into cargo cult. I don't want to sound racist here, but this is especially prominent within Indian development community (not that others don't do it, it's just that there it's much more visible), and consequently in outsourced projects. Either way, for that kind development, using Scala does not make any difference whatsoever, because to people writing the code it simply means using somewhat different magical incantations. They don't really gain anything from doing so, but the pain of maintaining that code afterwards is that much higher, because there are so many more non-obvious ways to do things, and you'll be almost certain that most of them will be in some or other code taken off the Net.
What do you guys think of this? In Scala, things like throws are annotations (at least so I read here). In Ceylon, things like shared are annotations. In Java, though, they're "reserved words".
The Scala and Ceylon approach seems, at first glance, a consistent one, in the sense that those things are information about the code, which qualify to be called "meta-programming". What I mean is: if you strip all classes of those "private", "final" and "throws", they'd still do the same thing. Thus, it seems to fit the "meta-information" concept.
Just for fun, the last few weeks I've been toying with the syntax of a programming laguage in which all these things are meta-information. The programmer can, in fact, create his/her own annotations which and be directly used in the code, without a marker operator (such as Java's @) to make the task of the parser simpler. It would, in turn, make the language appear extensible.
In order to do this, the reserved word private, for instance, is removed from the list of the language's reserved words, and implemented as an annotation. That annotation is part of a library distributed with the compiler, pretty much like distributing the java.lang package along with the javac compiler, and making all of its classes usable without import statements. I borrowed the idea from the Scala "syntactic sugar" for operators. Scala folks cleverly say that this: 1+1 is syntactic sugar for this: 1.+(1).
My idea is to allow the programmer to use a simple syntax when applying an annotation on an artifac (a class, an interface) that looks, when reading the code, like it is part of the language. private final class MyClass would become an abbreviated form of this: @private(value=true) @final(value=true) class MyClass. In the Celyon slides, doc is an annotation, by is an annotation, and so on. So I think they beat me to it.
I'm far from pretending to be an expert in programming language or compiler design, nor have experience with a huge span of languages. But I believe the compiler should work for the programmer, and make his life easier, and not the other way around.
Perhaps I'm trolling, perhaps I'm not.
My number 1 missing feature in Java is the ability to set object references to be 'copy on write'.
I'm doing numerical/scientific programming. Say I have an object which contains an array, and a 'get' function to return that array. Currently I have two choices: I can return a pointer to my object's array, or make a copy of the array and return that.
Returning a pointer is very fast, but now my class is at the mercy of callers which might write into my array. Returning a copy is safe, but so long as the callers behave themselves and don't try to write to it, is a waste of time and memory. If I could return a "copy-on-write-reference" to my array, I'd get the best of both worlds.
Any reference reached via a copy-on-write-reference would also need to be copy-on-write. If you make copy-on-write a qualifier on a variable, this could be all enforced by the compiler.
Are there any languages which do something like this?
You don't need the compiler to know about copy-on-write. To write a generic copy-on-write pointer class it is enough to have a compiler that knows about const-ness, as well as operator overloading that also allows overloading pointer operations (dereference..). Both features are available in C++, and in fact some implementations of STL string have used copy-on-write. Like reference-counting, performance becomes horrible with multiple threads because of the extra locks that are then needed.
No method overloading? I can understand no operator overloading, but no method overloading? They got to be kidding. Some things like nullable types are worth pursuing, but in the face of serious contenders like Scala which are already being used in the enterprise, the whole enterprise has a Diaspora'ish feel to it.
Java copied C++ and added GC.
C# copied Java and added nicer syntax (and a nice Windows GUI builder)
Now Ceylon is copying C# and added Linux friendliness....could work.
I *appreciate* what J2EE brings to the table.
That doesn't mean I _like_ it.
I generally agree with your list (with AJAX and WSDL being a notable exception; those are flaws, not a features, but the evils of AJAX and WSDL are another discussion entirely), but feel that it misses an important point: J2EE is just nasty.
It's like C++ -- the *list* of features does not mitigate the sheer soul-draining /wrongness/. And like C++, it's a reasonable "early effort", and we're now at the point of needing someone to look at J2EE with a critical and analytical eye, and to devise for J2EE what Java was to C++: something, while perhaps not perfect, is a few orders of magnitude *better*.
Your list is an important place to start, if not in actual features, then in issues addressed by those features that any successor *must* address just to get a seat at the table.
Pick One: http://www-rohan.sdsu.edu/~stremler/sigs/sigs.html (Note - disable Javascript first!)
why don't they use jruby
http://www.jruby.org/
or jython ?
http://www.jython.org/
inventing yet another languge when there so many to choose from doesn't seems to be too smart
i can give only one failure go language that is now falling from top 10 if you watch tiobe
http://www.tiobe.com/content/paperinfo/tpci/index.html
also another failure is Groovy used with grails:
"Other interesting moves in the TIOBE index this month can be found outside the top 20. This is due to the fact that the index uses 7 different search engines as of this month. Some promising languages lost many positions. Most striking examples of this are NXT-G (down from 19 to 54) and Groovy (from 25 to 65)."
developer http://flamerobin.org
Not for objects in java, and that's what we're talking about. You cannot pass an object in java - only a reference to it. The object is allocated on the heap, and that's where it stays.
If the language didn't actually allocate an object pointer variable distinct from the object itself, I'd concede your point. In that case, the memory location aliased by a variable would be the actual object, and that would arguably be a pass-by-reference language. It would also be a noticeably different language.
I think you need to clarify what you wrote - it doesn't parse cleanly. :-)
Java works the same as c and c++. When you allocate a new object, it is allocated on the heap, and you only get a pointer (reference) to it, not an alias. You can never pass an object in java, (unlike primitives), just the pointer to it, so not everything is passed by value. Objects cannot be passed by value.
Let me fix your example:
You're free to set them to null inside of foo, if that floats your boat.
I hope this clarifies things. :-)