Live data from Hacker News

Porting Python to GRUB: “Networking without an operating system”

lwn.net

1–10 of 49 posts

Re: Porting Python to GRUB: “Networking without an operating system”

#3

why would they not use lua ? which is pretty popular (and pretty much designed) as embedded scripting languages. Not to mention much more lightweight than python.. and has a much smaller footprint. Nginx is a pretty good example of this.

GRUB already has Lua, so I imagine the answer is "because we can"

Re: Porting Python to GRUB: “Networking without an operating system”

#4

why would they not use lua ? which is pretty popular (and pretty much designed) as embedded scripting languages. Not to mention much more lightweight than python.. and has a much smaller footprint. Nginx is a pretty good example of this.

What is it that makes the language suitable for being embedded? Actually, what does it mean to be embedded?

Re: Porting Python to GRUB: “Networking without an operating system”

#5

why would they not use lua ? which is pretty popular (and pretty much designed) as embedded scripting languages. Not to mention much more lightweight than python.. and has a much smaller footprint. Nginx is a pretty good example of this.

What is it that makes the language suitable for being embedded? Actually, what does it mean to be embedded?

Lua is extremely small, simpler, and has a jitted version. It's been used extensively as a scripting language in video games so has more mileage in constrained environment. Never used it really, just stating what other people say.

And luajit author, Mike Pall, is extremely skilled.

Re: Porting Python to GRUB: “Networking without an operating system”

#6

why would they not use lua ? which is pretty popular (and pretty much designed) as embedded scripting languages. Not to mention much more lightweight than python.. and has a much smaller footprint. Nginx is a pretty good example of this.

> why would they not use lua ?

The target audience for this is BIOS developers and firmware engineers. Several existing development tools in that area already support Python, including Simics and the Intel ITP, so the target audience is used to it.

Lua also has several other impedance mismatches with the target audience, such as 1-based array indexing (remember, the target audience writes assembly and C).

While people often describe Lua as "easy to embed", personally, I don't find Lua's stack-based C API easy at all; in particular, the references to stack-based indexes that change when you push or pop the stack feels like working with stack-based parameters in assembly without a base pointer, where the offset of a given location can change at any time. I much prefer the Python C API.

Finally, Lua would require additional libraries to provide a useful environment, precisely because it can assume so little about its environment. For instance, we'd need to bundle one of the Lua socket libraries in addition to Lua itself, as well as an HTTP library. Python's "batteries included" standard library works nicely here.

Re: Porting Python to GRUB: “Networking without an operating system”

#8

why would they not use lua ? which is pretty popular (and pretty much designed) as embedded scripting languages. Not to mention much more lightweight than python.. and has a much smaller footprint. Nginx is a pretty good example of this.

Speculation: At least for the given Intel use case, lightweight doesn't sound to important: they can use the entire machine. And given the fairly specialist application, porting a language experts and users are familiar with (or maybe was used in existing tooling) might be better.

Re: Porting Python to GRUB: “Networking without an operating system”

#9

why would they not use lua ? which is pretty popular (and pretty much designed) as embedded scripting languages. Not to mention much more lightweight than python.. and has a much smaller footprint. Nginx is a pretty good example of this.

> why would they not use lua ? The target audience for this is BIOS developers and firmware engineers. Several existing development tools in that area already support Python, including Simics and the Intel ITP, so the target audience is used to it. Lua also has several other impedance mismatches with the target audience, such as 1-based array indexing (remember, the target audience writes assembly and C). While peopl…

thank you for that. That explains a lot ! But Lua is already in Grub right ? wouldnt it have been more effective to just extend that anyway ?

Re: Porting Python to GRUB: “Networking without an operating system”

#10
post #3

why would they not use lua ? which is pretty popular (and pretty much designed) as embedded scripting languages. Not to mention much more lightweight than python.. and has a much smaller footprint. Nginx is a pretty good example of this.

GRUB already has Lua, so I imagine the answer is "because we can"

interesting. I never knew that... i wonder if any additional socket library dependencies were problematic in the lua world.
Post reply on HN