Porting SBCL to the Nintendo Switch
Charles Zhang's team is porting SBCL to the Nintendo Switch, facing technical challenges and incurring $17,000 in costs. They seek community support to complete the project after successfully executing Lisp code.
Read original articleCharles Zhang and his team have been working on porting the SBCL (Steel Bank Common Lisp) runtime to the Nintendo Switch for the past two years, primarily to run their game engine, Trial. The project has faced significant challenges, particularly in adapting to the Switch's proprietary operating system and its unique constraints, such as issues with garbage collection and audio output. Despite these hurdles, they have successfully compiled and executed Lisp code on the Switch, interfaced with shared libraries, and set up the necessary graphics context using OpenGL. However, the project has incurred costs of approximately $17,000, which the developer has been funding through sales of their game, Kandria, and donations. The financial strain has raised concerns about the feasibility of continuing the project, especially given the limited income from game sales. The Switch's environment, which runs on an ARM64 Cortex-A57 chip and lacks a traditional shell or compiler suite, complicates the porting process. The team has developed a workaround to compile Lisp code on a Linux host while simulating the Switch environment. They have also utilized SBCL's immobile-code and elfinator features to adapt the code for the Switch's requirements. The developer is seeking support through platforms like Patreon to help overcome the remaining challenges and complete the port.
- The porting of SBCL to the Nintendo Switch has faced significant technical challenges.
- The project has cost approximately $17,000, funded by game sales and donations.
- The Switch's proprietary operating system complicates the development process.
- The team has successfully executed Lisp code and set up graphics using OpenGL.
- Support from the community is sought to help complete the project.
Related
The Nintendo Switch Is Bringing Out the Big Guns Against Piracy
Nintendo escalates anti-piracy efforts against Switch piracy facilitators through lawsuits. Legal actions target Modded Hardware site and "Archbox" subreddit operator. Nintendo aims to protect IP and revenue amid upcoming game releases.
Rust on Dreamcast
Rust, a popular systems programming language, is being adapted for Dreamcast's SuperH architecture. Developers can use rustc_codegen_gcc and gccrs to compile Rust programs with core and alloc support. Ongoing improvements aim for full std functionality.
Doom on Playdate
Nic Magnier successfully ported Doom to the Playdate, facing challenges with makefiles and compilers. He plans to enhance controls and optimize the game, aiming to integrate features like using the crank for interactions. Despite encountering crashes, Nic remains committed to refining the port. The community eagerly awaits further developments.
Better Firmware with LLVM/Clang
LLVM and Clang are gaining traction in embedded software development, particularly for ARM Cortex-M devices. The article advocates integrating Clang for better static analysis, error detection, and dual compiler usage.
Porting My JavaScript Game Engine to C for No Reason
Dominic Szablewski announced the high_impact game engine, a C port of his Impact JavaScript engine, designed for 2D action games, supporting multiple platforms and featuring essential game development tools.
- Users express interest in the potential of using SBCL for game development on the Switch, questioning its utility compared to popular engines.
- Several commenters share their positive experiences with Lisp and the Trial framework, emphasizing the benefits of real-time game development.
- There are discussions about the technical challenges of using official SDKs versus homebrew options, with some questioning the rationale behind these choices.
- Commenters highlight the significance of the project and express admiration for the developers' efforts, wishing for more support from companies like Nintendo.
- Concerns about performance, particularly regarding garbage collection in Common Lisp for gaming, are raised, indicating a need for further exploration in this area.
I hope this port succeeds.
I'm also surprised (in a good way) that Shinmera is working on this - I've seen him a few times before on #lispgames and in the Lisp Discord, and I didn't know that he was into this kind of low-level development. I've looked at the guts of SBCL briefly and was frightened away, so kudos to him.
I wonder if SBCL (+ threading/SDL2) works on the Raspberry Pi now...
As an aside, reading about this kind of deeply interesting work always makes me envious when I think about the rote software I spend all day writing :)
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...
Context: Naughty Dog used a custom Lisp-alike (GOAL) to build the Jak & Daxter series on PS2. They left enough debugging information in that it was possible to reverse engineer. The OpenGOAL project has done so, and these games can now be run on all platforms that their GOAL compiler gets ported to (x86 for now AFAIK). Would be cool to port this to the Switch.
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.
Porting Yuzu to Nintendo Switch
Related
The Nintendo Switch Is Bringing Out the Big Guns Against Piracy
Nintendo escalates anti-piracy efforts against Switch piracy facilitators through lawsuits. Legal actions target Modded Hardware site and "Archbox" subreddit operator. Nintendo aims to protect IP and revenue amid upcoming game releases.
Rust on Dreamcast
Rust, a popular systems programming language, is being adapted for Dreamcast's SuperH architecture. Developers can use rustc_codegen_gcc and gccrs to compile Rust programs with core and alloc support. Ongoing improvements aim for full std functionality.
Doom on Playdate
Nic Magnier successfully ported Doom to the Playdate, facing challenges with makefiles and compilers. He plans to enhance controls and optimize the game, aiming to integrate features like using the crank for interactions. Despite encountering crashes, Nic remains committed to refining the port. The community eagerly awaits further developments.
Better Firmware with LLVM/Clang
LLVM and Clang are gaining traction in embedded software development, particularly for ARM Cortex-M devices. The article advocates integrating Clang for better static analysis, error detection, and dual compiler usage.
Porting My JavaScript Game Engine to C for No Reason
Dominic Szablewski announced the high_impact game engine, a C port of his Impact JavaScript engine, designed for 2D action games, supporting multiple platforms and featuring essential game development tools.