ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
ryanmtate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Ping timeout: 252 seconds]
kristate has joined #zig
moxotter has joined #zig
<moxotter> Hi!
mnoronha has quit [Ping timeout: 272 seconds]
<andrewrk> hi moxotter
<kristate> hi moxotter
<kristate> scientes: hey, let me get that code up re: networking. it has been a busy week for me and I haven't gotten a chance to push the code
<kristate> andrewrk: please kindly ignore https://github.com/ziglang/zig/pull/1415
<scientes> closed
<andrewrk> kristate, did you get to use macos stack traces yet? :)
<kristate> andrewrk: going to pull and make right now. I am excited.
<scientes> I was trying to think about how go-like async could be added. it is kinda intrusive
<andrewrk> also now error return traces are going to be beneficial for you
<scientes> and it would mean libraries couldn't be called as shared libraries
<andrewrk> scientes, why would we want go-like async when we can have multiplexed async/await?
<scientes> yeah that works
<andrewrk> what we have prototyped right now is more natural to parallelize
<scientes> with promises
<andrewrk> with go's model you have to choose where to parallelize things and it's difficult to be optimal
<moxotter> andrewrk, I'm an AI developer specializing in neural networks. I was wondering if Zig makes use of the FMA instruction set?
<andrewrk> moxotter, are you talking about the fused multiply-add operation?
<moxotter> andrewrk, yes
<andrewrk> moxotter, here's the issue to track for that: https://github.com/ziglang/zig/issues/767
<andrewrk> it's scheduled for 0.4.0 (note that 0.3.0 is to be released sept 12)
<andrewrk> it will probably be implemented as a builtin function, like these: https://ziglang.org/documentation/master/#Builtin-Functions
<andrewrk> and then also I'm guessing you will want to keep an eye on the SIMD issue as well: https://github.com/ziglang/zig/issues/903
<scientes> kristate, i'm just running into the same problems experimenting with tcp
<moxotter> andrewrk, so they are planned features, awesome.
<kristate> scientes: yeah -- I have udp and tcp
mnoronha has joined #zig
<kristate> conference room: https://meet.jit.si/zig
karlguy has quit [Quit: Konversation terminated!]
<kristate> scientes: what platform are you on? mac?
<scientes> I use ubuntu and debian
<kristate> okay
<kristate> scientes: your video is stalled -- framerate 1
<scientes> i can see that
<scientes> upload speed is only 10 mbps
<scientes> screen share only works for x11 windows
<scientes> not wayland
<kristate> scientes: okay
mnoronha has quit [Ping timeout: 244 seconds]
<kristate> scientes: CPU runs hot with screen sharing :-)
ryanmtate has joined #zig
<kristate> ryanmtate: hi ryan
<kristate> ryanmtate: conference room: https://meet.jit.si/zig
<scientes> ?
<scientes> is my sound working?
<scientes> i can hear you
darithorn has quit [Quit: WeeChat 2.2]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 272 seconds]
return0xe has quit [Ping timeout: 244 seconds]
return0e has joined #zig
<kristate> scientes: thanks for the conference call
<scientes> :)
kristate has quit [Read error: Connection reset by peer]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 252 seconds]
ryanmtate has quit [Ping timeout: 264 seconds]
kristate has joined #zig
mnoronha has joined #zig
davr0s has joined #zig
mnoronha has quit [Ping timeout: 268 seconds]
<kristate> andrewrk: are you awake?
<kristate> saw a commit 1 hour ago
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mnoronha has joined #zig
kristate has quit [Ping timeout: 264 seconds]
mnoronha has quit [Ping timeout: 272 seconds]
DutchGh0st has joined #zig
<DutchGh0st> what do you think of this: https://pastebin.com/fRU2hZpP ?
<DutchGh0st> it's goal is to kind of mimmic 'Traits' or 'Interfaces', or how you want to call it
<DutchGh0st> maybe require itself should @compileError if it fails to find the functions the 'Trait' specifies
kristate has joined #zig
DutchGh0st has quit [Ping timeout: 252 seconds]
_whitelogger has joined #zig
davr0s has joined #zig
mnoronha has joined #zig
ryanmtate has joined #zig
mnoronha has quit [Ping timeout: 268 seconds]
ryanmtate has quit [Ping timeout: 276 seconds]
DutchGh0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<kristate> haha, just got a taste of stack traces on macos
<DutchGh0s> I have a struct, it has a function taking '*this',
<DutchGh0s> but whenever I call that function, it complains I call it with *const this, instead of *this
davr0s has joined #zig
<kristate> DutchGh0s: got a gist or pastebin?
<DutchGh0s> 2 seconds
<DutchGh0s> var nxt = self.iter.next() ?? return null; <-- does not work anymore?
<DutchGh0s> kristate: , check the 'repro' function: https://pastebin.com/wvWinNer
<DutchGh0s> 'var ptr = item.as_mut();' does not work there
<kristate> taking a look
<kristate> DutchGh0s: what version of zig are you working with?
<DutchGh0s> uhh
<DutchGh0s> zig-0.2.0+ad3af97d
wryun has joined #zig
<kristate> is that from git master ?
<DutchGh0s> not that old I believe
<DutchGh0s> its from the website that builds on each commit
<DutchGh0s> it was the newest build of like 3 weeks ago or something?
wryun has quit [Quit: wryun]
<kristate> I'm getting an assert from within the compiler
<DutchGh0s> now the thing is,
<DutchGh0s> if you copy the argument into a new variable
<DutchGh0s> and then call .as_mut()
<DutchGh0s> it works
<DutchGh0s> but that is a copy, I dont like copies
<kristate> Assertion failed: (const_val->special == ConstValSpecialStatic), function hash_const_val, file /Users/cfkk/Source/zig2/src/analyze.cpp, line 4686.
<kristate> that is an old issue though
<kristate> DutchGh0s: you are not getting any sort of assert error on your build of zig?
<kristate> DutchGh0s: I don't think we have the logic inside of the compiler right now to do that sort of transformation in comptime -- but maybe you could use a builtin intrinsic
<DutchGh0s> error: expected type '*thingy', found '*const thingy'
<DutchGh0s> var ptr = item.as_mut();
<kristate> DutchGh0s: is that with repro ?
<kristate> On my build, I don't get an error :-)
<kristate> rather, I get a nasty assert, but the error is different
<DutchGh0s> yes, with repro
<kristate> DutchGh0s: what are you trying to accomplish?
<DutchGh0s> invent some kind of 'Trait' system, but without allocation and fully checked at comptime
<kristate> DutchGh0s: hmm, might be better to do these sort of things inside of the compiler
<DutchGh0s> but Im not a compiler hacker xD
<DutchGh0s> and maybe there are people who not like it
<kristate> DutchGh0s: it's not too hard :-) the world needs more compiler hackers
<kristate> DutchGh0s: you can learn a lot by looking at pull requests
wryun has joined #zig
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 272 seconds]
<DutchGh0s> how do I unwrap a nullable
<DutchGh0s> oh, .?
<DutchGh0s> but how do I unwrap, or if null, return null ?
<DutchGh0s> that used to be 'something ?? return null'
<scientes> if (maybe_something) |something| { } else return null
<kristate> if (abc) |a| { //do something with `a` }
<bodie_> fwiw, I figured out what I was doing wrong with LZ4.
<MajorLag> DutchGh0s: the `??` operator was replaced with `orelse`. `something orelese return null;`
<bodie_> The lz4.h interface doesn't support the streaming frame protocol, only the one in lz4_frame.h does.
<scientes> I still think its a bad idea to but so much extra data in a file that is mmap()ed
rohlem has joined #zig
<kristate> scientes: morning
<rohlem> hiho
<rohlem> DutchGh0s: I think you're looking for 'orelse', shown in https://ziglang.org/documentation/master/#Table-of-Operators
<rohlem> const something = maybe_something orelse return null;
<rohlem> Someone else must have thought of this already, but how would #1403 / #1418 interoperate with `continue` statements?
<rohlem> Specifically identifiers declared after a `continue`, will using those be disallowed, or tracked as undefined behaviour?
<rohlem> (referring to https://github.com/ziglang/zig/issues/1403 - continue expression with scope of while body)
wryun has quit [Quit: wryun]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
_whitelogger has joined #zig
mnoronha has quit [Ping timeout: 244 seconds]
<DutchGh0s> mhhh
<DutchGh0s> okey this is weird
<DutchGh0s> I run build-exe
<DutchGh0s> but I dont get an exe xD
<kristate> DutchGh0s: not in ./zig-cache/ ?
<DutchGh0s> no
<DutchGh0s> try it
<kristate> DutchGh0s: what's the command you are using, btw?
<kristate> DutchGh0s: I am getting a segfault
<kristate> DutchGh0s: you're like a natural fuzzer :)
<DutchGh0s> a segfault o.O
<DutchGh0s> ..\zig-nightly2\zig-0.2.0+ad3af97d\zig.exe build-exe .\decorator.zig
<DutchGh0s> thats all
<kristate> DutchGh0s: hang on -- I am trying to push updates to https://github.com/ziglang/zig/pull/1389
<DutchGh0s> maybe it does not like that .enumerate() takes any type by value
<kristate> DutchGh0s: I haven't looked at all of your code, but I did a backtrace on the compiler code and found a bug, so maybe we can fix that
<DutchGh0s> \o/
<DutchGh0s> but on windows it does not segfault, it just does...something, but doesnt create an executable
<kristate> okay, pushed it up: https://github.com/ziglang/zig/pull/1389
<kristate> DutchGh0s: let me take a look
<DutchGh0s> mhh, another weird thing: when create a comptime range, and then calling .next() in a loop and printing the returned value, does not print
<DutchGh0s> comptime var enumer = Iterator(range(), usize).enumerate(r); while (r.foo()) |item| { sum += item; }<--- compiles
<DutchGh0s> but there is no .foo() method
mnoronha has joined #zig
<andrewrk> kristate, wow, just got the email about sponsorship!
<kristate> andrewrk: yeah man -- let's launch all the zig
<andrewrk> lets get your logo on ziglang.org
<kristate> andrewrk: we can talk about that later -- let's do something when we launch 0.3.0
mnoronha has quit [Ping timeout: 268 seconds]
<andrewrk> ok, deal
<kristate> I offered scientes a job to hack on zig and I want to support all of the zig guys.
<andrewrk> that's very exciting, congrats scientes
<kristate> andrewrk: the offer also stands to anyone hacking on zig
<kristate> filter is probably if they have commits in master
<DutchGh0s> is there a job as 'compiler breaker' ?
<andrewrk> DutchGh0s, that job becomes more valuable with the passing of time
<andrewrk> in other news, llvm7 branch passed all tests with llvm 7.0.0rc2 in debug mode
<kristate> andrewrk: got another patch to fix the bug that DutchGh0s just found
mnoronha has joined #zig
<DutchGh0s> what was the fault of it?
<kristate> /Users/cfkk/Source/zig2/build/ddd.zig:18:13: error: 'enumerate' depends on itself
<kristate> pub fn enumerate(self: SELF) Enumerate(SELF, Item) {
<DutchGh0s> because playing around a bit more, I can call 'comptime { require(Iterator(Iter, Iter), Iter) }', and it compiles fine
<DutchGh0s> aka, Iter would be a type that has a next function, that returns maybe itself ?
<DutchGh0s> which is totally not the case
<DutchGh0s> enumerate depends on itself? huh?
<DutchGh0s> how does it depend on itself?
<kristate> DutchGh0s: can you clarify how you think it does not?
<DutchGh0s> well I have a function, Iterator, that returns a struct with 3 methods,
<DutchGh0s> .REQUIRE_next(), which you can see as a function that should be implemented to be an Iterator,
<DutchGh0s> a .enumerate() function, which returns whatever Enumerate() returns,
<kristate> DutchGh0s: if you can, best thing to try would be to pull-down my repo and checkout the const_ptr_pointee-deref-fix branch
<DutchGh0s> Enumerate() takes 2 comptimes, one to determine the type it calls .next() on, and another to know what the actual item type is
<DutchGh0s> where the item type is the type returned by .next()
<DutchGh0s> Ill download it once it's build
<DutchGh0s> its really just the normal Iterator-like stuff
<DutchGh0s> oh I see
<DutchGh0s> maybe its a problem with 'this',
davr0s has joined #zig
DutchGh0s has quit [Ping timeout: 252 seconds]
return0e has quit [Remote host closed the connection]
<MajorLag> andrewrk, did you see rohlem's question about #1403 and `continue`? I am also curious about this.
ryanmtate has joined #zig
ryanmtate has quit [Ping timeout: 264 seconds]
<andrewrk> kristate, 68e279 should trip the assert for the bug. do we have a test case?
<kristate> andrewrk: the test case was/is a somewhat long file from DutchGh0s
<kristate> I will post it in its entirety
<andrewrk> kristate, here's the steps to fix it: 1. start with DutchGh0s big file and reproduce it. 2. delete stuff from it until you have a minimal test case 3. fix the root cause, which is causing the value to be null 4. add test case to test/behavior.zig
<andrewrk> no worries if that's too much work, I'll take it on
DutchGh0st has joined #zig
<kristate> andrewrk: yes, I agree with you -- but it is hard to get your head around :-)
<kristate> what to cut
<kristate> andrewrk: if you can take care of it, that would be great
<kristate> I am working on #1223
<DutchGh0st> Ill try and reduce
<DutchGh0st> if that helps
<andrewrk> DutchGh0st, that would help a lot. if you can't do that, that's ok too, I would accept a bug report with your big test case too
<kristate> DutchGh0st: andrewrk that would be hard for you/him
<kristate> andrewrk: he is on windows and doesn't have a master build
<DutchGh0st> I could download the latest succedfull build
<DutchGh0st> and I have the 2.0 build
<DutchGh0st> I can at least try and reduce the Zig source :)
<andrewrk> I'm going to do social activities today, might be around later
<andrewrk> bye
<wink_> I tried to compile examples/hello_libc.zig and had to make some changes to do so. I had to remove the parameters, change return to u8 and return a positive value. Want me to create a PR or is it supposed to work as it and I've done something wrong?
ryanmtate has joined #zig
rohlem has quit []
<DutchGh0st> okey I got it to a minimal repro
<kristate> DutchGh0st: cool -- post it for me please
<DutchGh0st> but when removing a comptime block, it doesnt compile
<DutchGh0st> removing the comptime { require(....) } from the Enumerate() function, does not compile
<kristate> DutchGh0st: hmm, can you get it down to <= 10 lines?
<DutchGh0st> 10!
<DutchGh0st> uf
<DutchGh0st> maybe xD
<DutchGh0st> let met check something really quickly
<kristate> thanks
<DutchGh0st> 10 lines is verry little
<kristate> it needs to fit in our test suite
<DutchGh0st> nope
<DutchGh0st> cant really make it shorter
<DutchGh0st> actually
<DutchGh0st> hehehe
<DutchGh0st> almost 10
<kristate> cool
<DutchGh0st> 18
<DutchGh0st> is that fine?
<kristate> let me see them -- maybe we can shorten it
<kristate> not bad
<DutchGh0st> line 6 should fail actuallyt
<DutchGh0st> I do not call the function Wrapper() there
<DutchGh0st> while the return type is 'Wrapper()', which is some type
<DutchGh0st> I dont know how to make it shorter :3
<kristate> going to take a break
<kristate> 3:44 am in Japan
<DutchGh0st> I made it 13 lines
<DutchGh0st> Oh!
<DutchGh0st> wow
<DutchGh0st> thats the other side of the world....
reductum has joined #zig
mnoronha has quit [Ping timeout: 272 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 272 seconds]
<DutchGh0st> kristate: , 5 lines , well...8 if you count the main function
kristate has quit [Remote host closed the connection]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
return0e has joined #zig
DutchGh0st has quit [Ping timeout: 252 seconds]
davr0s has joined #zig
<scientes> I think its a bug in strip
<scientes> strip removes all the symbols
darithorn has joined #zig
wryun has joined #zig
wryun has quit [Quit: wryun]
mnoronha has joined #zig
wryun has joined #zig
wryun has quit [Client Quit]
wryun has joined #zig
wryun has quit [Client Quit]
wryun has joined #zig
mnoronha has quit [Ping timeout: 268 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kristate has joined #zig
mnoronha has joined #zig
kristate has quit [Ping timeout: 272 seconds]
mnoronha has quit [Ping timeout: 272 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 252 seconds]
mnoronha has joined #zig
reductum has quit [Quit: WeeChat 2.2]
davr0s has joined #zig
darithorn_ has joined #zig
darithorn has quit [Ping timeout: 276 seconds]
darithorn_ has quit [Client Quit]
<wink_> I found my problem compiling hello_libc.zig, I needed to compile using --library c like so: "$ zig build-exe --library c example/hello_world/hello_libc.zig".
dbandstra has joined #zig