Log In  


Hey folks,

I'd like to be able to parse a language (or just interpret Lua!) inside a Picotron cart. I'm aware of why this would be considered risky!

My initial thought was to look at Lua's own loadstring(), but that's not in Picotron. load() is, which one thread claims is very similar, but I can't get it to do execution of a string, or find its documentation.

I looked at lulpeg (https://github.com/pygy/LuLPeg) which someone claims to have gotten running on picotron (https://arnaught.neocities.org/blog/2025/03/14/year-of-the-picotron-desktop) but I'm having trouble with module imports and am wondering if load() will actually do what I need anyway.

  1. Is there documentation for load() anywhere and will it let me do e.g.
s = "print(1+1)"
load(s)
  1. Is there another alternative to the above approaches that might let me either write a simple DSL or interpret Lua strings at runtime?


load() returns a function that you need to call e.g.

s = "print(1+1)"
load(s)()

If you want to run the entire contents of a file, use include() instead


Haha ok that makes a lot of sense... thank you! Is this just Lua's load() then? I think I thought Picotron inserted more stuff between you and the main language.


Honestly, I'm not sure - I don't have much lua experience outside of PICO-8 or Picotron :P
Maybe you could try playing around with the other parameters and find out?



[Please log in to post a comment]