Running code at the command line for faster iteration?


I'm on macOS. Is there a tool that will let me run PlayDate SDK-based code at the command line for faster iteration?

I want to iterate a bit faster on some non-game Lua code. The code depends on 'CoreLibs/object.' Of course it runs in the simulator just fine, but iterating (on non-game code) with the simulator is a bit slow...

There's a lot in the SDK Lua code that's not pure Lua, so the lua command doesn't Just Work.

Other suggestions are also welcome.

Sadly not, the Simulator console is probably as close as you'll get.

In the past I've done plain Lua using CodeRunner (which is an editor that runs your code on the command line and shows you output all managed through a lovely native app interface).

From there I moved the code to a Playdate project in Nova, and used the Simulator console to inspect my output as I slowly integrated SDK functions. At some point in development, my output moved from console to screen/graphics.

Also, don't forget debugDraw for printing text over your screen output.

Edit: one thing I'd like to try but am currently unable to is running the Simulator binary from the command line and seeing if the output goes to stdout/stderr. Then you could playdate.simulator.exit() in your code and you'd have what you want. (Of course you'd have to ignore the Simulator window if it popped up briefly).


I took your suggestion and tested running the simulator binary directly from the Terminal. It does exactly what you expect: logs stdout to the terminal window.

So I think I would call that an acceptable solution. Thanks for the assist!