News for hackers. Stuff that matters.
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by 0xffff2 on Tuesday March 07, 2023 @12:38PM (#35058350)
Why is it such a great language? As a developer entirely divorced from the gaming industry aside from occasionally dabbling in modding, lua has always seemed completely inscrutable to me when I have encountered it.
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by Tyr42 on Tuesday March 07, 2023 @02:07PM (#35059692)
The C API is pretty straightforward and has a stack object to avoid lots of reference counting you would need with Python's c API.

It's also a tiny codebase which is easy to vendor and ship.

Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by agentultra on Tuesday March 07, 2023 @02:07PM (#35059695)
Its obscenely easy/consistent memory layout. It makes embedding it into another application straight-forward and easy to manage. Extending the host interface to the embedded scripts is very simple because of this. It's also serialize-able to a degree.

Python is also a decent glue language but creating a Python interpreter is a bunch more work and the API is a bit harder to work with.

Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by guipsp on Tuesday March 07, 2023 @02:10PM (#35059744)
LuaJIT is insanely good
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by schemescape on Tuesday March 07, 2023 @02:24PM (#35059922)
It’s a tiny but capable language that’s easy to embed, and can be surprisingly fast with LuaJIT.
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by elfprince13 on Tuesday March 07, 2023 @02:25PM (#35059933)
I think the main attractions are that it has pretty minimal syntax + core libraries, does a good job binding to C FFIs, and the interpreter is fast.
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by kzrdude on Tuesday March 07, 2023 @05:03PM (#35061914)
They have a clean API for embedding. All Lua interpreter state is kept in a struct that you alloc. If you alloc two distinct structs, you have two completely independent Lua vms and you can run them on independent threads if you want to no problem, and so on. (Few language runtimes are clean in this way.)
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by cozzyd on Wednesday March 08, 2023 @01:06AM (#35065799)
yes, python is basically impossible to embed in a multithreaded app.
Re:RustPython – A Python-3 (CPython >= 3.11.0) Interpreter w... by outworlder on Tuesday March 07, 2023 @05:22PM (#35062103)
Inscrutable?

The language is _tiny_ (and kept that way on purpose)

Aside from stuff like metatables(which may require you to play around for a bit to understand their value), you can pick it up in a couple of hours. I'm not even kidding. So much so that you see people modifying code without even looking at documentation.

https://www.lua.org/manual/5.4/

https://learnxinyminutes.com/docs/lua/