Earlier quoted context omitted.
Did you modify the CPython binary to run in the BIOS, or did you write a new interpreter from scratch? What was the hardest part of implementing this?
We build CPython's source into BITS, which runs as an EFI binary. (Or as a non-EFI image bootable on a BIOS, but that version doesn't include network support.) We have almost no changes to CPython itself, other than a couple of minor fixes to enable some additional calling conventions in the ctypes module. The hardest part of porting Python in general was porting libffi to support the EFI calling convention, which re…
Porting Python to GRUB: “Networking without an operating system”
21–30 of 49 posts
Re: Porting Python to GRUB: “Networking without an operating system”
#22why 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?
I'm running Lua on a DLX like processor implemented on a fpga, in this context Lua performs the same role as Basic did on many home computers in the 80's, a small IPL is setting up the machine and loading Lua on boot.
Re: Porting Python to GRUB: “Networking without an operating system”
#23why 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 C? Or forth, or any number of alternatives. You would get the same question with the names shuffled around whichever one you chose.
/snark:off
Re: Porting Python to GRUB: “Networking without an operating system”
#24Re: Porting Python to GRUB: “Networking without an operating system”
#25Was the talk recorded and can we expect it on the Pycon 2016 youtube channel[0] at some point? It's not there right now as far as I can tell. [0] https://www.youtube.com/c/pycon2016/videos
Yes: https://www.youtube.com/watch?v=AlkKvetGFSk The first few minutes of the talk got cut off; the conference organizers have the original footage and plan to re-cut and re-upload it at some point. The talk from PyCon 2015 on the Python port itself is available as well: https://www.youtube.com/watch?v=bYQ_lq5dcvM
Anyway, thanks for the links!
Re: Porting Python to GRUB: “Networking without an operating system”
#26why 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.
Re: Porting Python to GRUB: “Networking without an operating system”
#27Re: Porting Python to GRUB: “Networking without an operating system”
#28why 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…
In C, I make frequent use of "switch" statements.
Does CPython have a switch statment?
Re: Porting Python to GRUB: “Networking without an operating system”
#29Earlier quoted context omitted.
> 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…
"... the target audience writes assembly and C)." In C, I make frequent use of "switch" statements. Does CPython have a switch statment?
Note that Lua also does not have a switch statement: http://lua-users.org/wiki/SwitchStatement .
Re: Porting Python to GRUB: “Networking without an operating system”
#30Earlier quoted context omitted.
"... the target audience writes assembly and C)." In C, I make frequent use of "switch" statements. Does CPython have a switch statment?
The context is that Lua has "several other impedance mismatches" beyond Python, not that Python-the-language is like C. Note that Lua also does not have a switch statement: http://lua-users.org/wiki/SwitchStatement .
But let's consider Lua. Most of the Lua pogrammers I know also know C. How do they handle the so-called "impedence mismatches"? (Should this be plural? What else besides 1-based arrays?)
As far as I know Lua's target audience is, at least in part, C programmers. That's why it's made to be easy to embed in a C program.