ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
hoppetosse has quit [Remote host closed the connection]
hoppetosse has joined #zig
hoppetosse has quit [Ping timeout: 264 seconds]
<MajorLag> yeah, it's a tweening library
<MajorLag> ...did I misunderstand somethig? isn't 0.2.0.cc35f085 supposed to have @field?
<MajorLag> oh nevermind, I think I extracted the wrong build accidentally
<MajorLag> works as advertised.
davr0s has joined #zig
MajorLag has quit [Ping timeout: 276 seconds]
MajorLag has joined #zig
MajorLag has quit [Ping timeout: 264 seconds]
isd1 has quit [Ping timeout: 248 seconds]
MajorLag has joined #zig
MajorLag2 has joined #zig
MajorLag has quit [Ping timeout: 276 seconds]
MajorLag2 has quit [Ping timeout: 240 seconds]
MajorLag has joined #zig
relatingdata has joined #zig
<relatingdata> in zig what is the way of declaring the constant C++ array of constant strings like const (char *) const months[12] = { "Jan", .... ,"Dec"}; ?
<MajorLag> `const months = []const []const u8{ "Jan", "Feb", ... };`
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<relatingdata> Thanks :-) easier on the eye too :-)
relatingdata has quit [Quit: Page closed]
relatingdata has joined #zig
adagio1 has quit [Quit: Leaving.]
relatingdata has quit [Quit: Page closed]
adagio1 has joined #zig
return0e_ has joined #zig
return0e_ has quit [Read error: Connection reset by peer]
return0e_ has joined #zig
adagio1 has quit [Quit: Leaving.]
adagio1 has joined #zig
adagio1 has quit [Client Quit]
<GitHub10> [zig] andrewrk pushed 1 new commit to master: https://git.io/vpqaz
<GitHub10> zig/master 6e57243 Andrew Kelley: zig fmt: preserve comments in front of test blocks...
<heakins> OK now my AES-128 implementation can encrypt 155MB/s compared to 212MB/s for mbedTLS... getting closer
davr0s has joined #zig
<GitHub118> [zig] harryeakins opened pull request #935: Improving throughput test (master...improving_throughput_test) https://git.io/vpqwO
jjido has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jjido has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SimonNa has quit [Quit: Leaving]
return0e_ has quit []
<alexnask> Are there any docs on async/promises?
<alexnask> Nvm I'll look into the coroutines tests
<alexnask> What allocator is used when none is given to async?
hoppetosse has joined #zig
Hejsil has joined #zig
<Hejsil> alexnask, I haven't done anything with coroutines, but I would guess that it would use the parent async functions allocator
<Hejsil> Aka, you have to provide an allocator if you're doing an async all from a non async function
<alexnask> Right, makes sense
Hejsil has quit [Quit: Page closed]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<alexnask> Can I declare a comptime constant at global scope that will not get included in the binary?
MajorLag has quit [Ping timeout: 256 seconds]
MajorLag has joined #zig
Hejsil has joined #zig
steveno_ has joined #zig
<Hejsil> alexnask, if it isn't used at runtime, then it isn't compiled into the binary
<Hejsil> And for things like: const a = 2; fn a() u64 { return a; }, Im pretty sure the optimizer will take care of that
<alexnask> Right, good to know, I thought defining consts in global scope forced them into the binary
<alexnask> I got around my usecase a different way (that uses @field) anyways :)
<andrewrk> alexnask, I'm doing a proof of concept on a bunch of concurrency stuff and I'll write docs soon
steveno_ has quit [Quit: Leaving]
<alexnask> Pretty nice, I just use a struct with function pointers (+ a global instance named gl) and a func that automatically loads all of them from OpenGL
<alexnask> Works like a charm
<andrewrk> alexnask, nice, is the code published somewhere?
<andrewrk> on windows, right?
<alexnask> Not yet, I guess I will upload it at some point
<alexnask> Yup it's on windows
<alexnask> This is basically it though: http://prntscr.com/j7vddo
<alexnask> Nice and simple
<andrewrk> oh wow that's beautiful
<andrewrk> alexnask, mind if I post this on twitter?
<alexnask> I'm going to work on @reflect/@reify this weekend btw
<alexnask> Ofc not, go ahead :)
<alexnask> Would you prefer that I delete all the current @typeId etc functions or should I make them post a deprecation warning?
<alexnask> I'll also make a std.meta package that exposes them like before so basically @<reflection_func> -> std.meta.<reflection_func>
<alexnask> (That will obviously use @reflect behind the scenes)
<andrewrk> alexnask, `comptime` in front of `const` is redundant
<andrewrk> maybe I can make a compile error for this
<alexnask> TIL
<andrewrk> or rather, it's equivalent to putting the comptime in front of the initializer expression. but @memberName is always comptime so that is redundant
<alexnask> Right, got it, I thought const meant that the value was always present at runtime while comptime forced it to only be used in a comptime context
<andrewrk> is wglGetProcAddress expecting a null terminated string?
<alexnask> Yes, I shpuld probably ++ []u8 { 0 } right?
<andrewrk> I believe you can simply change "gl" to c"gl"
<andrewrk> otherwise what you said should work fine
<alexnask> The compiler doesn't complain with c"gl", nice
<alexnask> Right, it appears I still need to add the null byte
<alexnask> Even with c"gl"
<andrewrk> ah ok. so zig decided that &const u8 and []const u8 would be resolved to []const u8, ignoring null terminators
<andrewrk> this will be solved with pointer reform
<alexnask> Here's a new screenshot if you want it ;) http://prntscr.com/j7vkpy
<andrewrk> MajorLag, I'm happy to take over the std.os.time PR from you and do whatever needs to be done to get it merged this weekend
<andrewrk> thanks for spearheading that work
<andrewrk> I looked into the aux vector thing on linux too; I think I can make static linux binaries use the vdso
<MajorLag> Cool. I'd be really surprised if darwin works on the first attempt. If it weren't for the merge conflict CI could have helped me get that right first.
<MajorLag> How would that work w/ vdso?
<alexnask> std.mem.eql appears not to be working at comptime
<alexnask> Nvm, I think it's not std.mem.eql
<andrewrk> MajorLag, there's an "auxilery vector" given to programs, even static ones, which contains the address of the vdso. so then you just have to find the function address and jump to it, or something like that
<MajorLag> yeah, that's how it works. It's an elf image, so you have to do a lookup in the symbol table. What I mean is, how is the compiler doing that? vdso may or may not exist at runtime. Or did you just mean adding support for vDSO to os.time? That shouldn't be too tricky, though there is the problem of first determining if vDSO is available or not.
<andrewrk> I mean adding support in the std lib for accessing the auxilery vector, and then yes having std.os.time use the vdso, if available
cenomla has joined #zig
<alexnask> I hate WinAPI so much >.<
<MajorLag> anything in particular?
<alexnask> I'm struggling to find any parts I don't hate :p
<andrewrk> I think the audio api is better than linux
<andrewrk> that's a pretty low bar though
<alexnask> The one that triggered me right now is all the juggling to create a rendering context, then load OpenGL functions just to make a modern OpenGL enabled rendering context
<andrewrk> I would be curious to see a minimal example
<alexnask> Just give me the best version of OpenGL you can handle man :P
<andrewrk> I wonder if a cross platform abstraction for creating a window + opengl context makes sense to be in std
<alexnask> Only if nice OpenGL bindings are also available
<alexnask> But then people would ask for sound and inputs too etc
<alexnask> And in the end you are just remaking SDL
<andrewrk> true. I think we just need to have a great package manager, and trust users to create high quality packages
<alexnask> Right, the package manager would be great
<andrewrk> working on it! self-hosted compiler is underway, plus I have some networking proof of concept code working
cenomla has quit [Read error: Connection reset by peer]
cenomla has joined #zig
Ichorio has joined #zig
davr0s has joined #zig
<MajorLag> oh, yeah, win32 kind hates opengl > 1.1. Otherwise I have pretty much the oposite opinion and find Win32 API makes a lot more sense to me than posix.
<MajorLag> but posix is a pretty low bar too, I guess.
<MajorLag> as far as the context thing, what casey does in hmh is create a whole new window and opengl context just for loading extensions, then throw them away when he's done.
cenomla has quit [Quit: cenomla]
rain1 has joined #zig
cenomla has joined #zig
cenomla has quit [Client Quit]
noonien has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hinst_ has quit [Ping timeout: 240 seconds]
hinst has joined #zig
jjido has joined #zig
cenomla has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jjido has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jjido has joined #zig
hoppetosse has quit [Ping timeout: 265 seconds]
isd has joined #zig
qazo has joined #zig
<alexnask> @MajorLag I do something similar
qazo has quit [Ping timeout: 240 seconds]
rain1 has quit [Quit: Leaving]
cenomla has quit [Quit: cenomla]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<GitHub145> [zig] tiehuis pushed 2 new commits to master: https://git.io/vpYI7
<GitHub145> zig/master eef4bbb Harry Eakins: Changed all MB to MiB
<GitHub145> zig/master b229aff Harry Eakins: Readability improvements and bug-fix to std/crypto/throughput_test.zig
<GitHub199> [zig] tiehuis closed pull request #935: Improving throughput test (master...improving_throughput_test) https://git.io/vpqwO
<achambe> andrewrk: as far as network applications go, I had the thought a memcached compatible server might be an appropriate showcase people can use - I had the impression memcached has a simple protocol, but not certain.
<achambe> also, maybe a jerk comment, but be careful how much time you spend writing crypto code in zig, its just a bottomless pit of work with not that much payoff if zig has a C compiler built in.
<achambe> crypto libraries can probably be bundled with no dependency on libc anyway.
<achambe> doing that will mainly just attract people complaining the implementations are not constant time
<achambe> or not fast enough
<achambe> etc etc.
<achambe> go ahead if it is just for fun though.
qazo has joined #zig
isd has quit [Ping timeout: 264 seconds]