Log In  

Hey.

I really like PICO-8 - it's really helpful to be able to learn a little tool, and stay inside that same tool until I finish a whole game.

However, one of my goals in playing with PICO-8 is to practice Lua.

Is there a way to turn off the PICO-8 specific syntax, so that I don't acquire "bad habits" of using += or whatever?

Thanks!

Johnicholas

P#10175 2015-04-24 07:57 ( Edited 2016-05-13 13:27)

Similarly, why is setmetatable not allowed?

P#10256 2015-04-27 14:54 ( Edited 2015-04-27 18:54)

I think most of the Lua stdlib is not included in PICO8. It's a small subset of the Lua language.

P#10259 2015-04-27 15:20 ( Edited 2015-04-27 19:20)
1

I think at some point it'd be necessary to say exactly what PICO8's Lua does and does not implement and it would be better to give it a distinct name like "Moonlet, a subset of the Lua language" to make things clear for people experienced with the language.

Unity already made the mistake of claiming it supports javascript when it doesn't. It makes no difference for people who are new to the language but it can cause a lot of frustration for experienced users who already have assumptions and expectations

P#10272 2015-04-28 01:52 ( Edited 2015-04-28 05:52)

Is there a reference to the language subset, or a manual?

P#20519 2016-05-13 06:34 ( Edited 2016-05-13 10:34)

Hi,

  • The manual is included in the distribution. See file pico8.txt.
  • setmetatable is allowed (sample)
  • Lua stdlib is not Lua it's is a library of modules for common programming tasks in Lua. Don't get confuse between Lua (the language) and Lua the standalone interpreter (linked with common librairies).

With pico-8, you have the Lua language (syntax) with pico standard library.
The syntax shortcuts are described in the manul (+=,-=,... and != for ~=). They are really welcome.

If you speak french you can find additionnal documentation here.

Kind regards,
jihem

P#20520 2016-05-13 07:14 ( Edited 2016-05-13 11:14)

I like the idea of calling the pico-8 language "Moonlet". I also think it is important to note that you will learn good programming skills, and learn how to solve problems with code. Learning how to code in general is much more valuable than learning proper lua syntax. The skills you gain from pico-8 can then be applied to any programming language!

P#20521 2016-05-13 07:55 ( Edited 2016-05-13 11:55)

Also, the shorthands aren't mandatory. You can use the lua syntaxes instead if you prefer.

P#20522 2016-05-13 08:26 ( Edited 2016-05-13 12:26)

I have to agree that the manual text file has been an open tab in my browser constantly for the past week. It covers everything you need to make a great Pico-8 game.

That being said, I have looked up some Lua when trying to solve problems. I then try those in P8 and it fails...and that reminds me, this isn't Lua, it's Pico-8.

If I want to use Lua, I should use Lua, not Pico-8.

Pico-8 isn't Lua and I don't think it wants to or is trying to be Lua. They share some DNA, sure, but they are two separate things. If I want to learn how to play guitar, I don't practice on a trumpet.

And like breadbeard mentioned, regardless what you're using, learning and practicing general programming concept and patterns is far more valuable and can be transferred. Pico-8 will make you better without even knowing it.

P#20526 2016-05-13 09:27 ( Edited 2016-05-13 13:27)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-19 08:30:17 | 0.007s | Q:20