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/
<waleee-cl> ryuukk_: I think you need to create steps for hello/.../cube for that to work?
radgeRayden has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 260 seconds]
xackus has quit [Ping timeout: 240 seconds]
mschwaig has quit [Read error: Connection reset by peer]
mschwaig has joined #zig
ur5us has joined #zig
<ryuukk_> if i remove: "exe.install();" it works
<ryuukk_> not sure if that's a a bug or it's intended?
<ryuukk_> by it works i mean, when i call "zig build cube" it only creates the exe for the cube step now
<waleee-cl> ryuukk_: what happens if you try a run command?
<ryuukk_> zig build run doesn't work
<ryuukk_> but i get the behavior i wanted once i removed the exe.install(), so it's fine
<ryuukk_> "zig build cube" will create and run the exe i want
<ryuukk_> previously, it would create an exe for all steps
<ryuukk_> removing exe.install() solves that "issue"
<ryuukk_> maybe the compiler doesn't check for the step name before calling the install function, i'll need to check, but dunno where :p
zippoh has joined #zig
kristoff_it1 has quit [Ping timeout: 264 seconds]
layneson has joined #zig
ttb has joined #zig
<kandinski> what's the expected way to use regexps in zig as of today? import a C lib, is there a good zig-pcre alternative, other?
ur5us has quit [Remote host closed the connection]
ur5us has joined #zig
radgeRayden has joined #zig
cr1901_modern has joined #zig
a_chou has joined #zig
a_chou has quit [Remote host closed the connection]
Kingsquee has joined #zig
layneson has quit [Ping timeout: 246 seconds]
<ryuukk_> hmm there is no operator overloading in zig? :( how i am supposed to do math operations with structs (vectors mainly)
<daurnimator> correct.
<daurnimator> vectors are built in to the language
<daurnimator> otherwise you use methods.
<ryuukk_> methods is hard to read for math operations
<ryuukk_> > vectors are built in to the language
<ryuukk_> what do you mean?
<daurnimator> std.meta.Vector(N, T)
<ryuukk_> but that doesn't fix my problem with operator overloading
<ryuukk_> var result = a + b / 2; VS var result = Vec3.div(Vec3.add(a, b), 2)
<ryuukk_> you can see wich one is easy / hard to read
<daurnimator> vectors are a primitive type
<daurnimator> --> they come with operators working.
<ryuukk_> with about matrices?
<ryuukk_> what's the fields of the vector?
<daurnimator> no matrices.
<ryuukk_> then it doesn't solve my problem
<daurnimator> one of the important parts of zig's design is no-hidden-control flow
<ryuukk_> but it clases with readability
<ryuukk_> clashes
<daurnimator> I disagree
<daurnimator> if I'm reading code that contains `a + b`, I know that it's not some weird overloaded thing.
<ryuukk_> same for Vec3.add, what it does? maybe some weird overloaded thing too :p
<ryuukk_> a + b, we all learn at school
<ryuukk_> that's math
<daurnimator> ryuukk_: yes, but function call `()` means "go look over there"; and the `Vec3.` tells you where to look
<ryuukk_> same for the +
<daurnimator> it doesn't though
<ryuukk_> you know what are the types
<ryuukk_> compiler too
<daurnimator> please see the closed issues for more rationale. e.g. https://github.com/ziglang/zig/issues/427 https://github.com/ziglang/zig/issues/871
<ryuukk_> yes i read them already, it doesn't make sense to not allow people to use + - / * for doing math
<ryuukk_> i
<ryuukk_> > No hidden control flow
<ryuukk_> this is not good argument
<ryuukk_> we are talking about math
<ryuukk_> we even allow 1.2 + 1.5
<ryuukk_> floating points, what it does?
<ryuukk_> 0.0 == 0.0, not always true, so hidden control flow
<daurnimator> that's not control flow.
<ryuukk_> that decision is to not allow people to do math at all
<kandinski> ryuukk_: not true at all
<ryuukk_> it is, that is why python is used a lot in that field
<ryuukk_> they allow operator overloading, wich make things easier
<ryuukk_> i hope it is not final word for oprator overloading
<kandinski> it's one of the first reasons for the language, so...
<kandinski> I mean, julia is a lovely language
msingle has quit [Ping timeout: 240 seconds]
<ryuukk_> i don't know what julia is
<kandinski> a language with operator overloading
<ryuukk_> so you tell me to use an other language?
<kandinski> which already exists and has a jit
<kandinski> I'm not telling you to do anything
<ryuukk_> > [5:39:17 am] <kandinski> I mean, julia is a lovely language
<ryuukk_> why even mention julia in a zig irc
<kandinski> why keep insisting on operator overloading in a zig irc, when zig is designed to have no hidden control flow
<ryuukk_> the point is not what other people do, the point is, what does solve my problem
<ryuukk_> because it clashes with readability
<daurnimator> as I said: we believe it does the opposite
<ryuukk_> wich one to pick when both are the reason this language exists?
<daurnimator> it helps with readability when reading all code.
<daurnimator> there's a trade off here
<ryuukk_> math isn't just a + b
<daurnimator> and zig has picked one side.
<kandinski> what daurnimator said, it's a tradeoff, and zig is defined by choosing one side.
<ryuukk_> complex operations exists, hence peopel came up with operator overloading
<kandinski> jinx and all that
<ryuukk_> that's not a valid argument
<ryuukk_> you pick wich you prefer
<ryuukk_> wich is not valid
<ryuukk_> Vec3.mul(Vec3.div(Vec3.add(a, b), 4), Vec3.sub(b, 8))
<ryuukk_> nice readability
<daurnimator> ryuukk_: as I mentioned above, Vectors are built in.
<daurnimator> but yes; for e.g. matrices, you do need to write thatr
<ryuukk_> Matrices is same problem
<kandinski> ryuukk_: maybe you can contribute an std.meta.Matrix type and then the problem will be over
<daurnimator> but as it says in the issue I linked earlier: it looks much better on multiple lines: `const c = Matrix.add(a, b); const d = Matrix.div(c, 4);` etc.
<daurnimator> now; imagine that it was something like bignums: you need to handle allocations in there
<ryuukk_> it doesn't, that's not how people write formulaes
<daurnimator> and we accept that trade off.
<ryuukk_> trade off? i don't see where the trade off is
<daurnimator> "operator overloading makes generic code harder to read from a control flow perspective" vs "operator overloading makes math code easier to read from a math perspective"
<ryuukk_> math, that's all computers are about
<pjz> What about an expression compiler instead?
<ryuukk_> i don't know what that is
<ryuukk_> all i want is do math sanely
<pjz> some math mini-lang that so you could write expressions how you want, and they'd get compiled into good code.
<pjz> kind of like how formatting is done
<ryuukk_> that sounds like too much for doing a + b
<pjz> but it's not just a+b is it?
<ryuukk_> if it's not built in into the language, it makes it just not viable at all
<ryuukk_> it is, it is just operator overloading
<ryuukk_> telling compile i can do a + b on my structs, just like he does for i32
<pjz> hmm
<pjz> you kind of have a point. I grok + for ints - math there is easy. but extending it to floats seems 'special'
<pjz> and if to floats, why not to ... ?
<pjz> Honestly, a + b might not be clear if it's int + float
<kandinski> which one is coercd to which?
<kandinski> and why?
<pjz> or does it type-error/
<kandinski> if you're allowed overloading, it might launch a missile
<pjz> it's already allowed... float + int, no?
<pjz> I mean, + works for both int and float
<pjz> so it's already overloaded.
<kandinski> what I mean is, if we allow overloading by users
waleee-cl has quit [Quit: Connection closed for inactivity]
<daurnimator> pjz: no.error: incompatible types: 'u32' and 'f32'
<pjz> daurnimator: ah! thanks! I was just opening another window to test that :)
<pjz> well, as long as zig admits that floats are somehow special in that they get operator overloading, sure.
<daurnimator> pjz: f32 and comptime_int is allowed though.
<daurnimator> so you have to be a little careful when testing it :)
<pjz> ohh, interesting.
Ondingen has quit [Remote host closed the connection]
<pjz> so here's a stupid idea: have zig fmt write a comment at the end of lines with overloaded operators.
<pjz> if the point is readability, call it out.
<kandinski> pjz: but it's not overloading, it's coercion
<pjz> I thought ryuukk wanted overlaoding?
<kandinski> I mean what happens when you add a float and a comptime int is not so much overloading as coercion
<kandinski> the + sign does what it does for floats
<kandinski> it's just that the compiler knows to upgrade the comptime int to a float
<kandinski> and then uses the same + at runtime
<kandinski> without overloading it
<pjz> oh, right. Gotcha.
<oats> ah, the joys of figuring out how to make my homebrew circe notifications hook *not* notify me on "floats" :P
<kandinski> floots from now on
<daurnimator> f32-and-friends
<oats> 32 bit flooting point numbers
<pjz> but the point is that + is overloaded since it works for ints and floots.
<kandinski> pjz: I would dispute this
<daurnimator> pjz: overload means to give *extra* meaning than what they mean by default in the language
<daurnimator> pjz: what + does is *not* customisable in zig.
<kandinski> but I"llagree that ** seems overloaded since it means both "raise to the power" for numerics and "repeat pattern" for string literals.
<pjz> right. A stricter version of 'overload' is 'works with multiple types'
<pjz> which is what I was thinking of
<pjz> mostly from a method-overload stance
<kandinski> pjz, technically you're right, but emotionally these feel all like "numerics"
<pjz> but so do complex numbers and vectors.
<kandinski> ah also you have a point
<pjz> what about allowing explicit overloading?
<daurnimator> zig does not have complex numbers
<kandinski> my solution would be to add the standard mathematical types (complex numbers, matrices) to the std library
<pjz> so, like _+_ would be an overloaded +
<pjz> or something - notation/syntax TBD
<kandinski> I mean, I'm *not* _requesting_ this, to be clear
<daurnimator> pjz: see the issue(s) I linked earlier. they have such proposals in them.
<pjz> ah? kk, will look.
<kandinski> but if someone saw lack of matrix_a + matrix_b syntax as a real problem, I think that's the correct solution for them, in zig
ur5us has quit [Ping timeout: 260 seconds]
<pjz> hmm, k. method chaining can make it look decent, but still not as fluent as operators.
<pjz> but I heartly agree with the lack of magic.
<pjz> er, the importance of explicitness, I mean.
marnix has joined #zig
endragor has quit [Ping timeout: 265 seconds]
cole-h has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
ask6155 has joined #zig
haliucinas has quit [Remote host closed the connection]
ask6155 has left #zig [#zig]
haliucinas has joined #zig
ttb has quit [Ping timeout: 245 seconds]
skuzzymiglet has joined #zig
osa1 has joined #zig
[RMS] has quit [Ping timeout: 260 seconds]
[RMS] has joined #zig
skuzzymiglet has quit [Ping timeout: 260 seconds]
earnestly has joined #zig
user0 has joined #zig
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #zig
osa1 has quit [Read error: Connection reset by peer]
osa1 has joined #zig
omglasers2 has joined #zig
shurane has joined #zig
osa1 has quit [Read error: Connection reset by peer]
osa1 has joined #zig
ur5us has joined #zig
oxymoron93 has joined #zig
cole-h has quit [Quit: Goodbye]
<kandinski> this is a minimal test case where I try to import pcre2 but fail because I can't set the value of PCRE2_CODE_UNIT_WIDTH: https://termbin.com/aotkm
AceNovo has joined #zig
AceNovo has quit [Client Quit]
cole-h has joined #zig
AceNovo has joined #zig
<kandinski> can anybody suggest a way to pass the #define up to the c library?
cole-h has quit [Ping timeout: 256 seconds]
AceNovo has quit [Quit: Konversation terminated!]
AceNovo has joined #zig
<ifreund_> @cDefine()
AceNovo has quit [Client Quit]
AceNovo has joined #zig
<kandinski> ifreund_: thanks
<kandinski> since I'm interacting with C libraries, I'm using 0-sentinel terminated u8 arrays a bit. Can anyone point me to some code I could crib from for best practices?
<kandinski> For instance, was this ever implemented, or is there plan to implement it? https://github.com/ziglang/zig/issues/3731#issuecomment-556483080
<kandinski> I mean especifically this bit:
<kandinski> const ptr = buf[0..3 :0];
<kandinski> for getting null terminated slices out of regular arrays
<kandinski> hmm, seems so, just that it's not in the docs yet, but it was merged: https://github.com/ziglang/zig/pull/3940
<daurnimator> kandinski: I consider best practice to be adding the null byte at the last possible moment
<kandinski> daurnimator: so in the pcre wrapper before calling the c functions, then
<daurnimator> e.g. ArrayListSentineled should only be used when you need to retain a sentinel at all times
<kandinski> daurnimator: but string literals are already 0-sentineled
<kandinski> so if I'm mixing string literals and user input, why not 0-sentinel the user input as well?
<daurnimator> because then if your *users* don't have a 0-sentineled string, then they need to make a copy and put a 0 on the end
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
<kandinski> the users of the pcre wrapper, you mean
<kandinski> daurnimator: if I slice an [N]const u8, does the slice share memory with the array, or is it a copy?
<kandinski> I'm going to write myself some code to test
<ifreund_> slices are just pointers with a length field
<kandinski> so they point into the array they're slicing from?
<daurnimator> kandinski: note that libpcre2 has both length-taking and zero-terminated-taking forms
<kandinski> I guess you already answered that
<kandinski> daurnimator: oh nice, thanks!
<daurnimator> kandinski: infact you indicate zero-terminated by passing ~0 as the length
<daurnimator> (PCRE2_ZERO_TERMINATED)
<kandinski> daurnimator: gotcha, I'm not a C programmer so I'm learning the C APIs along as I learn zig. Thanks much.
ur5us has quit [Ping timeout: 260 seconds]
<omglasers2> what does the nosuspend keyword do?
<ikskuh> omglasers2: it's a runtime assertion that the function call does not suspend
<ikskuh> it makes the calling function synchronous, even if the called function is async
<ikskuh> fn not_async() void { noasync is_async(); }
<omglasers2> ok, thanks
xd1le has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
AceNovo has quit [Ping timeout: 240 seconds]
ask6155 has joined #zig
ask6155 has left #zig [#zig]
omglasers2 has quit [Ping timeout: 272 seconds]
m4r35n357 has joined #zig
radgeRayden has quit [Ping timeout: 272 seconds]
msingle has joined #zig
jorangreef has joined #zig
<jorangreef> Hey everyone! What's the safest way to cast a []u8 slice to a slice of packed structs?
<jorangreef> i.e. something like: @ptrCast([*]PackedStruct, @alignCast(@alignOf(PackedStruct), u8_slice))[0..count];
kristoff_it1 has joined #zig
Kingsquee has quit []
msingle has quit [Ping timeout: 240 seconds]
marnix has quit [Ping timeout: 264 seconds]
marnix has joined #zig
xackus has joined #zig
<daurnimator> jorangreef: mem.bytesAsSlice ?
<jorangreef> (y) Thanks, the source of that looks perfect. Is there any difference between the snippet above and bytesAsSlice, e.g. how they do alignment, assuming the divExact check is done for both?
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
xackus has quit [Ping timeout: 272 seconds]
omglasers2 has joined #zig
<Piraty> is `zig cc` capable of compiling c++ ?
<pixelherodev> `zig c++` I think?
<Piraty> ah
<Piraty> --help doesn't mention
<Piraty> yet it seems to at leat try
<Piraty> yeah works
<Piraty> cross target fails to find a system header though...
wilsonk has quit [Remote host closed the connection]
<earnestly> You'll have to tell zig where to look for them iiuc
wilsonk has joined #zig
ask6155 has joined #zig
<Piraty> got it
jorangreef has quit [Remote host closed the connection]
ask6155 has left #zig [#zig]
<ifreund> Piraty: passing -lc should be all you need
<ifreund> or -lwhatever
<earnestly> -lstdc++? heh
<ifreund> oh yeah this is C++ :P
<ifreund> -std=c99 is what I pass to zig cc actually
msingle has joined #zig
ask6155 has joined #zig
donniewest has joined #zig
oxymoron93 has quit [Quit: Connection closed]
FireFox317 has joined #zig
ask6155 has left #zig [#zig]
<FireFox317> andrewrk, i created #6746 regarding the infinite loops when doing dirname. I'm not sure if this is what you had in mind, but i know that this issue was still on your todo list before 0.7.0.
xackus has joined #zig
hnOsmium0001 has joined #zig
skuzzymiglet 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
m4r35n357 has quit [Quit: Ex-Chat]
haliucinas has quit [Read error: Connection reset by peer]
haliucinas has joined #zig
earnestly has quit [Ping timeout: 260 seconds]
hardy7cc has joined #zig
ask6155 has joined #zig
hardy7cc has quit [Remote host closed the connection]
ryuukk_ has quit [Ping timeout: 272 seconds]
ryuukk_ has joined #zig
notpiika has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<ikskuh> can someone explain why zig always sets FILE_SHARE_DELETE on windows when opening a file?!
<ikskuh> 
<ikskuh> Nachricht an #zig
<ikskuh> andrewrk, daurnimator?
notpiika has joined #zig
FireFox317 has quit [Quit: Leaving]
ask6155 has left #zig [#zig]
tane has joined #zig
earnestly has joined #zig
cole-h has joined #zig
waleee-cl has joined #zig
zippoh has quit [Remote host closed the connection]
skuzzymiglet has quit [Ping timeout: 272 seconds]
demizer has joined #zig
zippoh has joined #zig
user0 has quit [Remote host closed the connection]
Akuli has joined #zig
ryuukk__ has joined #zig
ryuukk_ has quit [Ping timeout: 260 seconds]
ryuukk_ has joined #zig
ryuukk__ has quit [Ping timeout: 260 seconds]
mixi has quit [Quit: quit]
mixi has joined #zig
<pixelherodev> ikskuh: what does that flag do?
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
<ikskuh> it allows me deleting this file but not deleting it
<pixelherodev> ...?
frett27 has joined #zig
<ikskuh> windows things:
<ikskuh> opening a file locks it against deletion by default
<ikskuh> zig prevents this behaviour by-default
AceNovo has joined #zig
skuzzymiglet has joined #zig
radgeRayden has joined #zig
Stephanie has joined #zig
Stephie has quit [Ping timeout: 265 seconds]
wootehfoot has joined #zig
<justin_smith> ikskuh: one hunch to check - this means that the behavior would match the default posix behavior, which means fewer corner cases to keep track of
<justin_smith> that's just a blatant guess though
<ikskuh> yeah that's my guess as well
fgenesis has quit [Ping timeout: 256 seconds]
AceNovo has quit [Remote host closed the connection]
ur5us has joined #zig
ur5us has quit [Ping timeout: 244 seconds]
donniewest1 has joined #zig
donniewest has quit [Ping timeout: 240 seconds]
donniewest2 has joined #zig
donniewest1 has quit [Ping timeout: 256 seconds]
marijnfs has joined #zig
marijnfs has quit [Ping timeout: 246 seconds]
marnix has quit [Ping timeout: 265 seconds]
ur5us has joined #zig
frett27 has quit [Ping timeout: 256 seconds]
osa1 has quit [Ping timeout: 272 seconds]
wootehfoot has quit [Ping timeout: 272 seconds]
tane has quit [Quit: Leaving]
wootehfoot has joined #zig
skuzzymiglet has quit [Ping timeout: 260 seconds]
marijnfs has joined #zig
<marijnfs> I have a zig conundrum
<marijnfs> I want to have an arraylist of callbacks, but the callbacks might get different inputs. So i'm not sure how to design the callback
<marijnfs> I was trying to have a standard struct that would be a member of other structs, and get the pointer with getParentPtr
<ikskuh> what about union(enum) { cb_a: fn() void, cb_b: fn(i32) void, … } ?
<kandinski> can anybody point me to zig code wrapping a heap-using C library so I can crib on best practices? I'm new to both Zig and C, know a lot of the theory but this is my first time managing memory by hand.
<ifreund> kandinski: it might be a lot to read, but: https://github.com/ifreund/river
<kandinski> ifreund: thanks
<ifreund> mostly just use std.heap.c_allocator aliased to util.gpa plus a few arenas on top of that in places
<kandinski> hmm
<kandinski> for now I'm not writing a library for others to use, just a one-file wrapper with barely enough functionality for my own use
<kandinski> but it's a learning project and I want to learn "the right way"
<kandinski> I'm implementing python's `re.compile(): Pattern` and `Pattern.findall()` on top of pcre2-8
<kandinski> so I'll have something nice to use for my actual-program-that-needs-regexps
<ifreund> well, unless the C code is nice enough to accept a custom allocator as a parameter you're pretty much stuck with using the C allocator as well
<kandinski> that's what I've figured out. Yes, it's a good library, but it's any colour you want as long as it's the C heap
donniewest2 has quit [Quit: WeeChat 2.9]
radgeRayden has quit [Remote host closed the connection]
Akuli has quit [Quit: Leaving]
wootehfoot has quit [Ping timeout: 258 seconds]
ryuukk_ has quit [Read error: Connection reset by peer]
ryuukk_ has joined #zig
msingle has quit [Ping timeout: 240 seconds]
omglasers2 has quit [Read error: Connection reset by peer]
<ryuukk_> how can i make this work ?
<ryuukk_> is there a similar thing as const Vec2& ?
<ryuukk_> and as you can see, Vec2.zero() is kinda ugly because no operator overloading.. :(
<marijnfs> ikskuh: interesting, I could pass this to function that creates the struct right?
<marijnfs> can you define a specific enum for the union?
<marijnfs> ryuukk_: doesn't it work?
<ryuukk_> i get error: expected type '*const Vec2', found 'Vec2'
<marijnfs> zero probably needs a self
<marijnfs> o wait i see what you do
CodeSpelunker has joined #zig
<ryuukk_> c++ accepts both value and when i initialize directly if the function parameter is const Vec2&
<ryuukk_> in*
<ryuukk_> nvm last msg
<marijnfs> not sure why the rhs doesn't propagate to const
<marijnfs> but if you get rid of the const, and supply b like &b it works
<ryuukk_> next question, how can i make it to also accept .add( Vec2 {.x = 1.0, .y = 1.0} ) ?
<ryuukk_> hence the need to do something liek const Vec2&
<kandinski> what's a good way to print a struct? I'm trying to get a printout of the full namespace of a @cImport()-ed C library.
<kandinski> tried std.debug.warn("pcre2={}\n", .{pcre2}) but it only prints "type"
<kandinski> well, "pcre2=type", but same difference
<alva> @typeName maybe
<ryuukk_> there is no operator overloading, so i try to comply and add methods, but even this way it doesn't provide a solution to my problem
<kandinski> haha @typeName is "cimport"
<ryuukk_> and i can't have 2 .add to accept pointer and value because u can't have 2 function with same name
<kandinski> hmm, is there a way to iterate over the labels in a struct?
<ryuukk_> so far the language works against me, i don't understand how people said no to operator overloading for zig, i just don't understand at all
<ryuukk_> even with that, const Vec2& seems not possible, so that adds up
<ryuukk_> it's sad because otherwise the language is nice
<alva> kandinski: Labels as in fields? const ti = @typeInfo(T).Struct; inline for (ti.fields) |f| ...
<kandinski> alva: thanks a lot
<kandinski> TODO
<kandinski> I guess I've met the end of this particular line :)
<kandinski> TODO, Unable to dump stack trace: debug info stripped
<ryuukk_> so nobody have an idea about my problem? there is no const Vec2&?
<waleee-cl> kandinski: are you using zig 0.6.0?
<kandinski> yes, from nixpkgs
<kandinski> waleee-cl: thanks!
ur5us has quit [Ping timeout: 260 seconds]
xackus has quit [Ping timeout: 256 seconds]
<ryuukk_> Structs, unions, and arrays can sometimes be more efficiently passed as a reference, since a copy could be arbitrarily expensive depending on the size. When these types are passed as parameters, Zig may choose to copy and pass by value, or pass by reference, whichever way Zig decides will be faster. This is made possible, in part, by the fact that parameters are immutable.
<ryuukk_> what the size compiler decide it's gonna be value or reference?
<ryuukk_> : Vec2 is enough to let compiler pass by reference when it's good?
<marijnfs> ryuukk_: &Vec2{.x=1, .y=2} works with the const*
ur5us has joined #zig
<ryuukk_> marijnfs: thanks
<ryuukk_> in perfect world &.{} would be perfect, but looks like it's not a thing
marijnfs has quit [Ping timeout: 258 seconds]
marijnfs has joined #zig
<marijnfs> ryuukk_: &Vec2{.x=1, .y=2} works with the const*