Log In  

After a long journey, I'm proud to present to you...

parens-8 v3!

...Along with the obligatory demo, a cart that stores its entire game code in ROM:

Cart #parens8_v3_demo-0 | 2024-03-10 | Code ▽ | Embed ▽ | No License
20

Parens-8 is a tool for bypassing the pico-8 token limit. It takes up 5% of the allowed 8192 tokens, and gives you practically infinite code space in return: store extra code in strings or cart ROM, load it during init, run it like regular Lua code.

Parens-8 is designed for maximum interoperability with Lua. Functions, tables, values and coroutines can be passed and used seamlessly between Lua and parens-8. Think of parens-8 as Lua semantics with Lisp syntax.

local a, b, c = parens8("1 2 3")
?(b == 2) -- true

local myfunction = parens8"(fn(x) (print x))"
myfunction(42) -- prints 42

-- use the lua multiline string syntax: [[]]
parens8[[
     (set foo 256)
     (set bar (fn (a b)
          (when a
               (print b)
               (print "a was false or nil")
          )
     ))
]]

bar(foo, "hello") -- prints "hello"
bar(false, "goodbye") -- prints "a was false or nil"

The new v3 implementation greatly improves on previous versions:

  • significantly faster (50-100% speedup)
  • lower memory usage
  • more extensions (variadics, table constructors, field syntax)
  • safer (no nil invisibility issue)

For more information and documentation, please refer to the parens-8 Github repository.

P#142700 2024-03-10 00:29

Nice & smooth.

P#142787 2024-03-12 08:46

[Please log in to post a comment]