you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (5 children)

No, they don't have to be Java, I develop cross-platform apps with Flutter in Dart, but the android OS itself is garbage collected, and iOS is not. There is a significant performance penalty associated with this

https://developer.android.com/topic/performance/memory-overview#:~:text=Any%20time%20a%20generation%20starts,objects%20are%20in%20each%20generation.

https://stackoverflow.com/questions/12811767/ios-garbage-collection#:~:text=iOS%20has%20no%20method%20of,other%20sort%20of%20memory%20management.

[–]Vulptex[S] 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 1 fun -  (1 child)

That's not even possible. Even if you could somehow get an OS working in Java, it couldn't be a fork of Linux.

Android seems to have built-in garbage collection for Java, as opposed to using the JVM. If your app uses C with malloc() and free(), there can't be garbage collection. Garbage collection only happens when the app doesn't handle memory allocation itself.

[–][deleted] 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 1 fun -  (0 children)

Even if you could somehow get an OS working in Java, it couldn't be a fork of Linux.

It isn't a fork of linux, it uses a linux kernel. Android has an entire garbage collected runtime sitting on top of the kernel that translates everything to bytecode. An OS is more than just a kernel. The enitire Android UI is running in Java on top of that garbage collected android runtime

[–]chickenz 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (2 children)

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (1 child)

Yes Ed, lack of garbage collection is part of what makes C so fast too

[–]chickenz 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

c is fast because it runs on Atari.