Page 1 of 2

[SUGGESTION] Python coding on HBL

Posted: Wed Feb 02, 2011 5:16 pm
by SunnyAutumn
Some of you may not know this, but there is a great programming language called Python. It is noob friendly, easy to learn and also has a simple syntax, so you won't get a lot of "stupid" errors :)
I have always wondered, there are lots of people who don't know C, but would like to be part of the HBL Dev community. Some of them can't test a lot of homebrews, some can't test newest HBL revs (who knows, why). So how can they help? And I got this idea. WHat if the HBL Devs "ported" Python to HBL as a scripting language? A bright example for that is Counter Strike 2D, which has Lua ported to it, so users can make their own mods (the game was made in Blitz3D).
So, I guess this is my suggestion :) Port Python so people, like me, could script some HBL features.
EDIT: Sorry for posting it here. Wrong forum.

Re: [SUGGESTION] Python coding on HBL

Posted: Wed Feb 02, 2011 5:35 pm
by m0skit0
You don't seem to understand what HBL is or how it works. Usually people who only touched high-level programming (Python, LUA, VB, Java...) doesn't understand what a homebrew loader actually does. HBL cannot be coded on Python because:

1) HBL is not a menu. That's wMenu or others. HBL is the core that actually loads homebrews. Menus are just a front-end. Real code is HBL core. Menus just send what homebrew should be loaded
2) Python is an interpreted language and need an interpreter. This makes it unsuitable for low-level developing such as HBL.
3) Python has no pointers.
4) Python is not as fast as C.
5) HBL needs no plugin extension. It's meant to run other homebrews, not offer fancy options. That's why there's a menu, which in fact can be coded on Python or LUA (or anything else giving it's an EBOOT).

Conclusion: if you want to develop HBL, you need to know C (very well) and PSP architecture (well).

And no, it's not wrong forum ;)

Re: [SUGGESTION] Python coding on HBL

Posted: Wed Feb 02, 2011 5:40 pm
by SunnyAutumn
Oh dang.
So, it would be just pointless to port scripting/coding languages :( Too bad.
P.S. The menu can be coded on Python? :shock: Didn't know that.

Re: [SUGGESTION] Python coding on HBL

Posted: Wed Feb 02, 2011 6:24 pm
by m0skit0
SunnyAutumn wrote:So, it would be just pointless to port scripting/coding languages
HBL can be ported to other low-level languages. For example C++, Pascal and such. You just need to find an SDK for them (AFAIK PSPSDK supports C++).
SunnyAutumn wrote:The menu can be coded on Python?
If you include a Python interpreter, I don't see why not. LUA should work as well or any other scripting language.

Re: [SUGGESTION] Python coding on HBL

Posted: Wed Feb 02, 2011 6:44 pm
by JJS
The scripting language must allow you to construct a pointer to an arbitrary memory address so that you can access the menu API. This is the only problem I could see with writing a menu in an interpreted language.

Re: [SUGGESTION] Python coding on HBL

Posted: Wed Feb 02, 2011 7:03 pm
by m0skit0
Didn't you implement an HBL API? Aren't they called like other system calls (through stubs)?

Re: [SUGGESTION] Python coding on HBL

Posted: Wed Feb 02, 2011 7:07 pm
by Strangelove
Well, games usually use LUA because the interpreter have a relatively small memory footprint. The PSP already has limited memory so slapping a big python interpreter in HBL probably won't make homebrew coders happy.

I guess LUA is ok-ish for the menu, but you'd still have to write function for graphics, image loading, HBL interface etc. so that means more space and of course work for whoever does it. Since these things can also be written in C I doubt anyone will care enough to put in the hours.

Edit: Actually most of the needed support libraries for a LUA menu should be possible to write in C. I don't know LUA's C API but if it's anything like the Python C interface it should be a thin piece of glue code.

Re: [SUGGESTION] Python coding on HBL

Posted: Wed Feb 02, 2011 7:19 pm
by JJS
m0skit0 wrote:Didn't you implement an HBL API? Aren't they called like other system calls (through stubs)?
I must shamefully admit that the new API is not yet in place :oops: .

Re: [SUGGESTION] Python coding on HBL

Posted: Wed Feb 02, 2011 7:37 pm
by SunnyAutumn
Strangelove wrote:Well, games usually use LUA because the interpreter have a relatively small memory footprint. The PSP already has limited memory so slapping a big python interpreter in HBL probably won't make homebrew coders happy.

I guess LUA is ok-ish for the menu, but you'd still have to write function for graphics, image loading, HBL interface etc. so that means more space and of course work for whoever does it. Since these things can also be written in C I doubt anyone will care enough to put in the hours.

Edit: Actually most of the needed support libraries for a LUA menu should be possible to write in C. I don't know LUA's C API but if it's anything like the Python C interface it should be a thin piece of glue code.
Grrrr! I dislike Lua for some reason. Probably because it uses a lot of "." and ",". Always got lost in those.

Re: [SUGGESTION] Python coding on HBL

Posted: Wed Feb 02, 2011 7:39 pm
by m0skit0
JJS wrote:I must shamefully admit that the new API is not yet in place :oops: .
Oh, ok ;)
SunnyAutumn wrote:Grrrr! I dislike Lua for some reason. Probably because it uses a lot of "." and ",". Always got lost in those.
That should not be a reason. Almost all programming languages use a lot of . and , For example I hate LISP's parenthesis, but it's a language I just love.