ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
atk has quit [Quit: Well this is unexpected.]
atk has joined #zig
dbandstra has quit [Quit: Leaving]
mahmudov has joined #zig
zolk3ri has quit [Quit: Lost terminal]
return0e has quit []
jjman has joined #zig
donlzx has quit [Remote host closed the connection]
v1zix has quit [Quit: Page closed]
donlzx has joined #zig
mahmudov has quit [Remote host closed the connection]
darithorn has quit [Remote host closed the connection]
xtreak has joined #zig
very-mediocre has joined #zig
<very-mediocre>
just saw this: `very-mediocre, can you elaborate on caching comptime computed consts? zig already caches all comptime function calls`
<very-mediocre>
I have a top-level const declaration that computes 500 primes, compile time is quite lengthy when using `zig test` on this file
<very-mediocre>
it's still just a few seconds, but definitely noticeable
<andrewrk>
ah I see, caching between invocations
<very-mediocre>
(ping andrewrk)
<andrewrk>
I have a plan to do that
<very-mediocre>
i see!
<andrewrk>
I am exploring this concept this week in the self hosted compiler
<very-mediocre>
re:`very-mediocre, what do you mean about continuation expressions? I'm not aware that we have those` -> i meant "continue expression" i.e. while (condition) : { expression }
<very-mediocre>
100% personal feedback about this of course, I feel it breaks the principle of not having unnecessary things, and it's not that consistent to have : denote this
<andrewrk>
I updated the docs to say "continue expression"
<very-mediocre>
right, I just checked the docs because I knew I'd seen it there :)
<andrewrk>
I appreciate the feedback. This feature is here to stay - it's the same thing as the final expression in a C for loop
<very-mediocre>
Understood
<andrewrk>
good night
<very-mediocre>
bye
<very-mediocre>
gn
unique_id has joined #zig
<unique_id>
very-mediocre: "that's a limitation of using functions that return structs, the namespacing becomes annoying" - You have to do the very same thing in languages that don't use anonymous structs. C++: using T = Type<bool>::InnerType; It's not annoying IMO, it's the proper way.
<unique_id>
Bas_: HashMap(...) returns a type. init returns an instantiation of that type.
<unique_id>
Bas_: Well.. I don't know if it's correct to say that HashMap(...) returns a type, or I should say it does so at compile time. It refers to a type.
<unique_id>
Or you think of HashMap(...) as being a type, like std::vector<int> is a type in C++
<unique_id>
could*
<very-mediocre>
It's "proper" but still a bit of a niggle
<very-mediocre>
Let's be honest, zig doesn't really have many "major" problems
<very-mediocre>
imho it's already mostly better than C
<very-mediocre>
I mean no "major" design problems
<stratact>
Well Zig can't just be a "better C," it has to be a unique language in its own right which cater to the needs that no other language does, so that it would make people (especially companies) want to use Zig instead of something that's already maintain and in abundance. I think Zig having first-class debugging makes this language unique and attractive that many would want to try switch to.
quc has quit [Remote host closed the connection]
davr0s has joined #zig
quc has joined #zig
xtreak has quit [Remote host closed the connection]
xtreak has joined #zig
<unique_id>
andrewrk, there's a leftover "const fmt = std.fmt" in buffer.zig
zolk3ri has joined #zig
unique_id has quit [Ping timeout: 240 seconds]
unique_id has joined #zig
xtreak has quit [Remote host closed the connection]
xtreak has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xtreak has quit [Remote host closed the connection]
xtreak has joined #zig
hio has joined #zig
davr0s has joined #zig
xtreak has quit []
very-mediocre has quit [Quit: Page closed]
<andrewrk>
unique_id, thanks
Ichorio has joined #zig
bheads__ has joined #zig
bheads_ has quit [Ping timeout: 244 seconds]
donzx has joined #zig
donlzx has quit [Ping timeout: 276 seconds]
<GitHub56>
[zig] andrewrk closed pull request #1240: Allow for all integer types up to 128 bits. (master...issue-#745-allow-any-integer-type) https://git.io/fNYIu
<GitHub185>
zig/master e9a03cc Andrew Kelley: all integer sizes are available as primitives...
<GitHub40>
zig/master d3ce9d0 Andrew Kelley: codegen: remove unused variable
<winksaville>
I tried "bin/zig build --build-file ../build.zig test -Dtest-filter=std.ArrayList.swapRemove" and I got a bunch of "No tests to run." and then 173 "docgen example code 1/174...OK" but I don't see anything about std.ArrayList.swapRemove
<andrewrk>
if you're trying to hit a specific test, I recommend this: bin/zig test file_with_the_test.zig --test-filter "foo"
<winksaville>
andrewrk: txs, ./bin/zig test ../std/array_list.zig --test-filter "std.ArrayList.swapRemove" worked and reported:
<winksaville>
Test 1/1 std.ArrayList.swapRemove...OK
MajorLag1 has quit [Ping timeout: 276 seconds]
<andrewrk>
now you have a binary which only contains that 1 test
<andrewrk>
so you can run it again with `gdb ./zig-cache/test -ex run`
<winksaville>
But then I tired leaving off the --test-filter and ran "./bin/zig test ../std/array_list.zig" and it ran 612 tests, I was expecting it to run just the 5 tests in array_list.zig, what's happening?
<andrewrk>
it's importing other files, and in each of those files they are importing other files, and zig ends up discovering all the tests
<andrewrk>
it's why you can do `bin/zig test ../std/index.zig` and it tests all the standard library
<winksaville>
got it
<andrewrk>
some of the way this works may change, but I don't consider it to be a high priority
MajorLag1 has joined #zig
<winksaville>
how do you run all of the tests in one file?
<andrewrk>
there's no way to specify that to zig
<winksaville>
interesting
<andrewrk>
if you do `zig test file.zig` then it will at least run all the tests in that file
<winksaville>
yeah, but 600 others also
<winksaville>
in my case
donzx has quit [Quit: Leaving]
<winksaville>
So it seems the naming convention is used to limit tests and test-filter can then be used to do a simple 'starts with' syntax (no regex), correct?
very-mediocre has joined #zig
<andrewrk>
correct, except 'contains' instead of 'starts with'
<winksaville>
Is "std.ArrayList.swapRemove" the new convention, the other tests are space separated english snippets in array_list.zig?
<andrewrk>
there's no convention because I'm probably going to change how it works
<andrewrk>
it's the wild wild west
<winksaville>
:)
<winksaville>
I was thinking I'd update the docs, but maybe to early for that?
<winksaville>
(gtg, be back on line later)
<andrewrk>
if you're looking for somewhere to contribute, my suggestion would be to build a simple project using zig, and then when you run into issues, work on those issues
bheads_ has joined #zig
bheads__ has quit [Ping timeout: 248 seconds]
jjman has quit [Quit: WeeChat 1.6]
unique_id has quit [Remote host closed the connection]
zolk3ri has quit [Quit: leaving]
zolk3ri has joined #zig
bheads__ has joined #zig
bheads_ has quit [Ping timeout: 240 seconds]
zolk3ri has quit [Quit: leaving]
zolk3ri has joined #zig
jjido has joined #zig
bheads_ has joined #zig
bheads__ has quit [Ping timeout: 260 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bheads__ has joined #zig
bheads_ has quit [Ping timeout: 240 seconds]
davr0s has joined #zig
mononomo has joined #zig
jjido has quit [Ping timeout: 260 seconds]
zolk3ri has quit [Ping timeout: 240 seconds]
zolk3ri has joined #zig
mononomo has quit [Quit: Page closed]
quc has quit [Read error: Connection reset by peer]
return0e has joined #zig
very-mediocre has quit [Quit: Page closed]
<winksaville>
in array_list swapRemove does not return an error how do you "catch" out of bounds errors?
<andrewrk>
one of the most important concepts in programming is to understand the difference between: normal runtime behavior, error handling behavior, and assertions
<winksaville>
that seems to be a squishy statment, in the end to write "perfect" code we need to handle both, I think.
Ichorio has quit [Ping timeout: 240 seconds]
<winksaville>
handling somethings with Null and other things with errors seems odd, but if that's the intent then I case swapRemoveOrNull would be prudent.
<andrewrk>
swapRemoveOrNull is right out
<andrewrk>
perfect code has assertions in it
<andrewrk>
every statement which derefereces a pointer is asserting that the pointer is valid
<andrewrk>
it would be incorrect, and in fact impossible, to make every pointer dereference return a possible error
<andrewrk>
implicit assertions are a fundamental requirement of software
<winksaville>
what do you mean by "swapRemoveOrNull is right out"
<andrewrk>
I believe it is a british idiom
<andrewrk>
it means "there is no doubt that this will not happen"
<winksaville>
k, so you'd prefer popOrNull and swapRemoveOrError
<andrewrk>
the way I would prefer all std library modifications is in the form of a pull request, with tests, and an explanation for the use case, ideally with a link to your open source zig project
<andrewrk>
you can always make the modifications in the form of utility methods that are available in your project in the mean time
<winksaville>
np, I'm trying to figure out the philosophy as array_list seems inconsistent. All of the inserts returning errors, then there is removeOrError but swapRemove didn't return an error and pop returning Null. Hence the questions.
<andrewrk>
the std lib is not stable until 1.0.0
<andrewrk>
right now it's mostly a test bed for the language
<winksaville>
sg
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Client Quit]
<MajorLag1>
For the record, I think I added a "orError" variation just because `set` had an `orError` variation.
<GitHub185>
[zig] winksaville opened pull request #1253: Give ArrayList tests consistent names (master...give-std.ArrayList-tests-consistent-names) https://git.io/fN3Or
hio has quit [Quit: Connection closed for inactivity]