Is making Boost more like Java a good idea?
Join the DZone community and get the full member experience.
Join For FreeI was reading a question StackOverflow about What is Boost missing? and I was wondering how many of these features are available in Java already and whether making boost more like Java is good idea.
Top suggestions
Suggestion | What is in Java |
---|---|
SQL support | JDBC |
JSon | Requires an additional library like XStream, Possibly should be in core Java |
Audio | Java has basic support. Don't know if it much good. |
logging | Logger |
callstack, a standard API | Throwable.getStackTrace() and Thread.getStackTrace() |
Support for archives | Support ZIP and JAR |
Redeveloped collections | The same could be said for Java Collections |
Standard XML parsing for UTF-8 text | SAX (event driven) and DOM (Document object model) parsers for XML |
Platform independent GUI | Swing |
Concurrency with lock free collections and atomic operations | Concurrency library |
Arbitrary precision floating point and decimal | BigDecimal and BigInteger |
Python, Ruby and Lua support | Not built in, but there is Jython, JRuby and LuaJava |
High performance (sub micro-second) timers | System.nanoTime() |
Better concept support | This looks like staticly defined duck typing and Java is a long way from having anything like this. ;) |
Atomic | AtomicBoolean, AtomicInteger, AtomicLong, AtomicReference, AtomicIntegerArray and AtomicLongArray |
Thread pools | ExecutorService and ScheduledExecutorService |
RPC | RMI |
Character encoding | CharSet |
GPU support | I would love Java to have this as well. There is JoCL but its not exactly transparent or close to the Write One, Run Anywhere model. |
Hashing/Checksums | MessageDigest and CRC32 |
OS performance measures | This is poor in Java. You can get the load average but its always 0 on windows. |
Co-routines | The closest is fork/join with anonymous classes. In Java 8 methods will become first class objects which is a little closer. |
Fixed size strings | You can have this in Java. However I assume the point of this is efficiency, which Java is unlikely to match, ever. |
Message Queues | JMS |
cryptography | Java SE Security |
Extend GC to trigger a GC and handle when an object is cleaned up. | System.gc(), finaliser() and PhantomReferences |
A overflow/underflow safe integer | This would be useful if language support was included, but I doubt that will happen, (like unsigned int) |
unification and backtracking | This could be added in the far future. I imagine after Java 8 |
Singletons | An enum with one instance (enum are Objects in Java not int values) |
A Persistent Collections Library. | Java doesn't have much support for functional programming. This is something which it could have, but I don't imagine it being any time soon. |
IMHO, The best suggestions which are missing or could be better in Java are
- persisted collections
- JSon serializaton/deserialization
- GPU support
- Good OS performance measures
Even more useful would be a common interface and basic support for collections which are distributed and persisted. e.g. standardised/simplified Hazelcast, Terracotta and Hibernate. @Vyadh points out this is not what is meant by a persisted collection in functional programming
Last thoughts
While I really like Java, but I have never looked at C++ & Boost and thought; if only it were more like Java. (Some of the limitations of the C syntax are a bit backward IMHO) I have thought this about the refactoring tools in IDEs e.g extracting a method from a body of code (and have it replace any duplicates)Is making C++ & Boost more like the relatively heavy weight Java a good thing? Or is it better to use a language for it strengths?
From http://vanillajava.blogspot.com/2011/09/is-making-boost-more-like-java-good.html
Opinions expressed by DZone contributors are their own.
Comments