<pixelherodev>
The tests aren't fully finished yet, but the framework is in place
slurpie has quit [Ping timeout: 240 seconds]
satchmo_ has quit [Ping timeout: 272 seconds]
satchmo_ has joined #zig
ifreund has joined #zig
<ikskuh>
andrewrk: is packages.zig a reserved file name in the zig build process?
satchmo_ has quit [Ping timeout: 260 seconds]
<ikskuh>
ah no
<ikskuh>
the auto-typename-thingy is just borked :D
satchmo_ has joined #zig
satchmo_ has quit [Ping timeout: 272 seconds]
xackus has joined #zig
dddddd has joined #zig
satchmo_ has joined #zig
satchmo_ has quit [Ping timeout: 252 seconds]
satchmo_ has joined #zig
satchmo_ has quit [Ping timeout: 260 seconds]
satchmo_ has joined #zig
<ikskuh>
okay, i have found a zig abomination
<ikskuh>
foo().?..bar().?
<pixelherodev>
Uh
<pixelherodev>
Ohhhh I see
satchmo_ has quit [Ping timeout: 246 seconds]
<pixelherodev>
Slicing?
<ikskuh>
yeah :D
<ikskuh>
with optionals
<pixelherodev>
yeah, got that part :P
<pixelherodev>
if you think that's bad...
<pixelherodev>
I wrote a real abomination earlier
satchmo_ has joined #zig
RagingDave has quit [Remote host closed the connection]
satchmo_ has quit [Ping timeout: 260 seconds]
satchmo_ has joined #zig
satchmo_ has quit [Ping timeout: 272 seconds]
satchmo_ has joined #zig
<pixelherodev>
error.no_errors
<pixelherodev>
lol
<pixelherodev>
error.did_not_fail is probably better
<pixelherodev>
But it's amusing that that would actually fit
<pixelherodev>
Just about done with the error checking framework :)
ur5us has quit [Ping timeout: 260 seconds]
<ikskuh>
it may actually make sense
<ikskuh>
so the test runner returns that a test did not fail which is the error condition :D
<pixelherodev>
Exactly
<ikskuh>
so you return error.NoError :D
<pixelherodev>
error.did_not_fail is better though
<pixelherodev>
Precisely because it avoids this
<ikskuh>
DidNotFail! :D
<pixelherodev>
:P
<pixelherodev>
Wait, are errors suppo - yes, yes they are
<pixelherodev>
good catch
<pixelherodev>
pun intended
satchmo_ has quit [Ping timeout: 244 seconds]
<ikskuh>
try harder()
<pixelherodev>
:)
satchmo_ has joined #zig
<pixelherodev>
Hmm
<pixelherodev>
What's a good name for the error when more errors are encountered than expected?
<pixelherodev>
e.g. we're expecting two errors but we got four
<pixelherodev>
error.ExtraErrors is too vague
<pixelherodev>
error.MoreErrorsThanExpected feels too verbose
<pixelherodev>
error.UnexpectedErrors feels stupid, but I guess it's on point?
<ifreund>
error.TooManyErrors
<pixelherodev>
and std.fs uses it (according to ZLS), so it's good
<pixelherodev>
UnexpectedError, that is
<ifreund>
yeah that's pretty good
<pixelherodev>
It sounds stupid but
<pixelherodev>
It does convey the intended meaning
satchmo_ has quit [Ping timeout: 260 seconds]
<pixelherodev>
MismatchedError might be good for when a different error than the one we expected shows up
<pixelherodev>
ExpectedOtherError
<pixelherodev>
s/^/or/
alexnask has joined #zig
<ifreund>
error.WrongError
stripedpajamas has joined #zig
stripedpajamas has quit [Client Quit]
<pixelherodev>
Now good for failed_file error messages, I think :)
<pixelherodev>
Yeah
<pixelherodev>
And for convenience, it prints e.g. "Expected error 'invalid decl', found 'invalid decl: %foo'"
<pixelherodev>
Or to use an actual example: `Expected '', found 'unrecognized identifier: %test'`
<pixelherodev>
Alright, fully done I think
<pixelherodev>
If I add another PR, more than 10% of open PRs will be mine lol
satchmo_ has joined #zig
<ifreund>
good job on being productive :D
<pixelherodev>
Yeah :)
<pixelherodev>
Three of the four PRs I have open are stage2 improvements :)
<pixelherodev>
Though one is just a minor one-liner :P
<pixelherodev>
I'll do more later, but for now I need to get more done on Ikiru :)
nycex- has joined #zig
nycex has quit [Ping timeout: 240 seconds]
hsh has quit [Quit: Connection closed for inactivity]
nycex- is now known as nycex
ovf has joined #zig
<pixelherodev>
alexnask: thanks for the ZLS work :)
<alexnask>
Does it enable completions on any of your types or are they still too complex? :D
<alexnask>
Probably not, I dont think many people recursively call type fns :P
<pixelherodev>
Going to find out in just a second...
riba has joined #zig
<pixelherodev>
:D
<pixelherodev>
It works :D
<alexnask>
\o/ !
<pixelherodev>
I mean, internally at least
<pixelherodev>
For external usage I still need package support :)
<pixelherodev>
My last attempt at implementing that didn't end well though :P
<alexnask>
I will give it a shot later today, the people want it
<alexnask>
Did you try to parse the build.zig file? I will probably ship a custom build runner, find zig in path and make it output a package list to the parent process (zls)
<pixelherodev>
Nah, I didn't even get that far
<pixelherodev>
I tried a manual override and it didn't work
<alexnask>
Aah gotcha
<pixelherodev>
That is, adding the name and path directly to the source
<pixelherodev>
It didn't work hardcoded, and I didn't have time to try getting it working
* pixelherodev
shrugs
<pixelherodev>
I'll focus on stage2, it's friendlier :P
<pixelherodev>
One nice benefit of ZLS showing function descriptions: it annoys me enough to document the hell out of things
riba has quit [Ping timeout: 264 seconds]
eddyb[legacy] has quit [Ping timeout: 260 seconds]
ovf has quit [Ping timeout: 240 seconds]
utzig has quit [Ping timeout: 240 seconds]
ovf has joined #zig
layneson has joined #zig
jzelinskie has quit [Ping timeout: 265 seconds]
ovf has quit [Max SendQ exceeded]
jzelinskie has joined #zig
eddyb[legacy] has joined #zig
utzig has joined #zig
<pixelherodev>
`1/1 test "self-hosted"...Test 'call with non-existent target' compilation succeded, error expected`
<pixelherodev>
That is, if we encounter an unknown function name, we don't pull a C and define it as a preset type or anything, right? :P
ovf has joined #zig
<alexnask>
lol
<alexnask>
just use int where there is no type :D
<ikskuh>
f(){}
<ikskuh>
shortest valid c file :D
<pixelherodev>
False!
<alexnask>
`The empty list in a function declarator that is not part of a definition of that function specifies that no information about the number or types of the parameters is supplied.`
<pixelherodev>
ikskuh: I've got a shorter one
<alexnask>
Gotta love C
<pixelherodev>
layneson has quit [Ping timeout: 272 seconds]
<pixelherodev>
:)
<pixelherodev>
alexnask: yeah...
<pixelherodev>
I mean, I do
<alexnask>
Sure
<pixelherodev>
It's still easily in my top three
<alexnask>
Its quirky though
<pixelherodev>
Oh for sure
<alexnask>
`void func1() { } .... func1(1, 2, 3); ` <- The compiler need not produce an error
<pixelherodev>
Yeah I know
* ikskuh
laughs evil
<ikskuh>
const char main __attribute__((section(".text"))) = 0xC3;
<pixelherodev>
The way I see it, C's quirks are utterly atrocious
<ikskuh>
valid for x86
<alexnask>
Ah yes another classic
<pixelherodev>
but
<pixelherodev>
C's quirks are *constant*
<pixelherodev>
C's quirks in ten years will be the same they were ten years ago
<pixelherodev>
C++, Rust, even Zig for now, don't provide that kind of guarantee
<pixelherodev>
Hell, C++ and Rust are basically determined to be as far away from that as possible
<ikskuh>
zig does not want to atm :D
<pixelherodev>
c++17 had so many changes the wikipedia page was basically "this... isn't complete. there's too many features to list for that."
<alexnask>
GCC should standardize their C extensions
<ifreund>
yeah c++ is ridiculous
<pixelherodev>
C18 literally added *nothing* to the language, and just improved what was already there
<pixelherodev>
alexnask: ehh
<pixelherodev>
I disagree
<pixelherodev>
Some of the GCC extensions are good, eys
<pixelherodev>
yes*
<pixelherodev>
Others less so
<alexnask>
I dont mean include them in the C standard
<pixelherodev>
Do you mean to define them?
<pixelherodev>
Add them to Clang
<pixelherodev>
?
<pixelherodev>
Add them to every other C compiler in existence?
<alexnask>
Make a "GCC extension" standard so that other compilers can implement them and guarantee the same behavior
<pixelherodev>
ahh
<alexnask>
Clang implements a good amount of gcc extensions
<pixelherodev>
True
<pixelherodev>
I think an official way to define C extensions would be good
<pixelherodev>
Ohh, i know a good example
<pixelherodev>
You know RISC-V?
<alexnask>
vaguely :P
<pixelherodev>
I'm thinking `C + GNULite + Embed`
<pixelherodev>
That is, well-defined standards (C standard, extension specs, etc), where a compiler explicitly reports what extensions it supports
<pixelherodev>
Heck, add e.g. POSIX to that list
<pixelherodev>
GCC would report `C + POSIX + GNU`
<pixelherodev>
Build scripts could then do `if (compiler.supports("POSIX"))`
<pixelherodev>
`if (compiler.supports("GNU"))`
<pixelherodev>
etc
<pixelherodev>
andrewrk: [insert party hat here]
<pixelherodev>
:)
<andrewrk>
let's see what happens to those ggf graphs :D
<pixelherodev>
alexnask: does this mean ZLS is about to get a bunch faster, too? :)
<alexnask>
We'll see :D Let me update my branch and merge to master
<pixelherodev>
:)
<pixelherodev>
andrewrk: I'm asking because it currently doesn't seem to do so and I wanted to be sure this wasn't deliberate before fixing it
<andrewrk>
pixelherodev, ZIR is the thing that makes all the zig compile errors work for zig source code
<andrewrk>
so your question can be answered by asking, "how does it work in zig?"
<pixelherodev>
That's a yes, I take it?
<pixelherodev>
`1/1 test "self-hosted"...Test 'call with non-existent target' compilation succeded, error expected`
<pixelherodev>
Alrighty, patching
Snetry has quit [Ping timeout: 256 seconds]
Snetry has joined #zig
dingenskirchen1 has joined #zig
dingenskirchen has quit [Ping timeout: 260 seconds]
dingenskirchen1 is now known as dingenskirchen
dermetfan has joined #zig
RagingDave has joined #zig
waleee-cl has joined #zig
<pixelherodev>
andrewrk: would the proper place to make the check be genCall?
<pixelherodev>
The *parser* probably shouldn't reject it; it's grammatically valid
<andrewrk>
pixelherodev, codegen.zig should not be doing any semantic analysis
<andrewrk>
by the time control flow gets there, everything should be smooth sailing
<andrewrk>
can you explain a bit more what you're trying to solve?
<pixelherodev>
Right now, `call(@foo)` doesn't result in an error if `foo` isn't defined
<pixelherodev>
Or at least, `module.update()` doesn't return an error for it
<pixelherodev>
My goal here is to scan the list of known decls and error out if it isn't found
<pixelherodev>
This should be in Module.zig, right?
<pixelherodev>
That's where semantic analysis is IIUC
<pixelherodev>
Wait... that *should* be failing
<pixelherodev>
self.resolveInst() should fail...
<pixelherodev>
Ahh
<pixelherodev>
I see
<pixelherodev>
it calls through to resolveDecl, which appears to create it if it doesn't already exist
<pixelherodev>
Though that *should* fail too, I'd think
<andrewrk>
yeah that's where it should fail
<andrewrk>
note that it will insert a placeholder "invalid" decl so that any other references to this same name will not produce redundant compile errors
<pixelherodev>
ohhh, gotcha
wozeparrot__ has joined #zig
greenfork has quit [Ping timeout: 260 seconds]
RagingDave has quit [Quit: quit]
aerona has joined #zig
bjornroberg has joined #zig
satchmo has joined #zig
satchmo_ has quit [Ping timeout: 260 seconds]
tgschultz has quit [Ping timeout: 240 seconds]
dddddd has quit [Ping timeout: 240 seconds]
dimenus has joined #zig
cole-h has joined #zig
iwq has quit [Ping timeout: 246 seconds]
layneson has joined #zig
<andrewrk>
alright. chores, then it's time to give some love to pull requests
iwq has joined #zig
<pixelherodev>
uh oh
<pixelherodev>
I need to quickly make more
<pixelherodev>
before all of mine get merged :P
_Vi has joined #zig
scientes has joined #zig
<scientes>
andrewrk, how do you get those nice instruction count statistics?
<scientes>
I have a new enough CPU
<andrewrk>
scientes, specifically, which column?
<scientes>
i.e. 8df0841d6ab964e2aec750a8cee
<andrewrk>
the columns are timestamp,benchmark_name,allocator,commit_hash,error_message,samples_taken,wall_time_median,wall_time_mean,wall_time_min,wall_time_max,utime_median,utime_mean,utime_min,utime_max,stime_median,stime_mean,stime_min,stime_max,maxrss,baseline_error_message,baseline_samples_taken,baseline_wall_time_median,baseline_wall_time_mean,baseline_wall_time_min,baseline_wall_time_max,baseline_utime_median,baseline_utime_mean,baseline_utime_min,baseline
<andrewrk>
that might be a really nice column to add
<scientes>
but where do those columns come from?
<andrewrk>
which one?
<scientes>
all of those above?
<scientes>
is it linux-perf?
<scientes>
ahh perf stat
wozeparrot__ has quit [Remote host closed the connection]
<andrewrk>
timestamp-> from the git commit. benchmark_name,allocator from manifest.json. commit_hash/error_message is part of the logic of the script. samples_taken is from the benchmark harness. maxrss, utime, stime are from getrusage. wall_time is from a timer
wozeparrot__ has joined #zig
<scientes>
oh, my git ids are ruined by a merge
<scientes>
nah, nvm
RagingDave has joined #zig
decentpenguin has joined #zig
<pixelherodev>
Hmm
<pixelherodev>
It never *does* resolve
<pixelherodev>
Ohhh
* pixelherodev
faceplams
<pixelherodev>
s/plam/palm
<pixelherodev>
I didn't export start
<pixelherodev>
so it never analyzed it :P
<pixelherodev>
... except I get the same result if I do export it :(
greenfork has joined #zig
<pixelherodev>
Hmm, I'm fairly certain analyzeFnBody is correctly erroring out (if for the wrong reason :P)
<pixelherodev>
Something's intercepting it further up the chain...
<pixelherodev>
performAllTheWork is catching it and continuing onwards...
<ifreund>
hmm, has someone proposed using underscores in function declarations to ignore parameters and making using all parameters required?
<fengb>
Would we reliably detect those with the debug allocator?
<ifreund>
yes, i think we would
<pixelherodev>
Okay, so update() should check for failures separate from the `try` when calling performAllTheWork, and then pass it up the chain that way...
<pixelherodev>
Or, since I'm already passing analysisfails upwards in update, I should do it here too, but I'm starting to suspect it was a deliberate design decision not to do so
<pixelherodev>
Better yet
<pixelherodev>
I shouldn't be checking if update() returned an error to see if it failed
<pixelherodev>
`Unexpected decl error: ErrorMsg{ .byte_offset = 118, .msg = TODO implement type coercion from [8:0]u8 to []const u8 }`
<fengb>
I don’t like it for function args since having a name is more self documenting
<ifreund>
more so than saying "I don't use this parameter" by ignoring it with an underscode?
<fengb>
But why is it there? You get nothing
<ifreund>
it's there to match the function signature required when declaring, for example, a callback
<fengb>
You see bizarre silliness in JavaScript where they do `function foo(/* context */)`
<fengb>
Yes I know but it doesn’t tell you anything. If you write _context: Context, that hints at it matching with what’s available
<fengb>
I suppose the type would work in this case too
<fengb>
But compare with something like _: bool
<fengb>
_isUpper: bool
<andrewrk>
pixelherodev, self-hosted is designed to continue making progress even in the case of compile errors. there can be 1 compile error per decl
<andrewrk>
fengb, the strategy used by GeneralPurposeDebugAllocator is not 100% foolproof, but it's pretty good, especially on 64-bit systems. it uses an monotonically increasing (but wrapping) global atomic integer as the "hint" parameter to mmap, and then never re-uses slots
<andrewrk>
its effectiveness is limited only by the address space range, and the operating system's honoring of the hint parameter
<andrewrk>
in practice, you have to really try on purpose to use up all the virtual address space so that the hint has to wrap back around to low addrs
<andrewrk>
also, arguably, operating systems should already be doing this. giving new addrs instead of repeating addrs for map/unmap/map
<pixelherodev>
andrewrk: right, that's what I realized (which is why I closed a PR)
layneson has quit [Ping timeout: 260 seconds]
decentpenguin has quit [Quit: decentpenguin]
<pixelherodev>
hmm
<pixelherodev>
Why would a decl be read as a [N:0]u8 instead of as a slice?
<pixelherodev>
Given that I haven't seen it attempt coercion elsewhere, I'm assuming most instances don't have this behavior
dimenus has quit [Ping timeout: 246 seconds]
<shakesoda>
don't things with comptime known sizes try to use sized types if possible since 0.6?
<shakesoda>
i ran into this and had to throw in a few instances of slicing at callsites
<shakesoda>
* sized array types
[rg] has joined #zig
chivay_ is now known as chivay
RagingDave has quit [Quit: quit]
[rg] has quit [Quit: Konversation terminated!]
[rg] has joined #zig
stripedpajamas has joined #zig
stripedpajamas has quit [Quit: stripedpajamas]
doublex has quit [Ping timeout: 246 seconds]
doublex has joined #zig
doublex has quit [Read error: Connection reset by peer]
doublex_ has joined #zig
doublex_ has quit [Read error: Connection reset by peer]
doublex has joined #zig
stripedpajamas has joined #zig
homa_rano has quit [Ping timeout: 265 seconds]
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
stripedpajamas has quit [Quit: sleeping...]
doublex has quit [Read error: Connection reset by peer]
doublex_ has joined #zig
doublex_ has quit [Read error: Connection reset by peer]
doublex has joined #zig
satchmo has quit [Ping timeout: 260 seconds]
stripedpajamas has joined #zig
_Vi has quit [Ping timeout: 260 seconds]
slurpie has joined #zig
metaleap has joined #zig
satchmo has joined #zig
return0e has joined #zig
return0e has quit [Remote host closed the connection]
layneson has joined #zig
satchmo has quit [Ping timeout: 272 seconds]
dddddd has joined #zig
doublex has quit [Remote host closed the connection]
doublex has joined #zig
aerona has quit [Quit: Leaving]
satchmo has joined #zig
bjornroberg has quit [Ping timeout: 256 seconds]
_Vi has joined #zig
traviss has quit [Quit: Leaving]
traviss has joined #zig
cole-h has quit [Quit: Rebooting]
<ikskuh>
huh
<ikskuh>
is it a well-known-problem that zig can't handle long paths on windows very well?
<ikskuh>
i can
layneson has quit [Ping timeout: 260 seconds]
<ikskuh>
i can't compile a project on a Desktop folder because zig build crashes with error.Unexpected: FileNameTooLong
cole-h has joined #zig
<andrewrk>
no that's not a known problem
<andrewrk>
I thought it worked up to something like 32,0000 bytes
<ikskuh>
doesn't look like it
<andrewrk>
smells like a bug
<ikskuh>
i'll try to make a minimal example
<ikskuh>
yep
<alexnask>
ikskuh, Can you give me an example path length so I can try to repro? Tried on desktop (pretty long path) and in some folders in Documents but I cant get the error to trigger
<ikskuh>
try building MasterQ32/gurl on Desktop
<ikskuh>
username "test" for me, so "alex" should be enough :D
<ikskuh>
C:\Users\test\Desktop\Projects\gurl
<ikskuh>
is my folder where i build in
tdc has quit [Ping timeout: 258 seconds]
<alexnask>
strange
<ikskuh>
yeah
<ikskuh>
win7, x86_64
<ikskuh>
clean install, using gitbash
<alexnask>
Managed to repro in directory C:\Users\Alex\Documents\directory_1\some_other_long_directory\a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z\gurl
<alexnask>
I can build a zig init-exe proj in C:\Users\Alex\Documents\directory_1\some_other_long_directory\a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z though >_>
layneson has joined #zig
<alexnask>
I can also build the init-exe project in the gurl subdirectory
<alexnask>
So not a path length issue
<ikskuh>
the stack trace runs into a path length error i think