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/
plumm has quit [Ping timeout: 256 seconds]
_Vi has quit [Ping timeout: 244 seconds]
benjif has quit [Ping timeout: 264 seconds]
ur5us has quit [Ping timeout: 252 seconds]
<aerona> is there any function that tells if a type is a string/string-like type?
<foobles> what do you mean?
<foobles> what qualifies?
<foobles> like an array of u8?
<aerona> []const u8, []u8, [*:0]u8, pretty much any type that can accept a string literal
Barabas has quit [Ping timeout: 245 seconds]
nephele_ has joined #zig
nephele has quit [Ping timeout: 244 seconds]
nephele_ is now known as nephele
marijnfs1 has joined #zig
marijnfs_ has quit [Ping timeout: 272 seconds]
decentpenguin has joined #zig
dputtick has quit [Quit: Connection closed for inactivity]
knebulae has quit [Read error: Connection reset by peer]
foobles has quit [Ping timeout: 245 seconds]
layneson has joined #zig
foobles has joined #zig
xackus_ has joined #zig
xackus has quit [Ping timeout: 256 seconds]
decentpenguin has quit [Quit: decentpenguin]
layneson has quit [Quit: WeeChat 2.8]
marijnfs has quit [Ping timeout: 256 seconds]
GreaseMonkey has joined #zig
<fraktor> When I define a const like the following, I get an "inferred array size invalid here" message: `const data: [_]u16 = .{ 1, 2, 3 ... };`
<fraktor> How can I make that inferred?
<aerona> if i understand the .{} syntax correctly .{} is actually an anonymous struct
<aerona> array literal syntax is actually [_]u16{ 1, 2, 3 ... };
<fraktor> I figured it was something like that. Thanks!
donaldallen has quit [Remote host closed the connection]
knebulae has joined #zig
constptr has joined #zig
marler8997 has joined #zig
<marler8997> having issues building zig on my new machine. Using NixOS, anyone know what toolchain I should use to build llvm/zig? I'm getting compile errors like strict-aliasing violations and unused variable errors
joey152 has quit [Remote host closed the connection]
metaleap has joined #zig
aerona has quit [Quit: Leaving]
reductum has joined #zig
z0ltan has joined #zig
z0ltan has quit [Ping timeout: 272 seconds]
<marler8997> figured it out, need gcc 9.2 not 8.3
z0ltan has joined #zig
<wilsonk> marler8997: I always just build clang/llvm with the previous release (never had that fail), then rebuild it with itself afterwards again to take advantage of new optimizations. That way you also have the latest llvm to build zig. I was on gcc-5.4 until just recently because I pretty much use clang for everything at this point
<marler8997> so I should start with clang from my package-manager?
z0ltan is now known as antaoiseach
antaoiseach has left #zig [#zig]
<andrewrk> marler8997, I used to use the nixos package for llvm and clang but lately I've been using a source build
ur5us has joined #zig
constptr has quit [Quit: Connection closed for inactivity]
ur5us has quit [Ping timeout: 244 seconds]
metaleap has quit [Read error: Connection reset by peer]
metaleap has joined #zig
cole-h has quit [Quit: Goodbye]
foobles has quit [Ping timeout: 245 seconds]
ifreund has joined #zig
reductum has quit [Quit: WeeChat 2.8]
FSX has quit [Quit: WeeChat 2.7]
pystub has joined #zig
dddddd has joined #zig
marijnfs has joined #zig
nycex has quit [Ping timeout: 240 seconds]
marijnfs has quit [Read error: Connection reset by peer]
sjm has joined #zig
dermetfan has joined #zig
Patrice_ has joined #zig
nycex has joined #zig
metaleap has quit [Remote host closed the connection]
metaleap has joined #zig
<wilsonk> marler8997: sorry I didn't notice your next question. If your distro has something as new as llvm-7, or newer, then I wouldn't see a problem with just installing that and then building llvm/clang-10 from source. I recently built llvm-10 with clang-7 and it worked fine. Source builds can take a VERY long time (like several hours with a slow-ish quad core... and expect to use about 2GB ram per core!). I think it takes about 1.11 hours with m
<wilsonk> oh, sorry about that last bit of the above comment...obviously if you built with gcc then you are aware of the build times for llvm/clang...my bad :)
ur5us has joined #zig
_Vi has joined #zig
slurpie has quit [Ping timeout: 240 seconds]
slowtyper has quit [Quit: WeeChat 2.8]
Barabas has joined #zig
ur5us has quit [Ping timeout: 244 seconds]
<daurnimator> grrrr
<daurnimator> I can't get git to not change .zig line endings to crlf on windows
<ikskuh> daurnimator: there are a lot of git options for that
wootehfoot has joined #zig
<ikskuh> you can put a line into .gitattributes "*.zig text eol=lf"
slowtyper has joined #zig
_Vi has quit [Ping timeout: 252 seconds]
<daurnimator> ikskuh: you'll see I already did
<daurnimator> (and it didn't work)
<ikskuh> :(
<ikskuh> windows line ending hell
<ikskuh> is core.autocrlf also false?
<daurnimator> i would hope so... as far as I know its in a default windows environment there in travis
<ikskuh> well, then it's on by default
<ikskuh> #insaneDefaults
Xavi92 has joined #zig
ifreund has quit [Ping timeout: 264 seconds]
ifreund has joined #zig
_Vi has joined #zig
<Barabas> What to do when I get 'cannot inline function' errors?
<Barabas> This actually: zig\std\fmt\parse_float.zig:55:5: error: unable to inline function
<Barabas> I'm calling print in a function that's recursive, so I guess it has to do with that.
<Barabas> Wait... that doesn't make sense... parse float shouldn't be used when printing, right?
_Vi has quit [Ping timeout: 252 seconds]
<Barabas> Ok, it's some other code which calls `std.fmt.parseFloat(f64, some_slice)`
<daurnimator> and a comment in there says its the default for git on windows
wootehfoot has quit [Read error: Connection reset by peer]
<ifreund> ew
<ikskuh> daurnimator: ah, this may help :)
slowtype1 has joined #zig
slowtyper has quit [Ping timeout: 260 seconds]
<daurnimator> `installRaw` doesn't seem to make much sense to me
<daurnimator> it seems to install to zig-cache ?
<daurnimator> wait no, it installs to the install dir.... not the output dir
bens has joined #zig
constptr has joined #zig
dddddd has quit [Ping timeout: 264 seconds]
keegans has joined #zig
slowtype1 has quit [Quit: WeeChat 2.8]
slowtyper has joined #zig
plumm has joined #zig
<oats> when I save a zig file in vim, and there's a syntax error in the file, zig.vim opens an empty split. Are there supposed to be error messages in here? https://paste.xinu.at/cAfbvf/png
<plumm> Yes
<Barabas> meh
<Barabas> I'm using `std.io.bufferedInStream`, but that doesn't really work with line by line user input
<Barabas> it tries to fill the whole buffer before returning from the read call =|
<oats> Barabas: why not use a bare InStream and use .readUntilDelimiterAlloc
<Barabas> Yes that'll probably work. I picked the buffered version because that's what the java code I'm transpiling did
<Barabas> didn't think it would be a problem
<oats> hmm
<Barabas> I also don't know what the correct behaviour is to be honest.
<Barabas> should be I mean
cole-h has joined #zig
<fraktor> Is there a way to get the index while in a for loop, or should I just use a while?
<oats> fraktor: for (items) |value, index| {...
constptr has quit [Quit: Connection closed for inactivity]
<fraktor> oats: Thank you. I didn't see that in the docs before
<oats> np. cheers :)
<oats> if a zig module, with some global variables in it, is imported by two separate other modules, do those modules both refer to the same global variable in the first module?
<oats> or are two separate "instances" of the first module created
<oats> hope that makes sense lol
<marler8997> wilsonk: Yeah it was taking me several hours till I got my new machine. New machine has a Ryzen 9 3900x, RAM speed is 3200MHz, Storage is a 500GB nvme drive. LLVM build time: 6min 24s, Clang build time: 3min 45s, LLD build time: 27s. And all that is with "make -j24"
Barabas has quit [Ping timeout: 245 seconds]
<marler8997> oats: there should be only 1 instance
<oats> marler8997: thanks!
Akuli has joined #zig
<plumm> marler8997 and what supercomputer did you just buy O_O
foobles has joined #zig
dddddd has joined #zig
xackus_ has quit [Ping timeout: 260 seconds]
<oats> these new AMD chips sound pretty snazzy, gotta say
<oats> think I'll probably put one in my next machine
Barabas has joined #zig
<Barabas> I also bought a 3900 recently. Can't say I'm disappointed :)
constptr has joined #zig
<fraktor> Is there a way I can get a mutable reference to something? `&variable` is giving me a `*const foo`, when I need a `*foo`.
<marler8997> plumm: I listed the main components up above, if you want more detail let me know. Machine will run you about $1000 for the bare bones. I run headless as well so no GPU. About $500 for the CPU and $500 for the other parts.
<Xavi92> fraktor: wouldn't it be `*foo`?
<andrewrk> fraktor, make your `variable` var instead of const
<fraktor> I don't know how I missed that. Thank you
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
waleee-cl has joined #zig
antaoiseach has joined #zig
fraktor has quit [Read error: Connection reset by peer]
<antaoiseach> /part/part
antaoiseach has left #zig [#zig]
Xavi92 has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
dnmllr has joined #zig
slurpie has joined #zig
daurnimator has quit [Ping timeout: 252 seconds]
<Snektron> 3700X here, got it right at the release. Everything builds so fast
<Snektron> its great
daurnimator has joined #zig
constptr has quit [Quit: Connection closed for inactivity]
riba has joined #zig
riba has quit [Ping timeout: 256 seconds]
racoon has joined #zig
racoon has quit [Client Quit]
waleee-cl has quit [Quit: Connection closed for inactivity]
_Vi has joined #zig
benjif has joined #zig
dermetfan has quit [Ping timeout: 256 seconds]
waleee-cl has joined #zig
brakmic has joined #zig
FireFox317 has joined #zig
dnmllr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnmllr has joined #zig
Akuli has quit [Quit: Leaving]
ur5us has joined #zig
brakmic has left #zig [#zig]
dingenskirchen has quit [Remote host closed the connection]
metaleap has quit [Remote host closed the connection]
dingenskirchen has joined #zig
metaleap has joined #zig
metaleap has quit [Remote host closed the connection]
metaleap has joined #zig
rjtobin has joined #zig
rjtobin has quit [Remote host closed the connection]
<jwmerrill> Just got my Lox interpreter compiling to wasm32-wasi. You can try it in the browser by going to https://webassembly.sh/?run-command=wapm%20install%20jwmerrill/lox-repl@0.1.1 and typing `lox-repl`. Caveat: the webassembly.sh site seems to only really work well in Chrome right now.
<jwmerrill> Here's the project repo if anyone is curious how this is working: https://github.com/jwmerrill/zig-lox/
<jwmerrill> There's now a "wapm.toml" that integrates this with the wapm webassembly package manager.
<ifreund> hah, firefox makes you enter each line in a dialog
<ifreund> seems to work though, nice
<jwmerrill> Firefox wasn't letting me do anything at all. I get "DataCloneError: Worker.postMessage: The SharedArrayBuffer object cannot be serialized. The Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy HTTP headers will enable this in the future."
<jwmerrill> I tried in Safari, and was getting the "prompt" behavior there.
<ifreund> this is what i get https://paste.rs/maT.png
metaleap has quit [Quit: Leaving]
<jwmerrill> Impressed you persisted through more than 1 command that way...
<fengb> Neat
<ifreund> there is no other browser :P
<jwmerrill> firefox is my daily driver too
<fengb> I’ve never had more random issues than I have with FF
benjif has quit [Ping timeout: 260 seconds]
dnmllr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FireFox317 has quit [Ping timeout: 260 seconds]
dnmllr has joined #zig
dnmllr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dermetfan has joined #zig
dnmllr has joined #zig
dnmllr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<oats> how does @intToEnum behave when given an integer that doesn't have a corresponding variant for a non-exhaustive enum?
<oats> I would've expected it return the '_' variant, but it seems to give the last enum variant in the listing before the '_'
<oats> jwmerrill: speaking of which, I've moved on to the bytecode VM. handling allocation and error-handling became veryNotFun™
dnmllr has joined #zig
rjtobin has joined #zig
dermetfan has quit [Ping timeout: 244 seconds]
<oats> here's a minimal example
<oats> I would've expected this to print "narp 1", not "yarp 0"
<fengb> This looks really buggy
<fengb> Changing it to 'packed enum' changes the output into a different wrong value
<tdeo> ...packed enum?
<oats> fengb: that is really odd
<fengb> Probably a compiler bug. Can you create an issue?
pystub has quit [Ping timeout: 260 seconds]
<oats> sure!
<oats> my first zig issue \o/
Barabas has quit [Ping timeout: 245 seconds]
<fengb> Probably not the last ;P