Live data from Hacker News

Is it possible to write plain C iOS app in 2025?

news.ycombinator.com

41–50 of 74 posts

Re: Is it possible to write plain C iOS app in 2025?

#42

Ha I ported my c solitaire program (uses SDL2) to iOS a couple years ago and it was pretty smooth. I didn't know or think this was unusual, but I suppose most people would not start an iOS app this way.

Did you like have a shared code logic in a separate dylib which you called into or was it a single binary?

Re: Is it possible to write plain C iOS app in 2025?

#43
post #9

Earlier quoted context omitted.

Just SDL2? Do you have access to OpenGL or some sound library as well? and if so what library are you using? How do you handle input and networking?

The game was 2d, and I just used the stuff in SDL_render.h for doing the graphics. SDL2 has input stuff built in, so that is easy. I didn't need networking for my game, so I didn't have it, but networking is not particularly difficult to do cross platform (I'm assuming iOS lets you just use the "normal" sockets API?) I also used SDL2 for the sound stuff, which was mostly playing back prerecorded things, but also a li…

SDL comes with a cross platform async socket API.

Re: Is it possible to write plain C iOS app in 2025?

#44
Yes. And many are when you require a common code-base for iOS, Android, and other devices. (But C++ is used more commonly)

Video games are the ones that do this by default. It would be close to impossible to have feature parity by coding a game for iOS in Swift, for Android in Java, for Steam in C++, etc. Unreal or Unity will have C/C++ code-bases with very light integration layers to do system calls.(The payment system may have code in Objective-C, for example, but mostly a wrapper for convenience reasons)

The other extreme is to just use webapps in an electron wrapper. But electron itself is build in C++.

My guess is that most developers are going to use the default Java/Swift combination for mobile development because that is what each company taught in their websites. I would prefer, thou, that engineers were more inclined to use opensource solutions to create common interfaces and avoid vendor lock-in. But cool events and free tutorials are hard to beat.

Re: Is it possible to write plain C iOS app in 2025?

#45

If you just want to write C and are ok linking to stuff that is in other languages, then I used SDL2 for my game which I wrote in C and is on the app store. It was a very pleasant experience, and if I were doing an iOS thing again, I would likely do something similar. I think I had one objective C file in there for calling a library function I needed, but otherwise I just wrote C code.

Any tutorial?

Re: Is it possible to write plain C iOS app in 2025?

#46
post #44

Yes. And many are when you require a common code-base for iOS, Android, and other devices. (But C++ is used more commonly) Video games are the ones that do this by default. It would be close to impossible to have feature parity by coding a game for iOS in Swift, for Android in Java, for Steam in C++, etc. Unreal or Unity will have C/C++ code-bases with very light integration layers to do system calls.(The payment sys…

Before settling on Electron, I recommend exploring Tauri. It's more lightweight, it's better with sandboxing and it allows dropping down to Rust when performance is critical.

Re: Is it possible to write plain C iOS app in 2025?

#48
post #44

Yes. And many are when you require a common code-base for iOS, Android, and other devices. (But C++ is used more commonly) Video games are the ones that do this by default. It would be close to impossible to have feature parity by coding a game for iOS in Swift, for Android in Java, for Steam in C++, etc. Unreal or Unity will have C/C++ code-bases with very light integration layers to do system calls.(The payment sys…

Before settling on Electron, I recommend exploring Tauri. It's more lightweight, it's better with sandboxing and it allows dropping down to Rust when performance is critical.

Tauri v2 is very good

Re: Is it possible to write plain C iOS app in 2025?

#49
post #17
post #4

Earlier quoted context omitted.

Why do you focus on "performance" here?

Presumably because C = performance? Although I think it really depends on how you structure your program.

Yeah. Many reasons your program might be too big or too slow still apply to C.

Re: Is it possible to write plain C iOS app in 2025?

#50
post #17
post #4

Earlier quoted context omitted.

Why do you focus on "performance" here?

Presumably because C = performance? Although I think it really depends on how you structure your program.

Indeed, a programming language can't do wonders when the authors did not pay attention to algorithms and data structures.
Post reply on HN