ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<andrewrk> fine by me
<jfo> well,
<jfo> the closes I could come to your orange was https://www.hexcolortool.com/ec915c
<jfo> closest*
<jfo> so either one of those will work, it's up to you
<jfo> I pushed the orangish one https://github.com/github/linguist/pull/4005
<andrewrk> cool
<MajorLag_> is a ?&c_void returned by an extern fn treated specially? because it seems to behave differently than the same type as a field in an extern struct.
jfo has quit [Quit: WeeChat 1.9.1]
<MajorLag_> or as returned by a non-extern fn, for that matter
<andrewrk> can you elaborate?
<andrewrk> ?&c_void is not supposed to be special
<MajorLag_> well I was trying to put together a minimal test case when I realized extern might be a factor. Don't think I'll be able to do that before I have to go though. Basically, if I call SDL_malloc I can do things with the result that I can't do with SDL_Surface.pixels. Specifically, I can cast it to a slice without a @ptrCast. If I return ?&c_void from a native fn (a fake malloc), I can't use ?? with it, but I can do that with SDL_malloc.
<andrewrk> hmm I'll have to poke around with this
<MajorLag_> error: slice of non-array type '?&c_void' is the error I get with SDL_Surface.pixels, error: incompatible types: 'void' and '&c_void' with fake malloc, even though the return type is explicitly ?&c_void.
<andrewrk> it looks like you need to handle null
<andrewrk> I gotta go AFK. feel free to file a bug and we'll get it sorted out one way or the other.
takeoffeveryzig has joined #zig
tridactyla has quit [Remote host closed the connection]
tridactyla has joined #zig
takeoffeveryzig has quit [Ping timeout: 260 seconds]
Topa has joined #zig
Topa has quit [Ping timeout: 256 seconds]
arBmind has quit [Ping timeout: 240 seconds]
Topa has joined #zig
Topa has quit [Ping timeout: 256 seconds]
Hejsil has quit [Read error: Connection reset by peer]
<tiehuis> by the way, working casually on a regex engine in zig. i've got a rudimentary parser/compiler/vm right now, might have something decent in a month or so.
<tiehuis> anyone had any pressing need for regexes yet?
Topa has joined #zig
Topa has quit [Ping timeout: 240 seconds]
jfo has joined #zig
<MajorLag_> andrewrk: so yeah, it wasn't a bug. I just didn't realize that it's behaving differently because the type I was slicing was actually &c_void, having been unwrapped by ??. However, I think I found a bug while working that out, which I've submitted.
<tiehuis> that error was actually fixed earlier today
jfo has quit [Ping timeout: 240 seconds]
<tiehuis> if you pull the latest you should be okay
<MajorLag_> Just my luck
<MajorLag_> I see why I didn't find it by searching for "extern"
jfo has joined #zig
<tiehuis> yeah, unlucky too that you were only one commit behind!
<jfo> tiehuis: I was just thinking about regexes last night! what flavor are you using?
<tiehuis> perl style I believe, although using a dfa approach so no backreferences and things
<tiehuis> i haven't fleshed out much yet, still need to flesh out some of the compilation and do some refactoring
jfo has quit [Ping timeout: 276 seconds]
jfo has joined #zig
<jfo> what is "dfa"?
<tiehuis> yes
<tiehuis> here a great set of articles outlining how it works: https://swtch.com/~rsc/regexp/regexp1.html
<tiehuis> pretty much what i'm basing everything on and it's what a few other languages like go, rust have followed pretty closely
davr0s has joined #zig
jfo has quit [Ping timeout: 252 seconds]
jfo has joined #zig
<jfo> cool, thanks for that link. lmk when it's on gh so I can take a look at it!
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jfo> tiehuis: this article is v good
<jfo> I appreciate how concise it is
Topa has joined #zig
Topa has quit [Ping timeout: 252 seconds]
arBmind has joined #zig
jfo has quit [Ping timeout: 256 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 256 seconds]
jfo has joined #zig
tiehuis has quit [Quit: WeeChat 2.0.1]
jfo has quit [Ping timeout: 256 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 256 seconds]
davr0s has joined #zig
jfo has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
jfo has quit [Ping timeout: 246 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 265 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 252 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jfo has joined #zig
jfo has quit [Ping timeout: 276 seconds]
jfo has joined #zig
davr0s has joined #zig
jfo has quit [Ping timeout: 240 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jfo has joined #zig
Hejsil has joined #zig
davr0s has joined #zig
jfo has quit [Ping timeout: 240 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 246 seconds]
jfo has joined #zig
arBmind has quit [Quit: Leaving.]
jfo has quit [Ping timeout: 256 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arBmind has joined #zig
davr0s has joined #zig
jfo has joined #zig
jfo has quit [Ping timeout: 246 seconds]
n_1-c_k_ has left #zig [#zig]
jfo has joined #zig
Hejsil has quit [Read error: Connection reset by peer]
jfo has quit [Ping timeout: 252 seconds]
jfo has joined #zig
jfo has quit [Ping timeout: 240 seconds]
jfo has joined #zig
tiehuis has joined #zig
jfo has quit [Ping timeout: 246 seconds]
<andrewrk> tiehuis, regex engine, that's exciting
<andrewrk> I have an idea for a use case
<tiehuis> what use case?
<andrewrk> you list a bunch of HTTP endpoints with regex, and the engine combines them into one master regex that dispatches accordingly
<andrewrk> for example, something like: addUrl("/user/(\d+)", handleUserFn); addUrl("/song/(\d+)", handleSongFn);
<tiehuis> right, i see
<andrewrk> idea being that instead of doing 2 regexes, at compile time it creates 1 regex
<andrewrk> this might be very difficult to achieve. I don't really know where to start
<tiehuis> you can actually do that in linear time fairly efficiently as you can combine regexes into a single automaton
<andrewrk> ooh
<tiehuis> although sorry this only allows you to know if one of those match
<tiehuis> so you wouldn't be able to dispatch in this case
<tiehuis> i know that fast routers in go typically use a radix trie, which we could compute at compile time
<tiehuis> those routers though usually are more limiting in their matching, however
jfo has joined #zig
<tiehuis> also would be really cool to be able to get regex construction at compile-time for free
<tiehuis> think the only thing blocking this right now is the ability to use allocators at compile-time
<tiehuis> just going back to the regex group construction, if we had good enough regex simplification you could just construct one big regex of the alternation of all the routes
<tiehuis> and then rely on the engine to simplify common literal prefixes
jfo has quit [Ping timeout: 265 seconds]
<andrewrk> tiehuis, I think we can solve the allocators at compile time problem
jfo has joined #zig
<andrewrk> not sure how to hook it up yet, but you should be able to allocate static storage with a comptime known size
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jfo has quit [Ping timeout: 256 seconds]
davr0s has joined #zig
<andrewrk> maybe we could have @comptimeAllocate() and then we could use that to create a mem.Allocator at comptime and pass that to a function
<andrewrk> I think this should work
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jfo has joined #zig
jfo has quit [Ping timeout: 252 seconds]
cenomla has joined #zig
jfo has joined #zig
davr0s has joined #zig
jfo has quit [Ping timeout: 256 seconds]
jfo has joined #zig
arBmind has quit [Quit: Leaving.]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<GitHub156> [zig] andrewrk pushed 1 new commit to master: https://git.io/vNDTn
<GitHub156> zig/master f66ac9a Andrew Kelley: fix crash when align 1 field before self referential......