<andrewrk>
in master branch, you can easily stack overflow by trying to write "[[[[[[[[[[[[[" (repeated some more)
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 260 seconds]
<companion_cube>
so by using async, how does the recursion happen? it's in the event loop's queue?
<andrewrk>
nah, forget the event loop
<andrewrk>
"async" only means the function's stack frame is provided externally. you might say it is "asynchronously allocated"
<companion_cube>
heh, cool. So just have your own queue or stack or bump allocator, and push the function frame into it? neat.
<andrewrk>
exactly
<companion_cube>
this might actually out-FP the FP languages
<fengb>
How so?
<andrewrk>
if you heap-allocate the frame, the code will have the same structure as recursion, but it will probably now take an allocator parameter, and return a possible error.OutOfMemory
<companion_cube>
well it's hard to write *robust* recursive code if you're dependent on the stack size
<fengb>
I agree but most FP languages like to ignore the stack entirely
<companion_cube>
not that I know of, really, except maybe Haskell?
<companion_cube>
(it's definitely a common issue in the ML family)
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 272 seconds]
<andrewrk>
IMO this is sort of where you arrive naturally when reconciling these 2 facts: (1) memory, including stack space, is a limited resource (2) programmers need recursion
<andrewrk>
programming languages which have hidden memory allocation do not recognize point (1)
<andrewrk>
this is an area where zig will be safer than rust (or at least has 1 less foot gun)
<andrewrk>
rust detects stack overflow and panics, but it does not provide a way to do have heap-based recursion
Zannzen has joined #zig
marijnfs has quit [Ping timeout: 240 seconds]
marijnfs_ has joined #zig
<pixelherodev>
Even heap is limited, though admittedly not in a truly comparable manner
mahmudov has quit [Ping timeout: 256 seconds]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 260 seconds]
<jaredmm>
If I'm using c_ushort in a comptime block, is that going to be sized according to the host or target platform?
<seoushi>
I couldn't get into rust. It's too opinionated. Sure if I use the borrow checked and lifetimes then my code is safe but I never really had those issues to begin with and now my "unsafe" code is a terrible thing to work with. Maybe if I gave more time into learning it I would have a better opinion, I dunno.
<fengb>
I wasn’t smart enough to learn Rust :/
<seoushi>
I will say that it has a ton of support a lot of good tooling tho.
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 268 seconds]
return0e has quit [Remote host closed the connection]
<andrewrk>
jaredmm, plumm is correct. comptime emulates the target - all the way down to cpu quirks (although admittedly there is no current cpu quirk emulated)
<andrewrk>
but point being comptime is aware of what cpu is being targeted
<companion_cube>
seoushi: wow, you never had memory issues? :D
<seoushi>
companion_cube, well of course I did but those took 5 minutes to clear up in valgrind
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 260 seconds]
<companion_cube>
so you never hd the magic segfault that happns somewhere else? :p
<seoushi>
My point is that sure memory issues happen but usualy they are easy to deal with and not a huge issues. The borrow checker and lifetimes however were a pain in the ass to deal with in rust. I'm sure if i took more time to leanr rust it would be better but I dunno. I still hear a lot of rust devs complain of the same thing that are far more experianced in the language than I am
lunamn has quit [Ping timeout: 256 seconds]
lunamn has joined #zig
<companion_cube>
if they happen quickly, that is. rust is supposed to shine in multithreaded programs :)
<fengb>
And larger programs with potentially less experienced engineers
<companion_cube>
yeah, not everyone is experienced with C :/
<fengb>
Only takes one leak for a massive hunting party :P
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 260 seconds]
<fengb>
Random aside: apparently DK64 had a leak they couldn’t fix for the holiday release so they bundled the expansion pack as a quick solution
<seoushi>
I didn't hear of that before but I know I had the expansion for turok before dk64 came out :)
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 265 seconds]
<plumm>
fengb: i work in rust professionally and you are leagues ahead, its not a smartness thing rather a will thing
<fengb>
I only pretend to know what I’m doing here
<fengb>
But I do agree. It was one of the hardest languages I tried to learn and I didn’t end up pushing through it
<mikdusan>
Xcode 11.4 beta download: 8.04 GiB -- and folks once thought ISDN 2B+D was the bomb
<seoushi>
Yeah I can see that. once you get in the mindset I'm sure it's a brillant language. it's just super abrasive up front
<seoushi>
I feel the same way about haskell too hah
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 260 seconds]
<jaredmm>
Anyone have an example of calling wprintf in Zig? I'm getting output that doesn't match the C code. Trying to determine where I screwed up.
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 268 seconds]
seoushi has quit [Ping timeout: 256 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 272 seconds]
Zannzen has quit [Remote host closed the connection]
waleee-cl has quit [Quit: Connection closed for inactivity]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 260 seconds]
return0e has joined #zig
return0e has quit [Ping timeout: 272 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 256 seconds]
rjtobin has quit [Quit: Leaving]
marijnfs_ has quit [Ping timeout: 240 seconds]
marijnfs has joined #zig
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 260 seconds]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 260 seconds]
<daurnimator>
jaredmm: calling C vararg functions is unsupported I thought
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 265 seconds]
<mokafolio>
is there an online playground to play around with zig?
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 256 seconds]
<mokafolio>
is there an online playground to play around with zig?
<mokafolio>
woops sorry for double post
<daurnimator>
mokafolio: https://godbolt.org/ supports zig. that's the only one I really know of right now
<mokafolio>
awesome thanks, will check it out
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 272 seconds]
_Vi has quit [Ping timeout: 256 seconds]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 256 seconds]
return0e has joined #zig
notjones has joined #zig
return0e has quit [Ping timeout: 268 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 240 seconds]
_whitelogger has joined #zig
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 256 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 256 seconds]
<pixelherodev>
Anyone have a good, working example of reading from a file into a buffer and increasing buffer size when StreamTooLong is encountered?
<pixelherodev>
My current method works ~99% of the time
<pixelherodev>
But the combination of buffering the input stream and using `seekBy(-1)` on the file doesn't seem to end well
<daurnimator>
.readAllAlloc
<pixelherodev>
Yeah but that's out of the question too
<pixelherodev>
I'm reading lines
<daurnimator>
.readUntilDelimiter
<pixelherodev>
readUntilDelimiterOrEof discards a byte when StreamTooLong is encountered
<daurnimator>
.readUntilDelimiterAlloc
<pixelherodev>
Requires allocation for each read
<pixelherodev>
Whereas currently the buffer is reused
<daurnimator>
huh?
<daurnimator>
it should reuse the buffer as long as you have the same max size
<pixelherodev>
Since there's tens of thousands of lines, readUntilDelimiterAlloc will make tens of thousands of allocs
<pixelherodev>
Better solution: shouldn't read the byte unless there's space
<pixelherodev>
Short term solution: default buffer size to currently needed size * 8
<pixelherodev>
Allocation 32KB is relatively trivial compared to the cost of it malfunctioning
<pixelherodev>
Or it could reset the bufferedstream...
ky0ko_ has quit [Ping timeout: 265 seconds]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 240 seconds]
dddddd has quit [Ping timeout: 260 seconds]
<pixelherodev>
`Token{ .token_type = TokenType.MetadataNamed, .index = 61961, .len = 12297829382473034410 }` I get the strangest feeling that that long length is just 8 bytes of `0xAA`
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 240 seconds]
<mikdusan>
Canadian token?
<pixelherodev>
Forgot to actually set the length on some tokens :P
<pixelherodev>
Nice little bit is that this is actually faster despite having removed some rather shortsighted lexer optimizations
<pixelherodev>
(e.g. i8** now gives three tokens, Type and two Asterisks, instead of a single Type token)
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #zig
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 256 seconds]
mahmudov has joined #zig
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 240 seconds]
return0e has joined #zig
plumm has quit [Read error: Connection reset by peer]
return0e has quit [Ping timeout: 260 seconds]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 260 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 240 seconds]
metaleap has joined #zig
mahmudov has quit [Ping timeout: 240 seconds]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 268 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 240 seconds]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 240 seconds]
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
return0e has joined #zig
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 260 seconds]
snappy has joined #zig
<snappy>
What's the favourite tutorial documentation to get acquainted with zig?
<mq32>
is it possible to add more code to a already existing pull request?
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 272 seconds]
_Vi has joined #zig
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 268 seconds]
jjido has joined #zig
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 260 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 260 seconds]
_Vi has quit [Ping timeout: 256 seconds]
<daurnimator>
snappy: home page?
<daurnimator>
not so much tutorial I guess
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 260 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 268 seconds]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 260 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 260 seconds]
mahmudov has quit [Ping timeout: 260 seconds]
<SyrupThinker>
mq32: push to your branch
marijnfs_ has quit [Ping timeout: 240 seconds]
marijnfs has joined #zig
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 256 seconds]
jjido has quit [Quit: Connection closed for inactivity]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 260 seconds]
dddddd has joined #zig
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 240 seconds]
_whitelogger has joined #zig
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 272 seconds]
<betawaffle>
is there a right way to declare the last field in a struct as something that will be used to represent a runtime-known length of data? basically i want a field that's zero size, but will be used as a handle to that location, for a ptrCast later
<mq32>
SyrupThinker, not my pull request ^^
<mq32>
betawaffle, no, that is not possible in zig atm
<betawaffle>
k
marijnfs_ has joined #zig
<mq32>
but you can use a struct and pointer arithmetic
<mq32>
not a nice solution
<mq32>
also you have to do all alignment by hand
marijnfs has quit [Ping timeout: 256 seconds]
marmotini_ has joined #zig
<betawaffle>
is it possible to set the tag value of a union member without defining a separate enum type?
<metaleap>
betawaffle: the enum gets inferred without explicit extra definition via `union(enum) { tag1: ..., tag2: ... }`
<metaleap>
and then to get the "enum `type`" still, @TagType for the union will provide
marmotini_ has quit [Ping timeout: 268 seconds]
<betawaffle>
right, i know that
<betawaffle>
but my enum needs to have explicit values
marijnfs has joined #zig
<mq32>
betawaffle: then, no
<mq32>
it's not possible with explicit enum values
marijnfs_ has quit [Ping timeout: 260 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 272 seconds]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 268 seconds]
marijnfs has quit [Ping timeout: 240 seconds]
marijnfs has joined #zig
<betawaffle>
will zig "do the right thing" when dereferencing a `*const align(1) T` when `@alignOf(T)` is greater than 1?
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 260 seconds]
lunamn has quit [Ping timeout: 256 seconds]
lunamn has joined #zig
snappy has quit [Ping timeout: 256 seconds]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 272 seconds]
snappy has joined #zig
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 260 seconds]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 246 seconds]
lunamn has quit [Ping timeout: 240 seconds]
lunamn has joined #zig
return0e has quit []
return0e_ has joined #zig
return0e_ has quit [Ping timeout: 272 seconds]
drp has quit [Read error: Connection reset by peer]
mahmudov has joined #zig
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 246 seconds]
drp has joined #zig
seoushi has joined #zig
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 265 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 268 seconds]
Akuli has joined #zig
knebulae has quit [Read error: Connection reset by peer]
return0e has joined #zig
return0e has quit [Ping timeout: 240 seconds]
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 260 seconds]
<andrewrk>
betawaffle, yes that is a safe, well-defined operation
<betawaffle>
cool, thanks
<andrewrk>
jaredmm, daurnimator calling C vararg functions has been supported forever- there's an example of calling printf in the lang ref
<andrewrk>
I believe daurnimator is thinking of exporting C var args, which is planned but not implemented
return0e has joined #zig
waleee-cl has joined #zig
marijnfs has quit [Ping timeout: 240 seconds]
marijnfs_ has joined #zig
return0e_ has joined #zig
return0e_ has quit [Client Quit]
<jaredmm>
I was looking at #4325. I have a comptime function that creates a null terminated utf16le array of [*c]c_ushort (or should). Was trying to think of ways to test it.
<jaredmm>
Obviously making sure the output bytes match the expected bytes for automated testing. For actually interfacing with the Windows APIs. I can call extern Windows APIs with [*c]c_ushort, but most example usages I saw were using LPCWSTR.
<jaredmm>
std/os/windows.zig indicates that the wrapper APIs should accept slices and null-terminated UTF16LE buffers.
<jaredmm>
byte buffers
seoushi has quit [Ping timeout: 268 seconds]
Akuli has quit [Ping timeout: 260 seconds]
_Vi has joined #zig
return0e has quit []
return0e_ has joined #zig
marijnfs_ has quit [Ping timeout: 240 seconds]
marijnfs has joined #zig
ur5us has joined #zig
ur5us has quit [Read error: Connection reset by peer]
metaleap has quit [Read error: Connection reset by peer]
metaleap has joined #zig
ur5us has joined #zig
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 260 seconds]
<mikdusan>
andrewrk: is `IrExecutableSrc.owner_exec` still a thing? I grep'd `owner_exec` for usage sites and doesn't seem like it's needed?
<andrewrk>
mikdusan, now that IrExecutable is separated into Src and Gen, all the fields need auditing to see which are actually needed for each thing
<andrewrk>
I didn't do that auditing yet
<mikdusan>
ah ok
<andrewrk>
so, I think you found a good candidate to delete :)
<andrewrk>
how's the memory overhaul stuff coming along?
<betawaffle>
what's the memory overhaul stuff?
<mikdusan>
right now I'm trying to attach an arena to IrExecutableSrc and see how much stuff can safely go in there :)
<andrewrk>
mikdusan, are you aware of ir.cpp:767-768 ?
<andrewrk>
I can shed some light on this
<mikdusan>
please do. This is the comment that had me pause at remove .owner_exec field
<andrewrk>
actually I forgot exactly, would need to refresh my memory. it has something to do with lazy values but after the "mem slot" cleanup thing I did, I think it might have changed things
<mikdusan>
on master, owner_exec is assigned to and referenced only in 2 places
<andrewrk>
oh hell yes, I think we can uncomment that destroy() and remove owner_exec. this is something that was solved by https://github.com/ziglang/zig/pull/4152
<mikdusan>
awesome
<mikdusan>
emergent cleanup made possible by tech debt payoff
<andrewrk>
yep :)
<andrewrk>
which reminds me though I still need to figure out the regression for dbandstra's oxid project
<andrewrk>
it's a nasty one. complex comptime code, and the assertion failure does not make the problem obvious
<mikdusan>
betawaffle: stage1 doesn't do much free() of any memory; and there's not too much benefit into making it do so considering self-hosted roadmap. but until then, we do run up on large heap requirements during testing.
rjtobin has joined #zig
<mikdusan>
and so here and there, we're trying to pick some low hanging fruit on stage1 and free gobs of memory
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 268 seconds]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 246 seconds]
notjones has quit [Quit: Lost terminal]
<mikdusan>
oh Xcode's lldb joins the ranks of xterm-color support. finally
<andrewrk>
woo
marmotini_ has joined #zig
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #zig
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 240 seconds]
marmotini_ has quit [Remote host closed the connection]
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 240 seconds]
ky0ko has quit [*.net *.split]
via has quit [*.net *.split]
m6w6 has quit [*.net *.split]
bkleiner has quit [*.net *.split]
betawaffle has quit [*.net *.split]
so has quit [*.net *.split]
betawaffle has joined #zig
ky0ko has joined #zig
m6w6 has joined #zig
via has joined #zig
bkleiner has joined #zig
so has joined #zig
seoushi has joined #zig
m6w6 has quit [Max SendQ exceeded]
so has quit [Max SendQ exceeded]
so has joined #zig
m6w6 has joined #zig
alva has quit [*.net *.split]
Snektron has quit [*.net *.split]
AlexMax has quit [*.net *.split]
Dominic[m] has quit [*.net *.split]
jmiven has quit [*.net *.split]
cncl has quit [*.net *.split]
l1x has quit [*.net *.split]
strmpnk has quit [*.net *.split]
meowray has quit [*.net *.split]
dch has quit [*.net *.split]
tyler569 has quit [*.net *.split]
programi1 has quit [*.net *.split]
bgiannan has quit [*.net *.split]
JX7P has quit [*.net *.split]
Flaminator has quit [*.net *.split]
crimson_penguin has quit [*.net *.split]
Yardanico has quit [*.net *.split]
rappet has quit [*.net *.split]
mgxm has quit [*.net *.split]
mikdusan has quit [*.net *.split]
mixi has quit [*.net *.split]
tines9 has quit [*.net *.split]
D3zmodos has quit [*.net *.split]
hryx has quit [*.net *.split]
jmiven has joined #zig
Yardanico has joined #zig
alva has joined #zig
D3zmodos has joined #zig
Snektron has joined #zig
hryx has joined #zig
AlexMax has joined #zig
Dominic[m] has joined #zig
meowray has joined #zig
mikdusan has joined #zig
tines9 has joined #zig
bgiannan has joined #zig
programi1 has joined #zig
Flaminator has joined #zig
crimson_penguin has joined #zig
l1x has joined #zig
cncl has joined #zig
strmpnk has joined #zig
mgxm has joined #zig
JX7P has joined #zig
tyler569 has joined #zig
dch has joined #zig
mixi has joined #zig
rappet has joined #zig
waleee-cl has quit [*.net *.split]
snappy has quit [*.net *.split]
qazo has quit [*.net *.split]
wilsonk has quit [*.net *.split]
mokafolio has quit [*.net *.split]
shakesoda has quit [*.net *.split]
occivink has quit [*.net *.split]
terinjokes has quit [*.net *.split]
jrl has quit [*.net *.split]
strmpnk has quit [Ping timeout: 247 seconds]
jrl has joined #zig
terinjokes has joined #zig
waleee-cl has joined #zig
qazo has joined #zig
snappy has joined #zig
wilsonk has joined #zig
mokafolio has joined #zig
occivink has joined #zig
shakesoda has joined #zig
dch has quit [Ping timeout: 246 seconds]
BitPuffin has quit [Ping timeout: 240 seconds]
m6w6 has quit [*.net *.split]
letoram has quit [*.net *.split]
mmx870 has quit [*.net *.split]
cbarrett has quit [*.net *.split]
karrick has quit [*.net *.split]
SyrupThinker has quit [*.net *.split]
hryx has quit [Ping timeout: 240 seconds]
alva has quit [Ping timeout: 246 seconds]
l1x has quit [Ping timeout: 246 seconds]
cbarrett has joined #zig
snappy has quit [Max SendQ exceeded]
mmx870 has joined #zig
fengb has quit [Ping timeout: 258 seconds]
AlexMax has quit [Ping timeout: 246 seconds]
Dominic[m] has quit [Ping timeout: 246 seconds]
pmwhite has quit [Ping timeout: 252 seconds]
dtz has quit [Ping timeout: 245 seconds]
SyrupThinker has joined #zig
m6w6 has joined #zig
letoram has joined #zig
snappy has joined #zig
dch has joined #zig
mahmudov has quit [*.net *.split]
AndroidKitKat has quit [*.net *.split]
SimonN has quit [*.net *.split]
jonathon_ has quit [*.net *.split]
bbrittain has quit [*.net *.split]
mattmurr has quit [*.net *.split]
Thalheim has quit [*.net *.split]
student069 has quit [*.net *.split]
jaredmm has quit [*.net *.split]
BaroqueLarouche has quit [*.net *.split]
jzck has quit [*.net *.split]
blackbeard420 has quit [*.net *.split]
Cadey has quit [*.net *.split]
jasom has quit [*.net *.split]
companion_cube has quit [*.net *.split]
daurnimator has quit [*.net *.split]
guan has quit [*.net *.split]
urluck has quit [*.net *.split]
mforney has quit [*.net *.split]
grayhatter has quit [*.net *.split]
Snektron has quit [Ping timeout: 246 seconds]
strmpnk has joined #zig
D3zmodos has quit [Ping timeout: 240 seconds]
BaroqueLarouche has joined #zig
blackbeard420 has joined #zig
jzck has joined #zig
Cadey has joined #zig
companion_cube has joined #zig
guan has joined #zig
jasom has joined #zig
grayhatter has joined #zig
urluck has joined #zig
mforney has joined #zig
daurnimator has joined #zig
lukeholder has quit [*.net *.split]
edr has quit [*.net *.split]
dom96 has quit [*.net *.split]
livcd has quit [*.net *.split]
ScentedFern has quit [*.net *.split]
redj has quit [*.net *.split]
cota has quit [*.net *.split]
tgschultz has quit [*.net *.split]
lunamn has quit [*.net *.split]
drp has quit [*.net *.split]
dddddd has quit [*.net *.split]
benaiah has quit [*.net *.split]
johnLate has quit [*.net *.split]
casaca has quit [*.net *.split]
Ekho has quit [*.net *.split]
hspak has quit [*.net *.split]
idxu has quit [*.net *.split]
halbeno has quit [*.net *.split]
bbrittain has joined #zig
SimonN has joined #zig
mahmudov has joined #zig
AndroidKitKat has joined #zig
diginet has quit [*.net *.split]
niftynei has quit [*.net *.split]
student069 has joined #zig
mattmurr has joined #zig
Thalheim has joined #zig
jonathon_ has joined #zig
jaredmm has joined #zig
strmpnk has quit [Changing host]
strmpnk has joined #zig
edr has joined #zig
lukeholder has joined #zig
cota has joined #zig
tgschultz has joined #zig
ScentedFern has joined #zig
redj has joined #zig
livcd has joined #zig
dom96 has joined #zig
seoushi has quit [*.net *.split]
so has quit [*.net *.split]
return0e_ has quit [*.net *.split]
Snetry has quit [*.net *.split]
marjohkan has quit [*.net *.split]
bheads has quit [*.net *.split]
cow-orker has quit [*.net *.split]
squeek_ has quit [*.net *.split]
nickster has quit [*.net *.split]
commander has quit [*.net *.split]
scientes has quit [*.net *.split]
andrewrk has quit [*.net *.split]
nore has quit [*.net *.split]
wtw has quit [*.net *.split]
losinggeneration has quit [*.net *.split]
pixelherodev has quit [*.net *.split]
marjohkan has joined #zig
so has joined #zig
seoushi has joined #zig
return0e_ has joined #zig
Snetry has joined #zig
losinggeneration has joined #zig
cow-orker has joined #zig
pixelherodev has joined #zig
nore has joined #zig
andrewrk has joined #zig
wtw has joined #zig
bheads has joined #zig
commander has joined #zig
scientes has joined #zig
nickster has joined #zig
squeek_ has joined #zig
waleee-cl has quit [Ping timeout: 270 seconds]
rom1504 has quit [*.net *.split]
mht has quit [*.net *.split]
M-ou-se has quit [*.net *.split]
shachaf has quit [*.net *.split]
xvilka has quit [*.net *.split]
s-ol has quit [*.net *.split]
sammich has quit [*.net *.split]
torque has quit [*.net *.split]
davidkrauser has quit [*.net *.split]
doublex__ has quit [*.net *.split]
tracernz has quit [*.net *.split]
jzelinskie has quit [*.net *.split]
Cloudef has quit [*.net *.split]
euantor has quit [*.net *.split]
lqd has quit [*.net *.split]
wjlroe has quit [*.net *.split]
CommunistWolf has quit [*.net *.split]
shodan45 has quit [*.net *.split]
Prf_Jakob has quit [*.net *.split]
dddddd has joined #zig
drp has joined #zig
lunamn has joined #zig
benaiah has joined #zig
diginet has joined #zig
johnLate has joined #zig
Ekho has joined #zig
halbeno has joined #zig
hspak has joined #zig
idxu has joined #zig
casaca has joined #zig
niftynei has joined #zig
mht has joined #zig
xvilka has joined #zig
rom1504 has joined #zig
M-ou-se has joined #zig
shachaf has joined #zig
sammich has joined #zig
s-ol has joined #zig
torque has joined #zig
davidkrauser has joined #zig
tracernz has joined #zig
Cloudef has joined #zig
doublex__ has joined #zig
jzelinskie has joined #zig
Prf_Jakob has joined #zig
shodan45 has joined #zig
lqd has joined #zig
CommunistWolf has joined #zig
euantor has joined #zig
wjlroe has joined #zig
l1x has joined #zig
seoushi has quit [Remote host closed the connection]
<metaleap>
not the answer but forgot "tuple arg" in debug.warn call (or are you on 0.5.0 instead of nightly?)
<metaleap>
as far as i can tell it should work like you expect. if in main you do `comptime enumTypeTest();` just to try, same issue?
<metaleap>
i mean yeah shouldnt be necessary but just to see..
metaleap has quit [Quit: Leaving]
fengb has joined #zig
<fengb>
Looks like typeId is runtime known, and @typeName requires a comptime value
<seoushi>
adding comptime gives me a different error and still doesn't work. But yeah. I'm basically trying to store a type so I can use it later to cast something. This was just a simple example of the issue.
<seoushi>
I thought this was working because for awhile I only have one type and the to/from functions work but when I have more than one it fails
ltriant has joined #zig
<andrewrk>
#4404 is ready to merge if the tests pass
<andrewrk>
it fixes a lot of compiler bugs with async functions
<andrewrk>
momumi did a bunch of work towards x86 assembly / machine code generation in zig
<andrewrk>
with this branch, my fledgling zig-window project (https://github.com/andrewrk/zig-window) is opening a file, reading it, connecting to a unix socket, sending/receiving data, all non-blocking
<andrewrk>
sorry I switched topics back to async again ^
<andrewrk>
the automatic file-system-stuff-on-separate-thread is working
<pixelherodev>
That's actually amazing
<pixelherodev>
What's the risk of something going wrong because of the threading?
<pixelherodev>
Or, to put it differently, is the behavior identical to systems that support non-blocking I/O natively?
<andrewrk>
forgot to add, this is all with 0 uses of the following keywords: async, await, suspend, resume
<pixelherodev>
There a way to have build.zig emit only LLVM IR instead of a binary?
<pixelherodev>
Wanting to add generation of the test IR to build.zig
<andrewrk>
the behavior is basically identical to if you coded this in go
<andrewrk>
pixelherodev, build.zig API doesn't yet support --emit cli flag. PR is welcome
<pixelherodev>
And will be received soon :)
qazo has quit [Read error: Connection reset by peer]
<pixelherodev>
Should that be as an option to LibExeObjStep?
<andrewrk>
just a heads up I might adjust the API a bit when merging; I have some plans to update the CLI syntax related to --emit (but I don't want to break godbolt)
<andrewrk>
yes it should
<pixelherodev>
Yeah that's fine
qazo has joined #zig
<pixelherodev>
IR should be a different Kind, like Exe or Obj? Or should it be an option that can be applied to all types?
<pixelherodev>
That is, should it be `builder.addLLVMIR` or `builder.addExecutable .... e.setOutputType(IR)`? Or...?
<andrewrk>
the plan is to add a new cli flag: -femit-llvm-ir which does everything else, and additionally outputs a .ll file
<andrewrk>
--emit will then be deprecated
<andrewrk>
you could do for example `-fno-emit-bin -femit-llvm-ir`
<pixelherodev>
So that's basically just the existing --verbose-llvm-ir?
<pixelherodev>
Except it writes to a file
<pixelherodev>
Gotcha, okay; this PR should use that flag?
<andrewrk>
rather than a switch, the plan is that all 3 things could be separately toggled
<pixelherodev>
PR should use the -femit-llvm-ir flag then?
<pixelherodev>
Heck, might as well add three bools to the step at once; asm, bin, and ir
<andrewrk>
exactly
<andrewrk>
remove g->emit_file_type; main.cpp can translate "--emit" cli into the other 3 things
<andrewrk>
after godbolt accepts a PR to update to the new syntax, we can drop the old one
<pixelherodev>
Should the verbose-llvm-ir option be removed from LibExeObjStep?
<andrewrk>
no, that's for debugging the compiler
<pixelherodev>
Has the same effect as emitting the LLVM IR though, doesn't it?
<andrewrk>
no
<pixelherodev>
(except for where it's emitted)
<pixelherodev>
What's the difference between `--verbose-llvm-ir 2>&1 >ir.ll` and `--emit llvm-ir --name ir`?
<andrewrk>
the flag possibly prints more than one codegen (depending on what is cached), and pre and post optimization
<pixelherodev>
Gotcha
<andrewrk>
but more importantly the intent is different
<andrewrk>
--verbose-llvm-ir is for debugging the compiler. -femit-llvm-ir is for getting a .ll file that represents the output of the compilation
<pixelherodev>
Alright, build.zig patch done, just patching that codegen section and adding supporting for the `-f{no,}emit-{asm,bin,llvm-ir}` flags
<pixelherodev>
s/supporting/suppor
<pixelherodev>
t
<mikdusan>
how about: `zig pipline -in foo.zig -emit exe,lex,ir0,ir,ll,bc,asm,obj -in bar.o -in baz.ll -lib c --trace lex,ir0,ir`
<mikdusan>
*pipeline
<pixelherodev>
andrewrk, what should resolve_out_paths do?
<pixelherodev>
Binary path (if bin generation isn't disabled)?
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 260 seconds]
<pixelherodev>
Current logic uses binary path, asm path, and llvm path if none of the preceding types are being emitted
<pixelherodev>
That is, if emitting binary, use binary output path; otherwise, if emitting asm, use asm output path; otherwise, if llvm IR is being emitted, use its path
squeek_ has quit [Quit: Leaving]
<pixelherodev>
Alright, just doing a bit of testing, but I think it's good
squeek502 has joined #zig
mahmudov has quit [Ping timeout: 268 seconds]
ur5us has quit [Ping timeout: 240 seconds]
backwhack has quit [Quit: Connection closed for inactivity]
mahmudov has joined #zig
<pixelherodev>
Okay, it works, but the `install` step can't be used on the IR
squeek502 has quit [Quit: Leaving]
drp_ has joined #zig
diginet_ has joined #zig
halbeno_ has joined #zig
marijnfs has quit [Remote host closed the connection]