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/
<delaney> nikki93, yeah that worked... odd
dch has joined #zig
yrashk has joined #zig
Miaourt has joined #zig
wjlroe has joined #zig
JimRM has joined #zig
guan has joined #zig
karrick has joined #zig
<ifreund> probably some kind of linking issue, the builds from the site are static
swills has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
cole-h has quit [Quit: Goodbye]
<delaney> Not sure if it's a Mac thing but vscode extension and nativedebug sure aren't playing, damn.
jjsullivan has quit [Ping timeout: 264 seconds]
<nikki93> i think it may be a mac thing haha -- there's a bunch of "security" stuff it does around things like debuggers
<delaney> Wouldn't surprise me, have this Mac for work, not a fan
ur5us has joined #zig
linuxgemini2 has joined #zig
linuxgemini has quit [Ping timeout: 240 seconds]
linuxgemini2 is now known as linuxgemini
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 260 seconds]
xackus has quit [Ping timeout: 260 seconds]
tundrax has joined #zig
<nikki93> what are y'all working on :D
tundrax has quit [Ping timeout: 245 seconds]
_whitelogger has joined #zig
<nikki93> delaney: yeah the main reason i've needed to hold onto a mac is to make builds for ios
adamkowalski has joined #zig
<adamkowalski> Is there a way to build a compile time lookup table?
<adamkowalski> I mainly just need a hash map that will be a fixed size with a few values that are known at compile time that I would like to be able to query from elsewhere
<adamkowalski> I will do the lookups at runtime, and no mutation is necessary. I just want to prefill the map at compile time and store it as a global constant
radgeRayden has joined #zig
adamkowalski has quit [Quit: Lost terminal]
wozeparrot has quit [Ping timeout: 260 seconds]
kristoff_it has quit [Ping timeout: 256 seconds]
qeeg_ has quit [Ping timeout: 260 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
Miaourt has quit [*.net *.split]
wjlroe has quit [*.net *.split]
guan has quit [*.net *.split]
JimRM has quit [*.net *.split]
yrashk has quit [*.net *.split]
dch has quit [*.net *.split]
karrick has quit [*.net *.split]
marnix has joined #zig
Miaourt has joined #zig
wjlroe has joined #zig
yrashk has joined #zig
dch has joined #zig
JimRM has joined #zig
guan has joined #zig
karrick has joined #zig
tundrax has joined #zig
tundrax has quit [Ping timeout: 245 seconds]
ur5us has quit [Ping timeout: 260 seconds]
moinstar69 has joined #zig
moinstar69 has quit [Remote host closed the connection]
moinstar has joined #zig
<moinstar> trying to build github main branch. stage 1 built successfully, unable to get pass `lld: error: undefined symbol: getPollyPluginInfo()`.
<moinstar> above error is for : `./zig build --prefix $(pwd)/stage2 -Denable-llvm`
<pixelherodev> Manually add libLLVMPolly or something to the list of linked libs
<moinstar> i edited CMakeLists.txt and passed ZIG_WORKAROUND_POLLY_SO for the stage 1 compilation. But confused for how to go about in the stage 2
komu has joined #zig
<komu> adamkowalski maybe https://github.com/ziglang/zig/pull/5359 and related comments
komu has quit [Remote host closed the connection]
osa1 has joined #zig
cole-h has joined #zig
retropikzel has joined #zig
retropikzel has left #zig [#zig]
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #zig
FireFox317 has joined #zig
delaney has quit [Ping timeout: 240 seconds]
mmohammadi9812 has joined #zig
g_w1 has quit [Ping timeout: 272 seconds]
g_w1 has joined #zig
cole-h has quit [Quit: Goodbye]
Cloudef has quit [Quit: ZNC - http://znc.in]
earnestly has joined #zig
jmiven has quit [Ping timeout: 272 seconds]
jmiven has joined #zig
FireFox317 has quit [Quit: Leaving]
<Piraty> jjsullivan1: ok, i will probably invert the logic to exclude known-to-not-compile archs instead of whitelisting them
osa1 has quit [Ping timeout: 240 seconds]
Cloudef has joined #zig
ask6155 has joined #zig
osa1 has joined #zig
<ask6155> if I realloc on a pointer (I assume it's a pointer) does the address stay the same?
<ifreund> you mean is the new allocation guarenteed to start at the same address as the old one? no
<ask6155> so my pointer has to be a var then?
<ikskuh> it depends on which realloc you use
<ask6155> I'm using the page allocator
<ikskuh> zig has a realloc that will fail when memory has to be moved
<ikskuh> and there's realloc which will move if no resize is possible
<ask6155> the realloc returns a var so I assume I have to put it into my address variable and then use that one?
moinstar has quit [Remote host closed the connection]
<ifreund> yes
<ifreund> use resize() if you don't want the allocation to be moved
<ask6155> what is the usize type? I want to put my int where the size is supposed to go. But it takes a usize
<ikskuh> usize is a unsigned integer that can take any pointer or object size
kristoff_it has joined #zig
mmohammadi98120 has joined #zig
mmohammadi9812 has quit [Ping timeout: 264 seconds]
mmohammadi9812 has joined #zig
mmohammadi98120 has quit [Ping timeout: 265 seconds]
mmohammadi98126 has joined #zig
mmohammadi9812 has quit [Ping timeout: 272 seconds]
mmohammadi98126 has quit [Ping timeout: 260 seconds]
waleee-cl has joined #zig
osa1 has quit [Ping timeout: 272 seconds]
<ask6155> what is the maximum number of elements an array can have?
<ikskuh> std.math.maxInt(usize) in theory
<ikskuh> in practise: depends on where the array is stored
<ask6155> let's say I allocated a 1024^2 u8s on the heap I trying to realloc it by increasing that number but I get stuck at around (1024^2)*1000
<ikskuh> huh
<ikskuh> you should be able to alloc gigabytes
<ikskuh> depending on how much memory you have avail
<ask6155> does it matter which allocator I use?
<ikskuh> yes
<ask6155> I using c malloc
<ikskuh> some allocatos (like FBA) will out of memory
<ikskuh> huh
<ikskuh> your still allocating megabytes of memory
marnix has quit [Ping timeout: 240 seconds]
<ikskuh> what do you do exactly?
<ask6155> I'm trying to make a ram eater
<ask6155> lol
<ikskuh> well
<ikskuh> what for?
<ask6155> well... uhhhh
<ikskuh> and for which os?
<ask6155> nothing
<ask6155> linux
<ikskuh> note: overcommitment is real
marnix has joined #zig
<ask6155> I'm just messing around. I wanted to make a tamed memory eater which only eats how much I say it to eat
FireFox317 has joined #zig
<ask6155> I get a segfault when I was a ~512M and I asked for more 50M
<ask6155> I have 4GB
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
osa1 has joined #zig
marijnfs has quit [Quit: leaving]
ask6155 has left #zig ["Later!"]
decentpenguin has quit [Ping timeout: 256 seconds]
decentpenguin has joined #zig
donniewest has joined #zig
marnix has quit [Remote host closed the connection]
marnix has joined #zig
<fgenesis> hm, tried to compile zig master but it fails at the cmake step, it's not finding llvm even though i just compiled it and llvm-config is on the PATH
<fgenesis> aha, turns out i just need to set the include dirs for some reason
<fgenesis> it's not picking up llvm-config --includedir for whatever reason
arqv has quit [Quit: WeeChat 2.9]
<fgenesis> same for the libs. do i really need to config all of them manually? ugh
waleee-cl has quit [Quit: Connection closed for inactivity]
omglasers2 has joined #zig
<fgenesis> oops, overlooked something. all good and builds now apparently
waleee-cl has joined #zig
juanfra__ has quit [Ping timeout: 240 seconds]
alva has quit [Ping timeout: 240 seconds]
waleee-cl has quit [Ping timeout: 240 seconds]
JimRM_ has joined #zig
gonz_ has quit [Ping timeout: 244 seconds]
JimRM has quit [Ping timeout: 244 seconds]
JimRM_ is now known as JimRM
gonz_ has joined #zig
layneson has joined #zig
alva has joined #zig
lqd has quit [Ping timeout: 244 seconds]
lqd has joined #zig
juanfra__ has joined #zig
waleee-cl has joined #zig
wjlroe has quit [*.net *.split]
Miaourt has quit [*.net *.split]
yrashk has quit [*.net *.split]
dch has quit [*.net *.split]
karrick has quit [*.net *.split]
guan has quit [*.net *.split]
dch has joined #zig
guan has joined #zig
Miaourt has joined #zig
karrick has joined #zig
yrashk has joined #zig
wjlroe has joined #zig
l1x has joined #zig
gonz_ has joined #zig
dch has joined #zig
guan has joined #zig
karrick has joined #zig
yrashk has joined #zig
ky0ko1 has joined #zig
dch has quit [Ping timeout: 244 seconds]
l1x has quit [Ping timeout: 246 seconds]
gonz_ has quit [Ping timeout: 244 seconds]
layneson has quit [Ping timeout: 240 seconds]
karrick has quit [Ping timeout: 244 seconds]
guan has quit [Ping timeout: 244 seconds]
yrashk has quit [Ping timeout: 244 seconds]
ky0ko1 has quit [Ping timeout: 244 seconds]
r0bby has joined #zig
r0bby has quit [Ping timeout: 244 seconds]
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
Akuli has joined #zig
squeek502 has quit [Ping timeout: 260 seconds]
casaca has quit [Ping timeout: 244 seconds]
casaca has joined #zig
marnix has quit [Ping timeout: 240 seconds]
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
wootehfoot has joined #zig
radgeRayden has quit [Remote host closed the connection]
wozeparrot has joined #zig
codemessiah has joined #zig
cole-h has joined #zig
mguaypaq has joined #zig
<fgenesis> compile error for current master, on arm32: https://paste.xinu.at/w6L/
<ikskuh> nice find
<ikskuh> fix it and PR it or open a issue
<ikskuh> stuff written in IRC is going to die :D
<fgenesis> i don't know enough zig yet to do this, guess why i'm building the compiler first :P
<ikskuh> then you should do an issue
<fgenesis> and the 0.6 release segfaults
<ikskuh> :D
<fgenesis> WELL you could maybe re-use 6501 for this? :P
<ikskuh> haha
<fgenesis> because it's a hole in the list and it makes me sad
SimonNa has quit [Remote host closed the connection]
<ikskuh> :D
<Piraty> is there any doc about nomenclature regarding stage0, stage1, stage2 ?
<ikskuh> stage0 is 100% c++
<ikskuh> stage1 is a compiler built both in zig and c++
<ikskuh> stage2 is a fully self-hosted compiler built with stage1
<ikskuh> stage3 is stage2 built with stage2
<Piraty> is this documented?
<ikskuh> somewhere, yes!
<fgenesis> "on irc"
<Piraty> at least now
<ikskuh> i think it's in the github README.md?
xd1le has joined #zig
<Piraty> doesn't mention stage0
<Piraty> so by using cmake , i get the stage1
<ikskuh> cmake builds stage0 as well
<ikskuh> in your build directory is a zig0 file
<Piraty> thanks ikskuh
<FireFox317> ikskuh, it is also the stage1.id file that is missing in your error?
<FireFox317> Because then #6493 is the same problem as yours
<ikskuh> try self.populateFileHash(ch_file);
<ikskuh> no, 6493 has a completly different path
<ikskuh> full trace
<FireFox317> Can you print the path?
<FireFox317> Like which file is not found?
<fgenesis> gnah, building zig1.o takes soooo much ram
<FireFox317> jup :(
<ikskuh> FireFox317: on my way
<ikskuh> first call fails
<ikskuh> populateFileHash("/home/felix/projects/cg-workbench/zig-cache/o/e4f3b5d925b4cd80e81c00c792d7c53a/libnfd.a")
<ikskuh> which … is wrong
<ikskuh> the file is called nfd.lib
<ikskuh> :D
<ikskuh> which is probably more wrong
<ikskuh> i'm using gnu abi
<ikskuh> so the file which is generated is wrong, should be libnfd.a
<FireFox317> Ah that gives us a good clue
<ikskuh> yeah
<ikskuh> sadly, i don't have the brainz to debug it atm
<ikskuh> but should be easily reproducable
<ikskuh> make a project having a static lib as well as a exe, depend on the lib, compile for gnu
<FireFox317> yeah indeed, lets see
<fgenesis> ok, i TRIED to fix the usize == 32 bit issue but i end up somewhere in the memory system and i really don't want to touch this just yet <.<
<ikskuh> fgenesis: just do it!
<fgenesis> just do what
<ikskuh> FireFox317: this also explains why the linux build is breaking
<ikskuh> fix it
<FireFox317> ikskuh, linux build of what?
<ikskuh> cg-workbench
<fgenesis> i would sed replace all u64 with usize and accept getting killed? umm no
<ikskuh> looks like it's the same problem
* ikskuh slaps fgenesis around a bit with a large trout
<FireFox317> fgenesis, @intCast maybe?
<fgenesis> i keep adding that and it keeps breaking elsewhere
mguaypaq has quit [Quit: leaving]
<FireFox317> ikskuh, yeah indeed. what is this project?
<FireFox317> like the one we were just talking about
<FireFox317> oh windows
<FireFox317> i see
<FireFox317> same project
<ikskuh> same project, only different target
<FireFox317> wow nice project :O
<ikskuh> thanks :)
wootehfoot has quit [Quit: Leaving]
<ikskuh> you're welcome to try
<FireFox317> yeah gonna build that while investigating the issue :P
<FireFox317> need some PR's anyway
<FireFox317> xd
<ikskuh> haha
<ikskuh> i hope to rewrite the workbench 100% in zig one day
<ikskuh> another big project port, but i think it's worth the time
omglasers2 has quit [Read error: Connection reset by peer]
<ikskuh> but i need to do a lot of changes. Snektron proposed to use vulkan, which sounds like a good idea
<ikskuh> i need a ui toolkit that is perfectly scalable *and* has a really good text editor built-in
<codemessiah> what's the workbench
<ikskuh> it's a creative live-editing tool for multimedia effects
<codemessiah> Oh that's cool
<codemessiah> if you made that UI toolkit that uses Vulkan as the backend and made it a library it would be really useful
<ikskuh> the ui toolkit is dear imgui
<ikskuh> atm
<ikskuh> but i'm not 100% sold
<codemessiah> I used to want to make a video editing software with vulkan, got about 1000k lines of C++ Vulkan code done and it was a white window :)
<ikskuh> heh
<ikskuh> Snektron has a nice hello-vulkan sample with zig
nvmd has joined #zig
moinstar has joined #zig
layneson has joined #zig
BaroqueLarouche has joined #zig
<moinstar> I am trying to build from the source. I was able to build the stage 1 with `-DZIG_WORKAROUND_POLLY_SO:STRING=/usr/lib/llvm-10/lib/LLVMPolly.so`. Now having difficulty building the stage 2. Getting `lld: error: undefined symbol: getPollyPluginInfo()`.
osa1_ has joined #zig
osa1 has quit [Ping timeout: 240 seconds]
<ikskuh> FireFox317 is on a PR streak i see :D
<FireFox317> ikskuh, getting that t-shirt right :P
<ikskuh> heh
<ikskuh> t-shirt progress tomorrow evening is 2/3 :D
<ikskuh> wait, wrong shirt
<ikskuh> current shirt is 3/4 :D
<ikskuh> we need more "get shirts for doing community chores"-incentives
wootehfoot has joined #zig
nvmd has quit [Quit: Later nerds.]
codemessiah has left #zig [#zig]
bartwe_ has quit []
nvmd has joined #zig
<kristoff_it> ikskuh, note taken :D
<ikskuh> :D
riba has joined #zig
nvmd has quit [Quit: Later nerds.]
nvmd has joined #zig
Tallin has joined #zig
osa1_ has quit [Ping timeout: 256 seconds]
<cr1901_modern> Uhh this might be a silly q, but how did zig get its own copy of ntdll.lib? http://ix.io/2zwz
<cr1901_modern> (This is a linux cross compile to windows)
<ikskuh> cr1901_modern: a lib file is mostly just a list of exported functions
<ikskuh> search for "implib"
cole-h has quit [Ping timeout: 272 seconds]
<Tallin> Hi everyone, Since Zig promotes reusability of code, is there already a function / package for reading in csv files into arrays`?
<ikskuh> you can generate a .lib file for every dll you have access to
<ikskuh> heya Tallin
<ikskuh> there's no CSV package yet
<ikskuh> at least to my knowledge
<Tallin> alright, I found this c++ thread https://stackoverflow.com/questions/48994605/csv-data-into-a-2d-array-of-integers/48994841 should it work analogue in zig?
<ikskuh> you can probably use std.io.Reader.readUntilDelimiter, then std.mem.split to get each line parsed
<Tallin> thank you i google for them
<cr1901_modern> ikskuh: oh right... I seem to vaguely recall that. Thanks!
<cr1901_modern> And I see: zig creates it's own copies of glibc, mingw libc, and musl as needed: https://github.com/ziglang/zig/tree/c92957da0ed6f74e328fd0414c56f885cdcff30b/lib/libc
<ikskuh> Tallin: search in the stdlib, not google ;)
<Tallin> :D
<nikki93> when i build to wasm (maybe applies to any target) is there a way to get source-annotated assembly? so far i've just been 'disassembling' the output with wasm2wat. would be neat if it works with `--release-small` too
<Tallin> Yeah Im still new and figuring out how to best research functions and how to use them
<nikki93> (just for reading, not intending to feed that to any program after)
<ikskuh> Tallin: use ZLS
jjsullivan has joined #zig
<fengb> There was some discussion about standardizing sourcemaps in wasm. I don't remember what the status was
<Tallin> cool so zls is like zig + some helpful functions and i can include it into vscode directly?
<ikskuh> zls is your power IDE
<ikskuh> go-to definition
<ikskuh> code completion
<ikskuh> ...
marnix has quit [Ping timeout: 256 seconds]
<nikki93> Tallin: it's a "language server" which then anything that is a "languageserver client" can talk to -- vscode is one of the editors that can host a languageserver client
marnix has joined #zig
factormystic4 has joined #zig
<Tallin> i never heard of a language server (client) I only programmed in R and Python up til now and followed some c++ tutorials. thank you for the explanation
<nikki93> i don't use vscode but a quick google search found this: https://marketplace.visualstudio.com/items?itemName=AugusteRame.zls-vscode maybe that works for you?
linuxgemini has quit [Read error: Connection reset by peer]
<Tallin> do i have to pass any options to `zig build config`? for the zls?
<nikki93> you'll have to build zls as described in zls's repo, and zls will have to be able to find zig, and vscode will have to be able to find zls
linuxgemini has joined #zig
<Tallin> yes vscode is mentioned in https://github.com/zigtools/zls#vscode
<nikki93> i just cloned zls (make sure to clone recursive or submodule init recursive) and then ran `zig build`
<nikki93> didn't do any config
<Tallin> alright
<Nypsie[m]> config can either be done manually in zls_config.json or by running `zig build config`
factormystic has quit [Ping timeout: 240 seconds]
factormystic4 is now known as factormystic
<Nypsie[m]> Note that you can only run `zig build config` after running `zig build`
<nikki93> the resulting zls executable will be in 'zig-cache/bin' under the repo directory
<nikki93> that's what the vscode extn will have to know about
<cr1901_modern> So if I understand correctly: zig never links against the system libc in the invocation "zig build-exe hello.zig"?
<cr1901_modern> it compiles its own under .cache and uses that
<alexnask[m]> Well, if you are not using libc and explicitly linking against it
<alexnask[m]> Then it doesn't even need it (we don't even rely on CRT)
<Tallin> > the resulting zls executable will be in 'zig-cache/bin' under the repo directorythat's what the vscode extn will have to know about
<Tallin> Thanks that was critical information
<cr1901_modern> >explicitly linking against it
<cr1901_modern> I'm not linking against it... the lld invocation has a libc.a on it
<cr1901_modern> err explicitly*
<cr1901_modern> >we don't even rely on CRT <-- that was my follow-up q :P, so good to know
<nikki93> Tallin: :)
riba has quit [Ping timeout: 256 seconds]
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
layneson has quit [Ping timeout: 258 seconds]
ikskuh has quit [Ping timeout: 240 seconds]
mq32 has joined #zig
layneson has joined #zig
mixi has quit [Quit: connection reset by purr]
mixi has joined #zig
wootehfoot has quit [Quit: Leaving]
layneson has quit [Ping timeout: 240 seconds]
Akuli_ has joined #zig
Akuli has quit [Disconnected by services]
Akuli_ is now known as Akuli
Amun_Ra has quit [Ping timeout: 256 seconds]
Amun_Ra has joined #zig
Akuli has quit [Quit: Leaving]
FireFox317 has quit [Ping timeout: 240 seconds]
kristoff_it has quit [Ping timeout: 246 seconds]
Tallin has quit [Ping timeout: 245 seconds]
donniewest has quit [Quit: WeeChat 2.9]
<nikki93> any reason to prefer one of `buf[0..]` or `&buf` over the other when passing an array as an argument for a slice param?
<alexnask[m]> Those are equivalent
<ifreund> i prefer the latter because it's shorter
<nikki93> wondering if there were any stylistic / legibility reasons too
<nikki93> i see yeah. i was using `buf[0..]` and only then discovered `&buf`
<alexnask[m]> I also personally preferr &buf
xd1le has quit [Remote host closed the connection]
<nikki93> does `buf[0..]` make it clearer that the function accepts a slice param, vs. with `&buf` it could be either a slice or a 'pointer to array' or sth
<ifreund> does it matter? if you want to know details you look at the function signature
<alexnask[m]> buf[0..] will also return a pointer to an array
<ifreund> zls makes that easy :)
<nikki93> :)
<nikki93> probs gonna start using `&buf`
<alexnask[m]> buf[a..(b?)] will return a pointer-to-array when a and b are comptime known
<alexnask[m]> So the semantics will always be the same, use the one you like the look of better ;)
<nikki93> cool :)
marnix has quit [Ping timeout: 240 seconds]
nycex has quit [Remote host closed the connection]
nycex has joined #zig
delaney has joined #zig
<delaney> fengb, I was asking about vscode/Mac last night on your stream but had to leave. Does zig's clang/wasm toolchain generate soutcemaps and stack debugging in was on the browser? I have a project where wasm makes a lot of sense but not sure about the current state vs something like assemblyscript or C with emscripten
moinstar has quit [Remote host closed the connection]
delaney has quit [Read error: Connection reset by peer]
delaney has joined #zig
layneson has joined #zig
traviss_ has quit [Quit: Leaving]
klltkr has joined #zig
squeek502 has joined #zig