Re: Lua taking advantage of MCU MRAM

"'Martin Eden' via lua-l" <[email protected]> Thu, 30 Jul 2026 14:51:34 +0200
Newsgroups gmane.comp.lang.lua.general
Message-ID <[email protected]>
Hello Ryan,

On 2026-07-30 01:24, Regan Ryan wrote:
> Has there been any thought given to whether Lua's VM could do it=20
> transparently or whether Lua syntax could be extended to support=20
> something like <nonvolatile> in the same way that <const> has been=20
> introduced?
> Strings and bytecode would be obvious ones to consider, but some=20
> strings will have very limited lifetimes.

Since Lua 5.4 syntax allows marking variables at definition with attributes=
:

 =C2=A0 local LookupTable < magnetoresistive_memory > =3D
 =C2=A0 =C2=A0 {
 =C2=A0 =C2=A0 =C2=A0 ['abc'] =3D 'Some long string',
 =C2=A0 =C2=A0 =C2=A0 ['def'] =3D 'Another long terminal value',
 =C2=A0 =C2=A0 }

So I think extension should add that attribute to specification.
Of course this will require extension of VM instructions set.

But keep in mind that Lua strings live in global pool of uniques.
So that table definition will only allocate array of pointers
in MRAM.

-- Martin

--=20
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 e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/3b654=
da3-b745-4e6e-a59a-76301b9d07b4%40disroot.org.