Hacker News new | past | comments | ask | show | jobs | submit login

Good point. I don't regret my time spent writing in Java. I think in many ways it improved on previous languages and clarified a lot of things that are pretty murky in C++ (like how objects have both a 'dynamic' and 'static' type). And it's nice to hear they're still innovating things.

It's just that small things add up. Take class members. In C++, all non-pointer class members are allocated together (like a struct). In Java, each non-array member is basically a pointer. That small little thing spread across say a UI/widget hierarchy adds up and creates a lot less memory locality, etc. Doesn't quite fold as nicely into the caching layers of the von Neumann model.

I totally agree with you about there being orders of magnitude more memory than the original machines that these languages were developed on. Actually, just googling 'ipad ram' (and filtering by last week -- man, I love that feature):

http://bit.ly/dioAjU

It looks like there's only 256MB or so. No idea why they didn't include more. That makes no sense to me. It's almost like they're squeezing VMs on purpose. Not sure if Jobs is that much of an evil genius, but yeah. I mean when you're paying $600 for a device made in bulk, RAM is cheap. Odd.




I'd argue 256 mb is more than plenty to run a VM. I recall running much slower and memory-hogging VMs (earlier versions of Flash, Bochs, Blackdown JDK 1.3 under Linux emulation in FreeBSD, how's that for layering?), running much heavier applications (Netbeans, Tomcat under Blackdown) in 256 mb of ram on a machine with a slow PATA disk and a Pentium-III processor. It wasn't pretty (this experience is what turned me away from JVM until recently), but it was tolerable.

I am not saying the JVM (at least HotSpot) is actually best for the iPhone/iPad, there are better VMs out there. Erlang's VM is better (and again, runs in a much more restricted space), there are also register based VMs (e.g., Dalvik and -- best example -- how Apple themselves emulated m68k on PowerPC based Macs).

I'll definitely trust you in regards to UI programming: last UI programming I did for a salary was GTK+- in C, having played a bit with OS X SDKs / IB -- even prior to iPhone -- I found that to be a much better experience. The only Java desktop apps I use extensively are the IDEs (and both Eclipse with SWT and IntelliJ IDEA with its JNA/JNI libraries make heavy use of native APIs).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: