From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 25 04:07:27 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7164923E; Mon, 25 Aug 2014 04:07:27 +0000 (UTC) Received: from felyko.com (felyko.com [IPv6:2001:470:1:2d5:26:3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 50FA83970; Mon, 25 Aug 2014 04:07:27 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 0445934A9E5; Sun, 24 Aug 2014 21:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1408939646; bh=xxWP/vvRoGvAH/rfjD1gQyUfF+ISJ/5LUXk326eD7aw=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=EWpT8HgF1n40OD03GJevwqecGSRUvdgLQRXdDPB8whKDUJ1dDFE0eVMSnvnZuErcP LEMf1q4xsFK9QUg1QZm7bOTcoOSYaze0/aiDiTeGaBQHTI37RXEEDIq5fgxGskpRRb pBiBnHCnGjK7stwcelrpJgg64hyKo7FeoAg5Esm8= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1973.6\)) Subject: Re: Lua in the bootloader From: Rui Paulo In-Reply-To: <5FE57E4E-A627-4ABA-AB73-F0D60A3602D5@ixsystems.com> Date: Sun, 24 Aug 2014 21:07:24 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <236878C4-2C3E-4744-A04B-736C91032BFC@felyko.com> References: <3D62F4F4-ECCF-4622-BB57-D028160F3451@freebsd.org> <157901cfbe83$6cbf18d0$463d4a70$@FreeBSD.org> <16e101cfbfee$42b3b930$c81b2b90$@FreeBSD.org> <5FE57E4E-A627-4ABA-AB73-F0D60A3602D5@ixsystems.com> To: Jordan Hubbard X-Mailer: Apple Mail (2.1973.6) X-Mailman-Approved-At: Mon, 25 Aug 2014 11:18:36 +0000 Cc: "Wojciech A. Koszek" , "" , "" , Pedro Giffuni , Pedro Arthur X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Aug 2014 04:07:27 -0000 On Aug 24, 2014, at 16:43, Jordan Hubbard 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