|
Zig |
Peter Hull
Member #1,136
March 2001
|
Has anyone else come across the programming language Zig?
|
Bob
Free Market Evangelist
September 2000
|
I have to say that I don't have a good reason to use C or C++ for personal projects anymore. C --> Zig The massive improvements with Zig is that it's harder to accidentally create some classes of bugs. E.g. many buffer or integer overflow bugs are caught at compile time. -- |
Peter Hull
Member #1,136
March 2001
|
Good to hear you've been working with Zig. I found it a bit tricky as the docs are not great and it's still being changed frequently. For example it's not possible to pass or return ALLEGRO_COLOR by value because of some limitations in the compiler which are due to be fixed in the future. I suspect in my zig code I've done things which are weird just because I wasn't sure of the optimal way to do them.
|
Bob
Free Market Evangelist
September 2000
|
I've only written trivial programs in Zig (basically, the examples in the website to get a feel for the language). So my experience is very limited. I typically use D or Python by default now. -- |
Niunio
Member #1,975
March 2002
|
I think Zig is the first C replacer that actually convinces me. I should test it. ----------------- |
David Couzelis
Member #10,079
August 2008
|
Peter Hull said: (also, it does have coroutines, so David will be happy!) !! I haven't heard of Zig before, I'll have to check it out! |
Doctor Cop
Member #16,833
April 2018
|
Zig is love, Zig is life. Wren is kinda also the same, but I always use C, it's my Goto unless I can't think of a solution in C and I have to choose the wicked C++. Even then I don't easily go for Zig and other languages for some reason.
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
I prefer Zag. You know, to keep 'em guessing. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
bamccaig
Member #7,536
July 2006
|
I've never heard of Zig before. That's exciting! Though I already think of Rust as a C killer. And it is pretty neat too. I hope people have interoperability on their radar so that code written in one is linkable and callable from another. Just to save on the square wheels. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Niunio
Member #1,975
March 2002
|
Ok, you can call C functions from Zig out-of-the-box, but what about the other way? I mean call Zig functions from C (or other language). Didn't found information about it. ----------------- |
Peter Hull
Member #1,136
March 2001
|
It's this section: For example, in my conversion of ex_blit to zig mentioned above, I have here export fn user_main(argc: c_int, argv: [*c][*c]u8) c_int { if (!a5.shim_init()) { abort_example("Could not init Allegro.\n"); } ... which is called by al_run_main (a C function) from Zig's own main. The signature of that function is the Zig equivalent of int user_main(int argc, char* argv[]) which will be familiar to you.
|
RmBeer2
Member #16,660
April 2017
|
Cute, another garbage language that mimics C and creates a cool name for the language. Another for the landfill. 🌈🌈🌈 🌟 BlackRook WebSite (Only valid from my installer) 🌟 C/C++ 🌟 GNU/Linux 🌟 IceCream/Cornet 🌟 🌈🌈🌈 Rm Beer for Emperor 2021! Rm Beer for Ruinous Slave Drained 2022! Rm Beer for Traveler From The Future Warning Not To Enter In 2023! Rm Beer are building a travel machine for Go Back from 2023! Rm Beer in an apocalyptic world burning hordes of Zombies in 2024! |
|