ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
sagecode has quit [Ping timeout: 256 seconds]
byronh__ has joined #zig
frmdstryr has quit [Ping timeout: 264 seconds]
willllll has quit [Ping timeout: 260 seconds]
zovt has quit [Remote host closed the connection]
darithorn has joined #zig
hoppetosse has quit [Ping timeout: 268 seconds]
_whitelogger has joined #zig
clownpriest has quit [Ping timeout: 260 seconds]
<bb010g>
andrewrk: I'm working on fixing up the zig-git PKGBUILD for Arch, and it's dropping off build/zig_cpp/lib{embedded_lld_{coff,elf,lib,mingw,wasm},zig_cpp}.a in weird locations. Are those required, and if they are, where should they ideally be installed?
<andrewrk>
bb010g, no, they're not required. I put them as install targets because they're used by stage2
<andrewrk>
but it's not recommended to ship stage 2 yet
<bb010g>
Where will they need to go once stage 2 becomes a thing?
<andrewrk>
"installed" to a prefix of $BUILD/stage1 in the build folder. then stage 2 uses them and "installs" to a prefix of $BUILD/stage2. then stage 3 uses stage 2 and that's the one you actually install to your system or to the package outpust
<andrewrk>
the .a files will not end up in the final installation
<bb010g>
Ok. So the PKGBUILD should be able to clean them up before install, then.
<andrewrk>
yes
tiehuis has joined #zig
<tiehuis>
I was going to add a patch to the PKGBUILD tomorrow to fix this when i was back home by the way
<tiehuis>
Its a pretty straightforward cmake patch to disable the targets
tiehuis has quit [Client Quit]
<bb010g>
I'm just running into this now since I'm setting up aurutils and using aur build's chroot stuff
<bb010g>
`namcap` is reporting "Dependency included and not needed ('llvm')"
<bb010g>
Is that just a build dep?
<andrewrk>
it's just a build dep if building statically against it
<andrewrk>
if it's a .so then it's a runtime dep
<bb010g>
It's the package llvm that it's talking about, which has `BugpointPasses.so`, `LLVMHello.so`, some executables, and a bunch of `.a`s and headers
<andrewrk>
you can use `ldd` on the produced zig executable to find out what the runtime dependencies are
<bb010g>
Yeah, doesn't look like it
<bb010g>
llvm-libs is a transitive dep of clang, which covers all the .so's from there
<bb010g>
Last namcap issue is license. It's fully MIT, right?
<bb010g>
Oh, NVM, that's just because it's a `-git` package. I'll pastebin the fixed files:
<GitHub196>
zig/master 6edd811 Andrew Kelley: nullable pointers follow const-casting rules...
_whitelogger has joined #zig
very-mediocre has joined #zig
very-mediocre has quit [Ping timeout: 260 seconds]
xtreak has joined #zig
<xtreak>
Hi I downloaded the linux binary distribution and unzipped it. I went to the directory where I had zig binary. I created a hello world program and tried to run it. I had `Unable to find zig lib directory. Reinstall Zig or use --zig-install-prefix.` as the error
<xtreak>
Can I just use the binary or do I need to do some other step from there to run it. If it's the later it will be helpful if someone can point me there so that I can follow the installation steps.
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<andrewrk>
xtreak, I added the runtime stdlib detection after 0.2.0
<andrewrk>
I suggest using the master CI build
<xtreak>
andrewrk: Works now. Thanks.
jjido has joined #zig
very-mediocre_ has joined #zig
<very-mediocre_>
got disconnected...
<very-mediocre_>
seems my message didn't make it
<very-mediocre_>
andrewrk: I encountered some weirdness with nullables again. If you recall the gist I sent earlier, it ended up with me saying I must've missed something
<very-mediocre_>
I encountered something similar again, but then I toyed with the code and after several recompiles it behaved as expected
<very-mediocre_>
Am I going crazy, or could there be some caching issue?
<very-mediocre_>
The exact thing I just experienced was: `var match_next: ?u8 = arr[cur_pos];`
<very-mediocre_>
and the compiler was complaining that `arr[cur_pos]` was u8 instead of ?u8, and wasn't letting me assign it
<very-mediocre_>
now it's compiling fine...
<very-mediocre_>
the same code.
very-mediocre has quit [Ping timeout: 260 seconds]
very-mediocre_ is now known as very-mediocre
<very-mediocre>
Actually I'm starting to think it's something to do with my system at this point, please disregard for now
<very-mediocre>
The files are on a network drive so it may be a sync issue.
dbandstra has quit [Quit: Leaving]
<donpdonp>
can someone explain 'error: unknown-length pointer to opaque'
xtreak has quit [Remote host closed the connection]
xtreak has joined #zig
quc has joined #zig
xtreak has quit [Remote host closed the connection]
xtreak has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xtreak has quit [Ping timeout: 240 seconds]
very-mediocre has quit [Ping timeout: 260 seconds]
davr0s has joined #zig
xtreak has joined #zig
triplefox has joined #zig
triplefox is now known as _triplefox
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jjido has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<donpdonp>
the hashmap.zig test has a line 'assert((??map.get(2)).value == 22);'
<donpdonp>
when i try to use it 'warn("root count {}\n", root.get("url").value);' -> error: type '?*Entry' does not support field access (for .value)
nc-x[m] has left #zig ["User left"]
<donpdonp>
(using zig master branch)
Ichorio has joined #zig
<donpdonp>
ok i stumbled my way into var url = (??root.get("url")).*; url.value.String
_triplefox has quit [Ping timeout: 260 seconds]
very-mediocre has joined #zig
sagecode has joined #zig
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
doingthings_ has joined #zig
xtreak has quit []
btbytes has joined #zig
btbytes has quit [Ping timeout: 260 seconds]
doingthings_ has quit [Ping timeout: 256 seconds]
SimonNa has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
clownpriest has joined #zig
doingthings_ has joined #zig
mahmudov has quit [Ping timeout: 264 seconds]
JinShil has quit [Quit: Leaving]
darithorn has joined #zig
hoppetosse has joined #zig
<andrewrk>
donpdonp, you can create the unknown length pointer to opaque like this: [*]c_void
<andrewrk>
fix with *c_void
quc has quit [Ping timeout: 240 seconds]
davr0s has joined #zig
doingthings_ has quit [Ping timeout: 268 seconds]
bheads has joined #zig
quc has joined #zig
quc has quit [Remote host closed the connection]
frmdstryr has joined #zig
<bheads>
Is there a way to log what a function after comptime resolution? ie the resulting function in Case Study: printf in Zig
<bheads>
would something like @compileLog(this) work (or in the future?)
<andrewrk>
bheads, if you could see it, it would look something like this: https://clbin.com/kma45
<andrewrk>
(zig ir)
<andrewrk>
but, maybe it would be a good idea to clean up that syntax and make it a little more user friendly and then yes, in fact, provide a way to introspect zig ir
<bheads>
interesting, is that the --verbose-ir flag?
<andrewrk>
yes
<andrewrk>
be warned, it's a firehose
<bheads>
lol yeah ir can be tricky but we could make a tool that takes the ir and the source code and makes an output like godbolt
<clownpriest>
wrote a pure zig implementation of xxhash function
<clownpriest>
still not optimized, but the basic functionality works
<andrewrk>
oh neat! this looks useful
<clownpriest>
yeah the function is supposed to be super fast, but i'd imagine the current implementation is still quite slow, will be a nice exercise in optimizations in zig
<andrewrk>
I know tiehuis has a lot of experience doing that
<andrewrk>
he may have some tips
<clownpriest>
i will ping him to ask to take a look once it's in better shape
bheads has quit [Quit: Leaving]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
doingthings_ has joined #zig
bheads__ has joined #zig
<MajorLag1>
andrewrk, is there a new typeId for [*] that is undocumented, or some way to tell *T from [*]T in comptime code?
<andrewrk>
MajorLag1, I made a couple modifications to type info regarding slices and pointers
<andrewrk>
@typeInfo([]u8) is now Pointer with Size == .Slice
sagecode has quit [Ping timeout: 260 seconds]
doingthings_ has quit [Ping timeout: 264 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
darithorn has quit [Quit: Leaving]
doingthings_ has joined #zig
doingthings_ has quit [Ping timeout: 260 seconds]
<clownpriest>
is there a way to un-const a []const u8?
<clownpriest>
i want to reslice and re-assign to it
<clownpriest>
x = x[i..]
ysengrimm has quit [Read error: Connection reset by peer]
bb010g has quit [Ping timeout: 245 seconds]
ysengrimm has joined #zig
sg-james[m] has quit [Ping timeout: 245 seconds]
lorde_kumamon[m] has quit [Ping timeout: 276 seconds]
clebermatheus[m] has quit [Ping timeout: 256 seconds]
pqflx3[m] has quit [Ping timeout: 240 seconds]
dtz has quit [Ping timeout: 260 seconds]
kammd[m] has quit [Ping timeout: 256 seconds]
<andrewrk>
sounds like you should use a different variable
<clownpriest>
yeah that's what i ended up doing, just wondering if there's a way to get around that
<clownpriest>
tho i guess that's not a good idea
<andrewrk>
it makes more sense to use a different variable
<andrewrk>
if you somehow did the other thing, your "program safety score" would go down
<MajorLag1>
I haven't had to do it in a while, but I think `x = @intToPtr([*]T, @ptrToInt(x.ptr))[i..end]` might still work to remove const. Still a bad idea unless a library is being really stupid or something.
<clownpriest>
right
<andrewrk>
yes that will work. @intToPtr and @ptrToInt is very bad for this "program safety score"
sagecode has joined #zig
<MajorLag1>
yeah, but they'll get you out of a jam when you need them.
davr0s has joined #zig
<andrewrk>
agreed
<GitHub171>
[zig] tgschultz opened pull request #1092: Add C string support to std.fmt w/ "{s}" (master...zig-std.fmt-c-string) https://git.io/vh2rC