Log In  

I would like to present jspicl, a transpiler for building PICO-8 games in JavaScript!

Some of the benefits with using jspicl are that you'll be able to:

  • write your code in a language you love
  • get access to a wide range of tools and featuers in the JavaScript ecosystem (linting, es2015+, npm packages)
  • use your editor of choice (with improved code completion, refactoring, navigation)

jspicl will transpile JavaScript down to the subset of LUA that PICO-8 uses. It will include polyfills automatically in the cases where certain language features are not available.

Github repo for jspicl

A simple mario game showcasing this can be found here and more are coming.

Please let me know what you think, I would love to receive some feedback.

P#52050 2018-04-26 11:05 ( Edited 2018-04-30 06:33)

Interesting - that said games that would be candidates for complex tooling are usually the ones where a single token means life or death, something difficult to control when using a compiler.

Edit: actually, would the transpiler be smart enough to optimize code for tokens, that would become an awesome tool!

Fun fact: all my games are using a json string parser to convert data string into actual objects. Somewhat the inverse of what you did ;)

P#52053 2018-04-26 16:02 ( Edited 2018-04-26 20:38)

I agree. It's easy for the token count to skyrocket if you're not paying attention, especially if you pull in a 3rd party library. jspicl has been optimized to produce as few tokens as possible based on the AST that it's provided with.

To alleviate this further, the build tool will constantly keep you updated about how many resources you're using everytime you save (tokens/character count/filesize) and tree shaking will ensure that unused code is stripped out.

P#52164 2018-04-30 02:33 ( Edited 2018-04-30 06:33)

[Please log in to post a comment]