2 ms·
What is a natively compiled non-GC lang. for Android?
I've been searching for a language to implement a game I had in mind. The problem with java on android: When GC runs, I get a weird world-stopping delay. The game requires continuous interaction with the touch screen, so users could be dismayed by these random stutters that happen every 20-30s. (I've checked with a memory profiler, I don't have any object allocations within tight loops, so I blame java for that randomness.)
The problem with C++: I love it. Especially after what they did with C++11. And with C++14 we even have polymorphic lambdas. Coding in C++ can be elegant provided that I've coded enough abstractions over the data structures and algorithms I need. That's why I won't touch C++. This project will never finish.
The problem with Free Pascal: Having worked with Delphi some of my professional life, I gave free pascal+LazSDL2 a go. Turns out it works great on android. (no world stopping delays). But it isn't the most elegant language. I know, because I'm a ruby person.
Go, Crystal, Nim, I fear their garbage collection schemes will end up doing the same thing as android's Java implementation.
I'm just one person, don't have the time to evaluate the whole world. Does HN have a suggestion?
- nabla9 9y agoHave you considered doing manual memory management in GC language? Create your own memory pool and use your own new() and free() functions just like with C/C++. When you free() memory it goes back to the object pool and is recycled.
- nurettin 9y agoI haven't considered creating my own thread safe custom memory management routines. I would probably get lost in the details instead of making a game.