Live data from Hacker News

Porting SBCL to the Nintendo Switch

reader.tymoon.eu

51–60 of 84 posts

Re: Porting SBCL to the Nintendo Switch

#51
post #36

Earlier quoted context omitted.

> The ability to evaluate code interactively without recompilation SBCL and other implementations compile code to machine code then execute it. That is to say, when a form is submitted to the REPL, the form is not interpreted, but first compiled then executed. The reason execution finishes quickly is because compilation finishes quickly. There are some implementations, like CCL, with a special interpreter mode exclus…

> the form is not interpreted, but first compiled then executed That's TempleOS technology right there.

Other way around.

Re: Porting SBCL to the Nintendo Switch

#52
post #21
post #17

Earlier quoted context omitted.

Lisp languages seem well-suited for building games. The ability to evaluate code interactively without recompilation is a huge deal for feature building, incremental development, and bug-fixing. Retaining application state between code changes seems like it would be incredibly useful. Common Lisp also appears to be a much faster language than I would have blindly assumed. The main downside for me (in general, not jus…

There are 1980's papers about Lisp compilers competing with Fortran compilers, unfortunately with the AI Winter, and the high costs of such systems, people lost sight of it.

Well, I imagine at the time they had some LISP implementations that were very well tuned for specific high end machines, which essentially duplicated Fortran functionality. This is difficult to do for general purpose Lisps like SBCL. It was also probably very expensive.

Re: Porting SBCL to the Nintendo Switch

#53
post #9

> The answer to that is that while I would desperately like to share it all publicly, the NDA prevents us from doing so. I'm curious what the rationale here was for using the official SDK, rather than the unencumbered "homebrew" ones[0]. As a complete guess, maybe Nintendo doesn't let you officially publish games built using 3rd party SDKs? [0] https://switchbrew.org/wiki/Setting_up_Development_Environme...

You cannot publish games with homebrew, it has to use the official SDK. Besides that, almost nobody has a jailbroken Switch, so it would make it extremely hard to play any games on anything but an emulator.

You don’t let your kids jailbreak their Switch. Because it’s a damn online system, so any leaked info and Nintendo can brick the Switch. And their game states are far too valuable for the kids for that.

Re: Porting SBCL to the Nintendo Switch

#54
post #44

b/c it isn't described anywhere... SBCL - "Steel Bank Common Lisp" > Steel Bank Common Lisp (SBCL) is a high performance Common Lisp compiler. It is open source / free software, with a permissive license. In addition to the compiler and runtime system for ANSI Common Lisp, it provides an interactive environment including a debugger, a statistical profiler, a code coverage tool, and many other extensions. https://www.…

According to the Benchmarks Game, SBCL is roughly as fast as Node.

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Re: Porting SBCL to the Nintendo Switch

#55
post #36
post #17

Earlier quoted context omitted.

Lisp languages seem well-suited for building games. The ability to evaluate code interactively without recompilation is a huge deal for feature building, incremental development, and bug-fixing. Retaining application state between code changes seems like it would be incredibly useful. Common Lisp also appears to be a much faster language than I would have blindly assumed. The main downside for me (in general, not jus…

> The ability to evaluate code interactively without recompilation SBCL and other implementations compile code to machine code then execute it. That is to say, when a form is submitted to the REPL, the form is not interpreted, but first compiled then executed. The reason execution finishes quickly is because compilation finishes quickly. There are some implementations, like CCL, with a special interpreter mode exclus…

Do either CCL or SBCL have any kind of partial evaluation or tracing compilation?

Re: Porting SBCL to the Nintendo Switch

#56
post #53

Earlier quoted context omitted.

You cannot publish games with homebrew, it has to use the official SDK. Besides that, almost nobody has a jailbroken Switch, so it would make it extremely hard to play any games on anything but an emulator.

You don’t let your kids jailbreak their Switch. Because it’s a damn online system, so any leaked info and Nintendo can brick the Switch. And their game states are far too valuable for the kids for that.

Trey can ban the Switch, but offline games will continue to work. Also the account doesn't get banned, so you can buy a new one. (Speaking from experience, unfortunately) You can still play the new Zelda, just can't play Splatoon, Mario Kart, or Smash online then on the banned Switch. It's possible but arduous to rescue the saves off the banned Switch if you have access to a second modded Switch that is not banned (also speaking from experience) and use homebrew to back up and restore your saves, then launch them all from sysMMC with legitimately owned versions of those games and let the cloud save feature kick in. Animal Crossing has a separate dedicated save tool.

Block Nintendo servers, disable auto updates, use separate sysMMC and emuMMC with no unauthorized games or DLC run on the sysMMC. If you follow the main guide everyone uses now, it's pretty safe. But updating becomes a more difficult and manual process. Have to grab a zip of the new firmware from the 'net on your PC and copy it to the SD card to be installed via a homebrew method. Installing games, game updates, and DLC is similarly manual. It's not like the PS3, Vita, and 3DS(?) where you can pull it all off of official servers easily.

Oh yeah, and we're stuck with a "tethered jailbreak", that's perhaps the worst part. Any time you turn off the hacked Switch it needs to be sent a payload from your PC or phone to boot up again then.

Whether it's all worth it depends on your needs I suppose. You could get a bunch of tournament setups going with Smash (or another fighting game) + all DLC for your LAN party and save a bit of money. You can try out new singleplayer games before buying them physically. You can mod games and run emulators. Honestly the Switch scene seems largely less cool than what we had with the 3DS or Wii (Wii U was a little disappointing as well). I barely touch my Switch(es) since getting a Steam Deck.

Re: Porting SBCL to the Nintendo Switch

#57
post #21

Earlier quoted context omitted.

There are 1980's papers about Lisp compilers competing with Fortran compilers, unfortunately with the AI Winter, and the high costs of such systems, people lost sight of it.

Well, I imagine at the time they had some LISP implementations that were very well tuned for specific high end machines, which essentially duplicated Fortran functionality. This is difficult to do for general purpose Lisps like SBCL. It was also probably very expensive.

What is difficult is having Apple, Google, IBM, Microsoft, Intel, NVidia, AMD,.... compiler teams budget.

Re: Porting SBCL to the Nintendo Switch

#58
How's CL's GC performance for games nowadays? I've been slightly eyeing the upcoming Autumn Lisp Game Jam myself, but last I checked all the major libre CL impls, including SBCL, still used a full stop-the-world collector, which feels like a recipe for latency spikes. I saw flashes of stuff on sbcl-devel about someone working on a lower-latency one, but I don't know whether it got anywhere.

Re: Porting SBCL to the Nintendo Switch

#59
Great article. One question I had, not to diminish this hard work, is why not use a different implementation like ECL which is pretty portable already and can compile to static C code which can just be compiled traditionally for the target? I've been doing that for a Wasm + SDL2 game in Lisp and it's been (relatively) straightforward. I suppose performance might be a issue.

Re: Porting SBCL to the Nintendo Switch

#60

I wish the likes of Nintendo and Sony themselves finance such efforts. I mean it's one another way to create games (IP) for your console, what possibly could be the downside of starting something similar to Github Accelerator for your platform?

They did in the past and the only thing people did was to port MAME and other emulators, or copies from old 8 and 16 bit days.

That is why we cannot have nice things.

Post reply on HN