Lua in the bootloader
Rui Paulo
rpaulo at felyko.com
Mon Aug 25 04:07:27 UTC 2014
On Aug 24, 2014, at 16:43, Jordan Hubbard <jkh at ixsystems.com> wrote:
>
>> limitations that I battle in Forth are significant enough
>> that I'd like to see if Lua can break said chains (such as
>> "dictionary full" errors causing BTX halt -- induced simply
>> by adding "too many functions" in Forth).
>
> I'm not one to stand in the way of progress either, but just to make sure we are not foolishly conflating "language" with "environment" here: You do all realize that ficl can have any sized dictionary you want, right? Presumably, it's kept small due to the limitations of the boot loader environment, and Lua is not going to magically transcend those limitations.
No, it's worse than that. There's not a really limit on the size and the stack can overflow easily on real hardware while at the same time it works fine on bhyve at the same time. userboot vs real hardware.
> Writing lots of boot code in Lua will require memory, perhaps even MORE memory since, say what you like about Forth, it's hard to get more concise or compact than a Forth dictionary of compiled CFA's. That's why we picked it for the role in the first place.
>
> So anyway, first try expanding the size of the dictionary. If that can't be done, now you know your "ceiling" for Lua. Can you stay below it, not just now but longer term? Those are the questions you need to answer.
The limitation of the dictionary and the size of the stack isn't the main reason why I would prefer lua over forth. Why do we need to subject ourselves to a stack based language in 2014? The very limited number of people hacking on the Forth boot loader on FreeBSD might have a different opinion, but the language is so arcane that I fail to see why we shouldn't replace it. Lua works because it's meant to be a library language and apparently it's small enough. Given the right implementation, we might even have a fail-safe boot loader with Lua. No one tried to fix that in ficl since it came to FreeBSD.
--
Rui Paulo
More information about the freebsd-hackers
mailing list