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/
ky0ko has joined #zig
doublex has joined #zig
jmiven has quit [Quit: bye]
doublex has quit [Ping timeout: 240 seconds]
doublex has joined #zig
doublex has quit [Ping timeout: 250 seconds]
doublex has joined #zig
doublex has quit [Read error: Connection reset by peer]
doublex has joined #zig
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 240 seconds]
<andrewrk> I just pushed a nice quality of life improvement in e42d86b657c
<andrewrk> it's evident when you link against a cross compiled libc that is not cached
jmiven has joined #zig
mahmudov has quit [Remote host closed the connection]
muffindrake has quit [Ping timeout: 276 seconds]
muffindrake has joined #zig
jmiven has quit [Quit: bye]
return0e has quit [Remote host closed the connection]
jmiven has joined #zig
chemist69 has quit [Ping timeout: 276 seconds]
chemist69 has joined #zig
_whitelogger has joined #zig
_whitelogger has joined #zig
return0e has joined #zig
return0e has quit [Ping timeout: 268 seconds]
return0e has joined #zig
return0e has quit [Remote host closed the connection]
return0e has joined #zig
return0e has quit [Ping timeout: 246 seconds]
FireFox317 has joined #zig
<ceymard> is there such a thing as comptime [_]var { } arrays ?
<ceymard> like, if I want to @noInlineCall(somefunc, ...) with values I computed at comptime ?
<ceymard> although I want the call to happen at runtime
marijnfs_ has quit [Quit: WeeChat 2.6]
<ceymard> I just read upward ^ that there was no meta-programming
<ceymard> isn't the whole comptime thing meta-programming in itself ?
<mq32> hey ceymard
FireFox317 has quit [Remote host closed the connection]
<ceymard> yo
return0e has joined #zig
Ichorio has joined #zig
<nrdmn> ceymard: you can make a [_]type{} that contains structs with a const attribute. alternatively you can define a struct and access its attributes by index
<ceymard> nrdmn: what about arbitrary values ?
<ceymard> I don't want to just play with types, but to construct a set of arguments to a function I will call
<ceymard> the thing is that the functions I want to call can be pretty different
<ceymard> and I'll build its arguments by introspecting it
<nrdmn> hmm, you can get the types of a function's parameters, I think
<nrdmn> and there are functions like bufPrint that take any number of arguments
<ceymard> exactly
<ceymard> but these take a ... parameter
<ceymard> which is cool
<ceymard> so does @noInlineCall or @inlineCall
<ceymard> the thing is I'd like to call those using a `[_]var`
<ceymard> to generate a function call
<ceymard> and I would like to build such a [_]var array at comptime
<ceymard> because I want to work with functions that could vary a lot in a generic way
<ceymard> hmm. maybe I should be more precise.
<ceymard> I'm trying to build a parser generator of sorts
<ceymard> the goal is for me to express rules as functions
<ceymard> in the end, I want to take the root function, the one that defines my toplevel, and have it analyzed entirely at run time
<ceymard> this would trigger recursion into all the other rules I call
<ceymard> the rules do not all have the same number of arguments
<ceymard> okay I have a feeling this is still vague
<ceymard> I'll do a gist later
<ceymard> but the short version is that I'd like to write a parser generator that does its magic at comptime to generate an array of states that will be used at run time
<ceymard> rules are functions that expect parse results as arguments and that themselves will return their own parse result
<ceymard> the comptime will ensure everyone is called with the right results, and that rules are being called as they should
via has quit [Ping timeout: 240 seconds]
knebulae has quit [Read error: Connection reset by peer]
via has joined #zig
<ceymard> okay, another question : can a fn return var instead of type or a defined type ?
<nrdmn> in a function declaration, you can use an expression that computes the return type
<nrdmn> fn f() b: { break b: u32;} { return 5; } or something like that
<ceymard> okay, the answer is about as on point as is my question precise :)
<ceymard> sorry I'm not being more clear
<ceymard> I'll fiddle some more
<Snektron> <mq32> also if thing() may not be always true?
<Snektron> Im pretty sure yes, unless thing() may have side effects
<Snektron> In which case it will just remove the unreachable
<Snektron> Which is ignores in release fast and safe i think
<Snektron> s/safe/small/
<Snektron> Does zig even have a notion of pure functions?
<Snektron> ceymard: im not sure you can really do what you want to
<ceymard> Snektron: this is the feeling I had
<Snektron> Maybe with some hacks but then it becomes nasty to program in as well
<Snektron> But
<ceymard> I don't mind hacks as long as they're constrained in the library itself
<Snektron> You could make a parser using comptime strings?
<ceymard> as long as the final result is nice to use, I feel like I won
<ceymard> Snektron: what do you mean ?
<Snektron> Comptime string with the grammar, call a function with it to turn it into a parser
<ceymard> that's not what I had in mind
<ceymard> I want to write production rules in zig
<ceymard> and be able to interact with their result easily
<ceymard> the gist is *full* of errors
<ceymard> it's just a brainstorm at this point
<ceymard> see the rules at the end of the gist
<ceymard> I want to express stuff more or less like that
<ceymard> what I wanted to do was to take for instance `TopLevel` and turn that into a parser with states (because speed)
<ceymard> but I'm in even if can just do combinators.
<ceymard> can a comptime function create a ad-hoc union ?
<ceymard> somehow I doubt it :)
<ceymard> it would be magical if we could just do @addUnionMember(union, "Name", typ)
<Snektron> I know its not what you had in mind, but it might be a compromise
<Snektron> Btw, i did make something like your idea at some point in Go
<Snektron> I think you can make an `apply` function though, you just gotta express []var as something else
knebulae has joined #zig
<Snektron> You gotta think more c++ with this
<Snektron> []var can only exists in function parameters, so you simply perform all your computations in ridiculous recursive functiojs
<ceymard> ok
ninepoints has quit [Quit: Lost terminal]
<Snektron> Oh, i just thought of why that doesnt work
<Snektron> What does maybe is expressing your rule as a type
<Snektron> So your actions would look like fn thing(a: Rule(Char('('), expr, Char(')')) i32 {
<Snektron> return a.rule(1).value;
<Snektron> }
<tgschultz> ceymard, I have done some wacky comptime stuff that might be like what you want. It allows you to construct a type at comptime, so you could build a tupple of whatever type->value combinations you want and pass it to a function that takes a `var` parameter.
<ceymard> thanks I'll take a look at it
ceymard has quit [Read error: Connection reset by peer]
Ichorio has quit [Ping timeout: 250 seconds]
return0e_ has joined #zig
return0e has quit [Ping timeout: 240 seconds]
kenaryn has joined #zig
<kenaryn> Hello, please what does the '_' token identifier? Here is a example of the official documentation: `_ = try map.put(1, {});`
<kenaryn> what does it mean*
<mikdusan> it "ignores" the result of map.put()
<kenaryn> Thank you sir.
<kenaryn> So this is just for academic purpose?
<mikdusan> compiler would issue an error similar to `error: expression value is ignored` without it
<mikdusan> the reason why it _sometimes_ makes sense in this case is:
<mikdusan> `map.put() --> Returns the kv pair that was already there.`
<kenaryn> I think I understand, thanks for your explanation.
<mikdusan> as an opposite, one would never want to ignore the result of a memory allocation
<fengb> The pattern exists to self document where values are returned. Without it, users start assuming functions like 'put()' don't return a value, but it actually does
waleee-cl has joined #zig
ceymard has joined #zig
utzig has joined #zig
<bgiannan> musl has a lot of green
<companion_cube> it's written by the author of musl ^^
<fengb> Iconv character conversions: the kitchen sink
<companion_cube> but well, there might be a reason why musl is popular-ish
sossy has joined #zig
casaca has quit [Ping timeout: 240 seconds]
casaca has joined #zig
ntgg has joined #zig
<ntgg> I can't seem to use a format string with more than 320 characters
<mq32> ntgg, do you hit "comptime eval limit"?
<mq32> you can increase that with some builtin-function
<ntgg> thanks! that fixed it
kenaryn has quit [Quit: WeeChat 2.3]
doublex has quit [Ping timeout: 245 seconds]
doublex has joined #zig
<muffindrake> Is there some way to set that limit globally when running a build?
<mq32> i don't think it's necessary as reducing that limit may uncover bugs
casaca has quit [Ping timeout: 240 seconds]
<muffindrake> ???
casaca has joined #zig
<mq32> increasing the limit isn't needed in most of the cases (only when you do *heavy* comptime computations)
doublex has quit [Ping timeout: 250 seconds]
<mq32> so if you run into some exponential growth at comptime, it's good to specify the limit in code as you can write a comment with "why is this needed anyways" to the quota message
<mq32> instead of just "increase it to u64.maxValue"
<muffindrake> I have the mental capacity to kill a task if it appears to be stuck in an infinite loop
<mikdusan> muffindrake: _currently_ stage1 compiler is very heap-hungry. stage2 should help immensely with that,
<mq32> yes, but do you also have the mental capacity to determine which exact piece of code caused this?
<muffindrake> Ah, that's a good point. That may not be so easy with functions strewn across modules, especially not with comptime
<mikdusan> and imagine bumping a global limit for this comptime branch quota, only because you included a new library
<mq32> someone™ should write more doc comments for std.fmt :D
<mq32> mikdusan, is it "sane" to clone/fork the zig repo, only change doc comments and make pull requests without doing *any* compilation at all?
<mikdusan> i'd like to overhaul all of std.fmt but those are just words... action is needed :)
<mq32> that's why i'm asking
<mq32> the doc system doesn't parse markdown right now, but is supposed to at some point, right?
<mikdusan> mq32: i could see that doc comments _appear_ to be a special case to avoid a build and your pull-request would get benefit of CI builds... so i'd say it is sane; but i would ecourage any PR to at least do a sanity build on your host before creating PR or push-updating PR
<mq32> yeah but my laptop is ... slow
<mq32> so building zig will probably take some hours with LLVM and all the stuff
<mikdusan> linux?
<mq32> yeah
<mikdusan> i apologize if stating things you are already well aware of,
<mikdusan> the key prep for any build is llvm prerequisite but it's generally a just-do-it-once and you are done. only needs to be updated when llvm version or (gcc in your case) is significantly bumped,
<mikdusan> then zig builds these days _WITHOUT_ installing is my favourite. you can _execute_ zig from your git workspace/build dir.
<mq32> hm
<mq32> can i tell cmake to use clang instead of gcc?
<mikdusan> yes. and clang has significantly less heap requirements than gcc
<mikdusan> what linux distro?
<mq32> arch
<mikdusan> you're in luck. i have arch, and have built llvm-9 binaries from llvm-project already. i can upload tarball and my zig build script somewhere if you're interested.
<mq32> i'll try to build it with system libraries
<mq32> but i heard that arch doesn't have static libs, right?
<companion_cube> sadly, it doesn't
<mikdusan> that would be the complicating factor. static vs. dylib vs monolithic dylib . the first one is, i believe, the only one supported currently by zig's cmake
<mikdusan> it's not that terrible to build llvm from git for arch. one sec.
<mikdusan> here's my last script used to build llvm9 on arch. https://gist.github.com/mikdusan/43f90b8f4a3a1edb20bdfe2cdda9b9a5
<mikdusan> llvm-project takes a while to clone, and checkout. this is normal.
<mq32> [felix@denkplatte tmp]$ /home/felix/projects/zig/build/zig run src/main.zig
<mq32> All your base are belong to us.
<mq32> seems to work by just using the installed llvm stuff
<mikdusan> if that works, then all you need is a command to build std docs.
<mq32> isn't that done by passing -fgenerate-docs to zig test $somethingInStd?
<mikdusan> option name changed
<mikdusan> something like this `zig -femit-docs --output-dir zig-cache test lib/std/std.zig`
<mikdusan> where the tests of std.zig provide code coverage. i suppose it's possible to build a sub of std too and the resulting docs would be reduced
<mq32> okay, code is running, but i can't type well anymore :D
<mikdusan> heh
<mikdusan> which std module are you adding docs for
<mq32> i'm going for format right now as i'm needing it :D
<mq32> want to document the format string grammar
<mikdusan> this might reduce laptop load a bit: zig -femit-docs --output-dir zig-cache test lib/std/fmt.zig
<mq32> yeah, will do that :)
<mikdusan> but it's a little quirky. i find on my system when opening zig-cache/docs/index.html that clicking on left-sidebar "std" first helps
<mq32> maybe someone™ should also start writing a markdown renderer for zig :D
<mikdusan> on thing i'm not a fan of in python-style string formatting is the positional: `{2}` meaning 2nd arg but the problem lies in if you do _not_ want positional, `:` must be used to get to the format_spec portion
<mikdusan> `{:5s}` . i'd rather see the inverse. `{5s}` is the spec. and if you want positional, _then_ pay the price of an extra delimiter.
<mikdusan> s/extra delimiter/delimiter/
<mq32> it's actually just {s:5}
<mq32> {[position][specifier]:[fill][<|^|>][width].[precision]}
<mq32> this is the grammar for format specifiers
marijnfs has joined #zig
doublex has joined #zig
<mikdusan> in zig or python?
<mq32> zig
<mq32> just added it to the doc comment for std.fmt.format
<mikdusan> oh that must be the last change. coincidentally my tabled overhaul of fmt was done before that
<mikdusan> i came up with `replacement := '{' [arg_index '/'] [spec] ['!' coercion] '}'`
<mikdusan> i was optimizing for what looked like (vastly) the most common usage (using all .zig files in zig's source) of not using positionals
<mikdusan> `{5s}` is shorter than `{s:5}`. and `{3/5s}` is equal-length as `{3s:5}` with imo having width before "type" having a higher familiarity factor
<tgschultz> Walter Bright gave a presentation about Hits and Misses with D at 20. Could be useful to glean for people working on zig: https://digitalmars.com/articles/hits.pdf
<mikdusan> +1 for first page: `No Preprocessor`
<Snektron> Whats the best way of bitflags in Zig?
<tgschultz> I haven't finished, but it does look like zig agrees so far
<Snektron> I suppose a packed struct could work, but eh
<mikdusan> i am not a D user so my opinions are novice, but it seems to me that D has a lot of of backwards compatibility baggage. i'd love to see what W. Bright would do if starting over knowing what he knows now
<tgschultz> I just use ints for bitflags and constants.
<tgschultz> C style
<tgschultz> you can't use | or & with packed structs
<mikdusan> i suppose that's partly answered with this pdf
<tgschultz> oh nevermind, I see now you meant the other kind of bitfield
<tgschultz> yeah, packed structs
<Snektron> nah yeah i meant bit fields
<Snektron> flags
<Snektron> Sadly you lose type safety with integers and constants
<mq32> Learned: ● everybody loves colored error messages
<mq32> :D :D
<tgschultz> Yes, this is true. I'm hopeful that we get something like the distinct type proposal (#1595) that can make that work
<mikdusan> does D UFCS permit paraenthesis-less function calls only for `@property` functions, or simply all functions?
keithdc has joined #zig
Ichorio has joined #zig
<mikdusan> tgschultz: thanks for the link. that was a good read and yes very much in agreement with zig
<mq32> what features do we need in the markdown parser?
<mq32> i'd go for a "minimum viable implementation" right now, so "lists", "emphasis", "link"
<mq32> and inline code with `code`
<Snektron> tgschultz: it doesn't really look like thats going anywhere soon though
<Snektron> I dont think distinct types like that are useful because its just a lesser form of operator overloading
<Snektron> if you're going to allow that then just add operator overloading
<emekankurumeh[m]> Snektron: you could put them in an enum and have a manual `or` method that takes a list of enums converts them to ints and `or`s them
<tgschultz> Andrew is only one guy and there are a lot of things to consider, and anything that requires adding to the language needs careful consideration. Once you add something, it is harder to take it away.
<Snektron> lame tbh
<Snektron> You cant really use an enum because that would lead to undefined enum values
dingenskirchen has quit [Quit: dingenskirchen]
<Snektron> so then youd end up wrapping a type and adding such operators
<emekankurumeh[m]> i meant casting it to an int when you return it
<Snektron> but you also cant give them the usual names since those are reserved
<emekankurumeh[m]> which is pretty gross, but if you switch on them the values you are comparing against are comptime known
<mq32> btw, on the bitfield topic: you can always create some comptime bitfield wrapper that supports functions like ".set", ".clear", ".testFor", ... with @OpaqueType as a distinction property
<emekankurumeh[m]> or you could set the bits in a pointer to an @OpaqueType
<Snektron> then its probably better to define an enum with the flags
<Snektron> then create a BitFlags.init(.a, .b, .c)
<Snektron> and define your .set, .clear,. test etc on that
<Snektron> at least you get the enum literal syntax then
<emekankurumeh[m]> infix functions would make this a lot nicer
<mq32> Snektron: enum is a nice idea
<mq32> if(tcpFlags.testFor(.ACK)) { }
doublex has quit [Ping timeout: 240 seconds]
wootehfoot has joined #zig
<Snektron> .ack then but sure
<mq32> more extensive documentation than single line sure needs a markdown parser: https://mq32.de/public/screenshot/d8f212da151355482ad8ac5634096059.png
<mq32> :D
<mikdusan> where. is. the. TL;DR :)
<mq32> hey, it's actually quite readable in code
<mq32> oh. the markdown parser should be implemented in javascript
<keithdc> Silly question, but are all function parameters immutable in zig?
<mq32> yes
<mikdusan> and that is a _good_ question
<keithdc> Thanks, thought I was going crazy there for a sec. I'm just messing around with the language now after following for a while.
wootehfoot has quit [Quit: Leaving]
doublex has joined #zig
wootehfoot has joined #zig
<keithdc> Can you still do pointer arithmetic in Zig? Seems like it won't let me increment a *u32 by an int or another *u32.
<mq32> keithdc, yes, but only on "pointer-to-many", not on a pointer-to-one
<keithdc> Ah, ok
<mq32> so [*]u32
<mq32> why do you want to do pointer arith?
<mq32> slices should be sufficient for most of your needs
<keithdc> I'm trying to implement a function that modifies an array with a "stride". So it's not a contiguous array.
<keithdc> So the use-case is for Vertex data where you might have position and color packed into an array
<keithdc> But don't want to pass the whole struct type, to be generic
<mq32> i'd probably just go with the generic solution
dingenskirchen has joined #zig
<mq32> scaleVertices(comptime Vertex : type, vertices: []Vertex, comptime positionFieldName: []const u8, scale: f32) void { for(vertices) |*vtx| { vtx.* = vtx.scale(scale); } }
<mq32> scaleVertices(MyVertex, vertexBuffer, "pos", 2.0);
<mq32> ah, damn. i forgot to use @field() :D
<mq32> i have to get some sleep
doublex has quit [Ping timeout: 240 seconds]
<keithdc> Damn, generics are pretty powerful. That's a much better solution than what I was going for, thanks.
ntgg has quit [Remote host closed the connection]
utzig has quit [Ping timeout: 240 seconds]
doublex has joined #zig
Akuli has joined #zig
mrkishi has joined #zig
keithdc has quit [Remote host closed the connection]
dimenus has joined #zig
<dimenus> is the namespace 'builtin' an actual zig file?
<dimenus> sorry for the dumb question
<nrdmn> dimenus: I think that's the function codegen_generate_builtin_source in src/codegen.cpp
doublex has quit [Read error: Connection reset by peer]
doublex has joined #zig
<daurnimator> mq32: I'm also working on a messaging library/protocol :)
<daurnimator> max packet size is 140 bytes (because SMS)
<marler8997_> Is there a way to cause your build function to fail without printing a stacktrace?
<mrkishi> Hey, folks. I've been toying with wasm in zig and there's been a lot of templating going on but it's a bit confusing at times. Has there been any discussion on doing comptime argument templating in zig? Would this be something strictly for build.zig? eg. having some form of the second kind of passing arguments: https://hastebin.com/vecajibiza.zig
doublex has quit [Read error: Connection reset by peer]
doublex_ has joined #zig
<Snektron> thats called string interpollation
doublex_ has quit [Ping timeout: 245 seconds]
<Snektron> the first version is the best you can do probably
<Snektron> you can use fmt.bufPrint for that
<marler8997_> yeah, the problem with string interpolation is that you need access to the caller's scope
<marler8997_> your first version works because you're explicitly passing all the arguments to the function that performance the string formatting, but the second version wont' have access to the variables/data in the interpolated expression
<Snektron> that and it hides a lot of functionality
<marler8997_> I implemented string interpolation in the D language, thought it was never accepted
<marler8997_> but right now it's a hot topic for D since the new co-leader Atila mentioned it as one of his priorities in a recent article
<marler8997_> I did a fair amount of work on it. D has "mixins" which enables a library solution by mixing in the interpolation logic into the caller, but Zig doesn't have that and probably shouldn't add support for it. This means that in order for Zig to support interpolated strings, it would need to add support in the language
<Snektron> I was thinking about it the other day
<marler8997_> If I were to implement interpolated strings in Zig, I would treat interpolated strings as anonymous structs, the proposed replacement for varargs
<Snektron> in a hypothetical language where you can have a "scope" datatype
<marler8997_> "this is a {a}" would become .{_0 = "this is a", _1 = a}
<Snektron> violates the one obvious way rule probably
* daurnimator has never liked interpolation in any language
<mrkishi> Yeah, I'm already doing the first version, it just gets confusing quite fast for more complex templates.
<Snektron> You could also add a @outerScope function to get to the symbols defined in the calling scope or whatever
<Snektron> Sounds like a hack still
<mrkishi> And I just didn't call it string interpolation because I'm actually parsing the string and returning a tree :P
<fengb> Sounds like the old Python hack
<marler8997_> @outerScope?
<Snektron> give a function access to the calling scope in some way, then you could use the same reflection as on structs
<Snektron> Still doesnt sound ideal
<Snektron> but thats what you can do in lua
<marler8997_> How in the sam hell does @outerScope work?
<marler8997_> Where is that?
<Snektron> its nowhere
<Snektron> its a theoretical addition that could allow stuff like interpollating to work, im just making up stuff
<marler8997_> If you could implement that, then yes, you could create a function that implemented interpolated strings
<marler8997_> Maybe @callerScope would make more sense though
<Snektron> Those are just details
<Snektron> It implies a few problems anyway
<mrkishi> That'd be terrifying :P
<marler8997_> Well, @outerScope sounds more like the outer scope, like the surrounding global scope, which you would already have access to
<Snektron> the biggest problem is that it would turn the function generic without depending on parameters
<marler8997_> If any function you call could reach into your @callerScope and modify variables, that would make it a nightmare to understand code
<Snektron> plus it would violate "no hidden control flow"
<Snektron> since whats to stop you from changeVariable(@outerScope().variables[0]);
<marler8997_> You could make @callerScope be readonly though
<Snektron> i think youll have the same problems
<Snektron> plus you require more hacks for expressions in interpollated strings
<marler8997_> yeah it can still create confusion
<marler8997_> interpolated strings are a bit of a special case because you can see all the data you're passing to the function
<Snektron> i dont think theres really a sane way to do it
<marler8997_> but, you don't want a function to have access to data that you don't pass to it
<Snektron> im not sure they fit into a systems language either way
<Snektron> there was a c++ proposal for them
<daurnimator> Snektron: you wouldn't be able to e.g. wrap the interpolation function; as it would introduce an extra scope
<Snektron> yeah thats true
<Snektron> you could always make it a parameter
keithdc has joined #zig
<Snektron> then you'd write `const a = "pythons"; format(@scope(), "i love {a}");`
<Snektron> @scope() would return a struct with local variables and a pointer to its parent scope
<daurnimator> Snektron: why just local variables? surely you'd want everything in scope...
<Snektron> those would be in the parent scope of course
<Snektron> it would a quite literal translation of how a compiler's scope struct might look like
<Snektron> advantage of this solution is that it has less hidden control flow
<Snektron> though it might be hard to optimize well
<Snektron> actually, should be too bad
<mrkishi> yeah, and then `format` has access to everything not-`a` and still has to parse zig and execute zig expressions in the interpolations
<Snektron> yeah good point
doublex has joined #zig
<mrkishi> I'd rather have syntax for comptime interpolation akin to marler's suggestion (and js template literals), but I have the feeling it'd be a tough buy on the community
<mrkishi> something more along the lines of `t"strings"`/`t\\multiline strings` that get transformed into anonymous structs
<mrkishi> say `t"int{er + pol}ation"` -> `{ parts: [2][]u8 = ["int", "ation"], values: [1]any = [er + pol] }`
mahmudov has joined #zig
doublex has quit [Read error: Connection reset by peer]
doublex_ has joined #zig
<marler8997_> I documented my thoughts in string interpolation in Zig here: https://github.com/ziglang/zig/issues/3479
doublex_ has quit [Ping timeout: 240 seconds]
<marler8997_> Feel free to add your comments and discuss
Akuli has quit [Quit: Leaving]
doublex has joined #zig
doublex_ has joined #zig
sossy has quit [Remote host closed the connection]
doublex has quit [Ping timeout: 268 seconds]
doublex_ has quit [Ping timeout: 250 seconds]
<pixelherodev> How do builtin functions work? Do they have access to the scope of the caller?
utzig has joined #zig
<Snektron> No
<Snektron> Well it depends on the function
<Snektron> Stuff like @This(); needs to have access
dimenus has quit [Remote host closed the connection]
<keithdc> Is there a reason why pointer alignment is built into the type (I.e *align(1) f32) if it differs from the underlying type?
doublex has joined #zig
manjaroi3 has joined #zig
<marijnfs> why does my c function return a c_int
<marijnfs> while its a void*
<marijnfs> how do I cast c_int to ?*c_void
<nrdmn> did you try @intToPtr?
manjaroi3 has quit [Remote host closed the connection]
<marijnfs> hmm I realised I was expecting the wrong result
<marijnfs> now I'm at a compiler bug, jej
<marijnfs> I should probably build zig directly
<marijnfs> which means I'm building llvm now
<marijnfs> which means I had to deal with the bug that doesn't build libclang properly
<marijnfs> Unreachable at ../src/ir.cpp:17571 in ir_analyze_instruction_elem_ptr. This is a bug in the Zig compiler.
<marijnfs> wonderful
keithdc has quit [Quit: leaving]
stratact has quit [Remote host closed the connection]
<marijnfs> // can't be used for comments anymore?
stratact has joined #zig