Conversation
Notices
-
Embed this notice
I've spent all day trying to make this shit work and I'm pretty sure that Zig is not worth it. It's been beyond horrible trying to interface with C code. It's almost certainly my own limited knowledge, but I wouldn't have to do any of this shit in C. Before you pat yourself on the back for liking C, it's because C doesn't check anything. The reverse is true with Zig, I cannot get the son of a bitch to just let me use the result in the way I want when I know what it is.
- Doughnut Lollipop 【記録係】:blobfoxgooglymlem: and Jeff "never puts away anything, especially oven mitts" Cliff, Bringer of Nightmares 🏴☠️🦝🐙 🇱🇧🧯 🇨🇦🐧 like this.
-
Embed this notice
@sun someone should plot the '% of programmer time spent interfacing languages over time'. i bet it's increasing /decade
-
Embed this notice
@segfault I have a malloc function that returns ?opaqueany type but I need to pass the result into a struct that gets passed into a C function; and it keeps complaining that nothing mutates that variable. the solution is apparently to cast it but nothing I do works
-
Embed this notice
@sun what issue are you having exactly?
-
Embed this notice
@segfault the reason I am using malloc instead of a zig allocator is that 1. the c library calls malloc itself so I need to link to it anyway and 2. I don't want to write a full zig allocator that has malloc. this is an embedded device so I don't have stdlb I have a stub version of malloc that will probably kill me later
-
Embed this notice
@segfault basically I just wanted sound on this thing but to get sound I have to implement malloc so it's quickly becoming not worth it
-
Embed this notice
@segfault I don't have stdlib so not sure but the docs didn't mention a c allocator when I intrnet searched it
-
Embed this notice
@sun does std.heap.c_allocator not work?
-
Embed this notice
@segfault requires libc but I have a fake-ish malloc linked already so maybe it will just work
-
Embed this notice
@segfault I spent all day trying to fix other issues so I'll take a fresh look at it tomorrow morning
-
Embed this notice
@sun std.heap.c_allocator uses malloc from I see from a glance.
-
Embed this notice
@sun couldn't you compile for the arch on your system and link it to libc there. zig statically links everything. I've done something like that compiling for a raspberry pi. I'm not too sure how your workflow is looking like. keep us posted! :oh_my_god_i_miss_my_kettle_i_mean_really_have_you_seen_this_existence_affirming_smile_that_tells_you_everything_will_be_okay: