Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration with zig cc #2010

Closed
nacho00112 opened this issue Jan 26, 2024 · 6 comments
Closed

integration with zig cc #2010

nacho00112 opened this issue Jan 26, 2024 · 6 comments
Labels
more info needed Further information is needed from the user

Comments

@nacho00112
Copy link

that would make easier to add Zig/C code to love2d projects, zig cc's cross-compilation features are VERY good, good enough to consider this imo

@slime73
Copy link
Member

slime73 commented Jan 26, 2024

Can you describe what doesn't work and what would need to change to make it work? And what sort of goals and specific platforms in mind do you have for cross-compilation? Keeping in mind most people don't ever need to compile love for any platform themselves (aside from iOS/Android support, maybe).

@flamendless
Copy link

On the top of my mind would be compilation speed if we use Zig 🤔

@nacho00112
Copy link
Author

nacho00112 commented Jan 26, 2024

Well, I want simply to be able to add optimizations through Zig if I want and then use them in lua,
I might get it to work, but I would probably need to do it manually,
I think that's an ugly solution considering that in android I have to
recompile to each architecture, so I want a build system for that,
I'm mentioning the cross-compilation because I believe that it would make
the integration easier, it seems that the Zig compiler managed to compile to android
without the android NDK https://lists.sr.ht/~andrewrk/ziglang/%20%3CCACZYt3T8jACL+3Z_NMW8yYvcJ+5oyP%3Dh1s2HHdDL_VxYQH5rzQ%40mail.gmail.com%3E

As a plus the user can also add C optimization with it

@tpimh
Copy link

tpimh commented Jan 26, 2024

I was also under impression that compiling native modules for Android would mean adding like 10 different targets including ARMv6, ARMv7, ARMv8, MIPS32, MIPS64, i686, x86_64 and probably some other...

Turns out I was wrong (I did a little bit of research here: #2008 (comment)), and Android only officially supports ARMv8 at the moment, and maybe will also support RV64 in the future.

This means the same tool chain that you use to compile for RPi for example would also work for Android. The only difference is that the binaries need to be linked against bionic instead of glibc.

@nacho00112
Copy link
Author

x86_64 is for emulator maybe?
and armv* can serve for compatibility with old devices

@slime73
Copy link
Member

slime73 commented Jan 28, 2024

Well, I want simply to be able to add optimizations through Zig if I want and then use them in lua

What sort of optimizations do you have in mind? Since love uses LuaJIT, your Lua code is JIT-compiled (on platforms where that's supported) and it also has its FFI library so you can directly call C functions or use C data structures.

So far from what's been described here, I don't really have a good picture of practical problems people ran into with current setups and how zig overcomes those problems, and how people imagine changing the compiler toolchain would actually work with love's build setup.

@slime73 slime73 added the more info needed Further information is needed from the user label Jan 31, 2024
@slime73 slime73 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed Further information is needed from the user
Projects
None yet
Development

No branches or pull requests

4 participants