Originally I was attempting to write a compatibility library so that PICO-8's version of Lua would easily be able to support standard Lua 5.2 libraries. After some extensive research, I realize that this task is actually huge (perhaps insurmountable!). I have started documenting the differences between Lua 5.2 and PICO-8's version of Lua from a lower level technical standpoint.
The purpose of this document to help folks further troubleshoot PICO-8 when coming from a scope of Lua 5.2. e.g. math.random may exist in PICO-8 as a function, but it always returns 0.
While I do have a lot of experience using Lua (and thus many of my confused frustrations with the PICO-8 variant), I do not have total knowledge of Lua.
I hope that this document can act as a guide to future PICO-8 Lua developers.
TL;DR;
Currently I am curating a list of undocumented differences between Lua 5.2 and PICO-8's Lua :
https://gist.github.com/josefnpat/bfe4aaa5bbb44f572cd0
Please offer corrections or additions!



Hey, this is very useful. Thank you for putting this together.
Can you add that to the awesome-PICO-8 list, please? :)



I assume @zep noticed this post, and released a quick update for 0.1.3 :)
If that's so, I'm glad that this got cleaned
up, but I am sad to see some commands go, like:
- tostring/tonumber
- type
- assert
- unpack
- pcall
Regardless, I have updated the document!



Damn, there goes a lot of work. Love it when an API gets smaller without a period of deprecation so all your code stops working... (sarcasm)



amazing work!!
what about collectgarbage or another GC tricks? I see it as removed in the gist but is there any way to trigger it?
Can we use weak tables? is there any way to set the table mode beside setmetatable?



I have updated I have updated this document to 0.1.6
.
@guntharpo wheeeeee!
@franciscod unless it's called by another function, I think you're SOL. Not sure though, folks can chime in here. As for weak tables, it looks like setmetatable
has been added in 0.1.6
(mind you, getmetatable
was not)
[Please log in to post a comment]