nodemcu-firmware icon indicating copy to clipboard operation
nodemcu-firmware copied to clipboard

Add modules to luac.cross which do not have hardware dependencies

Open HHHartmann opened this issue 5 years ago • 6 comments
trafficstars

Missing feature

Use non HW dependent modules in luac.cross

Modules are at least: struct.c bit.c color_utils.c sjson.c // work without problems bloom.c crypto.c encoder.c // would need some more work

Justification

help creating tests and allow usage of known functionality on the host.

Workarounds

none

HHHartmann avatar Jul 22 '20 17:07 HHHartmann

file could be added without much difficulty.

pjsg avatar Jul 22 '20 21:07 pjsg

The luac.cross environment already supports os and io. I did look at adding file but decided that given we already support io, I could not see the point of doing this dev work.

struct since this is already implemented in the Lua 5.3 string library (see String pack and unpack), so it is really redundant in a 5.3 world.

Ditto for deprecating bit as these bitwise operations are natively supported in Lua 5.3.

sjson and possibly crypto.c encoder.c might make sense, but I see the main potential advantage if we have some form of LFS object so that we can use the -e option to generate Protos for saving in a multi-TLF compiled file. This way developers could create resource functions. But let me get on-ESP LFS update and two LFS regions working first, eh? Because this is going to rework luac.cross quite a lot.

TerryE avatar Jul 23 '20 00:07 TerryE

file could be added without much difficulty.

Hmm file depends on vfs which operates on SPIFFS or FAT. SPIFFS uses platform_flash_read/write to access the storage. So some work to add another blockdevice would be necessary.

HHHartmann avatar Jul 24 '20 10:07 HHHartmann

@HHHartmann Gregor, as I said: we already have io for host filesystem I/O. The one potential use for file that could be of benefit is as a wrapper around SPIFFS the same way that spiffsimg does. This way you could use Lua scripts to provision a SPIFFS on host. A well-scoped and entirely doable little project: use io to access the host FS and file to access a host-based SPIFFS image.

TerryE avatar Jul 24 '20 11:07 TerryE

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 16 '22 07:04 stale[bot]

Still would like the associated PR to get in. Is anybody willing to back this?

HHHartmann avatar May 01 '22 12:05 HHHartmann