ChanServ changed the topic of #zig to: zig programming language | https://ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
ur5us_ has quit [Ping timeout: 264 seconds]
squeek502 has joined #zig
riba has quit [Ping timeout: 272 seconds]
dongcarl1 is now known as dongcarl
<teratorn> how does one export an init() method to C? I need it to return a pointer to some abstract struct that C sees
Core3159 has joined #zig
Core3159 has quit [Read error: Connection reset by peer]
<daurnimator> teratorn: `export fn init(.....) callconv(.C) { ...... }`
<teratorn> ok, now i have an exported struct with a hashmap field, which wont compile??
Core3159 has joined #zig
<Core3159> justin_smith: since -% have wraparound semantic, -%-1 still equal -1, isn't it?
jjsullivan1 has quit [Remote host closed the connection]
<daurnimator> teratorn: you'll have to elaborate a bit. but my hunch is that you need to use only `extern` structs in your C interfaces
<daurnimator> Core3159: yes; though note that `i1` doesn't fit `1`.
Core3159 has quit [Read error: Connection reset by peer]
ur5us_ has joined #zig
Core3159 has joined #zig
<Core3159> daurnimator: so @absCast(Uint, -%x) works , just like ~@absCast(Uint, x+% -1), right?
Core3159 has quit [Read error: Connection reset by peer]
<yZ5vlALg86lP> so this is my very first zig project, thanks all for helping me out, answering my noob questions. i am sure this code has a lot of room for improvement, hence i lay it before you, i hope some of you will provide constructive feedback: https://github.com/stef/zphinx-zerver
Core3159 has joined #zig
Core3159 has quit [Read error: Connection reset by peer]
a92 has joined #zig
<marler8997__> yZ5vlALg86l, cool project
<marler8997__> inStream and outStream are deprecated, it's reader and writer now
<marler8997__> concat already exists: std.mem.concat(allocator, u8, a, b)
<marler8997__> you're using the now kinda old allocator interface, are you compiling with an old compiler?
<yZ5vlALg86lP> i still use 0.6.0
<marler8997__> 0.7.0 just release, good time to update
<yZ5vlALg86lP> it's not yet in alpine edge :/
<marler8997__> I have a tool written in Zig that downloads/manages zig compilers if you're interested: https://github.com/marler8997/zigup
<yZ5vlALg86lP> the instream/outstream thing i mostly copied from the bearssl bindings
<yZ5vlALg86lP> i'm actually packaging stuff in alpine, i might just bump the version there...
<marler8997__> yeah, it's time for all the package managers to update anyway
<marler8997__> not sure if you want to wait for 0.7.1 though..not sure how long it will take, maybe a week or so?
<marler8997__> 0.7.0 was just released, but 0.7.1 is a patch release fixing a few known issues with 0.7.0
<yZ5vlALg86lP> ah. the problem is there is no llvm11 yet in alpine...
<marler8997__> ah, well, zigup is still there for you, you may want to have it around anyway if you are doing zig development because you'll want to be able to have multiple compilers installed and the ability to switch between them
<yZ5vlALg86lP> thanks. i cloned it, will have a look at the changed interfaces you suggested
pfg_ has joined #zig
Kingsqueee has joined #zig
Kingsquee has quit [Ping timeout: 260 seconds]
aerona has quit [Quit: Leaving]
<mla> maybe obvious but im struggling here, how do i pass options to clang in compile via zig build-exe, i want to just pass through -fno-profile-arcs
aerona has joined #zig
squeek502 has quit [Remote host closed the connection]
a92 has quit [Quit: My presence will now cease]
ur5us_ has quit [Ping timeout: 260 seconds]
<mla> ok figured it out, using zig cc passes things through
ur5us_ has joined #zig
Kingsqueee has quit [Remote host closed the connection]
Kingsqueee has joined #zig
jjsullivan has joined #zig
ur5us_ has quit [Ping timeout: 260 seconds]
msingle has joined #zig
msingle has quit [Ping timeout: 240 seconds]
dimenus has joined #zig
dimenus has quit [Ping timeout: 260 seconds]
<pfg_> mla, -cflags -fno-profile-arcs -- source.c
<pfg_> also build.zig lets you do .addCSourceFile("file.c", &[_][]const u8{"-fno-profile-arcs"});
ffde has joined #zig
ffde has quit [Remote host closed the connection]
a_chou has joined #zig
a_chou has quit [Remote host closed the connection]
Jeanne-Kamikaze has joined #zig
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
Jeanne-Kamikaze has quit [Quit: Leaving]
aerona has quit [Quit: Leaving]
sord937 has joined #zig
GrooveStomp_ has quit [Ping timeout: 264 seconds]
mmohammadi9812 has quit [Quit: Quit]
waleee-cl has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #zig
earnestly has quit [Ping timeout: 260 seconds]
Ashpool has joined #zig
gazler_ has quit [Ping timeout: 264 seconds]
lucid_0x80 has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
wilsonk has quit [Quit: Leaving]
xackus_ has joined #zig
cole-h has quit [Ping timeout: 240 seconds]
radgeRayden has quit [Ping timeout: 272 seconds]
gazler_ has joined #zig
gazler__ has quit [Ping timeout: 258 seconds]
haliucinas has quit [Ping timeout: 240 seconds]
haliucinas has joined #zig
omglasers2 has joined #zig
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
earnestly has joined #zig
cow-orker has quit [Remote host closed the connection]
<ikskuh> i found a miscompilation! \o/
<ikskuh> alexnask[m], andrewrk: https://zig.godbolt.org/z/dv6T7x is this a known problem?
<alexnask[m]> Not that I know of
<alexnask[m]> ALthough, something just popped into my mind, let me look it up for a second
msingle has joined #zig
<alexnask[m]> Ah, I think this is what I was thinking of: https://github.com/ziglang/zig/issues/3882 (which is unrelated)
<ikskuh> i created an issue for that
<ikskuh> luckily i could reproduce it easily :±
wootehfoot has joined #zig
lltt has quit [Ping timeout: 256 seconds]
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
cow-orker has joined #zig
Ashpool_ has joined #zig
Ashpool has quit [Ping timeout: 258 seconds]
<ikskuh> aaand a new PR \o/
tane has joined #zig
Kingsqueee has quit [Remote host closed the connection]
msingle has quit [Ping timeout: 240 seconds]
lucid_0x80 is now known as kacak
linux-newbie2020 has joined #zig
neceve has joined #zig
<ikskuh> daurnimator: i think your filename[1..filename.len-1] is harder to understand
<ikskuh> it doesn't convey that much intent
<daurnimator> okay
<ikskuh> i've changed the gitignore thingy
<ikskuh> any technical objections?
<daurnimator> nope
<daurnimator> LGTM
<ikskuh> lgtm?
<dutchie> looks good to me
<ikskuh> ah, thanks :)
msingle has joined #zig
linux-newbie2020 has quit [Quit: leaving]
LanceThePants has quit [Read error: Connection reset by peer]
dimenus has joined #zig
sawzall has joined #zig
dimenus has quit [Client Quit]
<g-w1> is merge error sets lazy (merge the sets before analyzing them) or non lazy (analyze both sets first and then merge them)? what should it be?
donniewest has joined #zig
marnix has quit [Ping timeout: 260 seconds]
marnix has joined #zig
donniewest has quit [Client Quit]
donniewest has joined #zig
waleee-cl has joined #zig
nvmd has joined #zig
kristoff_it has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
moo has joined #zig
wootehfoot has quit [Ping timeout: 246 seconds]
cole-h has joined #zig
nvmd has quit [Ping timeout: 258 seconds]
nvmd has joined #zig
skuzzymiglet has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
hnOsmium0001 has joined #zig
aerona has joined #zig
Ashpool_ has quit [Quit: Leaving]
<andrewrk> fengb, not sure if you are aware but LemonBoy just fixed an old ass bug that was making ReleaseSmall not actually do small
<BaroqueLarouche> haha "Brilliant. By now I should have dozens of diplomas after being schooled by LemonBoy so many times."
GrooveStomp_ has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
xackus_ has quit [Ping timeout: 260 seconds]
tane has quit [Quit: Leaving]
casaca has quit [Remote host closed the connection]
<fengb> :o
casaca has joined #zig
xackus_ has joined #zig
<xackus_> i'd like to take a shot at implementing astgen for continue. should it be implemented with BreakVoid?
sord937 has quit [Quit: sord937]
kacak has quit [Ping timeout: 264 seconds]
<GrooveStomp_> What's the idiomatic way to convert a c string into []u8 ?
<ikskuh> std.mem.span()
<ikskuh> will return []const u8
<GrooveStomp_> Wow! Thanks! :-D
<GrooveStomp_> Man, I'd love to help with the standard library documentation.
<g-w1> is the only reason that it doesn't work the lazy evaluation?
<andrewrk> the work has to be partially re-done in self-hosted, so I didn't push it beyond a proof-of-concept
<g-w1> ah
<demizer> i could also help with stdlib docs, no idea where to even begin. :D
radgeRayden has joined #zig
ur5us_ has joined #zig
xackus_ has quit [Ping timeout: 260 seconds]
<demizer> hey all, I am trying to add line numbers to my log output so it's easier to debug, see https://hastebin.com/qiruqulilu.zig. I am using @returnAddress() with a hacked up stacktrace, but it's not getting the correct line from where the prints are called in main. Does anyone have any suggestions how to overcome this? I think this should be a feature in the logging library and am more than happy to open a
<demizer> ticket. It's much quicker to go straight to the problem when debugging than grepping for the message when debugging an issue in prod. ;-)
<demizer> hey all, I am trying to add line numbers to my log output so it's easier to debug, see https://hastebin.com/qiruqulilu.zig. I am using @returnAddress() with a hacked up stacktrace, but it's not getting the correct line from where the prints are called in main. Does anyone have any suggestions how to overcome this? I think this should be a feature in the logging library and am more than happy to open a
<demizer> ticket. It's much quicker to go straight to the problem when debugging than grepping for the message when debugging an issue in prod. ;-)
<demizer> hey all, I am trying to add line numbers to my log output so it's easier to debug, see https://hastebin.com/qiruqulilu.zig. I am using @returnAddress() with a hacked up stacktrace, but it's not getting the correct line from where the prints are called in main. Does anyone have any suggestions how to overcome this? I think this should be a feature in the logging library and am more than happy to open a
<demizer> ticket. It's much quicker to go straight to the problem when debugging than grepping for the message when debugging an issue in prod. ;-)
<demizer> hey all, I am trying to add line numbers to my log output so it's easier to debug, see https://hastebin.com/qiruqulilu.zig. I am using @returnAddress() with a hacked up stacktrace, but it's not getting the correct line from where the prints are called in main. Does anyone have any suggestions how to overcome this? I think this should be a feature in the logging library and am more than happy to open a
<demizer> ticket. It's much quicker to go straight to the problem when debugging than grepping for the message when debugging an issue in prod. ;-)
<demizer> oh craps, sorry guys my window was scrolled up
xackus_ has joined #zig
lltt has joined #zig
<pfg_> demizer, @src() can tell you line numbres, I'm not sure if that's what you want
<pfg_> oh you want to get the line number without passing in something like `@src()`
<pfg_> the stacktrace you are printing is only showing the line in std.log for me and nothing else
<pfg_> demizer, try std.debug.writeCurrentStackTrace. you will then have to search through that to find the place where log was called
<pfg_> or you can use a StackIterator directly
<pfg_> that way you can get the value directly instead of writing a bunch of text out to an arraylist and searching through the arraylist to find what you want
<demizer> sweet, thanks pfg_, i'll see if i can make that work
cole-h has quit [Ping timeout: 260 seconds]
neceve has quit [Ping timeout: 260 seconds]
moo has quit [Quit: Leaving]
wootehfoot has joined #zig
decentpenguin has quit [Ping timeout: 264 seconds]
frmdstryr has quit [Read error: No route to host]
frmdstryr has joined #zig
msingle has quit [Read error: Connection reset by peer]
frmdstryr has quit [Ping timeout: 256 seconds]
kristoff_it1 has joined #zig
decentpenguin has joined #zig
kristoff_it has quit [Ping timeout: 258 seconds]
marnix has quit [Ping timeout: 258 seconds]
frmdstryr has joined #zig
zippoh has quit [Ping timeout: 272 seconds]
zippoh` has joined #zig
ur5us_ has quit [Ping timeout: 260 seconds]
omglasers2 has quit [Read error: Connection reset by peer]
omglasers2 has joined #zig
jjsullivan1 has joined #zig
ur5us_ has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
tane has joined #zig
Amun_Ra has quit [Ping timeout: 264 seconds]
donniewest has quit [Quit: WeeChat 3.0]
wilsonk has joined #zig
wilsonk is now known as Guest9767
nvmd has quit [Ping timeout: 240 seconds]
Amun_Ra has joined #zig
skuzzymiglet has quit [Ping timeout: 260 seconds]
omglasers2 has quit [Read error: Connection reset by peer]
skuzzymiglet has joined #zig
ur5us_ has quit [Ping timeout: 264 seconds]
tane has quit [Quit: Leaving]
skuzzymiglet has quit [Ping timeout: 260 seconds]
wootehfoot has quit [Read error: Connection reset by peer]