waleee-cl has quit [Quit: Connection closed for inactivity]
<pixelherodev>
Is there a way to differentiate between ErrorSet1.Error1 and ErrorSet2.Error1
<pixelherodev>
?
reductum has joined #zig
<rooke>
My read from the documentation is no, but I could be wrong... "However, each error name across the entire compilation gets assigned an unsigned integer greater than 0. You are allowed to declare the same error name more than once, and if you do, it gets assigned the same integer value."
<rooke>
Is the particular line
<pixelherodev>
Yeah, that's what I figured
<daurnimator>
pixelherodev: you can't: they're the same
<daurnimator>
note the name: error sets. its the same value in a different set
<pixelherodev>
Right
<pixelherodev>
Makes sense
fraktor has quit [Ping timeout: 265 seconds]
nycex- has joined #zig
nycex has quit [Ping timeout: 240 seconds]
reductum has quit [Ping timeout: 246 seconds]
tsmall has quit [Ping timeout: 246 seconds]
dddddd has quit [Ping timeout: 246 seconds]
st4ll1 has joined #zig
marnix has joined #zig
marnix has quit [Ping timeout: 265 seconds]
cole-h has quit [Quit: Goodbye]
drp has joined #zig
daex has quit [Ping timeout: 265 seconds]
marnix has joined #zig
daex has joined #zig
dermetfan has joined #zig
Kingsquee has joined #zig
manuzor has joined #zig
drewr has quit [Ping timeout: 260 seconds]
drewr has joined #zig
tdc has joined #zig
haliucinas has quit [Remote host closed the connection]
marnix has quit [Ping timeout: 264 seconds]
haliucinas has joined #zig
ifreund has quit [Ping timeout: 265 seconds]
pangey has joined #zig
daex has quit [Ping timeout: 256 seconds]
daex has joined #zig
ifreund has joined #zig
_Vi has joined #zig
Snetry has quit [Ping timeout: 246 seconds]
Snetry has joined #zig
<nerthus>
do you guys happen to know why the zig extension for vscode sometimes work and sometimes doesnt
<nerthus>
and it's only with the zig extension that this happens T_T
<Kingsquee>
because it's not written in rust?
* Kingsquee
shot
<ifreund>
it's a vscode extention, it's JS
<nerthus>
vscode is hard to debug as well
<nerthus>
it gives you a bunch of obfuscated JS to look through
<nerthus>
frustrating part is, is that I literally just restored it from a backup that worked fine
<nerthus>
lmao
WilhelmVonWeiner has quit [Ping timeout: 272 seconds]
bgiannan has quit [Ping timeout: 244 seconds]
HollMax has joined #zig
KoljaKube has joined #zig
Kingsquee has quit [Quit: Konversation terminated!]
<KoljaKube>
Is const-ness part of `type`s?
<KoljaKube>
Basically what I'm trying to accomplish is having a generic structure that can enforce const-ness of slice function parameters depending on how it was initialized
halbeno_ has quit [Ping timeout: 260 seconds]
<ifreund>
yes, `[]const u8` is a type
<ifreund>
and is distinct from `[]u8`
<KoljaKube>
But if I only have the u8 part?
<afontain_>
it's also a type
<KoljaKube>
Yeah, sorry, I guess I'm not good at explaining
<ifreund>
in that case you're talking about the constness of the variable storing the value
<ifreund>
const x: u8 = 42;
<ifreund>
the constness is a property of x not of the type it is storing
<KoljaKube>
I was thinking about a function like foo(comptime T: type, []T data), is there a way to switch data to []const T depending on T
<KoljaKube>
I'm trying to write a wrapper around mutable and immutable buffers and I'm trying to figure out how much of that information I can get into the type system
<ifreund>
why not do foo(comptime T: type, data: T) and call like foo([]const u8, data) or foo([]u8, data)
<KoljaKube>
I guess I could do that, if there was a way to get a @sizeOf(u8) out of that
<ifreund>
i think @typeInfo should give you that
<mq32>
yeah, you can use @typeInfo
<KoljaKube>
Would that be TypeInfo.Pointer.child? Documentation in builtin.zig is kind of sparse...
<mq32>
yeah
<KoljaKube>
Thanks :-)
halbeno has joined #zig
dermetfan has quit [Ping timeout: 272 seconds]
<KoljaKube>
So if all that would work, is it also possible to conditionally exclude functions from anonymous structs?
<ifreund>
not sure I follow
<KoljaKube>
What I would want to do is not have an `update()` function if my T above is []const u8
<ifreund>
indeed, I love how zig can do so much with such simple rules :)
<KoljaKube>
Yeah
alexnask has joined #zig
<KoljaKube>
So far zig has definitely one of the nicest compile-time type systems I've head the pleasure to use
<KoljaKube>
And a great community, thanks for entertaining my weekendly question-fueled pop-ins here ;-)
<ifreund>
no problem!
andrii has joined #zig
andrii has quit [Client Quit]
andrii has joined #zig
dddddd has joined #zig
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
Snetry has quit [Ping timeout: 260 seconds]
<KoljaKube>
Hm, in my actual code I do need the `else struct{}`. Not sure where the difference is
<ifreund>
i'd guess it parses without the else struct{} but doesn't compile, and whatever you were testing with wasn't using the update function so it didn't get compiled
<ifreund>
would be surprised if it worked without the else struct{} tbh
<KoljaKube>
No, definitely did compile with a call to the potentially hidden function
<mq32>
and yeah, i love the clarity of the sound as well
<andrewrk>
mq32, I know you mentioned it but it never quite sank in, I didn't realize you were creating an entire cpu architecture and then building it. your project is mind blowing
<mq32>
♥
<mq32>
and: it has a zig-based toolchain!
<andrewrk>
:D
<mq32>
it's paused right now, because of sme other projects, but i will return
<mq32>
doing hardware stuff is sometimes frustrating
<mq32>
how's stage 2 going on?
<andrewrk>
I'm hoping to reach a stage2 demo point early this week
<andrewrk>
Progress feels slow because I'm investing in all the difficult design decisions up front, rather than just cranking through zig language features
<andrewrk>
but I'm confident the investment will be worth it
<mq32>
yeah, it's just unusually silent
<mq32>
but i know that "thinking through"
<mq32>
instead of just going full-frontal coding
<andrewrk>
I've also taken a few vacation days this week for family stuff
<mq32>
good!
<fengb>
“Full-frontal coding”... not a phrase I’d use
<companion_cube>
nothing to hide between consenting adults
<fengb>
There’s documentation? What kind of programmer are you
<andrewrk>
is the SPU Mark II Instruction Set Architecture stable?
KoljaKube has quit [Quit: WeeChat 2.8]
<andrewrk>
looks like it has post-1.0 version numbering
<mq32>
it's the document versioning actually :D
<mq32>
it's quite stable already, nothing breaking is planned anymore
<ifreund>
i guess that's what you get with simplicity
<mq32>
except for an improved interrupt handling and two other instructions
<mq32>
(cpuid and some kind of "syscall" thingy for soft-cpu control)
<andrewrk>
neat! I think it would be a good architecture to support to make sure the design does not overfit for any particular architecture
<mq32>
true
<mq32>
the SPU ISA is quite different than most else
riba has quit [Ping timeout: 258 seconds]
<mq32>
also, it would be absolutely awesome to have a real compiler for that arch
<andrewrk>
it can go inside an elf container, yes?
<mq32>
i can use objcopy :D
<alexnask>
Hmm total ArrayList support (as in resolving T, Slice, etc. for a type returned by ArrayList(T)) is more difficult than I realized
<alexnask>
(in zls, that is)
nephele_ has joined #zig
nephele has quit [Ping timeout: 264 seconds]
nephele_ is now known as nephele
<alexnask>
Still relatively close, I think I can get it done this week
<ifreund>
is the immediate goal primitive types or are you going straight to arbitrary ArrayList(ArrayList(T)) nestings?
<andrewrk>
neat, I haven't seen this use case with @"" function names to do parsing
<ifreund>
yeah that's a super neat idea right?
doublex has quit [Ping timeout: 264 seconds]
<alexnask>
Primitive types are not interesting, they have no fields
<alexnask>
:D
reductum has joined #zig
<ifreund>
right :D
<alexnask>
Type argument parameter already works in type-fns
<alexnask>
But ArrayList calls into ArrayListAligned and I dont forward them yet
<alexnask>
type argument parameter binding*
tdc has quit [Ping timeout: 264 seconds]
<alexnask>
And issue #2 is that Slice/SliceConst depend on the alignment passed, so it requires some knowledge of comptime nullable types + integers
<alexnask>
To resolve the if expression correctly
nerthus has quit [Remote host closed the connection]
<andrewrk>
"Go with SPU Mark II, it doesn't have spectre, it doesn't have meltdown, it doesn't have cache misses, because there is no cache." this is gold xD
doublex has joined #zig
<andrewrk>
the unofficial Q&A during the break is nice
<andrewrk>
love those happy bird chirping vibes during pixelherodev's talk
reductum has quit [Ping timeout: 256 seconds]
<pixelherodev>
uheh
<alexnask>
lol type param forwarding actually works Im stupid
<pixelherodev>
propsoal:
<pixelherodev>
release mode with inlin8ng disabled
<pixelherodev>
This is useful for profiling
<pixelherodev>
s/8/i
<andrewrk>
profiling is an important use case. don't you want to run your profile tests taking into account inlined functions though?
<pixelherodev>
yes, but it's also nice being able to see how the function affect - hey wait, kcachegrind shows impact of indivisual lines
<pixelherodev>
sweet
<pixelherodev>
s/sual/dual
<pixelherodev>
never mind then :)
<mq32>
<andrewrk> neat, I haven't seen this use case with @"" function names to do parsing
<mq32>
i don't know, it appeared natural to me to do this
<mq32>
if i can @"" everything, why keep tables to translate it?
<andrewrk>
oh I agree with you, I just hadn't thought of it, and hadn't seen anyone else do it yet
<mq32>
my args parser is doing it as well
<pixelherodev>
?
<pixelherodev>
which bit is this?
<mq32>
i assume andrew is referring to my handling of mnemonics
doublex has quit [Ping timeout: 260 seconds]
waleee-cl has joined #zig
<andrewrk>
wow pixelherodev this is really ambitious. and your pace of development is impressive!
<andrewrk>
the package manager use case is interesting, I like that it solves the problem that most applications do not take advantage of -march=native
<mq32>
make zig compile so fast that we don't need precompiled packages!
doublex has joined #zig
<pixelherodev>
Working on jmproving rawmcodeg3n next
<pixelherodev>
Tehn some basic optimizations, possibly
<pixelherodev>
gah
<pixelherodev>
improving raw codegen next, then possibly some basic optimizations*
<pixelherodev>
stage2 error tests first though
<andrewrk>
pixelherodev, this testing infrastructure that you've pioneered is soon going to become something we need in zig for testing multiple backends. you've written a bunch of useful tools
<andrewrk>
I'm really impressed
<andrewrk>
it's so cool that mq32 just demoed his own cpu architecture and then pixelherodev comes along, "btw and I've written a JIT for it"
<mq32>
:)
<pixelherodev>
heh, yeah :)
<pixelherodev>
as I've said repeatedly
<pixelherodev>
the single nicest architecture I've worked with, emulation wise
<pixelherodev>
bar none
<pixelherodev>
LIMN comes close, but not quite
<mq32>
thanks
<mq32>
it's also nice to code in assembler
<mq32>
i should patch up the emulator and make it up-to-date with the current HW version
<pixelherodev>
uhoh
<pixelherodev>
:p
<mq32>
that means: MMU, more RAM, more ROM and more devices
<mq32>
for example: video!
<pixelherodev>
wait
<pixelherodev>
more ROM?
<pixelherodev>
fuuuuu
<pixelherodev>
wait no it's fine
<pixelherodev>
cache supports the full address space
<pixelherodev>
not just ROM
<pixelherodev>
oh yeah
doublex has quit [Ping timeout: 265 seconds]
<pixelherodev>
reworked the cache ;)
<pixelherodev>
it's now more than twice as fast in debug mode
<mq32>
debug mode doesn't coun
<mq32>
*count for perf
<pixelherodev>
it matters
doublex has joined #zig
<pixelherodev>
it was a deliberate goal
<pixelherodev>
it means a reduced incentive to skip tests
<pixelherodev>
release mode is onlyn10% faster ish so far
<pixelherodev>
probably a bigger improvement on older microarchs
ur5us has joined #zig
didymos is now known as oats
<andrewrk>
I like the construction sounds in the background of pixelherodev's Q&A, they are inspiring and metaphoric
<andrewrk>
that was an excellent showtime episode
<ifreund>
yeah tons of super cool low level stuff
<pixelherodev>
Ha
<pixelherodev>
andrewrk: TBH, I didn't hear the sounds :P
<pixelherodev>
Or perhaps I just didn't notice them