Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Aug 2014 21:07:24 -0700
From:      Rui Paulo <rpaulo@felyko.com>
To:        Jordan Hubbard <jkh@ixsystems.com>
Cc:        "Wojciech A. Koszek" <wkoszek@freebsd.org>, "<freebsd-hackers@freebsd.org>" <freebsd-hackers@freebsd.org>, "<dteske@FreeBSD.org>" <dteske@FreeBSD.org>, Pedro Giffuni <pfg@freebsd.org>, Pedro Arthur <bygrandao@gmail.com>
Subject:   Re: Lua in the bootloader
Message-ID:  <236878C4-2C3E-4744-A04B-736C91032BFC@felyko.com>
In-Reply-To: <5FE57E4E-A627-4ABA-AB73-F0D60A3602D5@ixsystems.com>
References:  <3D62F4F4-ECCF-4622-BB57-D028160F3451@freebsd.org> <157901cfbe83$6cbf18d0$463d4a70$@FreeBSD.org> <A87AA9EB-373F-400E-986E-4D9017EB2375@freebsd.org> <16e101cfbfee$42b3b930$c81b2b90$@FreeBSD.org> <5FE57E4E-A627-4ABA-AB73-F0D60A3602D5@ixsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 24, 2014, at 16:43, Jordan Hubbard <jkh@ixsystems.com> wrote:
>=20
>> 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).
>=20
> 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.=20
>=20
> 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






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?236878C4-2C3E-4744-A04B-736C91032BFC>