That's one of these ideas I wish I had come up with. It sounds fun to program, fun to use and even potentially useful to make cutesy gifs.

I wasn't familiar with PICO8, it seems to effectively be a faux-retro console emulator that you can use as a sandbox to build programs (that can then be exported to a web player, which is quite nifty): https://en.wikipedia.org/wiki/Pico-8

Unfortunately it's a proprietary platform.

It's $15 to be able to write programs for the platform, but you can export them to html5 to make available for others to play online for free. There's a pretty large library of such games hosted on pico-8's website.

There are some open-source alternatives like TIC-80 and PixelVision8. Personally, I'd only recommend them over pico-8 if $15 is a serious barrier or open source is an absolute must. They all have their various strengths and weaknesses, but pico-8 seems to be the best optimized for pure, unadulterated fun.

One downside of PICO-8's closed source is that it can't easily be ported to different architectures by fans, so you're limited to Windows, Linux (x86) and the Raspberry Pi (and HTML/JS, but just the player). There's no Android port.

TIC-80, on the other hand, runs more places (Android!). And someone has ported it to run on OpenDingux portable handhelds, there's a RetroArch core, etc.

That said, PICO-8 is super, super polished and absolutely worth the $15.

In Celeste, there's an easter egg that lets you play the original PICO-8 game on an in-game computer. How was this accomplished, if porting it themselves isn't possible? Did they have to remake the entire game?

They might have built their own pico-8 runtime/emulator. Alternatively, porting the game to use another Lua runtime (like LÖVE) would probably not be that hard. Ex, here's a pico-8 runtime in LÖVE:

https://github.com/picolove/picolove