ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bheads___ has quit [Ping timeout: 265 seconds]
bheads___ has joined #zig
Hejsil has quit [Quit: Page closed]
byronh_____ has joined #zig
bheads___ has quit [Ping timeout: 276 seconds]
byronh_____ has quit [Ping timeout: 265 seconds]
byronh_____ has joined #zig
byronh_____ has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
dbandstra has joined #zig
dbandstra has quit [Quit: Leaving]
xtreak has joined #zig
davr0s has joined #zig
very-mediocre has joined #zig
<andrewrk> yeah, which led me to working on a dynamic library loader in zig (dlopen, dlsym, etc)
<andrewrk> which led me to realize that the vdso stuff won't work when we create a library
<andrewrk> but we can make it work
alexnask has joined #zig
mahmudov has joined #zig
<very-mediocre> maybe silly nitpick
<very-mediocre> I keep typing `fn(whatever): type`
<very-mediocre> (colon to denote return type)
<very-mediocre> feels more consistent with the rest of the language
xtreak has quit [Remote host closed the connection]
very-mediocre has quit [Ping timeout: 260 seconds]
very-mediocre has joined #zig
xtreak has joined #zig
jjido has joined #zig
xtreak has quit [Ping timeout: 260 seconds]
Ichorio has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quc has joined #zig
Hejsil has joined #zig
<Hejsil> very-mediocre, more consistent would probably be const main = fn() void {};
<very-mediocre> Hejsil: all other type annotations are preceded by a colon though
<Hejsil> Well, all other declaration names have the type after :
<very-mediocre> Can you elaborate on how `const main = fn() void {};` is consistent with the rest of the language?
<Hejsil> const S = struct {};
<Hejsil> const a = 1;
<Hejsil> const main = fn () void {};
<very-mediocre> I guess.
<Hejsil> fn () void {} is a function literal
<Hejsil> Just like S{}; is a struct literal
<Hejsil> If we did fn (): void
<very-mediocre> Right, though anonymous functions aren't supported
<Hejsil> But they should be :)
<very-mediocre> so I don't see functions as something we assign now
<very-mediocre> anon structs are supported and assigned
<Hejsil> Ok
<Hejsil> Then let me compare current func syntax
<very-mediocre> I get your point though, if anonymous functions are in, then your suggestion would make sense :)
<Hejsil> fn (): void would mark that the result of an operation done on the type should be annotated with :
<Hejsil> because if fn a(): void {}, then the result a() is void
<Hejsil> So should we have var a: *: u8 = &b; ?
<Hejsil> In a way, a.* is like calling a function :)
<Hejsil> And the signature is *
<very-mediocre> I don't accept the first assumption: "fn (): void would mark that the result of an operation done on the type should be annotated with :"
<Hejsil> *u8
<Hejsil> Hmm, ooh well
<Hejsil> I tried lol
<very-mediocre> :)
<very-mediocre> I don't see functions as a general substitute for any operation
<very-mediocre> such as dereferencing
<Hejsil> Well, you could see *u8 as the function fn() u8 :)
<Hejsil> and calling it uses .* instead of ()
<very-mediocre> I don't, so that's where we disagree
<very-mediocre> But it is nonetheless a valid case you are making :)
<Hejsil> Just like '+' could be fn(u8, u8) u8
<very-mediocre> Yeah
<very-mediocre> I'm familiar with that functional view
<Hejsil> Alright, agreed to agree and disagree
<very-mediocre> Well there's no right answer, it's "how should something be designed"
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Hejsil> The ano function idea has some nice benifits in terms of consistency and usage
<very-mediocre> Definitely
<Hejsil> Even if they aren't closures, i tend to need ano functions at times
<very-mediocre> iirc there's a functional counterpart for expressing Turing completeness
<very-mediocre> forgot what it's called
<very-mediocre> so it's certainly one way to view things
<Hejsil> Hmm. Lambda calculus?
<very-mediocre> I'm familiar with that but I was looking for something specific
<very-mediocre> But let's go with that :)
<Hejsil> Well, i don't really want to view all Zig operations as functions though :)
<Hejsil> It was just to make a point
<very-mediocre> Right
<Hejsil> And &a.* does not behave as any function would anyways
<very-mediocre> doesn't that mean you reject your 1st premise and agree with me? :)
<Hejsil> Hmmm
<Hejsil> Geeh, kinda, kinda not
<very-mediocre> To me it feels very intuitive to write `fn main(): void {}`
<very-mediocre> if you want to use functional programming as a reference
<very-mediocre> it's referential integrity
<very-mediocre> `main` evaluates to a void
<very-mediocre> ok i brain failed
<very-mediocre> not RI
<very-mediocre> I'm rusty on the terminology
<Hejsil> Then I'd say that const main: fn() void = {} works better
<very-mediocre> referential transparency!!
<very-mediocre> there you go
<very-mediocre> everything is what it evaluates to
<Hejsil> Well, `main` evaluates to `fn()void` :)
<very-mediocre> yeah, hmmm
<Hejsil> and `main()` evaluates to `void`
<very-mediocre> but then the keyword is `fn`
<very-mediocre> so both are valid
<very-mediocre> and what do you know, something like JavaScript indeed has both forms
<very-mediocre> obv. type is implicit
<Hejsil> Be gone!
<very-mediocre> imho `fn main(): void` would be equivalent to the anonymous function `fn(): void { }`
<very-mediocre> I'm going to invoke another disastrously bad language which does this
<very-mediocre> I know it sucks
<very-mediocre> but it's still a proof of concept
<very-mediocre> iirc ActionScript 3 does this
<Hejsil> I'd agree, that if calling the function can be done with `main` and not `main()` then it makes sense to me
<very-mediocre> hmm
<Hejsil> s/done/called/g
<very-mediocre> I view it as
<very-mediocre> (main)()
<very-mediocre> where main = fn(): void {}
<very-mediocre> just writing `main` is like writing a var without doing anything with it
<Hejsil> Ye
<very-mediocre> e.g. `var a = 5; a;`
<Hejsil> And var a: u8 = 0; a; evaluates to u8
<very-mediocre> Yes, it would evaluate to the function itself
<very-mediocre> but not call the function
<Hejsil> just like fn main() void{} ... main; evalutes to fn()void
<very-mediocre> e.g. when passing an anonymous function, you don't want to call it!
<Hejsil> Oooh wait
<Hejsil> I might see the consistency in a way
<Hejsil> because fn main() void is kinda like denoting how main is called
<Hejsil> then main() -> void
<Hejsil> aka main(): void
<very-mediocre> yeah, it used to be -> as you know
<Hejsil> Sure, I can accept that
<Hejsil> I'd say, that : is more consistent than -> then
<Hejsil> But i'd rather have ano functions
<very-mediocre> Yeah, agreed
<Hejsil> As I think they are even more consistent
<Hejsil> But i see it
<very-mediocre> I like having both
<very-mediocre> but that's because I am OCD about anonymous functions having performance issues in various language implementations
<very-mediocre> they feel "dynamic" to me
<Hejsil> I'm pretty sure C++ lambdas have no cost if they don't capture
<very-mediocre> Yes indeed they're almost no cost
<Hejsil> and are not sendt throug a function taking std::function
<very-mediocre> I'm brain damaged from JavaScript
<very-mediocre> pre-ES6 was nightmarish
<Hejsil> I wouldn't know
<Hejsil> I've stayed away
<very-mediocre> I've had to use it professionally
<very-mediocre> Everything is a footgun
<Hejsil> I like the idea of Nim as a high level language
<very-mediocre> Ugh nim is so conflicting
<Hejsil> Never type a types, but it's a static type language
<Hejsil> It has the python feel
<Hejsil> Which people love
<very-mediocre> I'm one of the few people who hate python
<very-mediocre> I've never found anyone who agreed with me
<Hejsil> I don't like it either
<Hejsil> But if you want 3 lines that does a lot
<Hejsil> Then it does the job
<Hejsil> And that's why I think Nim is good
<very-mediocre> As a better python, sure
<Hejsil> Though, haven't used it
<very-mediocre> It's still currently very rough
<Hejsil> But it seems like a better python yes
<very-mediocre> I've toyed with it
<very-mediocre> It has some crazy things going on that I don't know I can accept
<very-mediocre> like case insensitivity
<Hejsil> Oooh really?
<very-mediocre> i'm trying to look it up to see if it's still the case, but i'm pretty sure
<Hejsil> I though I read somewhere, that they where gonna use case to specify certain properties of the type/func whatever
<very-mediocre> yep it's case insensitive
<very-mediocre> also one of the things I never got was space/tab based scopes
<very-mediocre> I get that it's "cute" but it's nightmarish to maintain
<Hejsil> Agreed
<Hejsil> Though, I see the point
<Hejsil> Forces code style
<very-mediocre> It's to resemble pseudocode
<Hejsil> I should try writing something none trivial in nim/cystal/D
<Hejsil> But Zig is too good to leave
<very-mediocre> Zig has no business being this good :)
<very-mediocre> I was dabbling in nim, rust and D
<Hejsil> Maybe even Javascript
<Hejsil> So I can have a firm opinion on it
<very-mediocre> ES6+ javascript is decent now if you use a subset
<Hejsil> Ooh yes, need to write something in Rust too
<Hejsil> Like C++, a subset is good now
<Hejsil> Lol
<very-mediocre> my subset of C++ is C with classes
<very-mediocre> and templates
<very-mediocre> beyond that I'm out
<very-mediocre> operator overloading is disastrous
<very-mediocre> I think Zig can very easily be a better C++
<very-mediocre> even if it doesn'
<very-mediocre> doesn't intend to be
<alexnask> Nim is pretty nice but it can look really weird to C and C++ programmers
<alexnask> It's not really a C style language
<very-mediocre> Nim has wayyyyy too many keywords and idioms though
<Hejsil> What I need is a sanes "shell like" scripting language
<alexnask> Right, I agree could never fully get into it
<Hejsil> s/sanes/sane/g
<very-mediocre> my go-to is node/JavaScript for shell-like
<very-mediocre> if you use ES6 classes it's neat
<very-mediocre> I wrote a Bitcoin trading bot in js
<Hejsil> Well, something where calling "commands" is trivial like Posix shell
<very-mediocre> ah, that sort of thing
<very-mediocre> hmm
<alexnask> I personally don't mind python
<Hejsil> I think Python is strong because of it's libraries
<very-mediocre> I honestly think it's because of the "cuteness"
<Hejsil> The language it self is not really something I'd enjoy playing with
<alexnask> Ruby is probably better if you need to interact with the shell a lot
<Hejsil> Hmm
<very-mediocre> iirc in the early 2000s Python was gaining traction as a scripting tool for game designers
<Hejsil> Well, it's not like I'll get rid of shell lol
<very-mediocre> really in the end it depends what you like in terms of style, for C style there's node/js, otherwise python/nim
<Hejsil> Isn't Lua becomming kinda popular for that now (or maybe it always was)
<very-mediocre> yes Lua is now what Python used to be
<alexnask> Lua is pretty popular for game scripting yeah
<very-mediocre> somehow nobody remembers this about Python though
<alexnask> I think it's mostly because of WoW :P
<alexnask> + it's really small, fast and simple
<very-mediocre> Python is slow
<alexnask> I mean Lua
<very-mediocre> oh, lua
<very-mediocre> right
<Hejsil> Lol
<very-mediocre> sorry, I like to diss python :)
<very-mediocre> can't resist an opportunity
<very-mediocre> `__self__`
<very-mediocre> please <.<
<Triplefox[m]> i enjoyed working with nim a few years ago, but i had reservations about how easily it let me write slow code. the irc channel got toxic and that was a good time to leave
<Hejsil> At least you can see the C output and determin for yourself whether it's bad
<Hejsil> (idk how readable it is)
<very-mediocre> averagely readable
<Hejsil> Python, you have no luck
<very-mediocre> as of last year when i tried it
<alexnask> Hmm interesting, I would assume the C output would be a mess
<very-mediocre> by average i mean
<Triplefox[m]> lua is one i often work with. it's a nice small language. it isn't made for writing big codebases at all though, the companies in the industry using it implement a lot of their own checking/analysis
<very-mediocre> it wasn't like minified js or anything
<alexnask> Right
<Hejsil> What I really don't like about Python and the likes, is when you want to know what the interpreter does behind you
<Hejsil> No one asks/answers these questions
<alexnask> I used to maintain a compiler that spat out C (ooc-lang), at some point you get used to how the compiler does stuff so you can read the code
<very-mediocre> most people use Cython if they want performance
<alexnask> But it was really messy :p
<very-mediocre> hey, i ran across ooc when looking around for languages to try :)
<alexnask> PyPy is pretty fast too right?
<very-mediocre> supposedly, never tried it
<alexnask> ooc was pretty cool when it first came out in 2010 or so
<Triplefox[m]> python was the language that got me into "real" programming, it's just, the runtime is a pretty big deal and it affects all sorts of considerations around deployment
<alexnask> I mean, it had features like lambdas etc. that were not common in managed languages at that time
<Triplefox[m]> it is possible to ship some nice fast code with cython/ctypes though, i have seen and written some
<Hejsil> Well, I was not worried about being fast. Just not extremely slow
<alexnask> (not managed, wrong word, it was native + GC)
<very-mediocre> end of the day, whatever gets the job done
<Hejsil> Things like, "How to preallocate a list"
<alexnask> No, we must all use Lisp variants /s
<very-mediocre> lol
<Hejsil> Ooh god no
<very-mediocre> I think the human brain is not good with recursion
<very-mediocre> or at least my mediocre brain
<very-mediocre> after a certain depth i feel like I need a nap
<alexnask> That call/cc tho
<Hejsil> Well, inherently recusive problems are simpler with, you guessed it, recursion
<Hejsil> Like a recusive decent parser
<very-mediocre> sure, if that's the problem itself
<very-mediocre> referential transparency is easy to map to recursive functions there
<very-mediocre> meaning everything has to evaluate to something, and that something is something you understand
<Triplefox[m]> the language i've used the most in recent years is haxe...it's a nice reference point as a kind of lowest-common-denominator for coding with a GC since it aims to target basically any runtime vm
<alexnask> Haxe can compile down to C++ too right?
<very-mediocre> HaXe can compile to "anything"
tiehuis has joined #zig
<very-mediocre> most common usage back in the day was compile to Flash
<alexnask> I assume it uses Boehm GC or something similar when compiling to native code?
<alexnask> Nvm they use their own GC
<very-mediocre> it was cool writing a game using a Flash-identical API, then outputting it as C++
<very-mediocre> and building to native
<very-mediocre> ya unclear what Gc they use
<very-mediocre> whatever it is though it performs better than Adobe's runtime
<Triplefox[m]> the downside/upside of working with haxe is that you can write once and debug anywhere...sometimes this is actually useful for catching certain errors that only show up some places
<very-mediocre> imho main downside is the compile targets have idiosyncracies
<very-mediocre> you can't be confident what you're doing will be exactly the same in the HTML5 target vs. Flash vs. cpp
<very-mediocre> abandoned it because of that actually
<very-mediocre> but if you're doing a game in it, the time saved is far greater than time spent fixing idiosyncracies
<Triplefox[m]> the c++ target is boehm i think, yeah. their current initiative is "hashlink" which is a new jit vm
<alexnask> Huh Dead Cells is written in HaXe, cool
<Triplefox[m]> in haxe land, it's mostly a case of, "which target has the library bindings already set up for me"
<very-mediocre> even if you have the bindings, the library will have idiosynracies
<very-mediocre> i.e. OpenFL
<very-mediocre> Was doing something ambitious and couldn't even get blend modes to work consistently across platforms :(
<very-mediocre> and it was a known issue
<very-mediocre> such was the experience in general
<alexnask> So now you can compile HaXe directly to C++(/other targets) or to their own VM, which can itself produce C code :P
<alexnask> I wonder how HaXe C++ output will compare to HashLink C output
<Triplefox[m]> it really can be infuriating for getting something done because you end up debugging a target that you have no direct experience with...but the basic tech is also good
pianofingers has left #zig ["Leaving"]
<Triplefox[m]> haxe did lead me towards being interested in zig because so many problems that haxe itself can't address naturally point to problems with building and maintaining native code
<Triplefox[m]> haxe did lead me towards being interested in zig because so many problems that haxe itself can't address naturally point to problems with building and maintaining native code
sagecode has joined #zig
<alexnask> The fact that you can cross compile from any target to any target is a winner
<very-mediocre> here i go again
<very-mediocre> `pub fn at(i: usize): T {...`
<very-mediocre> can't get used to no colon for return type
<alexnask> Is the error message any good at least?
<very-mediocre> yeah
<very-mediocre> invalid token: ':' pub fn at(i: usize): ?T {
<Hejsil> Well, "good"
<very-mediocre> it doesn't paste nicely, but it's actually perfect
davr0s has joined #zig
tiehuis has quit [Quit: WeeChat 2.1]
mahmudov has quit [Remote host closed the connection]
Ichorio has quit [Ping timeout: 256 seconds]
<very-mediocre> Could anyone help me wrap my head around this?
<very-mediocre> Can't seem to unwrap errors when using generics
<very-mediocre> Like if something returns !T, the compiler doesn't let me do `if (returned_thing) |unwrapped|`
<very-mediocre> I feel I'm missing something basic but it escapes me at the moment...
<MajorLag1> I believe you need an `else` clause for `if` to unwrap an error. I might be mistaken, it's been a while since I ran into a similar problem.
<very-mediocre> It works with the function that returns !i32
<very-mediocre> without the else
<very-mediocre> nope you may be right
<very-mediocre> for the love of......
<very-mediocre> hmmm
<very-mediocre> There's something weird here but I can't quite place it
<very-mediocre> I wrote that simple example but in my actual code I'm having the issue even with `else`
<very-mediocre> ok, it's that very same caching issue I always have
<very-mediocre> I should just not post here
<very-mediocre> lol
<very-mediocre> Every single time the variations I try return the same error
<very-mediocre> Then I ask here
<very-mediocre> then it works
<very-mediocre> :|
<very-mediocre> now the actual code works
<very-mediocre> which already had the `else` added but wouldn't work
<very-mediocre> the weird thing is I'm not using a network drive for this file, I wonder if the compiler caches anything?
<MajorLag1> `zig-cache` doesn't actually cache anything, but people who don't know that often delete it as a trouble shooting step because we've just been trained to expect caches to solve problems.
<MajorLag1> *have, not solve
<very-mediocre> well I'm baffled
<very-mediocre> like I committed the code with the `else`, just checked it out and it compiled
<very-mediocre> whereas previously it was complaining.
bheads has joined #zig
<very-mediocre> assumed previously it was due to my setup.
<alexnask> What line was the issue on?
<alexnask> nvm missed the comments :P
<very-mediocre> basically I'm getting stale compilation but since zig doesn't cache, I'm baffled
<alexnask> I don't think else is mandatory here since this is an if statement, not an expression though i could be wron
<alexnask> wrong*
<very-mediocre> turns out it is
<very-mediocre> nonetheless I actually __committed__ it with the else
<very-mediocre> at a time when it wasn't compiling
<very-mediocre> and complaining that I was supposed to provide an optional type
<alexnask> weird
<very-mediocre> happened twice before, and I wrote here about it
<very-mediocre> but then I thought it was because of my network drive
<very-mediocre> but this file isn't on it...
<very-mediocre> note to self: next time, just "turn it off and on again" before posting about a problem here
<alexnask> :p
<alexnask> Still, its even weirder if this is a semi-consistent issue
<alexnask> Let me know if you have questions about comptime/metaprogramming btw
<very-mediocre> thanks :)
<very-mediocre> i'm good for now
<very-mediocre> trying to pick up zig by doing streaming lz77
<very-mediocre> the algorithm is in place but I got stuck on this weird issue
<very-mediocre> I'm truly baffled
<alexnask> What OS/distro are you running on? I don't think it should matter but you never know
<very-mediocre> win10 64bit
<alexnask> I had some issues on WSL but that was because I was modifying files with windows app on the linux "filesystem"
<very-mediocre> the way I code is compile heavy
<very-mediocre> I write something down and just compile
<very-mediocre> and use the errors to fix it up
<very-mediocre> that's how i learn
<alexnask> If you are using WSL this could be something to consider, I dont see why this would happen with the native windows release though
<very-mediocre> i'm not running it on WSL
<very-mediocre> so, i'm basically iterating very quickly
<alexnask> Hmm
<very-mediocre> hm at one point i had it as
<very-mediocre> else switch
<very-mediocre> lemme try that and see if it dies :)
<very-mediocre> nope
<very-mediocre> works just fine
<very-mediocre> I swear someone's playing a prank on me
<alexnask> Is your PC haunted?
<alexnask> :p
<very-mediocre> hmmm
<very-mediocre> I'm using the vscode integrated terminal
<very-mediocre> I noticed sometimes the buffer is overwritten at the wrong index
<very-mediocre> like zig compile errors are partially overwritten with new ones
<very-mediocre> could be that!
<alexnask> Aahh that would make sense
<alexnask> Some stderr related issues perhaps?
<very-mediocre> Hmm, a recent vscode update renders the terminal in canvas
<very-mediocre> might be a bug in that implementation
<very-mediocre> ok
<very-mediocre> i'm sure this is the problem
<very-mediocre> it just happened
<very-mediocre> the vscode terminal is a mess
<alexnask> zig devs > MS devs confirmed /s
<very-mediocre> it just overwrote the previous buffer and i'm seeing merged error messages
<very-mediocre> C:\Users\user\Documeerror: type '@typeOf(Lz77InStream(ArrayInStream(u8),4,5)_next).ReturnType.ErrorSet!?Lz77_tuple' does not support field access debug.warn("({},{},{})\n", res.pos, res.len, res.next orelse ' ');
<very-mediocre> C:\Users\user\Documeerror
<very-mediocre> hell of a path there
<very-mediocre> this must be it
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xtreak has joined #zig
davr0s has joined #zig
Ichorio has joined #zig
sherjilozair has joined #zig
sherjilozair has quit [Quit: Leaving...]
<very-mediocre> Still getting very stale compiles!
<very-mediocre> hrmph
<bheads> anyone know how to get the zig build to copy dll file to output path?
<bheads> tried b.copyFile("lib-win64\\SDL2.dll", exe.getOutputPath()) catch unreachable; but it doesn't copy anything and
<bheads> but compiles just fine
sagecode has quit [Ping timeout: 260 seconds]
sagecode has joined #zig
mahmudov has joined #zig
<andrewrk> Hejsil, > inherently recusive problems are simpler with, you guessed it, recursion
<andrewrk> what makes you say that? (just kidding)
quc has quit [Ping timeout: 245 seconds]
<Hejsil> :)
<andrewrk> poor Hejsil implemented the entire self hosted parser without recursion because I claimed it was unsafe, and then I went off and did an experiment and discovered we actually can rescue recursion and make it safe
<Hejsil> Hey, it was fun
<andrewrk> this zig-window rabbit hole goes deep. I'm currently implementing a dynamic .so loader
<andrewrk> so that you can open libGL.so and start calling functions
<alexnask> lolwut how do you write a compiler with no recursion? :P
quc has joined #zig
<bheads> thank you for errors on integer overflow, that probably saved me an hour tracking down random behavior
<andrewrk> :)
kristate has joined #zig
very-mediocre has quit [Ping timeout: 260 seconds]
very-mediocre has joined #zig
<bodie_> any recursion can be rewritten as an iteration with accumulation
<bodie_> and it often has to be, because limited recursion depth is a thing
<andrewrk> I think my idea of not depending on libc for a basic opengl app is doomed: https://i.imgur.com/1fDPzEj.png
<andrewrk> vulkan is even worse than opengl, it depends on libstdc++: https://i.imgur.com/ZuNKdaV.png
<bodie_> isn't vulkan just a driver api?
<andrewrk> perhaps, but, in practice, this is how it's implemented on linux, with all these dependencies
<alexnask> @bodie_ Right I know you can turn recursive code into iterative code but I wager it would be a pain to do so in a whole compiler's codebase
<bodie_> I'm trying to work on a little parser in rust right now, and the way I'm doing it is w/ an enum + switch state machine
<bodie_> and then breaking those down into "methods" on the various enum members
<bodie_> but it is still really immature so for all I know this is a terrible approach
<bodie_> I'm thinking of migrating it to Zig though :D
alexnask has quit [Ping timeout: 256 seconds]
mrec has joined #zig
very-mediocre has quit [Ping timeout: 260 seconds]
mrec has quit [Client Quit]
xtreak has quit [Remote host closed the connection]
<andrewrk> bodie_, you might find that file I linked above interesting, it's a full zig parser written in the style you described
diefroggy242 has joined #zig
very-mediocre has joined #zig
dbandstra has joined #zig
<diefroggy242> Is this a place that I can ask for help with code? I'm trying to get Zig going on an MSP430, looking at the clashOs repo by andrewrk. Should I just copy paste if it's a small snippet?
<andrewrk> diefroggy242, yep this is a good place for help. if it's more than 2 lines I suggest using https://clbin.com/
<andrewrk> clashos has bitrotted some. I need to update it
<diefroggy242> OK thanks.
Sahnvour has joined #zig
<andrewrk> I fixed the compile errors just now, but looks like there's a new dependency on the __multi3 compiler-rt builtin, which I need to add to zig
<Sahnvour> hi andrewrk , what's the easiest way to hack on zig's stdlib ? I built my version of zig from source, but don't like having to run the install target everytime I make changes to std/ to have files copied, is --zig-install-prefix useful here ?
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alexnask has joined #zig
bheads has quit [Ping timeout: 264 seconds]
<andrewrk> that's the officially supported way to make changes
<andrewrk> but you could edit the installed files directly if you're careful not to overwrite your work
<andrewrk> sorry, when I said "that is the officially supported way" I meant running `make install` every time you change something
<Hejsil> "watch make install"
<Hejsil> :)
<Hejsil> Probably not the best idea
<Sahnvour> hmm ok
diefroggy242 has quit [Ping timeout: 260 seconds]
<Sahnvour> what's a bummer actually is having to use vcvars.bat to gain access to msbuild, or do some customization. meh windows ...
<alexnask> I just use the Visual Studio x64 command line by default
<andrewrk> same ^
<dbandstra> alexnask, thanks for fixing up that interface.zig, i had some issues with it and left a comment in the gist
<alexnask> Oh I didn't notice let me take a look
<alexnask> Huh I thought for sure I tried an interface with multiple methods, I'll test it and update with fixes
return0e has quit [Read error: Connection reset by peer]
return0e has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
very-mediocre has quit [Quit: Page closed]
davr0s has joined #zig
<dbandstra> that closure pattern doesn't seem to work
<alexnask> This is really weird
<alexnask> We end up in the 0 branch of the switch statement, when the expression is 1
redj has quit [Ping timeout: 268 seconds]
<dbandstra> by the way, is there any way to print `fn_name` or something like that in @compileLog
<dbandstra> when i try that it just prints out 'struct []const u8' or something like that
<alexnask> Right, this is a realy annoyance for me too, you need @compileError for strings
<alexnask> Which prints out a whole error, obviously
<dbandstra> oh i see, didn't even try that
<alexnask> Hmm this is probably some weird comptime evaluation bug
<alexnask> I think I hit something similar when I first wrote this and split that part of the code in another function
<alexnask> But when I updated to latest zig using a function seemed to break stuff
<alexnask> Well at least now I fail with an LLVM error :p
<alexnask> But I think I'm pretty close to a fix
<dbandstra> cool :)
<dbandstra> i have to head out.. hard to find free time
<andrewrk> cool, got basic runtime dynamic library loading working without libc on linux
<alexnask> Nice!@
<Sahnvour> just started from a fresh clone of the repo, building (windows+msvc) yields missing file errors from all embedded_lld_* targets even though files are here, I'm confused ... any idea ?
<andrewrk> Sahnvour, hmm, no, and we have appveyor do a full clean build on every master branch push, so it should be working
<Sahnvour> that's strange because even invoking the compiler myself results in an error, but opening the file works fine from the same command line ... investigating this, but this seems to be a problem on my end
<Sahnvour> ah, I bet that's some bad interaction between WSL and regular windows
<alexnask> You should probably have your folder in /mnt/c if you want to interact with files in it from windows
<Sahnvour> that's what I did, and this guy https://stackoverflow.com/a/50328492/1119972 had the same problem (and same fix)
mahmudov has quit [Ping timeout: 240 seconds]
<GitHub85> [zig] andrewrk pushed 1 new commit to master: https://git.io/vhMvP
<GitHub85> zig/master 48de57d Andrew Kelley: add basic std lib code for loading dynamic libraries...
<GitHub77> [zig] andrewrk pushed 1 new commit to master: https://git.io/vhMvj
<GitHub77> zig/master 65d04cb Andrew Kelley: std.DynLib: open the fd with CLOEXEC
redj has joined #zig
sagecode has quit [Ping timeout: 248 seconds]
tyler has joined #zig
Ichorio has quit [Ping timeout: 256 seconds]
Hejsil has quit [Ping timeout: 260 seconds]
sagecode has joined #zig
<alexnask> "Global is external, but doesn't have external or weak linkage!"
<alexnask> Could this be related to generating functions at comptime? (through the struct-fn idiom)
<alexnask> Seems to be happening when I assign a generated function to a nullable
<andrewrk> if you're getting an llvm error then it's a zig bug
<alexnask> Yup, I'll try to isolate this one
<andrewrk> it must have something to do with `export`
<alexnask> IDK, I'm basically generating Vtables on the fly and want to support optional methods
<alexnask> So I basically make a wrapper function that does some casting from a type erased self to the implementation type and @inlineCall's the method
<alexnask> And then assign that to the vtable field, which works fine if the field is just a function pointer but raises that error if the field is nullable
<alexnask> So my guess is nullable generated functions, testing that out in a few
dsn has joined #zig
zolk3ri has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<GitHub188> [zig] andrewrk pushed 1 new commit to master: https://git.io/vhMTv
<GitHub188> zig/master c529b81 Andrew Kelley: load_dynamic_library test: no need to link libc
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mahmudov has joined #zig
Sahnvour has quit [Quit: Page closed]
<GitHub152> [zig] andrewrk pushed 1 new commit to master: https://git.io/vhMkI
<GitHub152> zig/master a7d5908 Andrew Kelley: disable load dynamic library test...
_whitelogger has joined #zig
dsn has quit [Remote host closed the connection]
dsn has joined #zig
davr0s has joined #zig
<GitHub1> [zig] andrewrk pushed 2 new commits to master: https://git.io/vhMk5
<GitHub1> zig/master 3ee4d23 Andrew Kelley: posix read can return error.IsDir
<GitHub1> zig/master eae9634 Andrew Kelley: langref: be clear that float types are always IEEE 754
quc has quit [Ping timeout: 256 seconds]
dsn has quit [Client Quit]