laaron has quit [Remote host closed the connection]
<mikdusan>
daurnimator: hmm if valgrind has an api for that (i am oblivious) then something checking return values and in/out params sounds like a win in the pop-direction
<daurnimator>
mikdusan: you tell valgrind which memory is undefined; then valgrind detects reads/writes to those areas.
<mikdusan>
so nesting you are also responsible to remove the undefined range?
<mikdusan>
(or maybe it's smart enough to watch the sp move).
<mikdusan>
ugh. oh i see it just checks immediately. i get it.
laaron has joined #zig
<fengb>
I have an odd bug where the switch expression returns the wrong value
<fengb>
return switch(enum) { .match => foo catch bar }
<fengb>
I wonder if it's related to copy elision
<fengb>
"foo catch return bar" fixes it
stratact has joined #zig
donpdonp has joined #zig
ky0ko has joined #zig
Ichorio_ has joined #zig
Ichorio has quit [Ping timeout: 264 seconds]
Ichorio_ has quit [Ping timeout: 264 seconds]
_whitelogger has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 258 seconds]
chemist69 has quit [Ping timeout: 252 seconds]
chemist69 has joined #zig
_whitelogger has joined #zig
ntgg has joined #zig
_whitelogger has joined #zig
mahmudov has quit [Ping timeout: 245 seconds]
lunamn_ has quit [Ping timeout: 246 seconds]
lunamn has joined #zig
_whitelogger has joined #zig
dingenskirchen has quit [Read error: Connection reset by peer]
dingenskirchen_ has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
dbandstra has joined #zig
<dbandstra>
do the std fmt functions support printing c strings?
<dbandstra>
i see some code in there which kind of looks like it could be but i'm not having success using it
<dbandstra>
kind of hard to follow the code in fmt.zig
<dbandstra>
oh, i got it... it's "{s}" (for some reason)
<dbandstra>
for some reason i looked at fmt.zig and saw the "s", but my brain translated it to a "c" by the time i switched to my own source file, so i'd try that and it wouldn't work
ntgg has quit [Ping timeout: 258 seconds]
dbandstra has quit [Quit: leaving]
laaron has quit [Remote host closed the connection]
laaron has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
mahmudov has joined #zig
<mq32>
hey
<mq32>
i am saddened. it seems like i can't flash my µC right now, something is broken
<Yardanico>
although for smaller languages it might make more sense to have an awesome repo in their own github organization
<Tetralux>
Huh. Didn't know my sublime syntax was on that. Neat :)
lunamn_ has joined #zig
lunamn has quit [Ping timeout: 264 seconds]
Ichorio has joined #zig
ntgg has joined #zig
<gonz_>
`awesome-zig` is bound to be out of date for a long time
<gonz_>
And I don't think there's any way to tell something is actually "awesome" yet.
<Tetralux>
I mean... There is: Informality. ;)
<Tetralux>
.. which is how that repo intends it, I suspect.
<Tetralux>
But I also get what you mean.
<Tetralux>
Though, perhaps in some sense Zig's wiki page for community stuff could be that.
<Tetralux>
That has a much lesser list.
<gonz_>
Usually these lists will de facto be "Here is what people use", whereas one for a very young language will be "Here is what the owner of the repo + people who have made PRs know exists"
<gonz_>
Those aren't equally useful
<gonz_>
Though I'm open to the idea that I'm wrong and many of the `awesome-*` repos are just people tossing everything they know in there.
<Tetralux>
That's what I imagine it is.
<Tetralux>
Maybe they even tested it too - who knows :p
<fengb>
He put my silly protobuf experiment on the list. I feel compelled to make progress now :(
<Tetralux>
He put zigpaint on there too ;P
<Tetralux>
Still
<Tetralux>
I don't really care
<Tetralux>
First time any repo of mine's been mentioned anywhere so
<Tetralux>
I feel accomplished in life now.
alexander92 has quit [Ping timeout: 268 seconds]
<Yardanico>
how can I tell translate-c to translate parts which are not used?
<Yardanico>
or how can I make it believe that some parts are "used"
<dingenskirchen>
I'm trying to build a minimal TCP server using the stdlib, but ran into an issue I don't quite understand: https://pastebin.com/hvP4FLCq
<fengb>
Network code hasn’t been updated to the new async semantics yet
<fengb>
Anything in std.event is currently in flux
<dingenskirchen>
ah :|
<dingenskirchen>
guess i'll wait and see if it works after the next release, then
<dingenskirchen>
thanks for the quick response though
<fengb>
I think the goal is to get it better by 0.5.0 but not sure if there’ll be enough time
<Yardanico>
It works if I remove "orelse null" from that line though
<Yardanico>
I think 2045b4d is the cause (the commit before it works, and on it it starts to fail)
<fengb>
That looks like a bug
<nrdmn>
gonz_, Tetralux: For now I put anything in the list that doesn't look like a test repo. I hope it is useful in case someone wants to check if there are projects of a certain topic to get inspiration from.
<nrdmn>
As soon as there are more and more mature projects, I'll have to start to filter
<Tetralux>
nrdmn: That's what I figured. :)
<Snektron>
Tetralux: did you also publish the sublime text syntax?
<Snektron>
Because i made a pr that was merged like a half year ago and it still needs updating
<Tetralux>
You mean the one that's available through package manager?
<Tetralux>
No. I started out with that, but did not find it to my liking, so I made my own.
<Tetralux>
I update it whenever I'm using it and it doesn't do something that I think it could use.
<Tetralux>
'&&' highlights as illegal, for example.
<gonz_>
Unfortunately the modular windows headers were no real help, because they contain almost nothing.
<gonz_>
At some point I should come up with a smarter way of doing this
<andrewrk>
gonz_, fortunately I don't think it changes often, and ABI compatibility is stable
<gonz_>
All in all I guess it wasn't so bad, but it took a couple of hours.
<andrewrk>
yeah that's practically nothing in terms of developer hours
<gonz_>
There are some pretty unqualified guesses in there as well, based on their surrounding functions being from some lib, etc.
<andrewrk>
if it's a one time task
Tetralux has joined #zig
mahmudov has joined #zig
so has quit [*.net *.split]
mahmudov has quit [*.net *.split]
mahmudov has joined #zig
so has joined #zig
so has quit [Max SendQ exceeded]
so has joined #zig
so has quit [Max SendQ exceeded]
so has joined #zig
so has quit [Max SendQ exceeded]
so has joined #zig
so has quit [Max SendQ exceeded]
so has joined #zig
so has quit [Max SendQ exceeded]
so has joined #zig
so has quit [Max SendQ exceeded]
so has joined #zig
so has quit [Max SendQ exceeded]
curtisf has joined #zig
so has joined #zig
<andrewrk>
I don't remember who was asking about glibc 2.30 but that's in master now
<curtisf>
Is there a good way to profile a zig application on Windows?
<andrewrk>
I don't know the answer to that question but I also want to know. It should be the same answer as how to profile a C/C++ application on Windows
<gonz_>
Debugging works with VS & WinDbg, so I assume VS works.
<curtisf>
I'm not sure if my VS is just outdated or if there's some reason I can't find the cpu profiling tab
<Sahnvour>
curtisf: it's usually under the "DEBUG" menu
<gonz_>
Looks like Debug -> Performance Profiler, yeah.
<Sahnvour>
I mainly use VTune when the executable is not build via a VS project though, it's less of a hassle than profiling random executables inside VS
<andrewrk>
Sahnvour, oh that's good to know. I've been using an empty Project1.sln and just overriding the exe to whatever I wanted to debug
<gonz_>
andrewrk: You can run `devenv binary-name.exe` to open up an on-demand project
<andrewrk>
nice!
<gonz_>
for that exe
Aransentin has joined #zig
<Sahnvour>
trying to profile zig0 (for example) from on-demand project, the CPU Usage tool is greyd out
<curtisf>
Sahnvour: I don't see that there. Is it supposed to be in these menus? https://imgur.com/QC9YimV
<Sahnvour>
curtisf: you're currently debugging a running executable, it won't be available until you stop it
<curtisf>
Ooo, thanks
<Sahnvour>
then it's performance profiler > CPU usage > go
<curtisf>
I clicked that, it doesn't seem to do anything. Maybe I should just try updating
mahmudov has quit [Ping timeout: 252 seconds]
<gonz_>
Sahnvour: Is VTune usually a better choice?
<Sahnvour>
I think so
<Sahnvour>
it has more info
<gonz_>
Oh, being that you seem to be in the know: Is there a good interactive disassembler that works well with zig on Windows?
<gonz_>
I tried about 10 or so ones and they all had issues, most of them were anonymizing the names of every function for no reason.
<Tetralux>
gonz_: VS is the best I got, I'm afraid.
<Sahnvour>
overall VTune is better I think (and free since some time), a lot more full featured, but a bit less user friendly
<Sahnvour>
I don't know about disassemblers, sorry
<gonz_>
Tetralux: Yeah, it's what I use, but it's not nearly as nice as some of the disassemblers you can use for C/C++.
<gonz_>
The interactive ones with tree structures, etc.
<gonz_>
Or am I just missing features that VS has?
<Sahnvour>
iirc the good ones have to be bought right ?
<gonz_>
Some of them are free and from what I gather they do the whole tree structure thing for C/C++
mahmudov has joined #zig
<gonz_>
But somehow they just fail at preserving the names of functions in zig
<Sahnvour>
no it's very barebones, maybe WinDBG preview (note the _preview_, it's on windows store also :)) is a better
<gonz_>
I haven't needed it yet, but I was curious when I saw the really interesting ones whether or not they'd work for zig
<gonz_>
in the end the info I wanted I got from VS
<Sahnvour>
in my experience, it's hard to get good asm <-> source line matching in release-fast for zig
<Sahnvour>
I don't know why
<Sahnvour>
so for example you would try to profile a piece of code, but the actual costly instructions will all get mapped to some function at several outer scopes, basically where it wasn't inlined (eventually just main)
<Sahnvour>
and since all the generated code inside this call refers to the single line of the function call, it's rather useless
waleee-cl has joined #zig
<curtisf>
It looks like I just needed to update VS. Does VS provide anything finer than function-level profiling? In my case I have one large function and only about 10% of its runtime is attributed to sub-calls
Akuli has quit [Quit: Leaving]
<mikdusan>
given `const X = packed union { small: u32, big: u64 }` what is the expected alignment for X?
<Sahnvour>
curtisf: yes you can see line-level information
<Sahnvour>
you could even see instruction-level before, but I can't find it anymore since VS2017
<Sahnvour>
make sure to generate a full report from your profiling (ends up with a .vsps file) and then you can browse your code with inline costs :)
curtisf has quit [Remote host closed the connection]
curtisf has joined #zig
<curtisf>
Sahnvour: sorry for bugging you repeatedly, but you have been helpful so far :) Do you know I get there? From googling it looks like there should be a "Performance Explorer" window that I'm not seeing
<Sahnvour>
no problem
<Sahnvour>
did you get a report after profiling ?
<Sahnvour>
when you stop or the process ends, it should automatically open a tab with a report inside it
<Sahnvour>
listing the top functions or something like that
<Sahnvour>
okay then I think that's the "oopen details" link
<Sahnvour>
used to be "generate detailed report" iirc
<Sahnvour>
if I'm right, it will process for some time and then show you a hot path view
<Sahnvour>
from where you can navigate to functions
<Sahnvour>
the "function details" view is especially useful
<curtisf>
OH, I see, thanks!
<Sahnvour>
you're welcome
<scientes>
andrewrk, how do i get the file name in gdb again?
<andrewrk>
scientes, AstNode::src()
<andrewrk>
e.g. (gdb) p instruction.source_node->src()
<scientes>
sweet
<scientes>
*sweat
<scientes>
....
<Yardanico>
im sorry for asking that question but how do I print ascii value of a byte - u8 ?
<andrewrk>
if you are using formatting facilities I believe {c}
<scientes>
you also might want to test if it is ascii
<Yardanico>
thanks :)
<andrewrk>
fengb, I've fixed both the "Instruction does not dominate all uses" bugs regarding async/await. But it looks like there are a few more corner cases to solve, will open new issues soon
<andrewrk>
stability is improved though
<Tetralux>
kristoff_it: Can you run that fast float parsing example measurement again... only with --release-fast on, it's ten times slower than when I wrote it...
<andrewrk>
I'm down to just https://clbin.com/hZb4l for making std.os.read event-based-capable
<Tetralux>
Can someone else also pull down my fast float parsing example and measure it too
<andrewrk>
I wonder what he's blocked on. I'd really like to clear the path for him
<stratact>
andrewrk: I have a quick offtopic question (I don't want to derail). How is FreeBSD's debug-mode output system coming along?
reductum has quit [Quit: WeeChat 2.5]
<andrewrk>
stratact, you mean, e.g., stack traces?
<stratact>
yeah
<andrewrk>
It was my understanding those were working at one point in time. We have stack trace regression tests now thanks to mikdusan but I believe they are not yet enabled for FreeBSD
<stratact>
Gotcha, thanks for the update.
<andrewrk>
If someone goes through the trouble of fixing them and enabling test coverage, they'll stay working
<andrewrk>
Personally, I'm prioritizing language stabilization over FreeBSD support, although I do plan to dedicate time to it eventually
<stratact>
I might check it out once I get better at Zig
<andrewrk>
stratact, have you seen the support table / tier system?