Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: BGB Newsgroups: comp.lang.java.programmer Subject: Re: Android?Why Dalvik? Date: Mon, 30 May 2011 18:10:21 -0700 Organization: albasani.net Lines: 72 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 MPaRRgE0hNwbG/otC01YCjntokECbupNspsFGuSz5g+EJIyh85uz+XXQ4LhmEW0gkLmgWltDJEichb7YlCSG4w== NNTP-Posting-Date: Tue, 31 May 2011 01:13:23 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="xAPx1uviUF2k2QFNbMIbb6ZFPgqDDbyAV20X5a6oaAOa/r75vjY54rgyKlaQOi/dKrrjUR1+iiSjdOh2M1ptJsl87BhBGqrdKsFhP7DCxvSovBE1LI24DdUnf7phUFoZ"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: Cancel-Lock: sha1:7bgq6dkmZNKc7LmgFcSe4SiiZlk= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4779 On 5/30/2011 4:32 PM, Nasser M. Abbasi wrote: > On 5/30/2011 3:55 PM, BGB wrote: > >> >> my idea was less drastic: >> rather than by creating an entirely new set of abstractions, one creates >> a VM which is itself better suited to heterogeneous environments. >> >> in C, we called this mechanism "#ifdef". >> a new language can likewise devise newer, ifdef-like mechanisms. >> > > I know all about #ifdef. One a project long time ago, > I worked on porting Netscape web server source code, it would > build for I think 18 different platforms. Most of these are > flavors of Unix, few flavors of windows, and OS2 and such. > > The same source code, 18 or so different build targets. > > Just understanding the makefiles, never mind the 2 million > lines or so source code with the #ifdefs in them, was a > nightmare :) > > The same was for the Netscape browser code. > yeah. but, the #ifdef's and makefiles work fairly well IME... millions of lines of code, and it all still goes strong. #ifdef's and parallel sets of makefiles (and/or alternative build systems) are just part of the game. > Java is supposed to solve all this #ifdef stuff. but, at what cost?... it is worth noting that the Java class library is... rather large... and that also it tends to behave more like a "second class citizen" on many OS's. it is also a bit painful trying to work with OS-level functionality, and neither JNI or JNA are particularly friendly in these regards. also, mixed-language apps (mixed C / C++ and Java) are often a bit painful as well. granted, yes, a VM probably can and should gloss over what it reasonably can from the OS (providing common APIs for many things, possibly providing a simpler build system, ...), just I don't think it is worthwhile to try to be an all-encompassing platform either. also, it makes sense to allow that a common VM if being used in different situations may be able to provide additional functionality, or not provide certain functionality, and being able to handle this more cleanly/easily is a good thing IMO. also, the class libraries themselves may have to deal a fair amount with OS-specific quirks. hence, an ifdef-like system is a powerful tool, IMO. well, along with a reasonably powerful native FFI... or such...