Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news.albasani.net!.POSTED!not-for-mail From: BGB Newsgroups: comp.lang.java.programmer Subject: Re: no more primitive data types in Java (JDK 10+). What do you think? Date: Sat, 21 Apr 2012 08:55:30 -0700 Organization: albasani.net Lines: 56 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net Mygj9BflSOXT4wTPae2TV6yc4huK4Wcp2yPNZ0hoQUEx9zsTPN9eUXFX26QemslhRK42JRZEjeBNLzspN5ckeA== NNTP-Posting-Date: Sat, 21 Apr 2012 15:57:32 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="vkrHvL9zgJqPaT13Nl/Z5gB702ZQgzxNzU4FZJJ8xz6BykfxoxXNefwWrnoOtDTBGubgNE0jJJwJbS5MHv0I0jZojC5VN6WIPZoPNrpOsrt7wNLWvqKsU2NcED7xWXkZ"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 In-Reply-To: Cancel-Lock: sha1:KtJTBjAKhep7tcq5owyidJRyteQ= Xref: csiph.com comp.lang.java.programmer:13748 On 4/20/2012 11:53 AM, Bernd Nawothnig wrote: > On 2012-04-20, Roedy Green wrote: >> On Thu, 19 Apr 2012 18:27:43 -0500, "Nasser M. Abbasi" >> wrote, quoted or indirectly quoted someone who said : >> >>> "Unified type system (JDK 10+) >>> No more primitives, make everything objects" >> >> This is the way Eiffel works, > > The same for Python. > ironically, in my case I went differently: the root of the tree is not "objects", it is "variants", of which both the primitive/value types and objects are subtypes. variants have the funky behavior that anything can be stored in a variant (no casting needed), but going the other way may throw an exception (the language does not require explicit up-casts in most cases, but is much more inclined to give warnings about them). an "object" type also exists, but is generally considered an alias for "variant". "Object" is not the root of the type-system, it is only the root of the class hierarchy (the class hierarchy and type-system are not regarded as equivalent in this language). the ability to use ".toString()" on pretty much everything still exists though, except it doesn't currently do much useful for some types (many types which lack a sensible string representation will show up in a form like "#", which is the default syntax for anything lacking a known "toString()" method). >> but under the covers there are still primitives. Perhaps what they >> have in mind for Java, more intelligent boxing. At least at the low >> levels of the JVM you need primitives. > > These implementation details should better be hidden and invisible for > most cases. Let the compiler automatically detect and generate > possible optimisations. > > A programming language should be as simple and orthogonal as possible. > actually, I personally think it should be as "useful" and "usable" as possible, with simplicity and orthogonality coming second. otherwise, people could be off using very awkward toy languages in the name of simplicity and orthogonality, and this would hardly be a better outcome. so, it is more of a set of trade-offs.