I'm planning to broaden my perspectives in JVM platform, and I've got a dilemma: what should I learn first? Could you please explain, what are the advantages of Groovy, Scala and other languages for JVM? Thanks.
Answer:
Chosen as Best
JRuby and Jython. Both of these particular compilers are not quite there yet, mostly because JVM doesn't play nice with dynamic languages, so they have to go through some hoops.
Now, Ruby and Python are definitely two of the most important dynamic languages today. While they certainly compete against each other, they are quite different by themselves, in the community and philosophy.
Python is about choosing the Right Way and sticking to it. It's particularly conscious of form, and think form and semantics should not be dissociated, the most obvious example of which is the decision to delimit blocks through identation. As long as the particular decisions taken in Python agree with you, its a language that will please people who value stability.
Ruby is about going Your Way, the most striking example of which is the eagerness with which Ruby developers extend the language and libraries, sometimes to the detriment of interoperability when using multiple libraries. Their response to this late development is also quite telling: they are working on ways to keep doing that without causing such problems. People who like to tinker may well prefer Ruby.
Python had definitely a head start -- back in '99 it already had a name to it, while Ruby was slowing making inroads as an alternative to it. Ruby would only become a strong competitor when Rails came, and Ruby on Rails took the web by storm, leaving a path of copycats (for instance, Groovy's Grails).
Both languages have very strong community and features, and the most likely factor of choice is personal, subjective preference.
Which get us back to Scala, Groovy and Closure.
Groovy's strongest point is that its syntax is very, very close to Java, so a Java programmer can enjoy the benefits of a dynamic language almost effortlessly.
Closure's strongest point is that it is a Lisp. It has some advanced features, such as software transactional memory, but, in the end, the fact that it is a Lisp is more likely to influence one's decision to adopt it or not.
Finally, Scala is statically typed, which puts it in an entirely different class from all others. What often makes people group it together with the others is that it is a very concise and overhead-free language, like those dynamic languages. In that sense, a Java programmer may well be more comfortable with it than Groovy, as one gets the benefits of concise programs without giving up static typing.
What are the key differences between Scala and Groovy?
They're both object oriented languages for the JVM that have lambdas and closures and interoperate with Java. Other than that, they're extremely different.
Groovy is a "dynamic" language in not only the sense that it is dynamically typed but that it supports dynamic meta-programming.
Scala is a "static" language in that it is statically typed and has virtually no dynamic meta-programming beyond the awkward stuff you can do in Java. Note, Scala's static type system is substantially more uniform and sophisticated than Java's.
Groovy is syntactically influenced by Java but semantically influenced more by languages like Ruby.
Scala is syntactically influenced by both Ruby and Java. It is semantically influenced more by Java, SML, Haskell, and a very obscure OO language called gBeta.
Groovy has "accidental" multiple dispatch due to the way it handles Java overloading.
Scala is single dispatch only, but has SML inspired pattern matching to deal with some of the same kinds of problems that multiple dispatch is meant to handle. However, where multiple dispatch can only dispatch on runtime type, Scala's pattern matching can dispatch on runtime types, values, or both. Pattern matching also includes syntactically pleasant variable binding. It's hard to overstress how pleasant this single feature alone makes programming in Scala.
Both Scala and Groovy support a form of multiple inheritance with mixins (though Scala calls them traits).
Scala supports both partial function application and currying at the language level, Groovy has an awkward "curry" method for doing partial function application.
Scala does direct tail recursion optimization. I don't believe Groovy does. That's important in functional programming but less important in imperative programming.
Both Scala and Groovy are eagerly evaluated by default. However, Scala supports call-by-name parameters. Groovy does not - call-by-name must be emulated with closures.
Scala has "for comprehensions", a generalization of list comprehensions found in other languages (technically they're monad comprehensions plus a bit - somewhere between Haskell's do and C#'s LINQ).
Scala has no concept of "static" fields, inner classes, methods, etc - it uses singleton objects instead. Groovy uses the static concept.
Scala does not have built in selection of arithmetic operators in quite the way that Groovy does. In Scala you can name methods very flexibly.
Groovy has the elvis operator for dealing with null. Scala programmers prefer to use Option types to using null, but it's easy to write an elvis operator in Scala if you want to.
Finally, there are lies, there are damn lies, and then there are benchmarks. The computer language benchmarks game ranks Scala as being between substantially faster than Groovy (ranging from twice to 93 times as fast) while retaining roughly the same source size. benchmarks.
I'm sure there are many, many differences that I haven't covered. But hopefully this gives you a gist.
Is there a competition between them? Yes, of course, but not as much as you might think. Groovy's real competition is JRuby and Jython.
Groovy is a "dynamic" language in not only the sense that it is dynamically typed but that it supports dynamic meta-programming.
Scala is a "static" language in that it is statically typed and has virtually no dynamic meta-programming beyond the awkward stuff you can do in Java. Note, Scala's static type system is substantially more uniform and sophisticated than Java's.
Groovy is syntactically influenced by Java but semantically influenced more by languages like Ruby.
Scala is syntactically influenced by both Ruby and Java. It is semantically influenced more by Java, SML, Haskell, and a very obscure OO language called gBeta.
Groovy has "accidental" multiple dispatch due to the way it handles Java overloading.
Scala is single dispatch only, but has SML inspired pattern matching to deal with some of the same kinds of problems that multiple dispatch is meant to handle. However, where multiple dispatch can only dispatch on runtime type, Scala's pattern matching can dispatch on runtime types, values, or both. Pattern matching also includes syntactically pleasant variable binding. It's hard to overstress how pleasant this single feature alone makes programming in Scala.
Both Scala and Groovy support a form of multiple inheritance with mixins (though Scala calls them traits).
Scala supports both partial function application and currying at the language level, Groovy has an awkward "curry" method for doing partial function application.
Scala does direct tail recursion optimization. I don't believe Groovy does. That's important in functional programming but less important in imperative programming.
Both Scala and Groovy are eagerly evaluated by default. However, Scala supports call-by-name parameters. Groovy does not - call-by-name must be emulated with closures.
Scala has "for comprehensions", a generalization of list comprehensions found in other languages (technically they're monad comprehensions plus a bit - somewhere between Haskell's do and C#'s LINQ).
Scala has no concept of "static" fields, inner classes, methods, etc - it uses singleton objects instead. Groovy uses the static concept.
Scala does not have built in selection of arithmetic operators in quite the way that Groovy does. In Scala you can name methods very flexibly.
Groovy has the elvis operator for dealing with null. Scala programmers prefer to use Option types to using null, but it's easy to write an elvis operator in Scala if you want to.
Finally, there are lies, there are damn lies, and then there are benchmarks. The computer language benchmarks game ranks Scala as being between substantially faster than Groovy (ranging from twice to 93 times as fast) while retaining roughly the same source size. benchmarks.
I'm sure there are many, many differences that I haven't covered. But hopefully this gives you a gist.
Is there a competition between them? Yes, of course, but not as much as you might think. Groovy's real competition is JRuby and Jython.
Ubuntu 10.10 to be code named Maverick Meerkat
Ubuntu 10.04, codenamed Lucid Lynx, is scheduled for release this month. The developers at Canonical, the company behind the Ubuntu Linux distribution, have already started the process of planning for the next major release. Founder Mark Shuttleworth revealed today in a blog entry that Ubuntu 10.10, which is scheduled to arrive in October, will be codenamed Moribund Moth Maverick Meerkat.
Ubuntu 10.10 will coincide with the launch of GNOME 3, a major overhaul of the open source desktop environment that provides significant parts of the Ubuntu user experience. Shuttleworth's statements about bold moves and opportunities for dramatic improvement suggest that we could potentially see Ubuntu adopt the new GNOME Shell if it proves suitable. It's possible that we could also see the new default theme evolve and benefit from experimental features that were deferred during this cycle, such as RGBA colormaps and client-side window decorations.
The upcoming 10.04 release is looking really impressieve. Users can expect to see even more progress as theMalodorous Mongoose Maverick Meerkat begins to take shape. As usual, we invite our readers to share their most humorous alternate codename suggestions in the discussion thread.
More Details at Mark Shuttleworth (markshuttleworth.com)
Ubuntu 10.10 will coincide with the launch of GNOME 3, a major overhaul of the open source desktop environment that provides significant parts of the Ubuntu user experience. Shuttleworth's statements about bold moves and opportunities for dramatic improvement suggest that we could potentially see Ubuntu adopt the new GNOME Shell if it proves suitable. It's possible that we could also see the new default theme evolve and benefit from experimental features that were deferred during this cycle, such as RGBA colormaps and client-side window decorations.
The upcoming 10.04 release is looking really impressieve. Users can expect to see even more progress as the
More Details at Mark Shuttleworth (markshuttleworth.com)
7 reasons why you really should learn jQuery
Below are my 7 reasons why you should learn a javascript framework, and that the best one to learn about is jQuery.
1. jQuery seperates behavior from markup
In HTML markup it is still quite common to see things like this:
1. jQuery seperates behavior from markup
In HTML markup it is still quite common to see things like this:
Top 10 Reasons to Switch to the NetBeans IDE
- Works Out of the Box Simply download and install the NetBeans IDE and you are good to go. Installation is a breeze with its small download size. All IDE tools and features are fully integrated—no need to hunt for plug-ins—and they work together when you launch the IDE.
- Free and Open Source When you use the NetBeans IDE, you join a vibrant, open-source community of thousands of users ready to help and contribute. There are discussions on the NetBeans mailing lists, blogs on PlanetNetBeans, and helpful FAQs.
- Connected Developer The NetBeans IDE is the tool of choice for teams working in a collaborative environment. You can create and manage Kenai.com-hosted projects, file issue tracking reports using both Jira and Bugzilla, and collaborate with like-minded developers—all directly from within the familiar interface of the IDE.
- Powerful GUI Builder The GUI Builder (formerly known as Project Matisse) supports a sophisticated yet simplified Swing Application Framework and Beans Binding. Now you can build GUIs in a natural way.
- Support for Java Standards and Platforms The IDE provides end-to-end solutions for all Java development platforms including the latest Java standards.
- Java Mobility Support Complete environment to create, test, and run applications for mobile devices. With preprocessor blocks, you can readily handle fragmentation issues. Support for Java Mobility development is the best among all Java development tools.
- Java Enterprise Edition (EE) 6 support: The first free, open-source IDE to support Java EE 6 specifications.
- Java Standard Edition (SE) Support: You can develop applications using the latest Java SE standards.
- Profiling and Debugging Tools With NetBeans IDE profiler, you get realtime insight into memory usage and potential performance bottlenecks. Furthermore, you can instrument specific parts of code to avoid performance degradation during profiling. The HeapWalker tool helps you evaluate Java heap contents and find memory leaks.
- Dynamic Language Support The NetBeans IDE provides integrated support for scripting languages such as Ruby and Ruby on Rails, PHP, Groovy, JavaScript, JavaFX and Python.
- PHP: With the NetBeans IDE for PHP, you get the best of both worlds: the productivity of an IDE (code completion, real-time error checking, debugging and more) with the speed and simplicity of your favorite text editor in a less than 30mb download.
- Ruby and Ruby on Rails Support: Both native Ruby and JRuby development on Rails are available. You can switch easily between the two. The sophisticated Ruby editing capabilities makes it easy to create and modify Ruby applications.
- JavaScript: The NetBeans IDE has the JavaScript tools you need: an intelligent JavaScript editor, CSS/HTML code completion, the ability to debug JavaScript in Firefox and IE, and bundled popular JavaScript libraries. Your favorite JavaScript framework will get you 80% of the way, NetBeans IDE will help you with that last 20%.
- Groovy: In the NetBeans IDE, you can now create Grails applications, integrate Groovy scripts with your JavaSE project.
- JavaFX: The NetBeans IDE is the official tool for JavaFX development! See your visual code live in the editor, and analyze your application's performance with the JavaFX Profiler.
- Python: Discover the joys of Python programming with the NetBeans IDE. Enjoy great editor features such as code completion, semantic highlighting, and more.
- Extensible Platform Start with its extensible platform and add your own NetBeans IDE features and extensions or build an IDE-like application, keeping only features you want. Extending the platform and its Swing-based foundation saves development time and can optimize performance.
- Customizable Projects Through the NetBeans IDE build process, which relies on industry standards such as Apache Ant, make, Maven, and rake, rather than a proprietary build process, you can easily customize projects and add functionality. You can build, run, and deploy projects to servers outside of the IDE.
- Non-Java Code Support You're not limited to the Java programming language. You can include many other programming languages, such as C/C++, scripting languages like JavaScript, Ruby, etc. Even more exciting, define your own language and include it in your projects.
Subscribe to:
Posts (Atom)