Thanks, this sounds interesting.
Though I meanwhile switched to another idea with events... (but
currnently still in "idea state", not yet finally implemented :) ) .
On Wednesday I had a hard day in trying to run MicroPython on my
controllers for comparison, as MicroPython says that they clearly
support "scripted" Interrupts... .
MicroPython has of course the advantage, that it is really a meanwhile
VERY dominant and popular programming method.
I was happy when I succeeded to get the source code compilation
without errors after a "hard time" Thursday, but after I gave up the
ambition to get it done by my loved Keil ARMCC and I used their gnu cc
plus MSYS2 environment for Python3.exe plus make.exe, it really
worked, also generating this "mystical" QSTR header file
automatically, which really seems to require GNUCC for automatic
generation.
... so far so "quite good"... .
In the evening then I spent some time looking at MicroPython further -
I understand that the programming style really is quite nice, I
especially liked this print function "print( ..., [optional sep=...],
[optional end=...]).... this seems to be stunningly nice in my eyes,
especially for "lazy time to time programmers", which user programmers
often are... .
But then arrived the hard BUT: The async library for cooperative
multitasking seems to be a terrible mess... I can not imagine, how a
"simple user" without much programming experience could use this for a
generating a useful and working program - further in the docs it says,
that this is still in "Beta state"... and furhter there are quite a
bit of warnings in Dr. Google, that in the large Python3 the
pre-emptive multitasking seems to be "programmed buggy", so there is a
warning to use this for secure programs / or even an urgent
recommendation to test this extremely carefully.... .
On Wednesday morning I had announced to my crew already, that they
should arrive the next day in black clothes as we might bury Lua...
but on Thursday morning after "sleepoing over this Micropython async
problems", I reufully but also of course very glad returned to Lua...
:).
Concerning Scripting applications for IoT hardware control, there are
I think three clear "difficult to implement" but very necessary
implementation requirements:
- it must compile for restriced ROM RAM. The 256kB ROM / 20kB RAM
requirement for Micropython is acceptable in time of currently
available controllers, but the 80kB ROM / 20kb RAM of my current Lua
version of course is better (also in Lua it is much easier to strip
out quite a bit of "heavy functions", as they are mainly all lib
based, and it is easy to strip the libs... MicroPython has much more
functions "as is" ... I think this can in no way be stripped down
further - Lua currently is a factor 3-4 more ROM efficient - my
minimum ROM controllers have 512kB - so also ROM quite sparse, as it
also must include the user scripts...)
- it must support cooperative multitasking in some easy and clear way,
also for "simple minded time-time programmers". MicroPython (and even
"full Python") in this aspect with this async lib seems to be
non-acceptable in my sight. In Lua also I do not like so much the
"coroutine solution", but in Lua it is straight away to remove the
corountine library and implement own task handling with resume / yield
- this is super nicely documented in Roberto's Programming in Lua book
and also programming is very straight forward.
- it must support interrupts programming in some way. Here I like the
"fix function adressing" of MicroPython - so I can imagine it
"somewhow" will work there as thtey proclaim (although therre are
warnings in Dr. Googgle, that it is generally a stupid idea, to
implement interrupts by scripting...).
... so now I will implement interrupts by "Event classes", and the
user program then has to ask the events in some thread to get the
itnerrupt infos... , best of coures in the main thready, but for
"lower priority actions" also tin the slower tasks - this then is up
to the user.
I hope that this works fine and I will report how this works when I
did it and tested the it carefully... . I am now somehow very excieted
to come back to Lua programming in the next weeks, I then will also
test the "keep bin code in ROM work" in Lua 5.5 - I hope then I get
this run quite easily with minimum Lua software code changes... . (as
the bin format now is modified such, that the functions all start 32
bit aliinged in respect to the file start, this should work).
Am Sa., 4. Okt. 2025 um 04:35 Uhr schrieb 'Martin Eden' via lua-l
<
lu...@googlegroups.com>:
> --
> You received this message because you are subscribed to the Google Groups "lua-l" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
lua-l+un...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/lua-l/79e3dcf7-8dba-40d4-abdb-d36c5df20535%40disroot.org.