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/
CommunistWolf has quit [Ping timeout: 256 seconds]
<mikdusan> andrewrk: does your quick eyeball see anything wrong with what I'm seeing in foo2() ? I've got a WIP PR for #3963 and looking good so far but this case was unexpected. if this is expected behavior then I'll just follow the ConstPtrSpecialRef to ref.pointee
<mikdusan> oh wow riscv64 qemu CI tests. neato
CommunistWolf has joined #zig
<andrewrk> yeah thanks to your work getting that static qemu tarball
<andrewrk> sorry, without closer inspection I can't think of anything
<mikdusan> I think you just like making checkmarks in zig's matrix
<mikdusan> no prob. I'll comment it to bring attention in PR review.
ur5us has quit [Ping timeout: 240 seconds]
<andrewrk> it would be good PR to have a risc-v 64 tarball with the release. people would talk about that
<mikdusan> that would be pretty slick
gazler_ has joined #zig
gazler has quit [Ping timeout: 256 seconds]
ur5us has joined #zig
marijnfs1 has quit [Quit: leaving]
daex has quit [Ping timeout: 260 seconds]
Cucumbas has joined #zig
Cucumbas has quit [Client Quit]
Cucumbas has joined #zig
Cucumbas has quit [Client Quit]
daex has joined #zig
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 250 seconds]
nephele_ has joined #zig
nephele has quit [Ping timeout: 246 seconds]
<fengb> Bah, I was too hopeful that Homebrew would just fix the polly issue
nycex has quit [Remote host closed the connection]
nycex has joined #zig
<Yardanico> how can I build a binary for another target with "zig build"? do I need to modify build.zig for that?
<fengb> Yep
<Yardanico> and what do I need to add exactly?
<Yardanico> oh, thanks
<pixelherodev> shakesoda, what?
<pixelherodev> "Twitter syndrome?"
<shakesoda> pixelherodev: reloads crap out from beneath you
<shakesoda> twitter does that kind of crap constantly. auto-refreshing things from under your mouse, refreshing pages out of existence etc
<shakesoda> it's a nightmare
<pixelherodev> ah
<pixelherodev> Don't use Twitter, so I wouldn't know :)
<fengb> Do we have a naming convention of functions returning other functions?
<andrewrk> no but maybe that's a good idea
<fengb> `makeAtomicRmw`
<mikdusan> I wonder if it would be better to organize our tests around topics, and self-contain them. behavior.zig would then explicitly @import the unit tests, and for example compile-errors would import those files and naming conv like `<topic>/` with `test.zig` for units, and `compile-error.zig` and the naming tells us what should do the import
<redj> zig cc -- src/sys/DualPipe.ec:1:10: fatal error: 'stdarg.h' file not found -- shouldn't that work?
<mikdusan> yes. whenever I see stdarg.h not found I think, hey are you on macOS? :)
<redj> I tried -target native-native-gnu and x86_64-linux-gnu but same result
<redj> mikdusan: I'm on windows 10 and linux
<redj> though I have yet to run zig on windows
diltsman has joined #zig
<diltsman> Does anyone know of an example of how to use an ArrayList with an OutStream? I have been trying to get it to work and it is driving me crazy.
<fengb> Hmm, methods on enums can't accept a pointer? :(
daex has quit [Ping timeout: 258 seconds]
daex has joined #zig
daex has quit [Ping timeout: 250 seconds]
diltsman has quit [Remote host closed the connection]
daex has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
mahmudov has quit [Ping timeout: 256 seconds]
daex_ has joined #zig
daex has quit [Ping timeout: 250 seconds]
swills has quit [Ping timeout: 256 seconds]
swills has joined #zig
dddddd has quit [Ping timeout: 256 seconds]
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
<pixelherodev> I get distracted by side projects way too easily
cole-h has quit [Ping timeout: 256 seconds]
<pixelherodev> Also, ANSI color codes are one of the greatest inventions of all time, and nobody can convince me otherwise
FireFox317 has quit [Remote host closed the connection]
FireFox317 has joined #zig
_Vi has joined #zig
<pixelherodev> I just remembered zasm exists... please tell me it's not already able to produce binaries in memory
<pixelherodev> Ah phew
_Vi has quit [Ping timeout: 252 seconds]
ur5us has quit [Ping timeout: 252 seconds]
ur5us has joined #zig
marijnfs_ has joined #zig
daex has joined #zig
daex_ has quit [Ping timeout: 256 seconds]
marmotini_ has joined #zig
ur5us has quit [Ping timeout: 256 seconds]
x0r19x91 has joined #zig
<x0r19x91> Hi
wootehfoot has joined #zig
<ifreund> yo
<x0r19x91> should we keep a discord on this ?
<ifreund> i think there already is a discord
<x0r19x91> can you give the link please
mahmudov has joined #zig
<ifreund> i don't know it, check the wesbite and github
<ifreund> *website
dermetfan has joined #zig
dermetfan has quit [Client Quit]
dddddd has joined #zig
mahmudov has quit [Ping timeout: 256 seconds]
gazler has joined #zig
gazler_ has quit [Ping timeout: 265 seconds]
marmotini_ has quit [Remote host closed the connection]
marijnfs1 has joined #zig
mahmudov has joined #zig
marmotini_ has joined #zig
marijnfs_ has quit [Ping timeout: 256 seconds]
marmotini_ has quit [Ping timeout: 258 seconds]
frett27 has joined #zig
josch557 has joined #zig
josch557 has quit [Remote host closed the connection]
josch557 has joined #zig
marijnfs_ has joined #zig
_Vi has joined #zig
marijnfs1 has quit [Ping timeout: 264 seconds]
marijnfs1 has joined #zig
marijnfs_ has quit [Ping timeout: 265 seconds]
mahmudov has quit [Remote host closed the connection]
waleee-cl has joined #zig
mahmudov has joined #zig
mahmudov has quit [Remote host closed the connection]
rzezeski has quit [Quit: Connection closed for inactivity]
yurip has joined #zig
mokafolio has quit [Quit: Bye Bye!]
<yurip> Hi everyone, I'm experimenting with translating an existing C base to zig. I'm starting with the build system. An old blog post on the subject uses addCExecutable, but that seems to be gone. What's the recommended way now?
<ifreund> yurip: should be addCSourceFile() I think
<yurip> great, thanks! Hadn't seen that docs section yet, either
<yurip> I'll give it a read
<ifreund> no problem, and good luck!
<fengb> I'm triggering some compile errors in unused branches. Are builtin functions less lazy?
frett27_ has joined #zig
frett27 has quit [Ping timeout: 264 seconds]
mokafolio has joined #zig
mahmudov has joined #zig
x0r19x91 has quit [Quit: Connection closed for inactivity]
r4pr0n has joined #zig
dimenus has joined #zig
mahmudov has quit [Ping timeout: 260 seconds]
r4pr0n has quit [Quit: r4pr0n]
TheLemonMan has joined #zig
<ikskuh> is it possible to change the trapping behaviour of the ubsan?
r4pr0n has joined #zig
<FireFox317> fengb, are you working on compiler-rt atomic? Maybe we can combine forces, becasue i'm working on it too
<fengb> Oh
<TheLemonMan> lel, I was about to submit a PR for that
<FireFox317> lol
<fengb> Ha
<fengb> I'll just let the pros take over
<FireFox317> this is my progress: https://pastebin.com/RuJiz0TG
<FireFox317> fengb, ah you used some neat tricks
<fengb> I figured we can prove comptime is much nicer than macros :P
<ikskuh> fengb: you can even calculate the names of the exported functions with comptime ;)
<FireFox317> ikskuh, was thinking about that too, only the names of exported functions right? not of zig functions
<ikskuh> you can probably even generate the functions itself by using a generic struct for that
<fengb> That's what I'm doing :)
<fengb> Didn't get to exporting yet
<ikskuh> pub fn __atomic_load_2(src: *u16, model: c_int) callconv(.C) u16 {
<ikskuh> return atomic_load(u16, src, model);
<ikskuh> }
<ikskuh> this can be 100% comptime generated
<fengb> Something like `@export(makeAtomicLoad(u32), .{ .name = "__atomic_load_2" })`
<ikskuh> yep
<ikskuh> but __atomic_load_4 ;)
<ikskuh> and: you can calculate that name
<ikskuh> and do just an inline for([_]type { u8, 16, u32, u64, u128 }) |T| { }
<FireFox317> yeah i guess TheLemonMan is also/already doing that
<TheLemonMan> yeah, no way I'm typing all that shit by hand
<ikskuh> :D
<fengb> I guessed wrong! lol
mahmudov has joined #zig
<fengb> I'd probably just manually write the exports though. It's not too many more lines and copy paste is easier on my brain
<TheLemonMan> I'm hitting so many comptime bugs
<andrewrk> thanks for the tip TheLemonMan, was able to resolve the riscv thing
<fengb> Sometimes I want to tell Zig to stop helping. It can get frustrating trying to map to C semantics >_>
<andrewrk> self-hosted needs a much more deliberate design plan for how to do comptime. none of this experimentation based design that stage1 evolved from
<FireFox317> andrewrk, nice! so that means we get a ricv binary for 0.6.0 ? <3
<andrewrk> no so fast, still need to test it in the bootstrap repo :)
<TheLemonMan> andrewrk, cool, the whole ABI thing gets unwieldy pretty quick
<TheLemonMan> you have the ABI in the triple, the float ABI, the machine ABI...
<andrewrk> yeah. std.Target.Abi might need to get slightly more complicated, similar to how the cpu and os have recently
* ikskuh is confused about a trigger of ud2
<ikskuh> what could provoke undefined behaviour in a function pointer call that ud2 is executed after the return of that function pointer?
<TheLemonMan> noreturn function?
<ikskuh> nope
<ikskuh> void (*func)(void *);
<TheLemonMan> if the function jumps to ud2 right after the `bx lr` you may have some other thing going on
<ikskuh> x86_64, but yes, it does
<ikskuh> kinda?
<ikskuh> gdb tells me that the line of code is an assert
<ikskuh> but code after that assert got executed
<ikskuh> could it be a stack overflow?
<TheLemonMan> does the control flow resume after the branch to the function pointer?
<TheLemonMan> if it's returning to god-knows-where then you have a stack overflow
<TheLemonMan> or calling convention mismatch
<FireFox317> We closed almost twice as many issues as the previous release cycle :O 516 now comparing to 260 of the previous one
<FireFox317> s/we/andrewrk/
<ikskuh> nice!
<andrewrk> nah it's we for sure
<andrewrk> I am but one man, capable of a fixed amount of work. the contributions have skyrocketed this cycle
<andrewrk> special thanks to TheLemonMan for solving so many non-x86 issues
<ikskuh> TheLemonMan: i think it's a SO
<ikskuh> or some stupid programming mistake of mine
<andrewrk> also for yelling at me hard enough to learn how to use QEMU :)
<BaroqueLarouche> TheLemonMan is a MVP
<TheLemonMan> I'm just doing my part to accelerate the slow death of x86
<ikskuh> TheLemonMan: Slap me. Slap me hard.
<BaroqueLarouche> hahahaha
<andrewrk> kinky
<ikskuh> thou shalt not cast a function pointer
<ikskuh> i really wonder how that resolved into having a ud2 instruction in a completly other function
<ikskuh> but it looks like it worked correctly
<ikskuh> and did what it should
<TheLemonMan> haha nice
<ikskuh> well, it definitly sanitized some undefined behaviour
<ikskuh> because
<ikskuh> void foo(void*) and void foo(CAMERA*) are definitly not castable :D
<TheLemonMan> there's a lot of stuff that runs just fine due to sheer luck
<andrewrk> or misfortune, from a different perspective
<TheLemonMan> think of the aarch64 issue, we've been running with a faulty builtin for who knows how much time
<ikskuh> yeah, having a UBSan active all the time is great :)
<TheLemonMan> and everything worked just fine!
<andrewrk> yeah that was pretty crazy
<andrewrk> FireFox317, this riscv64 llvm build looks like it might succeed :D
<fengb> No errors means working fine right?
<TheLemonMan> andrewrk, `obj[start..end:T]` is meant to produce a slice with length (end-start+1) and an assertion that obj[end] == T, right?
<andrewrk> length should be end-start, no +1. otherwise yes
<andrewrk> note that obj[end..end] is allowed
<TheLemonMan> oh sure, I meant that the slicing operation should also assert that there's space for one more item in the backing object
<andrewrk> ahh I see
<TheLemonMan> #4857 helped me to find some potential oob sentinels in the stdlib
<fengb> https://github.com/samuela/rustybox we should rewrite this in Zig too
<ikskuh> hrhr
<ifreund> can't way till i can boot up zigux
<ifreund> or zigos
<BaroqueLarouche> yeah, we need a equivalent of Serenity OS written in Zig
<ifreund> i think the true victory would be gradually rewriting linux in zig, but that'll take 100 years
<fengb> V already has an OS going
<fengb> Oh... apparently it's dead already? I'm not surprised >_>
<andrewrk> I'd be more interested in an OS that is specifically designed for low latency rather than throughput, with a really nice kernel audio API
<andrewrk> an OS that you could rely on for live performances
<andrewrk> linux is unfortunately deeply flawed for this use case
marmotini_ has joined #zig
marmotini_ has quit [Remote host closed the connection]
<ifreund> i've been using MuQss for a while, been working quite well so far
<TheLemonMan> starting with kernel modules written in Zig is a better plan IMO
<andrewrk> damn, clang crashed trying to build itself for riscv
<ifreund> but yeah that doesn't go as far as building an os from the ground up for low latency could
<TheLemonMan> classic clang! *laugh track plays in background*
<mikdusan> andrewrk: unable to create branch something-or-something ?
<andrewrk> yeah: "Unable to insert indirect branch"
<andrewrk> it looks like a workaround would be disabling the NVPTX backend, but I am loathe to do that
r4pr0n has quit [Quit: r4pr0n]
<TheLemonMan> hmm, if I have a `defer <foo>` and a `return <x>` is <foo> executed before <x> ?
decentpenguin has joined #zig
<andrewrk> <x> is evaluated, then <foo>
marmotini_ has joined #zig
marmotini_ has quit [Remote host closed the connection]
<TheLemonMan> cool, thanks
r4pr0n has joined #zig
marmotini_ has joined #zig
marmotini_ has quit [Remote host closed the connection]
r4pr0n has quit [Quit: r4pr0n]
r4pr0n has joined #zig
jmiven has quit [Quit: reboot]
meowray has quit [*.net *.split]
\u has joined #zig
jmiven has joined #zig
cole-h has joined #zig
\u is now known as meowray
jmiven has quit [Quit: bye]
jmiven has joined #zig
jmiven has quit [Client Quit]
jmiven has joined #zig
frmdstryr has joined #zig
marijnfs_ has joined #zig
marijnfs1 has quit [Ping timeout: 256 seconds]
mahmudov has quit [Ping timeout: 258 seconds]
rzezeski has joined #zig
<TheLemonMan> andrewrk, #4924 should unblock the arm/mipsel bootstrap
<andrewrk> exciting!
<TheLemonMan> I've briefly tested all the builtins with some C++11 atomics, ymmv ofc
frmdstryr has quit [Remote host closed the connection]
<fengb> Oh you ended up ignoring the non-locked optimizations? That simplifies quite a bit
<TheLemonMan> the sized builtins are implemented using the llvm builtins, that's what clang does too
<TheLemonMan> pretty much every architecture ensures the load/store are atomic up to the pointer size
Akuli has joined #zig
<fengb> The semantics don't match Zig's `@cmpxchgStrong` so I spent forever trying to remap it
<fengb> By forever, I mean 2 hours >_>
marijnfs_ has quit [Ping timeout: 265 seconds]
<TheLemonMan> yeah getting trough that maze of macros/builtins takes some time
marijnfs_ has joined #zig
<TheLemonMan> IMO the lock-free optimizations in the runtime-known case are not that important, those builtins aren't really meant for hot paths
mahmudov has joined #zig
<fengb> Ah okay, those were the hardest parts to get right because Zig was pretty anal about the comptime semantics
<fengb> And remapping the runtime C values was driving me crazy
<TheLemonMan> gcc specification is kind enough to let you use a strong memory order everywhere
<TheLemonMan> it greatly simplifies everything heh
<fengb> I suppose it's not wrong, just not necessarily as optimized
<TheLemonMan> yeah
<andrewrk> here's where mipsel-linux-musl is landing with that patch applied: https://github.com/ziglang/bootstrap/issues/12#issuecomment-608580489
marmotini_ has joined #zig
<FireFox317> TheLemonMan, you saw tests were failing?
josch557 has quit [Ping timeout: 252 seconds]
<andrewrk> it's the linkage thing, the way compiler-rt tests run is the linkage gets set to internal for tests
<andrewrk> so unfortunately `export` keyword can't be used, it has to be `@export` with the linkage param
<FireFox317> andrewrk, did you try the patch on `armv6kz-linux-musleabi`? if you don't have a lot of time i can try that one
<andrewrk> yeah running it now
marmotini_ has quit [Ping timeout: 260 seconds]
<TheLemonMan> yeah saw that, I forgot to remove the export
<FireFox317> Nice PR tho! It's nice to see how someone implemented if you also tried it xd
<TheLemonMan> too bad it was not enough to tame the MIPS god!
<andrewrk> it's possible that I missed a flag that was supposed to be added on mips when building libc++.a
<TheLemonMan> have you tried building that as -fPIC
<andrewrk> look like -fPIC is on for all libc++ and libc++abi files
<andrewrk> it's not reproducible with c++ hello world
<andrewrk> maybe something to do with linking .so files
<andrewrk> too bad, because these .so files aren't needed for bootstrapping purposes. but llvm provides no cmake flags to disable them
<andrewrk> 69%
r4pr0n has quit [Quit: r4pr0n]
<andrewrk> using TheLemonMan's compiler_rt patch I have an armv6kz-linux-musleabi build :)
<fengb> 🤘
<TheLemonMan> now you should bootstrap zig using that copy of zig
<fengb> I... didn’t know there was an emoji for that
<companion_cube> 🖖
<fengb> 🦾
<pixelherodev> Someone send me a screenshot? I'm stuck with a lame font over here :)
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
frmdstryr has joined #zig
<ifreund> isn't this such a beautiful function :D https://paste.rs/TUU
<andrewrk> ifreund, it's pretty. IMO zig fmt should put the curly brace on the next line, after .current_tags != 0)
<ifreund> yeah I agree
<fengb> if within an if?
<ifreund> it actually just got worse since I forgot something https://paste.rs/NGc
<ifreund> now we're 3 deep
<ifreund> whoops, screwed up the paste https://paste.rs/vtL
<andrewrk> regarding mips, at least the 64 bit and 32 bit ones are hitting the same problem
_Vi has quit [Ping timeout: 252 seconds]
<shakesoda> ifreund: i hate it lol
<ifreund> i should probably rewrite this, but that can wait for later
r4pr0n has joined #zig
wootehfoot has quit [Ping timeout: 256 seconds]
dimenus has quit [Remote host closed the connection]
FireFox317 has quit [Ping timeout: 240 seconds]
FireFox317 has joined #zig
tributarian has joined #zig
<pixelherodev> Oh my god
<pixelherodev> What is that
<pixelherodev> Those nested functions...
marijnfs_ has quit [Ping timeout: 265 seconds]
marijnfs_ has joined #zig
r4pr0n has quit [Quit: r4pr0n]
frmdstryr has quit [Remote host closed the connection]
<yurip> what's the best way to add a bunch of C source files with the same args to a build? It looks like https://tiehu.is/blog/zig1.html this blog from the front website is pretty out of date
<ikskuh> yurip: right from my current wip port to zig build:
<yurip> ikskuh: thank you, that's just what I need!
<ikskuh> you're welcome
<ikskuh> btw, i ported zlib and physfs to a zig-build project
<yurip> awesome!
<yurip> the same one?
frmdstryr has joined #zig
<ikskuh> yeah those libs are in the same repo
<ikskuh> working on ODE right now :D
<yurip> nice
<yurip> is it hard?
<ikskuh> nah, ODE is just … much
<ikskuh> also i don't want to support a full featured build
<ikskuh> only with those features i require
<andrewrk> I wonder how BaroqueLarouche's inflate implementation is going
<ikskuh> heh. goodbye zlib?
<yurip> zig support for DEFLATE would be great
<BaroqueLarouche> andrewrk: inflate is working
<ikskuh> neat!
<BaroqueLarouche> (only decompression for now)
<pmwhite> is zlib the zig standard library?
<yurip> i'm considering using zig for a fairly major embedded project over the next year or so (student stuff), and having data compression might be important
<BaroqueLarouche> it will once I wrote a deflate (compression) implementation
<yurip> looking forward to compression!
<yurip> BaroqueLarouche: awesome, looking forward to it
<BaroqueLarouche> I want to finish reading PNG support first
<BaroqueLarouche> doing interlaced support this weekend
Akuli has quit [Quit: Leaving]
_Vi has joined #zig
FireFox317 has quit [Ping timeout: 265 seconds]
<ikskuh> oh man
<ikskuh> building ODE is hell
<ikskuh> :D
<ikskuh> there are build-files for autotools,cmake AND premake
<mikdusan> how does one find the default linker script (internal?) used by lld
r4pr0n has joined #zig
r4pr0n has quit [Client Quit]
r4pr0n has joined #zig
r4pr0n has quit [Quit: r4pr0n]
r4pr0n has joined #zig
<pixelherodev> That's terrifying
<ikskuh> there's some action
<pixelherodev> Someone pointed this out elsewhere, but that's a *lot* of names for a "research project"
<pixelherodev> At a glance, that's ~15 unique names on the first page
<pixelherodev> Dozens of unique contributors within the past two hours alone
<mikdusan> they're AI
<ikskuh> what the heck are they building?!
<pixelherodev> ...
<pixelherodev> This isn't a research project.
<pmwhite> New mobile OS, right?
<ikskuh> probably
<pixelherodev> Question is
<pixelherodev> Is that a good thing?
<pixelherodev> It's obvious why they're doing it
<pixelherodev> They want more control
<ikskuh> i'll stay with my trusty linux :D
<pixelherodev> I mean, I like the ideas
<fengb> I'm not sure they need more control on Android
<pixelherodev> Tighter integration is a bad thing in terms of maintainability, but could have unique performance / feature advantages
<pixelherodev> and maintainability isn't a problem if Google owns it
<fengb> But it's a chance to fix some of the design flaws
<shakesoda> i wouldn't say tighter integration is automatically a bad thing for maintainability
<fengb> I suppose baking more of the Google stack directly into the OS would help them a bit
<shakesoda> since generic solutions to things are usually more complex
<shakesoda> (often substantially so)
<mikdusan> I predict zig's std will support serenity before fuchsia
<THFKA4> hah i'm playing with Fuchsia on my desk right now
<pixelherodev> `<shakesoda> i wouldn't say tighter integration is automatically a bad thing for maintainability` true
<mikdusan> how fast does can it fork-bomb (launchpad) ?
<pixelherodev> Serenity?
<pixelherodev> On a different note
<THFKA4> the technical choices they made for the kernel are actually pretty great
<fengb> Oh it's actually working?
<pixelherodev> Anyone interested in working on a joint project to write a kernel in Zig?
<THFKA4> and they emulate a big part of POSIX, so porting Zig might not be that hard
<ikskuh> pixelherodev: what kind of kernel do you want to make? :D
<pixelherodev> I've done some bits and pieces for a project, and I know a few others have as well, but I want to actually make a usable system (even if not necessarily "the future!!!")
<fengb> Oh Serenity
<fengb> Oops I hit the enter key instead of delete >_>
<pixelherodev> Insert joke about how so did they? :P
<fengb> Sometimes I wish there's an undo button in IRC. And real life
<pixelherodev> The initial idea is a x64 kernel with cooperative multithreading instead of the usual preemptive (though with a preemptible bit for each thread table entry for reasons I'll get to shortly)
<pixelherodev> (sorry; had to take care of something)
<pmwhite> fengb: I mean, if you use matrix to edit your message, it will work for me :)
<pixelherodev> I don't have much concrete plans; the idea is to start by merging together various existing pieces (like APCICA, Linux kernel modules for graphics) with the goal of ASAP usability, then phasing them out and replacing with from-scratch ones
<pixelherodev> What I do have in the plans is to not support ELF executables.
<mikdusan> what I'd like to see are 2-sided (made up that name) page tables for virtual address space; one side is for stack, and other side is everything else. so thread can have it's own private stack, and thread-locals basically become globals. how much heavier does that make a thread? hopefully not much.
<pixelherodev> Instead, I want to have IR frontends (QBE, LLVM, etc)
<pixelherodev> Which is where my compiler project comes in
<pixelherodev> Every executable will be JITed into the native architecture on demand
<pixelherodev> This allows for `-march=native` by default, and security improvements
<fengb> Just use wasm as the "native" code
<pixelherodev> WASM frontend is okay too, but I also want to support LLVM + QBE + etc
<pixelherodev> That would allow for using, say, `cproc` as the C compiler, not just those that already support WASM
<pixelherodev> WASM + LLVM + QBE is a good set to start with
<ikskuh> luajit *grin*
<THFKA4> Fuchsia handles "runners" kind of like that. It's not tied to ELF.
<pixelherodev> The thing to note is that it's intended to use an in-memory tree for the AST
WilhelmVonWeiner has quit [Ping timeout: 240 seconds]
<THFKA4> it calls units of executable software "components" and you can implement your runtime in those
<THFKA4> then use them to interpret scripts, or whatever else you want
<pixelherodev> Still, I'm completely open to suggestions and improvements from others; I don't claim to have all the answers, and I'd rather work with others on a changed design than on my own with the current one
<ikskuh> what i found crazy was what microsoft did with their "windows subsystem for linux"
<ikskuh> which is like.... "ah, btw! our kernel now supports the linux syscall interface!"
<THFKA4> for v1 they had a shim layer to translate syscalls, right?
<THFKA4> now they embed the entire linux kernel or something
<ikskuh> nah
<ikskuh> the first thing: yes
<ikskuh> v1 was actually a kernel extension that allows to switch out syscalls
<ikskuh> v2 is just "we're running a VM"
<THFKA4> first the embrace, then the extend
<pixelherodev> pft
<pixelherodev> They can try
<ikskuh> someone wants to scream? https://bpaste.net/YC3Q
<ikskuh> the command called by zig build for ODE :D
<pixelherodev> What the...
<pixelherodev> Why not build files individually and link?
<ikskuh> because build.zig is convenient
<ikskuh> 120 source files though
<ikskuh> i have "executed" a 1000 line cmake file by hand now :D
<ikskuh> i probably fucked up anyways
<pixelherodev> Do we need a CMake -> build.zig translator ? :P
<ikskuh> would be helpful
<ikskuh> wow
<ikskuh> 70/120 files build
<ikskuh> done.
<ikskuh> \o/
ur5us has joined #zig
<pmwhite> The bootstrap repo could remove the cmake dependency if cmake were included in the repo, right?
yurip has quit [Quit: Leaving]
<THFKA4> so what's the best UI framework to use with Zig right now? GTK because C?
magejohn has joined #zig
<ikskuh> probably mine, and it's crap ATM *laughing*
<companion_cube> why not try imgui?
<THFKA4> that's immediate mode, right?
<ikskuh> yeah some people are quite successful with imgui
<ikskuh> ep
<THFKA4> b..because that lol
ur5us has quit [Quit: Leaving]
<companion_cube> THFKA4: yep, looks super simple to use
<THFKA4> i'm sure it's great for games
<THFKA4> ikskuh: got a link to yours?
<ikskuh> nothing quite useful right now
<ikskuh> here's an example
<ikskuh> i'm still missing textboxes though
<ikskuh> :D
<ikskuh> also it's not possible to "self-host" the UI right now
<ikskuh> meaning that you cannot have a single application that does both rendering/input and application logic
<THFKA4> hah cool
<ikskuh> will continue working on it tomorrow :)
<fengb> What's this C++
<fengb> More mq32. You'll never die!
<ikskuh> yeah, it's hard to change a nick :D
<ikskuh> and some stuff is just not possible (like breaking kinks)
<ikskuh> or getting 2-letter domain names
<ikskuh> Victory!
<ikskuh> I slayed that vicious CMakeLists.txt
<BaroqueLarouche> Level up!
ForLoveOfCats has joined #zig
<ikskuh> yep!
<ikskuh> now for some packing adventures :D
magejohn has quit [Quit: Leaving]
* CommunistWolf strokes his 2ld
<ikskuh> i need to automate the resource zip generation
<pixelherodev> ... did you mean *links*?
magejohn has joined #zig
dddddd has quit [Ping timeout: 256 seconds]
<ikskuh> BaroqueLarouche: my achievement of the day: https://github.com/TeamRetro/acknext/blob/master/README.md#build-steps
<BaroqueLarouche> :D
<ikskuh> removed a lot of dynamic deps thanks to zig build
<ikskuh> now most of the engine builds from source instead of using prebuilt libraries
<fengb> ... how many projects are you working on?
<ikskuh> yes
<magejohn> nice :D
<BaroqueLarouche> ikskuh: best response
<ikskuh> fengb: the part of this "project" right now is make that 3 year old project of mine be usable at least
<ikskuh> for other people
<ikskuh> because it's actually quite awesome
<ikskuh> (look at the feature list above)
<ikskuh> and now has only SDL2 and SDL2_mixer as prebuilt requirements
<ikskuh> i'll try to create a crossplatform (windows+linux) build and if that works, i'm happy and let it be
<ikskuh> but then i know that i can probably port every project of mine slowly to zig :)
<magejohn> love hearing about this sort of stuff
<magejohn> joining irc makes me feel a half/half inadequate and like I could do anything
<ikskuh> oka
<ikskuh> windows build is gonna be … different
<ikskuh> error: expected
<ikskuh> identifier or '{'
<ikskuh> typedef enum ERROR {
<ikskuh> #define ERROR 0
<ikskuh> thanks windows :D
<BaroqueLarouche> thanks C!
<ikskuh> yeah, thanks preprocessor!
<BaroqueLarouche> but yeah windows.h is a pain for that
<ikskuh> oh yeah
<ikskuh> i once had a function "GetUser()"
<ikskuh> which is … a define to GetUserW or GetUserH
<ikskuh> depending if UNICODE is defined or not :D
<BaroqueLarouche> GetObject() for me
<BaroqueLarouche> Had to use GetObjectPtr() instead to avoid conflict
<ikskuh> i'm the hardcore dude :D
<ikskuh> i just undefine it at the top of my header
joey152 has joined #zig
<BaroqueLarouche> haha
<redj> https://github.com/ziglang/zig/pull/4928 -- I hope this PR is ok, kind of asking for review really... and maybe some hints on my next issue...
daex has quit [Quit: /me 's znc kicks the bucket]
daex has joined #zig
<daurnimator> What do pd1/pd2/etc stand for?
<squeek502> parameter dash 1, parameter dash 2, parameter slash 1 presumably, they correspond to `-`, `--`, `/` being allowed prefixes for that option
<squeek502> that file is generated by update_clang_options.zig
<daurnimator> pixelherodev: a slice from LinearFifo can be represented with maximum 2 iovs: if you're reading from a pipe, you can use e.g. readv to fill it up across the wrap-around.
<pixelherodev> Ah
<pixelherodev> That's useless to me right now, but I'll note it down for later :)
r4pr0n has quit [Quit: r4pr0n]
decentpenguin has quit [Quit: decentpenguin]
<daurnimator> Its actually something that annoys me about the current stream interface
<daurnimator> squeek502: ah ha. thanks