Thanks for the reply, Kris There are some monumental misunderstandings going on here, so I'm not sure where to begin... I have absolutely no intention of starting a flame war, that is totally counter to the point of a forum. However, you clearly misunderstood my post, or you are defending your beliefs out of a sense of loyalty. Let me clarify a few points, and maybe get some input from others!
First and foremost, I didn't know this wasn't a Google "official" forum. The fact that I'm staring at a Google logo in the upper left hand corner of my screen while typing this, indicates they SHOULD have some interest in what's being said about their flagship enterprise! If Android isn't Google's top ticket item these days, I have no idea what is. If there's a better place to ask this question, I humbly ask a moderator to move this discussion to a more appropriate thread. Thanks in advance. I never suggested I was an expert in software architecture, thus the question in my original post. I've built numerous computers, and suggested only that I have a fairly comprehensive understanding of hardware architecture. It actually goes a bit beyond building computers, I also have a great deal of experience in troubleshooting hardware -- down to the circuit level. And yes, why Java? The whole point of my question is: Why base an operating system on a VM?! I never said a VM obviated the security architecture of Linux -- I said Linux had a great security architecture without the need to sandbox it. The fact that a VM is slow, wouldn't just be my thought if it's so common. The simple fact is that a VM cannot possibly execute bytecode as fast as native code. Even with processor extensions that give VMs direct access to to CPU (VT-x and AMD-V) there's still I/O (including display and memory), meaning computational throughput cannot possibly match native code. My contention that a VM is slow isn't my imagination, it's rooted in direct evidence that a VM cannot, by base virtue, perform as well as the host machine. And JIT (Just-In-Time) compilation doesn't mean the code is executed the same speed as native. It means the code is compiled on-demand to native machine code - and then executed. It still has the overhead of being compiled on the spot. Native code doesn't need to be compiled JIT! The argument about Haskell is ... what did you say? Uninformed? There is a vast difference between bytecode executed in a virtual machine, and high level compilers. A high level compiler is often considered "slow" compared to C because of the assembly/machine code that comes from it.... not because the code is being executed in a VM environment. I understand completely how register based code executes faster than stack based - it's the same difference between pascal calling convention and c calling convention. By most/many estimations the register based calling convention of pascal makes the code execute faster -- in that regard c is usually preferred because the difference in speed is relatively minor compared to the raw power (access) of c. But this isn't a discussion about the virtues of pascal and c calling conventions. Side note: Objective C is just another compiler - it still compiles to native code. Cocoa is just a library that Objective C programs build against. It's a "high level" language, yes - but the compiled code does NOT run in a virtual environment. Huge difference. And to address your final point: if I thought Android was "bad" I certainly wouldn't have spent $800 on Android powered devices. Apple iOS devices are crippled in a different way: they assume too much for their user, and leave little in the way of customization. They also lack a rather robust, open-source development community. In the end, I will choose any alternative on my mobile devices to Microsoft and Apple. That leaves Android. So, I've addressed all of your points. And I still submit my question: why Java? Or rather, why a virtual machine built on top of Linux, rather than Linux itself?? If this post belongs in a different forum, I apologize - but I believe the question itself is quite valid. On another side note, I don't believe anything I've said or asked is uninformed at all. Sorry for ranting, -jamb On Saturday, September 15, 2012 9:18:39 PM UTC-5, Kristopher Micinski wrote: > > Your post is somewhat uninformed for a number of reasons: > > - this isn't an official Google forum for Android. > - there are other more appropriate places for your question: > android-platform, for example > - Being able to build a computer == being able to modify a 50 million > line operating system? Sorry, I don't see that comparison. > - why Java? Fits the VM architectural model. > - Dalvik doesn't obviate the security architecture of the linux > kernel, it works together with it. Most of the security benefits in > Android are *indeed* from linux itself! > - You seem to think that the VM is slow. This is a common claim, but > do you really know? Dalvik as an interpreter was pretty damn good, > when it got JIT capabilities it became even faster, so much of the > code executing *is* native code. > - The fact that the NDK exists is an indication that Java isn't the > best? What are you talking about? Every successful high level > language has a way to talk to lower level code: Haskell, OCaml, etc.., > Does that mean it's slow / wrong? No, it just means that sometimes > you need a lower level of control you can't get from the langauge. Am > I saying that Dalvik will kill it for custom graphics code? No, but > that's why the NDK exists: to handle the very small percent of times > when you *really do* need native code that controls low level > hardware. > - The cross platform decision wasn't really the sole reason Android > settled on Java, I would wager it was the fact that it is simpler to > write in than C++, just my blind guess. > - The OS isn't implemented on Java, much of the higher level stuff > is, and lots of time is actually spent in systems level code anyway... > - Unsure if you were around, but the NDK isn't new, it's been around > since Java :-) > > The architect surrounding the VM and the choice of Java isn't > specific. In fact, calling it a *Java* virtual machine is just plain > wrong. What runs on Android is Dalvik bytecode. It's not quite the > same, it's a register rather than stack based virtual machine, and > there are some other differences as well. The way the VM is built > allows the platform to be architected a certain way, via forking a > zygote process and getting tons of common memory. > > You're asking some questions that seem to imply Android is *bad*, but > you don't really have much support for those claims. Certainly > Android is *different* than Objective C, but the claims as to why it's > "worse" are somewhat unfounded here... > > This video is old, but still relevant to help clear up some of your > confusion: > > http://www.youtube.com/watch?v=ptjedOZEXPM > > And remember, this forum isn't for discussion of the OS design, and > Google employees probably won't answer you :-). You could try > android-platform, but I'd think about these points before you reask > your question! > > kris > > On Fri, Sep 14, 2012 at 9:11 PM, jamb <[email protected] <javascript:>> > wrote: > > Hello Android devs! > > > > I recently bought a Motorola Razr Maxx, and then shortly after an Asus > > Transformer Infinity TF700T.... I suppose it goes without saying that I > like > > the idea behind Android as an OS. But I'm a little curious about the > > architecture decisions, and thought this would be the best place to > ask.... > > As far as I know this is the only "official" Google forum for Android > OS. > > > > As someone who has always built my own PCs from scratch, I have a pretty > > decent idea about hardware architecture. While I run Windows as my main > OS, > > I've experimented with Linux and BSD on occasion (with mixed and often > > disappointing results, due to the hardware I choose). I'm no stranger to > > digging into the OS and tweaking as I see fit. So after grabbing the > Android > > SDK and digging more into the architecture, one huge question is > baffling > > me.... > > > > Why Java? > > > > If my understanding of Apple products is accurate, iOS is based on > FreeBSD > > with Apple specific hardware drivers and Cocoa. It's my understanding > that > > Cocoa is a native set of classes that function in a similar way as GTK+ > or > > QT, but developed "in-house" at Apple. > > > > So why did Google choose to implement Android as a barebones Linux > Kernel, > > with phone/tablet specific drivers and a Java VM? Linux already has a > > fantastic security model, which (in my opinion) reduces the benefit of a > > sandboxed (virtual machine) environment. And a virtual machine, by > > definition cannot possibly perform as well as native code - even if it > IS a > > hand optimized version. > > > > In deciding to use Java as it's primary application architecture, it > appears > > to me that Google crippled Android from the get go. The fact that the > NDK > > exists at all is a good indication that Java was not the ideal solution. > > > > C/C++ has always been a relatively robust language to design > cross-platform > > applications - with some effort and preprocessor directives. Java is > > definitely _more_ portable, but who uses Android apps, but Android > users? I > > just don't see that Java was the best way to implement an OS. Embedded > > developers design software for 2 platforms: iOS and Android. Using Java > as > > the primary architecture forces developers to do far more than include > > different preprocessor directives and libraries - apps have to be > redesigned > > from the start, even using NDK. In fact NDK is kind of a joke - using a > VM > > to execute native code within it's context - of course there's no > > performance increase, though there's a huge increase in complexity! > > > > So why didn't Google choose a similar route as Apple? Creating a > framework > > like Cocoa based on a Linux kernel (and using native c/c++ code)? > > > > If I'm off in left left or simply missing some major point, I'm more > than > > happy to learn! > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to > > [email protected]<javascript:> > > To unsubscribe from this group, send email to > > [email protected] <javascript:> > > For more options, visit this group at > > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

