Cross-platform sapf

thought i should mention here that i am working on a cross-platform port of sapf at GitHub - ahihi/sapf: Sound As Pure Form, cross-platform edition, with a focus on Linux right now.

not all features are ported yet, but it does make sound :slight_smile: feel free to try it out, report any issues, and join the development if you have some C++ experience!

8 Likes

Thank you very much!

I will test it today and will be in touch about this initiative.

Great news. And you needed no time to make it work.

( I can test and also have some C++ skills, and I will be glad to help)

UPDATE (after 5 minutes): It just works here (Fedora Linux). It was compiled without any problems, and the examples with audio just work.

2 Likes

This is great!
someday for windows maybe?

in theory, the code is Windows compatible, but the build process may need adjustments. i would appreciate it if someone else could take a look at this, because Windows is not one of my favorite platforms to work with :slight_smile:

2 Likes

Windows support is now in, thanks to @chairbender :slight_smile:

3 Likes

Thanks for windows support .
I followed the building instruction but do I have to install all of these :

Build started at 2025-03-22T14:56:46.946302
Main binary: C:/msys64/ucrt64/bin/python.exe
Build Options: -Dbuildtype=debug
Python system: Windows
The Meson build system
Version: 1.7.0
Source dir: C:/msys64/home/MASOUD
Build dir: C:/msys64/home/MASOUD/build
Build type: native build
Project name: sapf
Project version: undefined
WARNING: Failed to activate VS environment: Could not find C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe
-----------
Detecting compiler via: `icl ""` -> [WinError 2] The system cannot find the file specified
-----------
Detecting compiler via: `cl /?` -> [WinError 2] The system cannot find the file specified
-----------
Detecting compiler via: `c++ --version` -> [WinError 2] The system cannot find the file specified
-----------
Detecting compiler via: `g++ --version` -> [WinError 2] The system cannot find the file specified
-----------
Detecting compiler via: `clang++ --version` -> [WinError 2] The system cannot find the file specified
-----------
Detecting compiler via: `clang-cl /?` -> [WinError 2] The system cannot find the file specified

meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['c++'], ['g++'], ['clang++'], ['clang-cl']]
The following exception(s) were encountered:
Running `icl ""` gave "[WinError 2] The system cannot find the file specified"
Running `cl /?` gave "[WinError 2] The system cannot find the file specified"
Running `c++ --version` gave "[WinError 2] The system cannot find the file specified"
Running `g++ --version` gave "[WinError 2] The system cannot find the file specified"
Running `clang++ --version` gave "[WinError 2] The system cannot find the file specified"
Running `clang-cl /?` gave "[WinError 2] The system cannot find the file specified"

It’s trying to detect what compiler you have. You only need to install one of them. You should already have them if you followed step 3. Maybe because it is getting cut off by markdown it’s easy to miss.

Try running pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain

And enter to select all. Then try again.

And make sure you’re running this in the msys2 shell.

1 Like


Thanks . it works really well . :slightly_smiling_face:

1 Like

It’ll work even faster once we actually turn on optimization and port over the simd stuff! I think the current build doesn’t do any compiler optimizations, but my current PR adds them.

As a side note on my own development activities…Working on this got me really interested in learning more C++ instead of learning and fumbling as I go. I’m binging “A tour of C++” and learning so much. I find the language really fun for a change as someone who works professionally with Java.

I got a crazy idea in my head once the remaining stuff is ported over (which is my top priority, plus helping to get it up streamed if there’s interest in that). As a personal project, I was thinking about writing a compiler for sapf in c++23. Well more of a transpiler. It would basically convert the sapf code into (optimization friendly) c++ code. I’ve never written a compiler before and it always interested me and we have a shiny new language already defined. Not that the language isn’t already performant enough interpreted!

Thinking about switching to CLion… VSCode isnt cutting it and I want a cross platform IDE. Yes I used to use neovim but honestly I always end up wanting a GUI (more power to vim and emacs users though!).

Okay, enough of my rambling. I just have nobody else to talk to about this stuff haha.

3 Likes