Hi Lex -
Your criticism is well received and understood but unless you have an alternative it is also utterly pointless. We can discuss the various flaws in the Java module system to death but it doesn't change the fact that it is there and it actually works. If you do know of any alternatives that allow for scalable and reasonably secure deployment of code in effectively unknown environments, I'll happily look at them. If they are better than Java, great. It's just ... that so far there are so damn few (if any) alternatives.
In short: What impresses me about the Java solution is not that it's flawless - what impresses me is that it works, that people actually use it to deploy code and this code actually works in the way intended.
Cheers, - Andreas
Lex Spoon wrote:
Andreas Raab andreas.raab@gmx.de writes:
J J wrote:
Namespaces ok, but the way they have been done is not always that great. Modules are pretty much the same thing, and interfaces? No. Traits are much better then interfaces imo.
Modules is one area where IMO Java shines. Not necessarily because of the language part but because of the whole ClassLoader/JAR/Applet pipeline (just run Dan's SqueakOnJava in the browser and then think about what must be true to be able to handle that in a reasonably secure fashion).
Security I'll give you. That would be great if Squeak could do that. Python, incidentally, can do such things with its module system. We could have that too, but having it plus also keeping our existing code running is a really hard pair of features.
Anyway, the rest of Java's modules system I don't like at all. Let me mention two major problems.
First, it is troublesome to assemble groups of jar's along with their dependencies for both compilation and execution. It takes a while to track down all the necessary jar's, and it is hard to debug errors having to do with using the wrong version or with jar's that are only accessed on some control paths. To contrast, the ELF loader on Linux blows it away. You compile with -lm and get the math library plus its dependencies. You then run the resulting executable, with no extra arguments at all. Why doesn't Java work like that? Is C technology too advanced?
Second, linking jar's of different versions gives a lot of spurious errors. Package Universes for Squeak has a big advantage over the same thing for Scala in that department. It is rare for a Scala package to remain usable for longer than a couple of months, because the packages it links against keep getting changes in the signatures and the Java type checker complains. To contrast, some of the packages in the 3.9 stable universe are over a year old.
It is to the point that Scala users periodically request on the list that its version of package univeres use a non-JAR format. I wish I had time to design one, because I think they are right. JAR is an awkward format.
-Lex