10 ms·
> I'm really not sure the drive for garbage collected languages in memory constrained systems with no user recoverability. Seems like a recipe for a device that
by vardump 9y ago
> I'm really not sure the drive for garbage collected languages in memory constrained systems with no user recoverability. Seems like a recipe for a device that just stops working from time to time.
Remember all those home computers from seventies and eighties, such as C64, Apple II, MSX compatibles and Spectrum? Almost all of them were running "garbage collected" BASIC interpreters.
I don't think blanket statements are justified. There are a lot of different types of embedded systems.
> Without them, how can you guarantee an interrupt can be reliably serviced in time?
You wouldn't allocate memory in IRQ service routine in the first place, GC or not. GC, dynamic (malloc) and static system would all take exactly as long to service an interrupt.
GC can also be a subset of the system, where less time critical functionality is running.
That's not to say embedded systems should do allocation at runtime. It's often reasonable to avoid it. But perhaps not all the time.
- YZF 9y agoAre you sure those BASIC interpreters used garbage collection? I wouldn't have thought so. I don't think you even had dynamic memory allocation in most of these, you had to size your arrays in advance. The memory might not have gotten allocated until you got to that line of code but that's not the same thing...
- pjmlp 9y agoYes for string and array management. Many BASICs had REDIM for resizing arrays on the go.