<hryx>
oh yeah daurnimator, I remember you showing that before. neat!
<hryx>
only 5 more review comments to address, then parser is :rocket:
r1b has quit [Ping timeout: 264 seconds]
euantor has quit [Ping timeout: 264 seconds]
lqd has quit [Ping timeout: 264 seconds]
euantor has joined #zig
lqd has joined #zig
AlexMax has quit [Ping timeout: 264 seconds]
odc has quit [Ping timeout: 264 seconds]
r1b has joined #zig
odc has joined #zig
AlexMax has joined #zig
companion_cube has quit [*.net *.split]
SimonNa has quit [*.net *.split]
l1x has quit [*.net *.split]
Vinski has quit [*.net *.split]
nullher0es has quit [*.net *.split]
adtac has quit [*.net *.split]
kristoff_it has quit [Ping timeout: 258 seconds]
companion_cube has joined #zig
SimonNa has joined #zig
adtac has joined #zig
nullher0es has joined #zig
l1x has joined #zig
karrick has joined #zig
karrick has quit [Remote host closed the connection]
emekankurumeh[m] has joined #zig
_whitelogger has joined #zig
<tgschultz>
hryx, I actually hadn't thought to do that, that is a good trick
<tgschultz>
related: after struct literals are in, it will actually be unnecessary to have functions take multiple parameters. `fn foo(args: struct{a: usize, b: f32, c: []const u8}) void` => `foo({10, 32.5, "bar"});`
kristoff_it has joined #zig
<hryx>
SO wild
kristoff_it has quit [Ping timeout: 246 seconds]
<hryx>
tgschultz: I saw on your website that you were designing an OS user space. Super interesting, are you still working on it?
<tgschultz>
I can't honestly say yes because I keep working on other things, but it is never very far from my mind because the current state of OSs bothers me.
<hryx>
understood. well I'm into it
<tgschultz>
I'll let you know if I develp anything in that direction.
<andrewrk>
tgschultz, struct literal syntax as currently proposed is .{.a = 10, .b = 32.5, .c = "bar"}
<andrewrk>
but you could do that with anon list literal syntax with a different fn proto
<tgschultz>
still neat`
<shachaf>
tgschultz: Yes, this is one of the things I've wanted in some language for a while!
<shachaf>
If you have a good struct literal syntax you can just have single-argument functions a struct per function, and have it get the same calling convention as C.
<shachaf>
And you can get keyword arguments and default arguments and things for free.
<shachaf>
I'm not sure that sort of thing fits Zig exactly but I'd like it in some language.
<hryx>
andrewrk: so excited about finishing up this parser I can barely contain myself. In the morning you'll have something that's ready to go (pending new review comments)
anarchyrucks_ has joined #zig
<anarchyrucks_>
hi, what is the equivalent of typedef in zig?
<hryx>
anarchyrucks_: types are values like any other value in zig, they just have to be known at compile-time
<hryx>
so as long as you are in a compile time block or top-level const declaration, you can just do a plain ol' assignment: `const T = SomeOtherType`
<hryx>
ah sorry, actually, you don't have to be in a comptime block. You can do it anywhere, as long as the right-hand side type is know at compile time
<anarchyrucks_>
hryx: that makes sense thanks :)
<anarchyrucks_>
hryx: somehow I missed that on the examples on the front page.. now that you told me I can see them now haha
<hryx>
anarchyrucks_: nah, the new front page is FULL of content, it's easy to miss something like that
<hryx>
I read the whole thing and uh, already forgot that was on there
stratact has joined #zig
_whitelogger has joined #zig
<anarchyrucks_>
I'm using std.os.File to read a file from the disk..
<anarchyrucks_>
I did `var file = File.readOpen(filename);` to read the file
<anarchyrucks_>
but when I try to close the file with defer file.close(), I get does not support field access error
<hryx>
what's the exact error? you most likely need to `try` that function call, or `catch` the error
<hryx>
gotta deal with the error. try using `var file = try File.openRead(filename);`
<hryx>
that way, either it succeeds and `file` refers to a `File`, or it fails and automatically returns an error from your current function
<hryx>
the important thing to remember is: if the function you are calling has a `!` in the return type, that means it might be an error. You must deal with possible errors via `try` or `catch`
_whitelogger has joined #zig
_whitelogger has joined #zig
anarchyrucks_ has quit [Ping timeout: 256 seconds]
<mikdusan>
fyi video of Andrew's "The Road to Zig 1.0" ETE Conference Philadelpha '2019: https://youtu.be/Gv2I7qTux7g
porky11 has joined #zig
<hryx>
mikdusan: awesome, thanks
qazo has joined #zig
shollrollah951 has joined #zig
tdc has joined #zig
_whitelogger has joined #zig
jjido has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 268 seconds]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
neceve has joined #zig
neceve has quit [Remote host closed the connection]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qazo has quit [Ping timeout: 268 seconds]
nrdmn has joined #zig
<nrdmn>
hello!
wootehfoot has joined #zig
<shollrollah951>
hi
Sahnvour has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 258 seconds]
HollyRain has joined #zig
hio has quit [Quit: Connection closed for inactivity]
HollyRain has quit [Quit: bye, bye]
_whitelogger has joined #zig
<mikdusan>
shollrollah951: i haven't really grok'd your interface mockup except to say are you aware of `@This()` ?
<shollrollah951>
mikdusan: I (kinda) know about it, but because I don't really know how it works yet, I didn't research how it'd fit in the mockup.
<mikdusan>
just thinking `hasNext : fn(<>) bool` is basically `hasNext : fn(self: @This()) bool` unless i missed the boat entirely :)
<shollrollah951>
Thanks. I will have a look at it, and probably replace the <>.
tdc has quit [Ping timeout: 246 seconds]
<shollrollah951>
mikdusan: any other thoughts on the mockup?
<shollrollah951>
mikdusan: Updated the gist now. Thanks
very-mediocre has joined #zig
neceve has quit [Remote host closed the connection]
karrick has joined #zig
<karrick>
So finished reading the 0.4.0 release notes and all the github issues linked the other night. One of the things I like about Zig is the no compromise approach to efficiency. Copy elision semantics for return values sounds obvious in hind sight, and most other languages would just not bother with the additional complexity, but Zig is not resting on its laurels, and continues to make progress towards making the most efficient way to
<karrick>
way.
<karrick>
daurnimator I am about a third the way done with my assigned homework. Coupled with all of the async processing issues I read the other night, this seems like integration will be more than just adapting the platform code for Linux to take advantage of. But I really think the goal of making this the default handling of async IO streams is a great goal.
Zaab1t has joined #zig
Zaab1t has quit [Client Quit]
jjido has joined #zig
karrick has quit [Remote host closed the connection]
return0e has quit [Remote host closed the connection]
karrick has joined #zig
karrick has quit [Remote host closed the connection]
<shollrollah951>
What intrigues me about zig is how everything you need to build software is included in the language. Less to learn to become productive.
<shollrollah951>
code, build, unit testing: all in zig
<shollrollah951>
compared with e.g kotlin, where code=kotlin, build=gradle, testing=junit, runtime=JVM
karrick has joined #zig
karrick has quit [Remote host closed the connection]
karrick has joined #zig
karrick has quit [Remote host closed the connection]
porky11 has quit [Quit: Leaving]
Zaab1t has joined #zig
Zaab1t has quit [Client Quit]
return0e has joined #zig
<andrewrk>
hryx, merged! I did zig fmt on the standard library to celebrate
<andrewrk>
shollrollah951, the reason for this is to reduce the difficulty of collaborating and code sharing. if you know it's going to be easy to contribute to someone else's zig project you're more likely to do it
karrick has quit [Remote host closed the connection]
SimonNa has quit [Remote host closed the connection]
SimonNa has joined #zig
very-mediocre has quit [Ping timeout: 256 seconds]
<hryx>
andrewrk: next stop, #21. I would really like to get something shipped this release cycle. With the fantastic new hybrid compiler strategy, this should be easier and more fun than before
<hryx>
but heads up that it will likely raise a couple design questions and maybe a proposal or two
<hryx>
I'll try to stay nimble and not get bogged down
<andrewrk>
hryx, sounds great to me! just as another option, in case it is appealing to you, there is the "make translate-c self-hosted" project
<andrewrk>
that one would be more straightforward with less design questions
<hryx>
ah yes. Maybe that would be a good warmup - I'll take a peek
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
<andrewrk>
hryx, I want you to work on what excites you but if you started on #1964, I would switch over to copy-elision/coroutine rewrite which is long overdue
<hryx>
ok! I appreciate the context. What I'll do is take a couple days to play around with 1964 and see if it & I have chemistry. The nice thing is it's possible to chip away at that one incrementally
<hryx>
I'll let you know how it goes~
<andrewrk>
cool :D
<andrewrk>
of course #21 is a great issue too
<hryx>
next release is gonna be killer either way
<hryx>
people's heads be blowin up
<jjido>
shollrollah951 I like the idea of the comptime function for interfaces
<shollrollah951>
jjido I suppose you mean the idea with using a function to get "generics" for interfaces?
<jjido>
yes
<jjido>
It could also include interface implementation right? Your examples left that outside the function
<shollrollah951>
Good point. I didn't think of that possibility, but that gives you generics for implementations as well. Write once, adapt to different types.
qazo has quit [Ping timeout: 258 seconds]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qazo has joined #zig
jjido has joined #zig
<shollrollah951>
Has anyone looked into using the geany-ide for zig?
<shollrollah951>
I got rudimentary syntax highlighting working in it, and triggering builds from within geany.
<shollrollah951>
The error messages you get are clickable puts the caret on the corresponding place in the code.
<shollrollah951>
and puts *
<redj>
andrewrk: is there a proposal for the safety stuff you mention in the talk?
<andrewrk>
increasing the minimum supported version and making the followup changes will be one of the things that zig project must continue to do even after 1.0.0 and after the language is "done"
<Sahnvour>
thanks
Sahnvour has quit [Ping timeout: 268 seconds]
xbat has joined #zig
<xbat>
um, is there somewhere better to read about how the build system works than zig/std/build.zig ?
<xbat>
the manual just has some TODO markers, and i can see how it's used in some examples but they don't always still work
<xbat>
oh! and what was the a!b operator? (referred to in an example but otherwise mysterious)
<jjido>
xbat does it compile?
<xbat>
don't know, sorry; it's just in the list of operator precidences, is all
<xbat>
sorry, should've tried that before bothering you all
<xbat>
no, it doesn't compile, just curious what it used to mean
<jjido>
I think it had to do with errors... don't remember
<xbat>
oh, that would fit
qazo has quit [Read error: Connection reset by peer]
qazo has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]