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/
tane has quit [Quit: Leaving]
radgeRayden has quit [Ping timeout: 264 seconds]
CmdrCrisp has joined #zig
earnestly has quit [Ping timeout: 240 seconds]
notpiika has quit [Remote host closed the connection]
notpiika has joined #zig
xackus has quit [Ping timeout: 264 seconds]
frmdstryr has quit [Ping timeout: 268 seconds]
frmdstryr has joined #zig
CodeSpelunker has quit [Quit: CodeSpelunker]
klltkr_ has joined #zig
notpiika has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
klltkr_ has quit [Client Quit]
klltkr has quit [Ping timeout: 260 seconds]
klltkr has joined #zig
frmdstryr has quit [Ping timeout: 264 seconds]
notpiika has joined #zig
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
CmdrCrisp has quit [Quit: Leaving]
jzelinskie has quit [Ping timeout: 240 seconds]
utzig has quit [Read error: Connection reset by peer]
jzelinskie has joined #zig
utzig has joined #zig
ovf has quit [Ping timeout: 268 seconds]
ovf has joined #zig
<dominikh> is there a good workflow for translate-c'ing things in isolation, without them each having their own definitions of shared includes, like the stdlib? say I want to translate and clean up libfoo, and later libbar, and the two have a common dependency on something… if people were to use the libfoo and libbar bindings, they'd have to deal with duplicate types, and needing explicit casts between them.
Kingsquee has joined #zig
a_chou has joined #zig
a_chou has quit [Remote host closed the connection]
marnix has joined #zig
<endragor> How do you pass a comptime flag as a build option?
x2C25 has quit [Ping timeout: 256 seconds]
<daurnimator> endragor: you mean in build.zig?
<justin_smith> dominikh: I make a single file use all the c libs, and everything else grab it from there
dumenci has joined #zig
jayschwa has quit [Remote host closed the connection]
_whitelogger has joined #zig
frett27 has joined #zig
frett27 has quit [Read error: Connection reset by peer]
frett27 has joined #zig
dddddd has quit [Ping timeout: 272 seconds]
dddddd has joined #zig
xentec has quit [Ping timeout: 272 seconds]
xentec has joined #zig
cole-h has quit [Ping timeout: 272 seconds]
x2C25 has joined #zig
marnix has quit [Ping timeout: 260 seconds]
marnix has joined #zig
tane_ has joined #zig
<tane_> howdy
_whitelogger has joined #zig
<endragor> daurnimator: I mean pass a flag from build.zig to the code. Similar to defines in C.
earnestly has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
<daurnimator> endragor: the zig build system creates a special import `"build_options"`
<daurnimator> use e.g. `const build_options = @import("build_options");`
dumenci has quit [Ping timeout: 264 seconds]
lucid_0x80 has joined #zig
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
lucid_0x80 has quit [Ping timeout: 246 seconds]
Kingsquee has quit []
lucid_0x80 has joined #zig
skuzzymiglet has joined #zig
ur5us__ has joined #zig
x2C25 has quit [Ping timeout: 264 seconds]
ur5us__ has quit [Quit: Leaving]
_whitelogger has joined #zig
marnix has quit [Ping timeout: 264 seconds]
tane_ has quit [Quit: Leaving]
klltkr has joined #zig
marnix has joined #zig
frmdstryr has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
osa1 has joined #zig
<scientes> Daniel J Bernstein bragging that his 20-year-old bug report in GCC is finally getting attention https://twitter.com/hashbreaker/status/1322190276333498368
frett27_ has joined #zig
Barabas has joined #zig
<Barabas> Hello
<Barabas> If I have a function which takes a `type` parameter. How do I give it a `const` type? Just like with slices you can do `[] f32` and `[]const f32`, but I can't seem to do `myFun(const f32)`.
Hastur has joined #zig
frett27 has quit [Ping timeout: 264 seconds]
<scientes> Barabas, pass-by-value is always const
<dutchie> what's the best tool to profile memory usage?
<scientes> given the way zig allocates memory, a memory profiler would be nice to have
neceve has joined #zig
skuzzymiglet has quit [Ping timeout: 268 seconds]
<Barabas> scientes that's not what I meant.
<Barabas> For example this case `fn myFun(t: type) struct { return struct { p: *t, }; }` I want `p` to be of type `*const f32` not `* f32`. How do I do that?
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
<daurnimator> `p: *const t`
tane has joined #zig
<frmdstryr> daurnimator: Thanks for the review. Any chance you could try the code I had there and see if you can get the same error as in #6590?
<daurnimator> frmdstryr: the error seems familiar
<frmdstryr> Yeah I remember seeing it a while back, idk if it was ever resolved
<daurnimator> was difficult to replicate; but always came up in a sufficiently complex program
<daurnimator> I can't find an open issue for it though aside from the 6590 you mentioned
<daurnimator> frmdstryr: however, I think you should start plumbing in the stuff required for proper SIGPIPE handling
<frmdstryr> The way the event loop is designed idk if it is possible
<daurnimator> frmdstryr: on linux it should be as simple as using MSG_NOSIGNAL when you call send()
<frmdstryr> It has to choose a proper write fn based on what it's writing to but it only uses the fd
<Barabas> daurnimator -.-
<daurnimator> on other platforms, you will need to check (via e.g. fcntl + F_SETNOSIGPIPE) if its set on the socket; and if not... temporary unset and set the signal handler around send() calls
<daurnimator> which then implies you should set `F_SETNOSIGPIPE` and equivalents by default on new sockets to avoid the signal mask setting dance for every read/write call
<daurnimator> :)
<Barabas> Sometimes I want a `f32` sometimes I want `const f32`. I don't want to hardcode it in my struct (and write two version, one for when it's const and one for when it's not).
<daurnimator> Barabas: though in reality I haven't run into it outside of iov/msghdr.... yet
<daurnimator> Barabas: perhaps comment on that issue with your usecase
<Barabas> That seems like a slightly different issue.
ave_ has quit [Remote host closed the connection]
lunamn has quit [Remote host closed the connection]
linuxgemini has quit [Read error: Connection reset by peer]
<Barabas> That's about propagating const to types pointers point to, which I think is a bad idea, but I'll comment on it.
<tane> does a slice of cost types make any sense?
<tane> const*
<tane> I can see use of a const slice of T and for a slice of pointers to const-T, but a slice of const-T?
<Barabas> What do you mean?
<Barabas> There are build in slices in the language `[]f32` and `[]const f32`.
dimenus has joined #zig
_whitelogger has joined #zig
lucid_0x80 has joined #zig
skuzzymiglet has joined #zig
dimenus has quit [Quit: WeeChat 2.9]
Akuli has joined #zig
waleee-cl has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
dumenci has joined #zig
lucid_0x80 has quit [Ping timeout: 240 seconds]
lucid_0x80 has joined #zig
dumenci has quit [Ping timeout: 258 seconds]
dumenci has joined #zig
Patrice_ has joined #zig
lucid_0x80 has quit [Ping timeout: 264 seconds]
frett27_ has quit [Ping timeout: 258 seconds]
g-w1 has quit [Ping timeout: 260 seconds]
frett27_ has joined #zig
g-w1 has joined #zig
Patrice_ has quit [Ping timeout: 272 seconds]
dumenci has quit [Read error: Connection reset by peer]
dumenci has joined #zig
skuzzymiglet has quit [Ping timeout: 264 seconds]
lucid_0x80 has joined #zig
dumenci has quit [Ping timeout: 265 seconds]
mschwaig has quit [Read error: Connection reset by peer]
mschwaig has joined #zig
nycex has quit [Quit: Quit]
nycex has joined #zig
<ask6155> It's a but offtopic but in zig if you want the most optimized version of the code you have written you do --release-fast. It gives the best optimizations. But in c there are things like -O1 -O2 and I think -O3 too. But whenever I check makefiles or cflags it always only has -O2. Why is that? isn't -O3 better?
marnix has quit [Ping timeout: 260 seconds]
marnix has joined #zig
<scientes> ask6155, gcc does alot of crazy things with -O3, so its recommended to use -O2 with C code
<ask6155> What about clang?
<scientes> not as crazy
<scientes> gcc has a autovectorizer that gets turned on with -O3
<scientes> -O3 is also much more likely to break code, both incorrect and correct code
<ask6155> That's weird
<scientes> as we check for most of those issues in zig, zig compiles with -O3 with --release-fast
cole-h has joined #zig
skuzzymiglet has joined #zig
* Ristovski here using -Ofast
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
* ask6155 here using debug mode because none of my programs get to release
dumenci has joined #zig
lucid_0x80 has quit [Ping timeout: 256 seconds]
<tdeo> ifreund: happened to be checking the irc logs and saw your question about the licensing of my xml parser, you can use it under the same license as your repo (expat MIT)
<tdeo> you can consider that a license grant, or I can submit a PR with an explanation in the commit message instead
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ifreund> tdeo: thanks, I appreciate it. If you wouldn't mind, submitting the xml.zig file yourself as a PR would probably the most clear way to handle this
<ifreund> (I haven't merged my work using it to master yet and could rebase)
teleton has joined #zig
teleton has quit [Remote host closed the connection]
lucid_0x80 has joined #zig
klltkr has joined #zig
dumenci has quit [Ping timeout: 260 seconds]
dumenci has joined #zig
lucid_0x80 has quit [Ping timeout: 264 seconds]
<ifreund> thanks :)
frett27 has joined #zig
<dutchie> i'm not entirely convinced that .Monotonic is correct but i think so
frett27_ has quit [Ping timeout: 256 seconds]
<tane> I see a lot of people move over to sourcehut, what's the motivation?
<ifreund> not having to deal with github's BS, email driven workflow, open source, etc.
<dutchie> for me, mostly 100% foss
<dutchie> and emailed patches > pull reqs
<Nypsie[m]> I wish it had better UX, and maybe more exposure.
<tane> thanks, it has been on my radar for a while
<tane> does one actually need drew's aerc mail client to handle these patch emails effectively?
<ifreund> no, you can use any functioning mail client
<tane> ok, nice
<dutchie> you don't even need a mail client at all, just `git am`
<ifreund> indeed
<ifreund> though a mail client may be useful for discussing/reviewing patches :D
skuzzymiglet has quit [Ping timeout: 264 seconds]
Hastur has quit [Remote host closed the connection]
skuzzymiglet has joined #zig
mschwaig has quit [Read error: Connection reset by peer]
mschwaig has joined #zig
dumenci has quit [Ping timeout: 264 seconds]
mschwaig has quit [Read error: Connection reset by peer]
mschwaig has joined #zig
TheLemonMan has joined #zig
mschwaig has quit [Read error: Connection reset by peer]
mschwaig has joined #zig
nullheroes has quit [Quit: WeeChat 2.9]
hnOsmium0001 has joined #zig
cole-h has quit [Ping timeout: 264 seconds]
Snetry has quit [Ping timeout: 256 seconds]
marnix has quit [Read error: Connection reset by peer]
Snetry has joined #zig
skuzzymiglet has quit [Read error: No route to host]
marnix has joined #zig
lunamn has joined #zig
linuxgemini has joined #zig
ave_ has joined #zig
frmdstryr has quit [Ping timeout: 264 seconds]
Snetry has quit [Ping timeout: 240 seconds]
x2C25 has joined #zig
mmohammadi9812 has quit [Ping timeout: 268 seconds]
Snetry has joined #zig
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
Snetry has quit [Quit: left Freenode]
frmdstryr has joined #zig
neceve has quit [Ping timeout: 272 seconds]
mmohammadi9812 has joined #zig
slevin21 has joined #zig
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
slevin21 has quit [Remote host closed the connection]
klltkr has joined #zig
marnix has quit [Ping timeout: 260 seconds]
frmdstryr has quit [Ping timeout: 264 seconds]
ave_ has quit [Remote host closed the connection]
linuxgemini has quit [Remote host closed the connection]
lunamn has quit [Remote host closed the connection]
lunamn has joined #zig
ave_ has joined #zig
linuxgemini has joined #zig
ave_ has quit [Client Quit]
linuxgemini has quit [Client Quit]
lunamn has quit [Client Quit]
lunamn has joined #zig
linuxgemini has joined #zig
ave_ has joined #zig
xentec has quit [Quit: memento mori]
xentec has joined #zig
adamkowalski has joined #zig
<adamkowalski> is there any documentation on result location?
<adamkowalski> I want to create a struct on the stack which takes in an allocator in init
<adamkowalski> and it will create an arena allocator internally for memory management
<adamkowalski> but when it returns it, it seems like there are problems
<adamkowalski> I end up having to first allocate it using the parent allocator, and store a reference to the arena and the parent allocator, then deinit the arena and then destroy it with the parent allocator later
Akuli has quit [Quit: Leaving]
adamkowalski has quit [Quit: Lost terminal]
skuzzymiglet has joined #zig
skuzzymiglet has quit [Ping timeout: 240 seconds]
Michcioperz has quit [Read error: Connection reset by peer]
Michcioperz has joined #zig
tane has quit [Quit: Leaving]
a92 has joined #zig
ur5us has joined #zig
swills has quit [Ping timeout: 258 seconds]
swills has joined #zig
_whitelogger has joined #zig
swills has quit [Ping timeout: 265 seconds]