4 ms·
Humm, I don't think you can equal an SDK to an OS. Before getting this high level, you really have to start with a kernel to handle/manage device. And this as a
by ldng 8y ago
Humm, I don't think you can equal an SDK to an OS. Before getting this high level, you really have to start with a kernel to handle/manage device. And this as a lot of constraint that yous simply can not fulfill with a garbage collected language.
edit:
I wasn't at the point you mentioned yet. Well, IMHO, it is not just the GC, it is not having access to native pointer prevent you to implement algorithm that are keys in term of performance for a kernel. IIUC more savvy dev than me it might not even be possible to implement a kernel in Rust without "unsafe" (which give you access to those raw pointers)
Happy to be proven wrong though.
- littlestymaar 8y agoAlso, Android is more than the SDK: almost every game running on this platform uses the NDK.
- ldng 8y agoThe NDK is a wrapper above a slew of C/C++ lib and those are not garbage collected. It make me think of PHP. The language is actually really slow but because most of it's standard library are wrappers around actual C library, a lot of people perceive it as a really fast language. But compared to raw C/C++/Rust, it is still slow.
- pjmlp 8y agoThe NDK is very limited, its sole purpose is for 3D, real time audio, ML and porting ISO C and ISO C++ code into Android, everything else requires JNI, even reading files outside the APK sandbox.
- karmakaze 8y agoOK that was a bad example. I just meant to say that C compatibility is an over-specification. We just need machine level interfacing like maybe locking to hardware threads, fixed address referencing, etc. Edit: I don't know much about this but it might be a better example "GRiSP 2 – Erlang and Elixir on bare metal." I'm assuming this is possible and includes the BEAM VM with GC. https://news.ycombinator.com/item?id=19358133 https://news.ycombinator.com/item?id=19358133
- brightball 8y agoThe BEAM GC is a little bit special because there’s not a shared memory model. Millions of little Erlang processes will be GC’d independently which simplifies things a ton. That isolation model probably wouldn’t translate to the greater code ecosystem even though it’s very effective for BEAM applications.
- ldng 8y agoOh I see, you mean "unvirtualizing" the VM and run on the hardware that comply to the VM spec. I was under the impression that generally VM are idealized hardware that is friendlier for software development but they would make terrible actual hardware. I suppose it also depend on the language/VM. But I'm totally out of my comfort zone. Let wait and see if someone more knowledgeable chimes in :-)
- badsectoracula 8y agoGC doesn't prevent you from writing an OS, see Project Oberon[0] for an example of a system with its own CPU (implemented in FPGA), OS, language and applications by Niklaus Wirth which actually does use a system-wide garbage collector. The language does allow for direct memory access though through some special functions that the compiler converts to direct memory accesses. [0] http://www.projectoberon.com/ http://www.projectoberon.com/
- samus 8y agoThere are Java APIs that give access to raw memory. It's one of the infamous, largely undocumented sun.misc-stuff though. There are libaries that used it to implement efficient off-heap data structures. Because of modularization its future looks grim though. After all, Java was not designed with having an unsafe subset of language constructs like Rust has. It would degenerate to C++ in terms of safety.