edit: Also D in safe mode like mentioend above - not sure if it was around in 2010?
edit: Also D in safe mode like mentioend above - not sure if it was around in 2010?
On some devices you have 32MB flash storage in total.
32 Megabytes, not gigabytes. This is not a typo.
This needs to fit the bootloader, the Linux kernel, the initrd, the rootfs containing all the user-space tools making OpenWRT an actual usable OS and whatever daemons you need to implement your particular network needs. Oh and you probably want the WebUI too.
In 32MBs. There are newspapers online which loads more than that just to show the front page!
There’s no room for 2MB HelloWorld type languages in this space.
Eg on https://ada.godbolt.org/ you can see the default program compiled to ~25 lines of assembler.
edit: actually it contains a call to a bounds check function that presumably is in the runtime library, i don't know how big that is.
A major point in this is that C also has a fairly big runtime library that should be factored into the comparison!
You can still build software for OpenWRT that requires the much bigger Glibc, but of course it will not work that well on devices with limited memory.
464.7K Oct 15 2022 /lib/libc.so
As seen on openwrt on armv7l system 20.0K Oct 13 2022 /usr/lib/libudev.so.1
8.0K Dec 15 2022 /sbin/udevtriggerThe original releases of OpenWRT used uClibc, which is nowhere near Glibc levels of bloat (Musl beats it on code quality and is used today, but didn’t exist back then). Also, yeah, you’re going to have a libc on a Linux system no matter what, so this is one of the rare cases where dynamic linking makes for a legitimate optimization.
But libc will be there anyways, unless you are rewriting absolutely all of userland.
You have to consider the surrounding ecosystem. Those interested in such languages are not necessarily those interested in contributing solutions to the problem space. Any project attempting to use such a language in OpenWrt would very likely not have survived until today.