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/
<andrewrk> it doesn't say that anywhere. it's a proposal for improving std.Mutex which is a single-process mutex
<andrewrk> I think it would help me to approve your work faster if you took some time to explain in more detail what you want to do. I find myself confused a lot when I try to understand what you want
<scientes> yes, i think that is good advice
<andrewrk> you're very smart, and impressively quick coder
<andrewrk> but sometimes it might help to slow down and help everyone else follow along
<andrewrk> especially when I'm 2061 insertions, 1819 deletions into a bug fix branch and trying to also merge PRs @_@
<scientes> yes, communication is key to programming
<mikdusan> for IPC mutex, wouldn’t it be better to model it completely separate from a same-process mutex? it’s a very high-end thing. and i suspect each platform will require some wizard level expertise
<andrewrk> that's what I was thinking
<andrewrk> though this robust futexes thing may be some kind of standard that is worth supporting
<mikdusan> yes like how linux syscalls vs. posix are supported. i think that makes sense.
<scientes> mikdusan, it won't share any code
<scientes> I also was thinking of a circular buffer lock
<scientes> I'll write up a proposal
oats is now known as ailur
ailur is now known as oa
<scientes> I wish I could run the test suite without having an open pull request
<scientes> My laptop is not really that fast, so its easier to run the test-suite remotely
<mikdusan> andrewrk: unrelated; to current topic; for zig invocation of clang for C code, this is probably how it will work long-term? ie. rely on clang? i ask re: #2046 . wondering if it’s ok to assume -MV (nmake/jom) dep format as opposed to regular make’ish stuff.
<andrewrk> scientes, do you know about -Dskip-release
<andrewrk> you can use the --help menu of zig build to see more options
<andrewrk> for example: ./zig build --build-file ../build.zig -Dskip-release test-std
<andrewrk> mikdusan, yes we can rely on -MV, because zig is tightly coupled to LLVM/libclang
<mikdusan> if u had the choice; would you have a preference between -MV or not? i’ll try to take a stab at a pr for the tokenizer.
<scientes> mikdusan, the cross-platform Mutex it would have to support the same API so that algorithms could use either, depending on context.
<andrewrk> mikdusan, you have to use -MV otherwise it generates ambiguous .d files
<mikdusan> conundrum. clang is always emitting the target name in make/compatible format, with pre-reqs adhering to -MV options.
<andrewrk> test with small file names, and with file names with spaces. those are the problem cases
<andrewrk> hryx, loving these zig fmt improvements
<hryx> thank you andrewrk! Gonna attempt one more today (1269)
<andrewrk> hryx, I'll post another example on that issue
<hryx> ooh, good call, I'll make sure that new one is covered
_whitelogger has joined #zig
scientes has quit [Quit: Leaving]
scientes has joined #zig
<scientes> Is there a technical reason that alignment is only u29, instead of u30?
<andrewrk> scientes, search llvm.org/docs/LangRef.html for "maximum alignment"
<scientes> there should be a better way than (size + alignment) to get large alignments out of mmap()....but of course there isn't
<scientes> besides reading all currant mappings from proc
<andrewrk> yeah it's unfortunate
<andrewrk> I also would like a way to request a specific address with one size, but if that address cannot be provided then I want a different size
<andrewrk> for growing a memory mapping
<scientes> you can do that
<scientes> just use MMP_FIXED
<scientes> MAP_FIXED
<scientes> on the first call
<scientes> and also use MAP_FIXED_NOREPLACE for safety
<scientes> MAP_FIXED_NOREPLACE (since Linux 4.17)
<andrewrk> ah great
<andrewrk> scientes, this documentation seems to contradict itself
<andrewrk> the notes for MAP_FIXED_NOREPLACE says that you can use MAP_FIXED on older kernels and rely on the result address to not match the hint address to find out if it failed
<scientes> yeah i noticed that too
<andrewrk> but the NOTES at the bottom imply that it would clobber existing mappings
shritesh has joined #zig
scientes has quit [Remote host closed the connection]
scientes has joined #zig
keithdc has joined #zig
scientes has quit [Ping timeout: 245 seconds]
keithdc has quit [Ping timeout: 258 seconds]
fengb_ has left #zig [#zig]
fengb_ has joined #zig
return0e has quit [Read error: Connection reset by peer]
return0e_ has joined #zig
<hryx> whew... finally finished the last zig fmt PR for tonight
scientes has joined #zig
scientes has quit [Ping timeout: 245 seconds]
_whitelogger has joined #zig
neceve has joined #zig
fsateler has quit [Read error: Connection reset by peer]
fsateler has joined #zig
fsateler has quit [Quit: ZNC 1.7.2+deb1 - https://znc.in]
fsateler has joined #zig
tiehuis has joined #zig
forgot-password has joined #zig
<forgot-password> Can somebody point me to the implementation of @field in the source code?
<tiehuis> Interesting mention of zig on this post on rust, in regards to moving towards preferring compile time function over macros: http://antoyo.ml/future-of-rust
tiehuis has quit [Client Quit]
tiehuis has joined #zig
<tiehuis> Ahh it is april 1st, seems like this was partly in jest. Seemed reasonable to me on surface. Ha
tiehuis has quit [Client Quit]
scientes has joined #zig
scientes has quit [Ping timeout: 245 seconds]
<hio> That's actually not nice to make an april fools joke and attack another language in it
<hio> especially since they are clearly wrong
halosghost has joined #zig
oa is now known as hafer
noonien has joined #zig
Zaab1t has joined #zig
Zaab1t has quit [Remote host closed the connection]
scientes has joined #zig
<andrewrk> it's fine, it's not necessarily an attack
<andrewrk> most commented post on https://www.reddit.com/r/rust/comments/b7vlyl/the_future_of_rust/ is "I really like the idea of using compile time reflection with const functions instead of procedural macros regardless of whether this was posted on April Fool's."
<fengb_> Half the replies want the stated features. I think it’s just a bad “joke”
forgot-password has quit [Quit: leaving]
<andrewrk> there's no zig april fools joke today. ain't nobody got time for that shit
<bheads> But a blog about adding in a GC to zig would be some funny :)
bheads has quit [Quit: Konversation terminated!]
<mikdusan> in stage1 land, `src/cache_hash.cpp` https://github.com/ziglang/zig/blob/master/src/cache_hash.cpp#L468 is allocating memory. where is it free’d?
<tgschultz> I don't think stage1 frees at all
<andrewrk> correct
<andrewrk> it's a bit of a problem in long-running compile time evaluation
<andrewrk> the current plan to fix it is to write stage2 :)
<mikdusan> ok well that’s easy!
<hryx> Is this supposed to be @panic() while all the others in testing use std.debug.panic() ? https://github.com/ziglang/zig/blob/master/std/testing.zig#L146
<andrewrk> hryx, the difference is that @panic would invoke the user's panic override function, while std.debug.panic does whatever std.debug.panic does
<andrewrk> by default if there is no panic override function then it calls std.debug.panic
<andrewrk> when using `zig test` there is no way to override panic as far as I remember, so they should be the same
<andrewrk> @panic is a little bit better in terms of a compile time failure since var args at comptime is still broken
<hryx> roger that, just wondering if the inconsistency with the other functions in testing was intentional or an oversight
<andrewrk> in summary it's a bit messy right now, but it's in practice the same
<hryx> great, very clear explanation
<andrewrk> I take a breadth-first approach to working on zig
<andrewrk> so sometimes I have to leave the details to be a bit messy and go work on another big tree branch
<scientes> I think that is a good way to go about a large project
<hryx> breadth-first creation
<hryx> I like it :>
<scientes> leave the low-hanging fruit for new contributors
<scientes> so they can get confident in the code-base
gamester has joined #zig
develonepi3 has joined #zig
bheads has joined #zig
<gamester> I think this is a very important way to remain productive when working on any large project. You wouldn't write a book page-by-page, finishing one before working on the next.
<gamester> page/chapter
<bheads> I ran across this old article from Casey Muratori (https://caseymuratori.com/blog_0015) I was realizing the Andrew does a really good job following this style of coding, not sure if its on purpose or just evolved that style on his own
<bheads> I have been trying to do that kinda of coding myself, though I work in java at my day job, kinda hard to avoid over using oop
wilsonk has joined #zig
wilsonk|3 has quit [Ping timeout: 250 seconds]
wilsonk|3 has joined #zig
wilsonk has quit [Ping timeout: 245 seconds]
Ichorio has joined #zig
wootehfoot has joined #zig
Zaab1t has joined #zig
Zaab1t has quit [Client Quit]
<andrewrk> hryx, I wouldn't wish this task upon anyone who didn't for some reason find it incredibly appealing, but one thing that is on the table is rewriting std/zig/parse.zig to use recursion. for context: https://ziglang.org/download/0.3.0/release-notes.html#recursion
<andrewrk> Hejsil wrote that code when we didn't think recursion would be able to be safe
<andrewrk> it would be neat to get a benchmark going for the parser for this project. we have no excuses for the stage2 parser being slow!
<andrewrk> strategies for doing this project could include rewriting the logic, or simply deleting everything and starting over, since we have the grammar neatly documented thanks to Hejsil
shritesh has quit []
<scientes> andrewrk, I'm doing a bunch of work on the stage2 parser
<andrewrk> what kind of work?
<scientes> I make CharLiteral and StringLiteral work
<scientes> with the new syntax
<andrewrk> ah that makes sense
<scientes> and now I'm working on doing circular buffers to stream the input
<andrewrk> what's the use case for streaming the input?
<scientes> between reading the file-> validators (utf8 mainly) -> tokenizer -> parser
<scientes> doing things in parallel ^
<andrewrk> I see
<scientes> however there is a major llvm bug on getting the performance as it should be
<scientes> thats a very difficult bug
<andrewrk> that's an important issue for llvm to tackle I think. I agree with your reasoning in the bug description
neceve has quit [Remote host closed the connection]
<scientes> so I think we should have the bit-wise builtins all take a type, in order to prevent having a foot-gun
<andrewrk> scientes, let me think on that for the rest of today, and then give you an "approved"
<scientes> I mean, intel syntax doesn't have the type, and you guys seem to prefer that
<scientes> but you can always do @typeOf() if you really need it
moo has joined #zig
wootehfoot has quit [Ping timeout: 245 seconds]
metabulation has joined #zig
wootehfoot has joined #zig
moo has quit [Ping timeout: 255 seconds]
metabulation has quit [Ping timeout: 245 seconds]
moo has joined #zig
hafer is now known as oats
wootehfoot has quit [Ping timeout: 244 seconds]
niftynei has joined #zig
Sahnvour has joined #zig
<Sahnvour> hi all
<Sahnvour> what do you use for zig dependencies until the package manager comes to life ?
<scientes> Sahnvour, git submodule
<Sahnvour> I guess that's a safe default choice, but found them cumbersome on my single experience of them ... maybe that's ok for mini projects though
<andrewrk> copy paste is not so crazy for now
<andrewrk> I'll note that's what zig stage1 does with C and C++ code
<andrewrk> copy pasted code modules will be one of many supported ways to fetch a zig package
<andrewrk> download an http(s) resource, svn checkout, git clone, file system path
<andrewrk> alright I'm going dark for a couple hours to try to finish this branch
<hryx> g'luck
moo has quit [Quit: Leaving]
wootehfoot has joined #zig
bheads_ has joined #zig
<mikdusan> can anyone point me to some projects using ugly windows ‘backslash’ pathnames in c or c++ include directives?
bheads has quit [Ping timeout: 250 seconds]
mikdusan has quit [Ping timeout: 252 seconds]
mikdusan has joined #zig
gamester has quit [Quit: Leaving]
Sahnvour_ has joined #zig
Sahnvour has quit [Ping timeout: 245 seconds]
Sahnvour_ has quit [Client Quit]
Ichorio has quit [Ping timeout: 255 seconds]
halosghost has quit [Quit: WeeChat 2.4]
<hryx> oh andrewrk, I just noticed your earlier message about recursion. I'd love to take a look tonight
wootehfoot has quit [Read error: Connection reset by peer]
<andrewrk> mikdusan, if you use zig to build "hello world" in C, and use --verbose-cc it'll print some .d paths for you to look out. and some of the paths will be MSVC paths
<andrewrk> I do think it will be worth our time to bring this up with clang developers and find out if backslash can be escaped
<mikdusan> i wonder if they’d be open to a raw slice-like binary output format with lengths, or even list of nullz strings. -MZ :)
<mikdusan> but that doesn’t solve our immediate issue
<andrewrk> I'd be satisfied if the format was lossless
<andrewrk> it's a pretty low bar
<mikdusan> here’s trace output of the new tok engaged with a few thousand 1-char and 2-char “header files” https://gist.github.com/mikdusan/3944f9d34576ce6fbb7dfbae0f71d86f
<andrewrk> your poor filesystem
<andrewrk> does it work on windows though?
<mikdusan> not tested on windows/linux yet
return0e_ has quit []
presiden has quit [Ping timeout: 258 seconds]
presiden has joined #zig