VOOZH about

URL: http://blog.vanillajava.blog/2013/01/should-java-be-more-high-level-or-low.html

⇱ Should Java be more high level or low level?


Skip to main content

Should Java be more high level or low level?

Overview

Java 8 is bringing much antisipated features such as Lambda expressions, Type Annotations and Virtual Extensions.

While this functionality is a) valuable, b) playing catch up with cooler languages, are these richer, higher level functionality the only area Java should be focused.

What are the most widely used languages

There are many ways to assess which are the most widely used languages. One index which attempts to consider a wide variety of sources is the Tiobe Index. The positions and ratings are taken from Jan 2013.

Position Programming Language Ratings Age Cooler Level
1 C 17.9% older no lower (much)
2 Java 17.4% same no same
3 Objective-C 10.3% older no lower
4 C++ 9.1% older no lower
5 C# 6.2% newer yes lower (slightly)
6 PHP 5.5% older yes higher
7 (Visual) Basic 4.7% older no same?
8 Python 4.2% older no higher
9 Perl 2.3% older no higher
10 JavaScript 2.0% same no higher
11 Ruby 1.8% older yes higher
12 Visual Basic .NET 1.0% newer no higher
13 Lisp 1.0% older no higher
14 Pascal 0.9% older no same
15 Delphi/Object Pascal 0.9% older no higher
16 Ada 0.7% older no same?
17 MATLAB 0.6% older no higher
18 Lua 0.6% older yes higher
19 Assembly 0.6% older no lower (much)
20 Bash 0.6% older no higher

The "Age" is based on the initial release date, the "cooler" is purely subjective on my part, and the "Level" column is whether the language supports lower level functionality or is it designed to be more abstract/higher level.

What I take from this list that there are many higher level languages, but the really popular ones support lower level constructs. e.g. Java is the only one in the top 5 not to support structs directly. (It has an optimisation which can work aorund this to a small degree)

Conclusion

While Java should be looking to add higher level functionality, it should also consider the lower level features languages like the *C* languages support as these are likely to become more popular as there will be more mobile and embedded devices in the future.

Comments

  1. Java 8 also plans to introduce fairly low level stuff. How about, for example, the introduction of the `@Contended` annotation to (try to) solve false sharing issues? (http://mail.openjdk.java.net/pipermail/hotspot-dev/2012-November/007309.html) It seems like that one is going to go through. On the other hand, I'm not sure if JEP 169 (http://openjdk.java.net/jeps/169) will make it (sort of structs)...

    Delete
  2. That is an interesting addition. You can do much the same with padding, but it would be a real pain for anything non-trivial.

    Delete
  3. Languages based on VM should be "higher" level, it is no point making a VM language very "low level", what is the VM for then? Or do you want to develop bytecode assembler code?

    C# is basically what Java should (have) be(en) and it shares same abstraction level, and other languages, C and C++ have clearly other purposes, in general, than Java. Objective-C is just an anecdote due to iPhone and (very little) OSX, but not used anywhere else...

    In my opinion, Java should evolve à la C#, adding kind of LINQ, etc.., Java 8 brings, but being very conservative and keeping backwards compatibility, and, maybe, relying most functional/dynamic features to Scala/Clojure and Groovy initiatives.

    Rgds

    Delete
  4. I miss structs hard in Java. This would enable en/de-coding-free messaging (similar to casting a void* to struct* in C), very fast instantiation of data structures, off-heap without the mess, stack allocation for zero-GC realtime parts of a software, control over memory layout, ease interfacing with native languages ...

    However http://openjdk.java.net/jeps/169 did not convince me from a language-conceptual perspective ..

    Delete

Post a Comment

Popular posts from this blog

Asking multiple AI to optimise the same code

As different AIs are implemented differently, they don't all provide the same answer, nor do they consistently outperform one another. The best approach is to use multiple AI and pick the one you like best. My goal here is not to declare a winner based on one example, but instead to show the variety of answers you can get with different AI. I asked each AI to Suggest how to implement this more optimally private static String formatOffset(int millis) { String sign = millis < 0 ? "-" : "+"; int saveSecs = Math.abs(millis) / 1000; int hours = saveSecs / 3600; int mins = ((saveSecs / 60) % 60); int secs = (saveSecs % 60); if (secs == 0) { if (mins == 0) { return sign + twoDigitString(hours); } return sign + twoDigitString(hours) + twoDigitString(mins); } return sign + twoDigitString(hours) + twoDigitString(mins) + twoDigitString(secs); } private static String twoDigitString(int value) { ...

Demystifying Java Object Sizes: Compact Headers, Compressed Oops, and Beyond

Introduction Measuring an object’s size in Java is not straightforward. The platform encourages you to consider references and abstractions rather than raw memory usage. Still, understanding how objects fit into memory can yield significant benefits, especially for high-performance, low-latency systems. Over time, the JVM has introduced optimisations like Compressed Ordinary Object Pointers (Compressed Oops) and, more recently, Compact Object Headers. Each of these can influence how large or small your objects appear. Understanding these factors helps you reason about memory usage more concretely. Measuring Object Sizes In principle, you can estimate an object’s size by creating instances and observing changes in the JVM’s free memory. However, you must neutralise certain factors to get consistent results. For example, turning off TLAB allocation ( -XX:-UseTLAB ) makes memory usage more directly observable. Repeated measurements and median calculations can reduce the im...

Updated Biography

Peter Lawrey is an Australian/British software engineer and entrepreneur best known for work on ultra-low-latency Java systems and for leading the open-source OpenHFT libraries. He is the founder and chief executive of Chronicle Software, a London-based company whose technology is used in trading and market-infrastructure workloads. Lawrey is also a recognised Java community figure: he was named a Java Champion in 2015, has been described by conference organisers as having provided the most answers for the Java and JVM tags on Stack Overflow, and writes the long-running Vanilla Java blog. ( Chronicle Software , javachampions.org , qconnewyork.com , blog.vanillajava.blog ) Career Lawrey founded and leads Chronicle Software, which builds enabling technology for event-driven trading and market-data platforms. The company states that its software underpins systems at several tier-one banks; a 2024 press announcement similarly described Chronicle as supplying "8 of the t...