Getting ready to program in C with GCC on RISC OS
Paolo Fabio Zaino (28) 1882 posts |
Ok got my Lib working now, RiscLua can find my methods. I just have a minor issue with RiscLua itself not exporting its own symbols correctly. Fixing this now. |
Paolo Fabio Zaino (28) 1882 posts |
@ Gavin I need to make some dinner now, however to build RiscLua to make it export its symbols correctly you need to add the following in your Makefile:
This should make the Unknown Symbol error to go away. It is required because in Lua Lua can call functions in a plugin AND the plugin can call functions in Lua, therefore both of them must export their symbols correctly. I’ll get back at this tomorrow, but hope this fix will help you. Also if you want to use POSIX with RiscLua you can, but you need to add the followings in your risclua.h: #define LUA_USE_POSIX #include "setjmp.h" #define _longjmp longjmp #define _setjmp setjmp This will make RiscLua behave a bit more like the Lua on Linux and it should still be fully compatible with RISC OS. It’s worth a test in case you have time. |
GavinWraith (26) 1563 posts |
@Paolo Many thanks. With this advice it now seems to be working. I will do some testing of course. Hope you had a good dinner. When you have the time I would like to get your opinion on how RiscLua should develop. I very much welcome your involvement. I had been worrying that when I depart there might be nobody to continue development. You would be the ideal person to take over, if you can spare the time. My naming and numbering of versions has been all over the shop. For the present I will proceed with RiscLua86 as a version of RiscLua84 that does dynamic linking, but is otherwise the same. One more technical question, concerning the GCC tool |
Paolo Fabio Zaino (28) 1882 posts |
@ Gavin
Nice! This is a big feature offered by Lua, which makes it a bit like “BBC BASIC was with ASM”, but in a much better way, and it should still work fine when Lua is distributed as Bytecode.
With pleasure, I also have a ton of libs for Lua on Linux that I would like to port/repackage for RiscLua, there is a lot of stuff that can be very useful to the community and I also started at some point a game engine and never had the time to finish it, but it would be cool as it’s mostly in C and so it’s pretty fast leaving the coder to just have to code his stuff in Lua that makes game programming fun and no pain from C complexity.
Thanks a lot and sure. I may sound obvious here, but if that’s ok for you (please take your time to think about it) it would be nice to have RiscLua in the RISC OS Community on GitHub (I can help with that) and whoever is interested could join to make it better. Right now I can see a lot of stuff that can be added through the C Packages, the first one of which is probably going to be my wrapper for Gennan (the Deep Learning library), I stopped working on it temporarily ‘cause I had to improve its performances (so the NEON based memcpy/memmove/memset library and the NEON based Math library projects). The NEON faster memory will also potentially help other projects and could help RiscLua too to get faster when dealing with a lot of data, we’ll see how it goes.
Nice! can’t wait to get the new release :)
You can try to play with it yes, but you need to make sure that all the lualib symbols are left untouched, they are going to be used by each plugin to (at the very minimal) register their presence and function sets in Lua, so yes you have to be careful.
You can try by using “—strip-debug” and see how it goes, it is also possible to strip everything and just keep certain symbols using “—keep-symbol=symbolname”, but I would suggest to make sure you know all the required luaapi for plugins first.
There are multiple approaches to solve this, yes Absolua is one, but you can also split the actual RiscLua in two !app: 1) !RiscLua (runtime, that should be deployed in !Boot) This way you can also register a Lua file extension with ROOL (if you haven’t done it yet), so that we could start using Lua scripting in RISC OS. One of my project using RiscLua is to build a cross-platform build system for RISC OS and having Lua scripts being easy to be executed in the CLI would help a lot. I’ll put some of this work in the RISC OS Community (ROC) on GitHub so you can have a look (if you’re interested). Right now I am working on a dependencies-downloader which processes a JSON file in a ROC project repository and pulls down all the required dependencies to build such project automatically, this will definitely help to manage large projects on RISC OS and integrate it with GitHub. After that I’ll integrate libgit2 with Lua using dynamic linking, so that the tool above can pull directly from GitHub in RISC OS and then control the build. When this 2nd step is completed then I’ll integrate it with RiscPkg so that one can build a RiscPkg straight from sources and managing dependencies. And the last bit will be integration with GitHub automation and actions as well as with travis-ci. There is a reason for this which will be made public in the near future if I manage to make another crazy idea work :) Beside the above, we can have a look at Absolua and make it work again. I definitely need the RiscLua interpreter at boot and as compatible as possible with Lua on Linux (they are very well compatible, so I do not see much issues right now). Thanks! |