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/
<stratact> daurnimator: regarding your question to my PR, should I have made `caps` a `StringHashMap(ArrayList(u8))` instead? So the hashmap "owns" the string data? I think I realized my mistake there and why I'm bad at manual memory management. :)
ur5us has quit [Ping timeout: 250 seconds]
ur5us has joined #zig
<adamkowalski> andrewrk: I am watching your stream about the evented chat server. You show that by declaring io_mode = .evented you enable asyncronous IO rather then blocking
<adamkowalski> How do you handle a situation where you want some blocking operations and some evented operations. Does it have to be all or nothing?
<fengb> Anyone have a recent memory of the original Gameboy? Trying to gauge how accurate this ghosting is: https://i.imgur.com/4ljI6sW.png
adamkowalski has quit [Quit: Lost terminal]
dddddd has quit [Remote host closed the connection]
protty has joined #zig
traviss has joined #zig
<daurnimator> stratact: that would be one way. or you could just mem.dup() every time you add to the map (and iterate over the map freeing in deinit)
benjif has joined #zig
<Cadey> andrewrk: what's the fastest way to install all of the dependencies of the zig compiler for iterating on zig's wasi support?
<Cadey> assuming an ubuntu host that is
return0e has quit [Read error: Connection reset by peer]
return0e has joined #zig
daex has quit [Ping timeout: 240 seconds]
daex has joined #zig
<daurnimator> Cadey: the only dependency is essentially llvm....
<daurnimator> I guess cmake too?
waleee-cl has quit [Quit: Connection closed for inactivity]
lunamn has quit [Quit: leaving]
merlyndmg has quit [Remote host closed the connection]
qbradley has joined #zig
mahmudov has quit [Remote host closed the connection]
protty has quit [Remote host closed the connection]
muffindrake has quit [Ping timeout: 250 seconds]
muffindrake has joined #zig
<stratact> daurnimator: actually thinking about it again, would it be better to avoid deiniting the buffer and save it in memory to another Terminfo field, so that way the names and caps maps can still slice view it?
return0e_ has joined #zig
return0e has quit [Ping timeout: 268 seconds]
<stratact> ...oh, that was your implicit point
* stratact feels embarassed
return0e_ has quit [Read error: Connection reset by peer]
return0e has joined #zig
<stratact> emekankurumeh[m]: You're @emekoi on github, right? I'm still confused why downward function access from anon struct literals are not working for my closure use
ur5us has quit [Ping timeout: 250 seconds]
return0e_ has joined #zig
return0e has quit [Ping timeout: 268 seconds]
ltriant has quit [Quit: leaving]
qbradley has quit [Ping timeout: 260 seconds]
Cloudef has quit [Quit: ZNC - http://znc.in]
Cloudef has joined #zig
return0e has joined #zig
return0e_ has quit [Ping timeout: 240 seconds]
<pixelherodev> I was mentioned twice while AFK. That's new for me. :P
<pixelherodev> Nothing wrong with a bit of infamy, I suppose :P
<pixelherodev> but yeah, I'm happy to chat about doing OS stuff in Zig, or that text adventure, which was a nice learning experience but I was too busy to finish :( One of these days.
marmotini_ has joined #zig
return0e has quit [Read error: Connection reset by peer]
return0e has joined #zig
marmotini_ has quit [Remote host closed the connection]
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen1 has joined #zig
dingenskirchen1 is now known as dingenskirchen
marmotini_ has joined #zig
marmotini_ has quit [Quit: Leaving...]
marmotini_ has joined #zig
dddddd has joined #zig
<stratact> So with nothing left for me to do for std.terminfo atm, I searched for other std lib contrib friendly issues and I couldn't find one that I'm capable of. That not only makes me bored for the rest of the night here but feel terrible as a coder :(
hyu has joined #zig
<stratact> Welp, time for bed.
marmotini_ has quit [Remote host closed the connection]
<hyu> Where I live is only 3pm
<benjif> 3am here
<hyu> Hi benjif, it's time to go to bed
<benjif> hyu: Just woke up actually
<benjif> a little too early
ur5us has joined #zig
ur5us has quit [Remote host closed the connection]
ur5us has joined #zig
FireFox317 has joined #zig
hyu has quit [Read error: Connection reset by peer]
ur5us has quit [Remote host closed the connection]
ur5us has joined #zig
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
dingenskirchen has quit [Client Quit]
dingenskirchen has joined #zig
<pixelherodev> 4 AM here, but my sleep schedule is so messed up it makes a landfill look organized
<pixelherodev> :(
* vegai would like to implement deflate/inflate but it's been years since I last did Real Programming
marmotini_ has joined #zig
<mq32> vegai, just go for it!
marmotini_ has quit [Ping timeout: 268 seconds]
<vegai> :)
<vegai> I'm looking at various projects for insipration / stealing of code
<vegai> https://github.com/pfalcon/uzlib looks nice for instance
<vegai> miniz_oxide looks remarkably clean in fact, perhaps I'll try to port that
merlyndmg has joined #zig
<merlyndmg> translate-c-2 still converts void some_func(); into fn some_func(...); Is that ellipsis supposed to be removed now that varargs is gone?
<merlyndmg> I'm potentially finishing up a PR for that now, so wondering if I should be wiping that out now and just make the function signature take 0 parameters, or what it should do
<merlyndmg> (PR for translate-c-2 properly handling function signatures)
marmotini_ has joined #zig
<pixelherodev> Wait, varargs is gone already?!
return0e_ has joined #zig
marmotini_ has quit [Ping timeout: 268 seconds]
ur5us has quit [Ping timeout: 250 seconds]
<muffindrake> Is if(optional) specifically required, or am I allowed to swap the branch blocks by doing if (!optional)?
ikan-keli_ has joined #zig
marmotini_ has joined #zig
<FireFox317> pixelherodev: Yes they are gone. We now have tuples!! `std.debug.warn("i: {}\n, .{ 1 });` however var args are still posible to use in code that interfaces with C
marmotini_ has quit [Ping timeout: 245 seconds]
<FireFox317> so merlyndmg I guess varargs should stay in code that interfaces with C: <andrewrk> this is not related to C functions. C functions still work the same
<mq32> muffindrake: you can always access an optional with opt.?
<mq32> but you need to be sure that the optional is actually initialized with a value
<aperezdc> How is one supposed to compare a slice (`[]u8`) with a literal string (`[4]u8` in my case, according to the compiler)?
<aperezdc> The `==` operator doesn't work (incompatible types)
<aperezdc> I am supposed to use `strcmp()` from the libc?
<aperezdc> Sorry if this is too basic a question, I just started with Zig yesterday O:-)
<mq32> aperezdc: std.mem.eql(u8, myString1, "hello");
halbeno_ has quit [Quit: Leaving.]
halbeno has joined #zig
<aperezdc> Oh, that's it. Thanks mq32
<mq32> you're welcome
FireFox317 has quit [Ping timeout: 250 seconds]
slice has quit [Ping timeout: 268 seconds]
<pixelherodev> In theory, if you know both str1.len % 4 == 0 and str2.len % 4 == 0, is std.mem.eql(u32, @as([]u32, str1), @as([]u32, str2)) faster?
<pixelherodev> Native size, rather
<pixelherodev> So len % 8 ==0 and u64 on x64
<mq32> pixelherodev, probably, probably not?
<mq32> will not work on aarch64 for example
<mq32> as it will die with alignment problens
mahmudov has joined #zig
return0e_ has quit [Ping timeout: 250 seconds]
return0e_ has joined #zig
return0__ has joined #zig
return0e_ has quit [Read error: Connection reset by peer]
return0__ has quit [Read error: Connection reset by peer]
return0e_ has joined #zig
<stratact> ah nice, sleeping took the bad feelings away. Glad to see people talking about timezones after I went to sleep. I'm waking up to this: https://www.youtube.com/watch?v=4G9M9b6Bz3A
frmdstryr has quit [Ping timeout: 240 seconds]
<aperezdc> Mmh, I would expect either std.mem.eql() has some optimizations to do that automatically when possible, or that LLVM will optimize the loop
<aperezdc> Some libc implementations include hand-coded assembler inner loops for memcmp() and similar functions, for example
<aperezdc> Also not all architectures would necessarily benefit from hand coded versions... Sometimes the optimizer in the compiler will beat the programmer anyway ;-)
<mq32> aperezdc, yeah it's sure possible to write optimized versions for differrent platforms
<mq32> but i don't think that's a high priority right now
<aperezdc> Of course, doesn't need to be
<aperezdc> LLVM might be doing some optimizations already, anyway
dimenus has joined #zig
<mq32> yeah
<mq32> probably
mixi has quit [Remote host closed the connection]
mixi has joined #zig
dimenus has quit [Remote host closed the connection]
frmdstryr has joined #zig
dimenus has joined #zig
return0e has quit [Ping timeout: 240 seconds]
return0e has joined #zig
<frmdstryr> daurnimator: Is your test script for the h1 branch in the repo somewhere?
return0e_ has quit [Ping timeout: 240 seconds]
protty has joined #zig
return0e_ has joined #zig
<protty> can an async function thats suspended and running the code inside the suspend block be resumed in parallel on another thread?
<mq32> protty, yes, async functions can be resumed from another thread
<mq32> but i don't think it's legal to resume from two threads at the same time
<SyrupThinker> I think this is exactly whats asked, no?
<protty> mq32: maybe a better phrasing: could code1 `suspend { code1 }`and code2 `code2: resume frame_from_code1` be executing simultaneously?
<SyrupThinker> Yes
<protty> ah just read the link, thx
frmdstryr has quit [Remote host closed the connection]
return0e_ has quit [Remote host closed the connection]
return0e_ has joined #zig
return0e_ has quit [Read error: Connection reset by peer]
return0e_ has joined #zig
frmdstryr has joined #zig
waleee-cl has joined #zig
<fengb> andrewrk: looking at your changes, os/wasi.zig is meant to be a pure wrapper around system calls?
<andrewrk> fengb, yes, the idea of that abstraction layer is that it's the actual API the system provides - no cross platform abstractions there. std/os.zig has some cross platform abstracting in it
<fengb> Okay sounds good
<andrewrk> protty, yes, and so one thread will be finishing the suspend block, and the other thread will resume *after* the suspend block (the place you would expect it to resume)
<andrewrk> and the whole reason that suspend takes a block is because of this race
<fengb> Oh boy, anonymous init makes nested structs so much nicer :)
<andrewrk> yes, nested anonmyous types actually work now
<andrewrk> anonymous structs as parameters & return values, anonymous enums as parameters & return values
<protty> another question: try to use `testing.expectError()` and keep getting this stack trace https://hastebin.com/soqegebevo.js buried between many similar ones. Know how to resolve this?
<andrewrk> protty, did you run make after pulling master?
<andrewrk> one explanation for that would be updating std lib without rebuilding
<protty> ah, nope. lemme try
adamkowalski has joined #zig
<adamkowalski> Did std.debug.warn change how it works? This no longer works std.debug.warn("{}", 25);
<Snektron> yeah, varargs are removed
<Snektron> the right syntax is `std.debug.warn("i like {}", .{"pythons"});` now
<adamkowalski> Woah thats a big change haha. Where can I read about that?
<adamkowalski> Ahh so it's taking an anonymous struct with the same number of fields as the number of placeholders?
<companion_cube> ahah so Zig now has tuples :D
<adamkowalski> Is that what we call anonymous structs now?
<andrewrk> anonymous list literals, yeah. same thing
<adamkowalski> andrewrk: is this hos you're supposed to use @fieldParentPtr? I tried creating a minimal example of a heterogenous list: https://pastebin.com/SqFdUWqg
<companion_cube> well, sum types, tuples, `switch`, Zig is now officially a ML
<andrewrk> adamkowalski, yes that looks like the current interface pattern that std uses, if that's what you're asking
<andrewrk> MatLab? Machine Learning?
<companion_cube> ML, meta language (SML and OCaml basically)
<companion_cube> where type inference comes from ;)
<adamkowalski> awesome, thanks. I'm not sure if we have too many examples of that yet. I was gonna document that somewhere
<adamkowalski> Hindley Milner!
<adamkowalski> Their inference is kindof limited though
<protty> andrewrk: looks like that was it
<adamkowalski> I feel like just having functions which take and return types is more expressive
<companion_cube> yeah, Zig goes further in some directions, for sure
<adamkowalski> Also I like forcing people to document the signature, even if you can infer it
<companion_cube> yeah I agree
<companion_cube> my OCaml is heavy on annotation
<companion_cube> s
<adamkowalski> andrewrk: do you have any example code using the vtables instead of fieldParentPtr. I wanted to write the equivalent example with that approach
<andrewrk> fengb, nice work on WasmPageAllocator
<adamkowalski> Awesome thanks!
<adamkowalski> What kinds of things would be good to have in docs for that? I'm thinking this is the simplest example that still demonstrates the feature. Maybe also plug it in to compiler explorer and compare the assembly?
<fengb> Thanks
<muffindrake> Is goto still on the table?
<muffindrake> defer/errdefer offer some manner of useful features, but they don't replace goto as the documentation claims.
<andrewrk> goto was removed for being a redundant feature: https://github.com/ziglang/zig/issues/630
<lupine> I wanted to use goto to break out of a nested while loop, but then I found tagged breaks, so *shrug*
<andrewrk> if you want to be taken seriously you should probably provide example code to show why the claims in the docs are not correct
<fengb> We should totally support a comefrom 🙃
<mq32> fengb: comefrom is great for concurrency!
<fengb> It solves crosscutting logging concerns!
<fengb> "thread 'main' panicked at 'not yet implemented: Clock eventtypes in wasi::poll_oneoff', lib/wasi/src/syscalls/mod.rs:2354:18"
<fengb> So much for adding tests :/
<andrewrk> wasi is woefully incomplete
adamkowalski has quit [Read error: Connection reset by peer]
<andrewrk> IMO if we do a wasi interpreter, we should start just finish the spec, and implement it, and then wasi project will end up having to use our design
<fengb> lol
adamkowalski has joined #zig
<andrewrk> I promise you that would happen - users will use what works, and then the real actual project gets pressure from users to support what already works unofficially
<andrewrk> ha!
<fengb> Yeah looking at this stuff, it's something we already do in Zig
<fengb> I never thought about how similar our os layer is to the wasi vm
<andrewrk> yep :)
adamkowalski has quit [Quit: Lost terminal]
<fengb> I guess it's not really worth looking at right now since there's not a proposed replacement yet
protty has quit [Remote host closed the connection]
adamkowalski has joined #zig
<adamkowalski> andrewrk: do you accept pull requests for the documentation on master? This section https://ziglang.org/documentation/master/#Values uses the old std.debug.warn syntax
<andrewrk> adamkowalski, yes
<adamkowalski> In the docs it says that the code samples are ran as part of the test suite of the compiler. Is that just using make test? Or is there anything else I need to do to check my work?
<adamkowalski> Wait I can just run zig build test to test the compiler!! Even the stage one?
<andrewrk> yes, have a look at https://github.com/ziglang/zig/blob/master/CONTRIBUTING.md for more details
<andrewrk> you probably want `zig build docs`
<adamkowalski> thats awesome. for some reason I would have assumed you could only use that for building stage 2. But I guess you can use zig build even for C++ projects
<adamkowalski> I wonder if you could steal people over by just going to the C++ people and tell them there is a new alternative for CMake that has a sane language
<adamkowalski> Then before they know it, they are using Zig, and then we tell them, by the way it's a general purpos programming language, you can just leave C++ behind
<andrewrk> that's part of the plan :)
<andrewrk> especially when you consider zig can compile C/C++ code, so the package manager will be a reasonable way for C/C++ projects to depend on C/C++ libraries
<andrewrk> to be clear adamkowalski you need cmake/make to build zig stage1. then you can use that for zig build
THFKA4 has joined #zig
adamkowalski has quit [Ping timeout: 250 seconds]
<Snektron> adamkowalski: check out meson, it has much mroe sane syntax when compared to cmake
qbradley has joined #zig
adamkowalski has joined #zig
adamkowalski has quit [Client Quit]
* aperezdc agrees regarding Meson
return0e_ has quit [Remote host closed the connection]
return0e_ has joined #zig
return0e_ has quit [Ping timeout: 265 seconds]
<stratact> andrewrk: wait, null-terminated pointers are... [*c], right?
<andrewrk> no, those are C pointers
<stratact> Heh, you're right, TIL about #3731
<fengb> Well of course he’s right 😛
<stratact> oh, I didn't mean it that way. It was more to imply my ignorance of what's happening and how stupid my question was.
lunamn has joined #zig
<andrewrk> stratact, buddy, you don't have to beat yourself up to fit in here. take it easy on yourself. consider that calling yourself stupid could be seen by other newbies as how they should feel
Nairou has joined #zig
wootehfoot has joined #zig
<Nairou> This seems like a silly question, but how do you cast between similar types? For example i32 -> usize (attempting to use a i32 as an array index). I saw the GitHub proposal where plain casts were removed, but I don't understand what they were replaced with.
<andrewrk> Nairou, @as(DestType, value)
<andrewrk> however i32 -> usize is a lossy conversion, because usize does not contain the entire range of values that i32 spans
<andrewrk> for this you will have to choose what kind of cast you want. do you want to assert that the value fits in the destination? @intCast
<andrewrk> do you want to treat the i32 as unsigned and zero extend it? @as(usize, @bitCast(u32, x))
<Nairou> True. So far I've been using i32 as a generic type, like "int" in C. In this case I know it'll never be negative, so I guess the latter.
<Nairou> What happens if I know the i32 isn't negative, but I only do a @as(usize,x) ?
<Nairou> Hmm. Was @as added after 0.5?
<Nairou> I guess it wasl, It's in master docs but not 0.5 docs. Guess I need to get a newer version of Zig.
<andrewrk> @as was always supported by calling a type as a function
<andrewrk> however now a function call is always a function call
<Nairou> I tried usize(x) in 0.5 but that didn't work either, if that's what you mean
FireFox317 has joined #zig
<stratact> andrewrk: I'll be careful next time. I'm kind of an INTP person, so it's part of will of growth. I will take it easy, that's something I'm really working on :)
marmotini_ has joined #zig
* stratact plays some Rameses B
FireFox317 has quit [Remote host closed the connection]
marmotini_ has quit [Quit: Leaving...]
return0e_ has joined #zig
return0e_ has quit [Client Quit]
<stratact> Let's see, when adjusting the std.c functions from [*] to [*:0] and *[N] to *[N:0], there appears to be some functions in that module that std.os uses and requires to be not null-terminated?
darithorn has joined #zig
<andrewrk> not all c functions are null terminated, you have to determine which ones do and which done
<andrewrk> *don't
<stratact> fair enough, will do
<Nairou> Is there a trick to using AutoHashMap.getOrPut() ? I see examples of it in GitHub, but when I try to access the kv field in the returned result I just get a "does not support field access" error.
<andrewrk> Nairou, you truncated the part of the error message that would have made it possible to answer your question
<Nairou> error: type '@typeOf(std.hash_map.HashMap(i32,GuardSleep,std.hash_map.getAutoHashFn(i32).hash,std.hash_map.getAutoEqlFn(i32).eql).getOrPut).ReturnType.ErrorSet!std.hash_map.GetOrPutResult' does not support field access
<Nairou> I'm using an AutoHashMap of i32 to a struct named GuardSleep
<tdeo> you need to handle the error i think
<Nairou> Oh good grief, I should have known that. Learning, thanks :-)
<Nairou> Am I correct in assuming that, at least until 1.0, master is always best to use and the periodic releases are just milestones?
<tgschultz> yes
<andrewrk> yes and breaking changes and regressions can happen without warning until then, so, best to keep an old build around until you update your project to use latest master
lunamn has quit [Ping timeout: 240 seconds]
darithorn has quit [Remote host closed the connection]
darithorn has joined #zig
darithorn has quit [Quit: Leaving]
ur5us has joined #zig
<fengb> Is this a common problem in C? "To build wac/wax/wace you need a 32-bit version of gcc and 32-bit versions of SDL2 and libedit."
<andrewrk> yes
<andrewrk> meanwhile, to cross compile legend-of-swarkland for windows, pass -Dtarget=x86_64-windows-gnu to zig build
FireFox317 has joined #zig
Nairou has quit [Quit: Nairou]
<andrewrk> that test is incorrect since the docs for sleep says: /// Spurious wakeups are possible and no precision of timing is guaranteed
<andrewrk> a valid implementation of std.time.sleep() according to these semantics is `pub fn sleep() void {}`
<andrewrk> and I am confident this is the correct API
<andrewrk> I think it should be corrected to testing.expect(time_1 >= time_0)
<andrewrk> that's the best we can do
<fengb> Okay, the wasi version I got ~1200 ms, which is also correct right?
<andrewrk> yep
<fengb> It's a little silly since I'm running it in a wasi vm in a Docker on my Mac
<fengb> So precision is over ------> there
<andrewrk> you should probably eyeball the results of std.time.milliTimestamp()
<stratact> Now that I think about it, Zig has all of the interesting/practical properties of C (which I'm learning for the first time) but with a healthy blend of ideas from D and Rust (which I have experience in) on top of its own unique features, which is why it's extremely fun. I never thought of it like this before, but it feels right.
companion_cube has quit [Quit: WeeChat 2.3]
companion_cube has joined #zig
dddddd has quit [Remote host closed the connection]
FireFox317 has quit [Ping timeout: 245 seconds]
frmdstryr has quit [Ping timeout: 268 seconds]
ltriant has joined #zig
ur5us has quit [Ping timeout: 250 seconds]
<stratact> Heh, I'm feeling evil (in a good way). I'm going to abuse the the Azure CI to help me purify null-terminated work based on how other OSes complain along with searching man pages for which *read/*write/*pipe functions don't need them.
ur5us has joined #zig
frmdstryr has joined #zig
sammich has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
darithorn has joined #zig
sammich has joined #zig
<pixelherodev> Got my LLVM parser almost done :D
<pixelherodev> Parses the test fully, just need to finish the backend
<stratact> Oh neat, will this be used for the self-hosting compiler?
<daurnimator> frmdstryr: no. but I linked to the sprunge for it earlier
<frmdstryr> I tried that but it was giving an error saying ensureCapacity didnt exist or something like that
<fengb> andrewrk: whoops, I misread the test. It's suppose to sleep for 1ms, not 1s, so this check of <50ms is probably correct
<andrewrk> it's unlikely to fail but still theoretically incorrect
<fengb> I found the bug lol: "const ns_per_ms = 1000;"
<pixelherodev> stratact, nah
<pixelherodev> Implementing an alternate backend
<daurnimator> "andrewrk>however now a function call is always a function call" except when its a builtin
<stratact> pixelherodev: an alternative backend also is equally (if not, more) important. Keep up the fine work.
<pixelherodev> Uh, I mean
<pixelherodev> For a non-standard ISA
<pixelherodev> Though if I finish that, I could probably add support for e.g. x86
<pixelherodev> That's actually a really interesting idea, thanks!
wootehfoot has quit [Read error: Connection reset by peer]
<andrewrk> daurnimator, the statement is ambiguous. an unambiguous statement would be: now function call syntax is always a function call
<stratact> pixelherodev: and arm64, please? :)
<pixelherodev> I don't know ARM, but it would probably be doable
<pixelherodev> First, need to get it done though
<shakesoda> what does/will the different backend provide
<pixelherodev> It's an LLVM backend written in Zig
<daurnimator> andrewrk: `@field(foo, "bar")` => looks like a function call..... isn't
<stratact> I think what pixelherodev is doing is both cool and practical
<shakesoda> like, instead of passing llvm ir to llvm, build it yourself?
<shakesoda> stratact: i just don't have the full context
<pixelherodev> It parses LLVM IR produced by Zig and produces assembly
<shakesoda> very nice
darithorn has quit [Quit: Leaving]
<pixelherodev> The only real goal is parse the IR produced by Zig
<pixelherodev> If it lacks support for features Zig doesn't use, I'm not concerned
<pixelherodev> Needs a major cleanup / refactor already though
<shakesoda> sounds potentially useful for fast builds
<pixelherodev> It's one file with ~2K lines
<pixelherodev> And the memory allocations are... well, I didn't bother freeing memory at all because I knew I'd need to rewrite that later anyways :P
frmdstryr has quit [Ping timeout: 240 seconds]
<pixelherodev> I plan on implementing a "buffer pool"
<Snektron> you're writing a Z80 LLVM backend?
<shakesoda> ah yes, "make the OS deal with the mess" strategy
<pixelherodev> Not quite
<pixelherodev> The "put off dealing with this for a week more" strategy :P
<pixelherodev> Snektron, nope
<pixelherodev> Not Z80
<Snektron> sad
<pixelherodev> Though I am considering adding that
<pixelherodev> Very strongly leaning towards it honestly
<Snektron> isn't it a lot of work to add another LLVM backend?
<pixelherodev> I'm not adding it to LLVM
<pixelherodev> Rather, I'm not using the LLVM libraries
frmdstryr has joined #zig
<pixelherodev> It's a Zig library that parses LLVM IR directly and generates assembly
<Snektron> Ah, so a direct backend
<Snektron> oh right, i see
<Snektron> isn't that what an LLVM backend is though
<pixelherodev> Eh
<pixelherodev> Basically every LLVM backend is a hot mess of C++
<stratact> Different API, better independence
<pixelherodev> Because they all use the standard libLLVM
<Snektron> i see
<pixelherodev> Once I get it working, it'll be refactored even further because right now parsing and AST building are one step and that's probably Bad Practice™
<andrewrk> OTOH I think they designed that format so that you could do that
<pixelherodev> They did, but then they turned around and created an ecosystem of pain :P
<pixelherodev> But "working" here means "able to parse itself and generate viable assembly"
<andrewrk> neat!
<pixelherodev> Currently, there's a few bugs preventing that - such as the inability to parse identifiers containing spaces
<pixelherodev> Nothing major, but a bunch of minor bugs and unimplemented features
<andrewrk> yeah a bunch of breaking language changes landed in master recently, but the good news is that these changes are now in the past instead of the future. there are a very finite number of language changes left
<pixelherodev> I know this is Bad, but my programming strategy tends to be "make working project with terrible code" → "make code good"
<pixelherodev> Is the goal that after 0.6 there should no more major changes?
* shakesoda is really looking forward to functions as expressions / #1717
<stratact> <stratact> pixelherodev: an alternative backend also is equally (if not, more) important.
<pixelherodev> more important than?
<stratact> having one competition
<andrewrk> pixelherodev, I don't think I can promise that yet
<pixelherodev> That's fine
<pixelherodev> Was just curious
<pixelherodev> Honestly, stability before 1.0 is a bit much to ask
<stratact> I was reflecting on how D lang has multiple compiler backends, but one main backend. It gives more choice for specific optimizations of a project.
<andrewrk> what pixelherodev is working on is not a zig backend for zig
<andrewrk> it's for his own project
<companion_cube> stratact: one main frontend you mean
<stratact> andrewrk: Ah I see, I thought the backend was general purpose enough for any compiler frontend to use. companion_cube: that too, I mean the dmd backend along with the dmd frontend.
<pixelherodev> andrewrk, yeah, but it easily could be :)
darithorn has joined #zig
ltriant_ has joined #zig
ltriant has quit [Ping timeout: 252 seconds]
ltriant_ is now known as ltriant
darithorn has quit [Quit: Leaving]
<merlyndmg> is there some source file showing how C varargs functions should get imported and used in zig now? Or is that solved yet?
<merlyndmg> (now that varargs changes have been done to zig)
<Snektron> Those are a different kind of varargs
<andrewrk> merlyndmg, nothing changed with regards to C functions
<merlyndmg> so an imported C function should look like `pub extern "c" fn printf(format: [*:0]const u8, ...) c_int;` then, with the ellipsis
<merlyndmg> :thumbsup:
<fengb> `Exception: wasi proc exit` 🤔
<merlyndmg> cool thanks andrew!
merlyndmg has quit [Remote host closed the connection]
darithorn has joined #zig