ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
shodan45 has quit [Quit: No Ping reply in 180 seconds.]
schme245 has quit [Remote host closed the connection]
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Ping timeout: 255 seconds]
sebastianlin has joined #zig
kristate has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
_whitelogger has joined #zig
kristate has quit [Ping timeout: 240 seconds]
knebulae has joined #zig
knebulae has quit [Quit: Leaving]
knebulae has joined #zig
kristate has joined #zig
sebastianlin has quit [Ping timeout: 256 seconds]
kristate_ has joined #zig
kristate has quit [Ping timeout: 244 seconds]
sebastianlin has joined #zig
very-mediocre has joined #zig
schme245 has joined #zig
schme245 has quit []
sebastianlin has quit [Ping timeout: 256 seconds]
kristate has joined #zig
kristate_ has quit [Ping timeout: 246 seconds]
Zaab1t has joined #zig
Zaab1t has quit [Quit: bye bye friends]
Ichorio has joined #zig
fsateler has joined #zig
fsateler has quit [Client Quit]
fsateler has joined #zig
forgot-password has joined #zig
<forgot-password> exit
<forgot-password> oops, sorry :)
forgot-password has quit [Client Quit]
Flaminator has joined #zig
marmotini_ has joined #zig
Zaab1t has joined #zig
Zaab1t has quit [Client Quit]
jevinskie has joined #zig
jevinski_ has quit [Ping timeout: 258 seconds]
kristate has quit [Remote host closed the connection]
Ichorio has quit [Ping timeout: 255 seconds]
Ichorio has joined #zig
very-mediocre has quit [Ping timeout: 256 seconds]
mercurian has joined #zig
Akuli has joined #zig
marmotini_ has quit [Ping timeout: 245 seconds]
jevinskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jevinskie has joined #zig
jevinskie has quit [Ping timeout: 250 seconds]
darithorn has joined #zig
Zaab1t has joined #zig
<Zaab1t> andrewrk: recommended ressources for learning llvm to create toy languages?
<andrewrk> Zaab1t, I would start with https://llvm.org/docs/LangRef.html
<Zaab1t> andrewrk: so the general approach is just to write llvm assembly to a file and then let llvm do the rest?
<andrewrk> and observe the LLVM IR that clang and zig output for various examples
marmotini_ has joined #zig
<andrewrk> is your toy language Ahead Of Time compiled or Just In Time?
<andrewrk> there is also this: https://llvm.org/docs/tutorial/
wilsonk has quit [Read error: No route to host]
<mercurian> the second one is probably a better starting point :)
<mercurian> though I imagine the language reference is a great resource
<Zaab1t> andrewrk: I dont really know anything about the language. A friend of mine said he had a goal since his twenties to create his own programming language and now he is forty-something. Decided to help him out, already looked at the docs
<Zaab1t> just thought there maybe was a really good talk, or hello world or whatever :p
<Zaab1t> ill dig into the docs
<andrewrk> Zaab1t, the general approach for AOT is to build an in memory representation of LLVM IR in a "module" and then you can call LLVM functions to write it to a .o file. then you have to link it
<andrewrk> if your friend just wants a toy language, he might consider interpreting first. that's the easiest
<Zaab1t> well he is a compile-a-holic generally, so I'm betting he does not want interpreted :p
<Akuli> how does zig's optimizer work? it seems a bit magical to me, or does zig just use some llvm's optimizer thing?
DutchGh0st has joined #zig
<andrewrk> Akuli, optimization is all LLVM
<DutchGh0st> what do you think of this?: https://pastebin.com/SuKUMTgJ
<andrewrk> zig guaranetes certain semantics to the programmer, and then LLVM takes care of the rest
<andrewrk> *guarantees
<DutchGh0st> its digits10, but you choose (at compiletime) the ammount of unrolls its gonna do
<DutchGh0st> and if you pass in null for `unroll`, then its gonna do a full unroll
<andrewrk> DutchGh0st, neat! looks like a nice example to demonstrate how zig's comptime features work
<DutchGh0st> there's one problem with it however, it doesn't work on isize, usize, i64 and u64, somehow
<DutchGh0st> it overflows somewhere, so I need to fix that
<DutchGh0st> okey thats fixed now
schme245 has joined #zig
darithorn has quit [Remote host closed the connection]
jevinskie has joined #zig
jevinskie has quit [Client Quit]
marmotini_ has quit [Ping timeout: 272 seconds]
<DutchGh0st> andrewrk: , would you say that comptime operates at *design* time,
<andrewrk> I watched 30 seconds of that clip that somebody linked about "design time" and it didn't make sense to me
<DutchGh0st> becuase you can just write `if (comptime expr) { // One implementation} else { // another implementation }`
<andrewrk> it literally happens at compile time. if you want to call that "design time", ¯\_(ツ)_/¯
<DutchGh0st> more in the sense that you can write multiple implementations while you're writing, without paying any cost at runtime
<DutchGh0st> sure, comptime executes during compilation, but just the fact you can write `if(comptime whatever) {} else {}` is powerfull :)
<andrewrk> agreed
wilsonk has joined #zig
wootehfoot has joined #zig
marmotini_ has joined #zig
DutchGh0st has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #zig
marmotini_ has quit [Ping timeout: 246 seconds]
Zaab1t has quit [Quit: bye bye friends]
marmotini_ has joined #zig
marmotini has joined #zig
marmotini_ has quit [Ping timeout: 246 seconds]
darithorn has joined #zig
DutchGh0st has joined #zig
marmotini has quit [Ping timeout: 250 seconds]
darithorn has quit [Ping timeout: 258 seconds]
darithorn has joined #zig
<DutchGh0st> Think this is the final code, with tests: https://pastebin.com/LKwXYimX
dec05eba has joined #zig
<DutchGh0st> altough one of the overflow checks at compiletime can go away actually, lol
<dec05eba> i love zig. I dont have to use aweful c++ anymore
<DutchGh0st> I've never used c++ haha
<DutchGh0st> but I love doing comptime stuff, see how far you can actually push it
darithorn has quit [Remote host closed the connection]
<DutchGh0st> soo how did you get into zig dec05eba?
<dec05eba> i think i saw it posted on reddit or something. I was looking at new languages like jai and zig looked ideal for the type of programming i do and unlike rust, zig is not an ugly as sin
<dec05eba> since i like zig i added support for it in my c++ build system so you can mix c/c++/zig code and automatically fetch dependencies
<dec05eba> how did you get into zig if you haven't used c++? i would assume people who use zig come from c / c++ world
<DutchGh0st> Jai, heh
<DutchGh0st> I...think I saw one of andrews video's when I was on youtube once
<DutchGh0st> it probably showed up because I watched alot of Jonathan's Jai video's back in the day
<DutchGh0st> why is Rust ugly as sin? I think Rust is quite beautifull
<DutchGh0st> it's where I come from :3
<wrl> subjective analysis of languages is pretty low-brow honestly
<wrl> or, rather, their "beauty"
<DutchGh0st> the only ugly thing within Rust that I agree is ugly, is the `unsafe` keyword
<DutchGh0st> but it's purpose is usefull
<mercurian> lol
<mercurian> oh Jai, if it ever actually releases, I'll be interested to see it
<mercurian> but, it has exceptions, so there's only so much I can like it
<dec05eba> maybe if i use rust more i would feel more comfortable using it, but it feels like you are re-learning c++ when learning to use rust. I have used c++ for around 9 years but i hate it
<dec05eba> does jai have exceptions now? jonathan blow said he dislikes exceptions
<DutchGh0st> I dont think he'll ever add those
<mercurian> there's a video where he covers adding them
<mercurian> perhaps he removed them
<mercurian> but, that's when I stopped following the language's development
<DutchGh0st> he has done quite some work on his game, and game engine lately
* mercurian doesn't know
<mercurian> not available on linux
<mercurian> (afaik)
<DutchGh0st> I dont know, its not finished yettt
<mercurian> which game?
<DutchGh0st> sokobon
<dec05eba> he demoed the game in linux
<DutchGh0st> sokabon? something like that
<dec05eba> so the language also works on linux
<dec05eba> somebody else ported it to linux
<mercurian> dec05eba: jai? it hasn't been released, even privately, has it?
<DutchGh0st> it actually has
<DutchGh0st> but only for like 10 people
<DutchGh0st> welp, this is awesome: https://godbolt.org/z/D104ot
schme245 has quit [Remote host closed the connection]
<mercurian> hmm
Akuli has quit [Quit: Leaving]
<andrewrk> DutchGh0st, if (comptime unroll) <--- the comptime is redundant here. you need it to make function calls comptime but not for expressions that are already comptime
<andrewrk> of course you can do that to make it explicit, if that helps readability
<DutchGh0st> oh! maybe the keyword helps realize the if - else is done at compiletime
<DutchGh0st> but good catch!
shodan45 has joined #zig
mercurian is now known as halosghost
MajorLag has quit [Ping timeout: 246 seconds]
MajorLag has joined #zig
DutchGh0st has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
MajorLag has quit [Ping timeout: 252 seconds]
MajorLag has joined #zig
halosghost has quit [Quit: WeeChat 2.3]
wootehfoot has quit [Read error: Connection reset by peer]
tleguern_ has joined #zig
Ichorio has quit [Ping timeout: 255 seconds]
<andrewrk> alright. we're down to 2 non-WIP pull requests, oldest one being 9 days ago
<daurnimator> andrewrk: I'm unsure why valgrind PR is a WIP. Its not "complete valgrind support for zig", but it is useful code already to merge.
<andrewrk> daurnimator, apologies, I removed the label
<andrewrk> I'll take it from here
MajorLag has quit [Ping timeout: 268 seconds]
MajorLag has joined #zig
tleguern_ has quit [Ping timeout: 256 seconds]
<daurnimator> andrewrk: I noticed the http issue doesn't have a userland tag
MajorLag has quit [Ping timeout: 250 seconds]
<andrewrk> fixed
<daurnimator> andrewrk: so what are your current priorities?
<daurnimator> We need a new planning blog post :P
<andrewrk> yeah, the problem is that those compete for time getting stuff done
<andrewrk> my priorities for 1 month are the 0.4.0 release. trying to get some new stuff in there, get the docs done that are long overdue, and fix a reasonable amount of bugs
<daurnimator> okay. so bug bashing + docs (rather than e.g. copy elision - take 3)
<andrewrk> then I'm going to go for attempt #3 at copy elision. coroutine rewrite. major language changing proposals. self-hosted compiler.