lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi:

On Mon, 10 Jan 2022 at 21:12, Flyer31 Test <flyer31@googlemail.com> wrote:
> if you really want to change the VM for this, I cannot help you - this
> sounds very difficult from my point of view, much about my level (and
> of course strings / storage is really VERY deeply at the base of Lua).

That's why I was asking for prior art, and found it, seems my
jujel-foo is not as strong as it was.

> But if I understand you correctly I had a similar problem 2-3 months
> ago, and then I programmed my own string bufffer / strbuf lib, which
> meanwhile really runs perfectly and very fast and avoiding any string
> allocation / garbage collection for the strings handled by this strbuf
> lib.

It's not the same problem. I target small strings. In my code I
regularly use a couple of string/buffer class ( they are really the
same thing in lua ), one is just a wrapped std::string ( which buys
you a lot of functionality for very little code )  the other is a
buffer-gap ( or gap-buffer, I never know which is right ) which I need
due to some strange string building I use ( specially building them
backwards ). I have a couple more, for mmap files and libc fmemopens,
but I do not use them currently, and I have a "normal" ( c++, regex or
pcre depending on host ) regex libary running against all of them (
plus lua strings ). I'm well covered on big mutable strings.

> This I did with metafunction support, I described it roughly 1 month
> ago here in the forum.

I read it.

> I had the problem that I had the ambition to cut down text files for
> programming to my small STM32 controller devices, which have anly
> about 64kByte RAM available for Lua. (Lua32 5.3.4).
...

That problem domain is totally different than mine. As you may have
deduced by the "64 bit only" I have lots of available memory, I
normally fire states with associated threads by the hundreds or
thousands, and fire a couple extra docens just to arbitrate comms
among the others. Probably I waste more memory on holding
configuration files in RAM than you have available.

I was just curious after reading some discussions on TValue tagging,
did some investigation, and was htinking on speed, but lot of experts
comments pointed me to same things I missed which makes this difficult
( I asked for prior art as I thought it was impossible nobody has
considered this, alongside NaN tagging and all other stuff employed by
other VMs ).

Francisco Olarte.