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/
<pixelherodev> I think the biggest section is astgen right now
<pixelherodev> That's what needs the most work, rather
<pixelherodev> astgen is basically what "understands" Zig code (in the form of the AST), and translates to the IR
<pixelherodev> so it goes from e.g. `if (a) {b }` to `condbr(a, { b })` - which codegen sees and turns into e.g. z80's `jz`
<pixelherodev> Relatedly, a lot of work is needed on codegen
<pixelherodev> For x64 work - which is most crucial, since most zig development occurs on x64 - codegen isn't *complete*, but there's enough of it to support a good chunk of astgen without needing codegen work
<qeeg_> yeah i'm on x64 :p
<pixelherodev> I'm not sure anyone would outright *reject* optimization work, but it would have to come with the understanding that changes in the compiler might require constant work to keep it up to date - which nobody wants, so nobody really cares to work on it yet
<pixelherodev> We also, for the record, have *no* intent of *ever* matching GCC / LLVM level of optimizations
zippoh has joined #zig
<qeeg_> uh why not? o.o
<pixelherodev> Because, to put it frankly, their optimizations are ludicrously complex and not worth competing with
<pixelherodev> We don't *need* to match their performance
<pixelherodev> Basic optimizations will get us a very large percentage of the way there
<pixelherodev> If maximum performance is the goal, LLVM (or possibly GCC) will be needde
<pixelherodev> needed*
<qeeg_> well, is there any way i could learn about basic optimization stuff for compilers?
<pixelherodev> Wikipedia :P
<pixelherodev> Start on a page like https://en.wikipedia.org/wiki/Common_subexpression_elimination and there's plenty of links to follow :)
<pixelherodev> They should also have decent references
<qeeg_> i learn better by actually doing and reading simple code that does what i want to do
<qeeg_> *actually coding
<pixelherodev> I have a couple of papers I can send you on the topic
<pixelherodev> That I downloaded from random internet places lol
<qeeg_> papers would be even worse than wikipedia!
<qeeg_> i need like, actual examples
<pixelherodev> Nah, they're usually straightforward
<pixelherodev> I can link you to my implementation of some bits, but they're probably worse ;)
<qeeg_> please just humor me
<pixelherodev> I have e.g. register allocation in a separate project
<pixelherodev> (Register allocation is basically what assigns variables in the language to physical registers)
<pixelherodev> but my implementation isn't the cleanest, and I've been meaning to rewrite it
<companion_cube> CSE? start with inlining! :p
<pixelherodev> I don't know of any projects that do a good job implementing it in a simple sane way to make it easy for readers
<pixelherodev> That'll be my goal for the eventual Thor 0.2 release (Thor is my JIT / compiler backbone project)
<pixelherodev> GCC and Clang are both absolutely *horrid*
<pixelherodev> At least, in terms of readability
<qeeg_> ooh, can i see the code for thor?
<qeeg_> what language is it in?
<pixelherodev> Yeah, but it comes with a content warning
<qeeg_> oh?
<pixelherodev> It's in Zig, but not very good zig :P
<qeeg_> lol fair enough :p
<pixelherodev> It's linked under `sources`
<pixelherodev> I think the best optimizations Zig can develop internally would be architectural ones
<pixelherodev> Tweaking codegen based on microarchitecture, effectively
<pixelherodev> `-march=native` on GCC / Clang does this
<pixelherodev> Basically, some instructions have different performance characteristics on different *micro*architectures
<pixelherodev> e.g. Ryzen vs Skylake vs Bulldozer vs Kaby Lake etc
<pixelherodev> GCC takes it a step too far IIRC, but the general idea is sound
<pixelherodev> The general optimizations I'd love to see in Zig are microarchitectural, inlining, dead code elimination (DCE), common subexpression elimination (CSE), and constant folding
<pixelherodev> That alone should at least make for good debug builds produced rapidly
<pixelherodev> Anywho, I need to get back to work
<pixelherodev> qeeg_: you can also look at https://github.com/limnarch-extra/seadragon if it helps
<qeeg_> uh, that link is dead
<pixelherodev> you were asking about what to do with an AST, right?
<pixelherodev> Ah wait, it's private :P
<pixelherodev> Let me fix that
<qeeg_> ah
<pixelherodev> ok
<qeeg_> also how do liveness analysis
<pixelherodev> That takes an AST and produces machine code for a RISC architecture
<pixelherodev> There's no IR, so it's a bit simpler than Zig's
<pixelherodev> It's also only 115 lines, so it should hopefully be easier to grok
<qeeg_> well, i ask because i want to improve the speed of an x86 emulator's dynamic recompiler.
<pixelherodev> I'd say "feel free to ask questions," but I realllly need to get to work now bye
<pixelherodev> Oohh
<pixelherodev> what emulator??
<pixelherodev> :D
<qeeg_> 86box
<pixelherodev> Ahh
<qeeg_> it's written in like, c99 lol
<pixelherodev> http://86box.net/ ?
<pixelherodev> Yeah, C99 is great :D
<pixelherodev> Oof that looks complex
<pixelherodev> Optimizing a dynarec is much easier when there's few interacting parts
<ifreund> they even seem to have a fairly normal coding style
<pixelherodev> With one minor problem
<pixelherodev> That linked list definition is gross
ur5us has quit [Ping timeout: 244 seconds]
<pixelherodev> and.. they seem to use a linked list where one really isn't needed...
<pixelherodev> I think a dynamic array would've worked better in the random file I just opened and have no context for
<pixelherodev> :P
<ifreund> heh
<pixelherodev> anywho, I'm going to get to work for realsies, I don't think "I was playing with an emulator's source" is a valid excuse for, well, anything
<ifreund> both data structures kinda suck in C due to lack of typesafety or overabundance of macros
earnestly has quit [Ping timeout: 240 seconds]
<qeeg_> ifreund, yeah, it's just that weirdly, you start to get diminishing returns with the emulator's speed, with faster host cpus
<qeeg_> which doesn't make much sense to me?
<qeeg_> like, even though the emulator doesn't even use the gpu much at all (literally just to blit a framebuffer to the screen), faster cpus don't really do much for it
gazler has quit [Remote host closed the connection]
gazler has joined #zig
ur5us has joined #zig
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 265 seconds]
knebulae has quit [Read error: Connection reset by peer]
<pixelherodev> qeeg_: is it threaded?
<qeeg_> partially
<pixelherodev> Single thread performance hasn't been increasing all that quickly for the last... decade or so?
<pixelherodev> At least
<pixelherodev> my eight year old CPU has ~70% the single-thread perf of a modern Ryzen 7 IIRC
<qeeg_> the cpu emulation happens on one thread, but a lot of other stuff is offloaded to other threads
<pixelherodev> If CPU emulation is the bottleneck, that might explain it
<pixelherodev> It's also possible that there's a lot of threading contention
reductum has joined #zig
<pixelherodev> qeeg_: if you have any questions, feel free to ping me here
<qeeg_> aight, thanks
<pixelherodev> I might not always be able to respond instantly, but I have a good deal of experience with the Zig stage2 compiler and am glad to help out :)
drawkula has joined #zig
yeti has quit [Ping timeout: 260 seconds]
ifreund has quit [Ping timeout: 246 seconds]
ifreund has joined #zig
reductum has quit [Quit: WeeChat 2.9]
gazler has quit [Remote host closed the connection]
gazler has joined #zig
jjsullivan__ has quit [Ping timeout: 260 seconds]
gazler has quit [Ping timeout: 240 seconds]
gazler has joined #zig
_whitelogger has joined #zig
ur5us has quit [Ping timeout: 244 seconds]
andrewrk has quit [Quit: ZNC - http://znc.in]
cr1901_modern has joined #zig
andrewrk has joined #zig
<nikki93> https://imgur.com/a/KiYABTz that wasm/webgl quick reload setup but just bound shaders buffers and attributes :o
drawkula is now known as yeti
waleee-cl has quit [Quit: Connection closed for inactivity]
tomku has quit [Ping timeout: 244 seconds]
cole-h has quit [Quit: Goodbye]
tomku has joined #zig
<ikskuh> good morning european ziguanas!
retropikzel has joined #zig
<shachaf> nikki93: Oh man, I bet my program https://github.com/shachaf/mustardwatch would be good for that.
daurnimator has quit [*.net *.split]
wjlroe has quit [*.net *.split]
Miaourt has quit [*.net *.split]
yrashk has quit [*.net *.split]
JimRM has quit [*.net *.split]
dch has quit [*.net *.split]
guan has quit [*.net *.split]
karrick has quit [*.net *.split]
nycex has quit [Remote host closed the connection]
nycex has joined #zig
decentpenguin has quit [Read error: Connection reset by peer]
<ikskuh> oh man
<ikskuh> #6250 will have some trail until zig is back to full usability again
decentpenguin has joined #zig
earnestly has joined #zig
<pixelherodev> yep
<pixelherodev> Most useless benchmark win of all time: I improved a z80 emulator's performance from ~180MHz to ~550MHz
<pixelherodev> For a stream of nops and absolutely nothing else
<pixelherodev> ~575, actually :P
<ikskuh> lol
<pixelherodev> Slightly less useless number: at 80MHz, power consumption goes from ~7.7W to ~6.4W
<pixelherodev> I can burn slightly less power doing nothing! Woot!
<pixelherodev> ooh - and in a release build, it goes from 230 to ~720
<pixelherodev> ...holy crap I take that back
<pixelherodev> It hits 0.96GHz
<pixelherodev> of nops lol
<pixelherodev> I wonder if I can get a nopstream over 1GHz...
<pixelherodev> For context, the host CPU is 2.0 GHz
<pixelherodev> It's peaking at over 48% of the host's speed, and sustaining over 47%
<ikskuh> huh
<ikskuh> compilation fails mit "FileNotFound"
<ikskuh> thanks…
<ikskuh> how can i debug this?
<pixelherodev> It doesn't give an error trace?
<ikskuh> nope
<pixelherodev> weird
<ikskuh> nah
<ikskuh> andrew catches them and just prints FileNotFound
<ikskuh> which isn't helpful at all
<pixelherodev> lol
<pixelherodev> ouch
<pixelherodev> Whoa, 0.973GHz peak~
<pixelherodev> Why does this meaningless number fill me with joy?
<ikskuh> haha
<pixelherodev> It's meaningless, and I *know* it is
<ikskuh> stage2.mainArgs(gpa, arena, args) catch |err| fatal("{}", .{@errorName(err)});
<ikskuh> i know that feel
<pixelherodev> and I fully understand why it is
<pixelherodev> Yet still...
<pixelherodev> 49% of host is the new record :P
<pixelherodev> Wait why am I burning CPU just in the hopes that microarchitectural BS gives me a tiny boost??
* pixelherodev kills it
<pixelherodev> Obviously I should profile it and *deliberately* get it higer
<pixelherodev> higher*
<pixelherodev> ooh microoptimization idea
<ikskuh> going to do a PR to print error return trace here…
<pixelherodev> Smart
<ikskuh> heh
<ikskuh> 6250 is going to make me do a lot more PRs now
<pixelherodev> ditto
<pixelherodev> also, drats
<pixelherodev> perf went down to 708MHz even though I didn't touch the code lol
<pixelherodev> Downsides of relying on nondeterministic behavior
pangey has quit [Ping timeout: 272 seconds]
<ikskuh> huh
<ikskuh> caching breaks
<pixelherodev> Oof
<ikskuh> yep
<pixelherodev> okay, now for another fun test
<pixelherodev> What's the perf like on a *real* CPU?
<pixelherodev> Oof.
<pixelherodev> Not *bad*, but not nearly as much of an improvement yet
ur5us has joined #zig
mmohammadi9812 has joined #zig
<pixelherodev> Huh
<pixelherodev> I think I might legitimately be able to cross 1GHz without issues
<ikskuh> :D
<ikskuh> z80 → x86 is a good jittable arch :D
<ikskuh> "just copy over the bytes and patch some" :D
<pixelherodev> I'm not doing direct to x86
<pixelherodev> This goes through RISC-V first ;)
<pixelherodev> also yes I *am* abusing my graphics library by pretending the CPU is a custom widget and having it be executed by the window rendering code :P
<pixelherodev> ahhh whoops
<pixelherodev> I'm using the TI ASIC MMU, which is slowing everything down massively
<pixelherodev> What I really need to do is JIT away the MMU access :)
<pixelherodev> Could probably cache opcode lookups until pages are swapped
<pixelherodev> Woot! 1GHz on the laptop!
<pixelherodev> 1.24GHz, even
<pixelherodev> and shockingly these optimizations are actually useful :P
<Michcioperz> which graphics library is that
<pixelherodev> A bespoke one :P
<pixelherodev> `widget_t *z80_callback = customwidget_create(callback_function);`
* Michcioperz googles bespoke graphics library
<pixelherodev> lol
<pixelherodev> bespoke: application-specific
<Michcioperz> ah hahaha
<Michcioperz> that makes sense
<pixelherodev> I mean, it's a really nice API IMO, but it's part of the application, fundamentally
<pixelherodev> I do intend to split it out though
<Michcioperz> i searched for customwidget_create on github and only your repo came up
dch has joined #zig
guan has joined #zig
Miaourt has joined #zig
karrick has joined #zig
wjlroe has joined #zig
yrashk has joined #zig
daurnimator has joined #zig
JimRM has joined #zig
<pixelherodev> That's honestly hilarious
daurnimator has quit [Max SendQ exceeded]
<pixelherodev> Michcioperz: wait, it did??
<pixelherodev> I just tried and I don't see it lol
<pixelherodev> Oh this is hilarious.
<Michcioperz> i mean, after selecting C language only
<Michcioperz> i assumed you were not like, writing this in shell
<pixelherodev> I got the z80 running at 2GHz on my (3.2GHz) PC, because I set 2GHz as the limit
<pixelherodev> I tried upping it to 3
<pixelherodev> Then I remembered that it's defined as the raw Hz value.
<pixelherodev> and it now exceeds the limit lol
<pixelherodev> (because C is dumb and has the time as int by default :P)
daurnimator has joined #zig
<pixelherodev> There we go!
<pixelherodev> ~400MHz on the interpreter to over 2.2GHz on the JIT
<pixelherodev> To put it differently, <1MHz in valgrind with the interpreter to >50 ;P
tomku has quit [Ping timeout: 265 seconds]
<pixelherodev> Whelp, I'm out of fruit apparently
<pixelherodev> ikskuh: I think I can make this specific microbenchmark even more insane
<pixelherodev> I figured out how to hit THz levels
<pixelherodev> When translating some address X, and a nop is encountered, trawl from X until either the end of the address space or a non-nop value is encountered
<pixelherodev> Produce a function which simply adjusts `cycles` and `cpu->registers.PC`
<pixelherodev> That'll process 64K NOPs in the time I can currently process one :P
<pixelherodev> So, 128THz on my PC
<pixelherodev> Why am I like this
<pixelherodev> ikskuh: "my SPU II emulator is over a million times faster than yours!!!"
<pixelherodev> actually, due to the 16-bit instructions on SPU II, it'd be a tad slower
<pixelherodev> Still THz insanity though
tomku has joined #zig
<Michcioperz> our scientists were so preoccupied with whether or not they could
<pixelherodev> Still, anything that can emulate 262144 cycles in the space of two x86 `mov`s is obviously stupid, even if this is fun to make
<pixelherodev> Michcioperz: lol
<pixelherodev> On a modern microarchitecture, I think this could hit... *technically*... about two hundred thousand instructions per (physical) cycle?
<pixelherodev> It could tear through the full address space probably *twice* in a single cycle lol
<pixelherodev> The thing is, this wouldn't slow down real uses
<pixelherodev> So there might not be a practical benefit, but the entertainment is free :)
osa1 has joined #zig
FireFox317 has joined #zig
Miaourt has quit [*.net *.split]
wjlroe has quit [*.net *.split]
yrashk has quit [*.net *.split]
JimRM has quit [*.net *.split]
dch has quit [*.net *.split]
karrick has quit [*.net *.split]
guan has quit [*.net *.split]
mmohammadi9812 has quit [Ping timeout: 256 seconds]
guan has joined #zig
karrick has joined #zig
JimRM has joined #zig
wjlroe has joined #zig
dch has joined #zig
Miaourt has joined #zig
yrashk has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
mmohammadi9812 has joined #zig
redj has quit [Ping timeout: 258 seconds]
marnix has quit [Ping timeout: 256 seconds]
marnix has joined #zig
mmohammadi9812 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
<ifreund> so std.os.toPosixPath() returns a pointer to a stack variable
<ifreund> how is this safe? is this guarenteed to be safe if no other function is called before the variable is used?
tomku has quit [Ping timeout: 256 seconds]
tomku has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
<ifreund> wait no I can't read
retropikzel has quit [Quit: Leaving]
redj has joined #zig
kristoff_it has joined #zig
osa1 has quit [Remote host closed the connection]
osa1 has joined #zig
ask6155 has joined #zig
<ask6155> hello
<ifreund> o7
<ask6155> my master zig compilation was failing. I deleted the build folder and tried again I was building but at the last stage it hanged my pc. The last one was 99% building self-hosted component /home/user/zig/zig1.o It ate all my ram and started eating my swap. I killed it. I then turned my swap off and tried. It failed at the last step with an allocation failure. I was able to build it before and I have 4GB ram.
<ask6155> Also I noticed it certainly does have a kind of poetry to it. If you know what I mean
<ifreund> ask6155: The quick fix would be using a commit from before #6250 was merged
<ask6155> what was it?
<ifreund> this PR moved a LOT of C++ to Zig code and increased the size of the zig1 codebase significantly
<ifreund> unfortuneatly the C++ zig0 compiler is not at all memory efficient, so it sounds like this change was enough to push things over the edge for your machine
<ask6155> so you mean I can't compile it?
<ifreund> there are some ideas to make the zig0 compiler more efficient as a stopgap until the self-hosted compiler is feature complete
<ifreund> (the self hosted compiler is WAY more memory efficient and faster than the stage0 C++ implementation)
<ask6155> One of the things I like about zig was I could actually compile the compiler and use it unlike all the other compilers. I wouldn't want to loose that
<ifreund> feel free to open an issue to discuss, I agree that this is a problem
<ask6155> can you tell me the commit hash at which this was changed?
<ikskuh> ask6155: 0.6.0+f8b3543ca is still using the old system
ask6155 has quit [Ping timeout: 256 seconds]
ask6155 has joined #zig
<ask6155> I created an issue
<ask6155> building the compiler is a thing noone really cares about. The only other compiler I can think of that I can compile is tinycc.
<ikskuh> i really love how easy building Zig with cmake is
<ask6155> is it safe running gdb with sudo?
Sahnvour has quit [Quit: WeeChat 2.9]
<ifreund> afaik yes
<ifreund> you need privlages for some of gdb's functions in fact
<ask6155> ok I was asking because gdb was using ptrace and I had set it so that ptrace can only be used by privileged users
ask6155 has quit [Ping timeout: 240 seconds]
FireFox317 has quit [Remote host closed the connection]
FireFox317 has joined #zig
layneson has joined #zig
waleee-cl has joined #zig
layneson has quit [Ping timeout: 240 seconds]
zippoh has quit [Read error: No route to host]
knebulae has joined #zig
mmohammadi9812 has joined #zig
salotz has quit [Remote host closed the connection]
<fgenesis> uhm apparently there's a nullptr dereference somewhere in the zig part of the zig compiler. tried to compile a .c file on a rpi4 and after adding an asm volatili("yield") in the .c file it kept segfaulting
<fgenesis> plus valgrind finds a bunch of "conditional mode depends on uninitialized value"
<fgenesis> was testing the arm7 binary release of zig 0.6 yesterday
<fgenesis> didn't bother to debug it but likely will sometime this weekend if anyone is interested
<ikskuh> fgenesis: not really relevant atm. some days ago, #6250 landed and rewrite 20kLOC of the stage1 compiler
<ikskuh> *rewrote
<fgenesis> *conditional move
<fgenesis> thought as much
<fgenesis> still wanted to mention it for completeness
<fgenesis> i'll probably go and build zig master when i have the energy for it
<fgenesis> oh and i wanted to mention that the biitstrap build script is broken for me, i'm apparently too dumb to supply the right cmdline args to make it past line 13
<fgenesis> *bootstrap (gah i can't type today)
wozeparrot has joined #zig
marnix has quit [Ping timeout: 260 seconds]
marnix has joined #zig
xackus has joined #zig
Akuli has joined #zig
<fgenesis> compiling llvm10 on a pi4 takes a long time indeed
<fgenesis> don't even want to know how a pi1 or 2 would cope *brr*
<fengb> Pi1 falls over due to memory
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
<fgenesis> not if you enable swap
<fgenesis> and plan in extra time
<ikskuh> wear out that SD-Card!
<ikskuh> or even better: use a file on NFS for swap!
<fgenesis> nah, just put the swap on a usb-hdd
<fengb> I mean... swapping out that 512 MB is doable
<fengb> But that's akin to falling over to me
<fgenesis> or remote-smb-share backed by a ramdisk. remote-ram as a service
<fengb> Since LLVM takes gigabytes to build
<ikskuh> fgenesis: https://downloadmoreram.com/
<fgenesis> yes
<fengb> Hmm... is there a way to make the VRAM config more fluid? Rebooting each change is annoying
klltkr has joined #zig
cole-h has joined #zig
yrashk has quit [*.net *.split]
JimRM has quit [*.net *.split]
dch has quit [*.net *.split]
karrick has quit [*.net *.split]
Miaourt has quit [*.net *.split]
wjlroe has quit [*.net *.split]
guan has quit [*.net *.split]
<nikki93> shachaf: nice :o i was using entr for it http://eradman.com/entrproject/ which works on macos and happens to work on windows wsl too
donniewest has joined #zig
wootehfoot has joined #zig
<ikskuh> hm
<ikskuh> anyone an idea why zig emits a call to __memcpy_chk when building for x86_64-windows-gnu?
<ikskuh> and where this might come form
<ikskuh> aha!
Stephie- is now known as Stephie
<ikskuh> zig sneakily sets _FORTIFY_SOURCE
<donniewest> Has anyone considered setting up a bridge between zig's Matrix and IRC services? It'd make following all the conversations easier :)
<donniewest> Neovim has, uh, all the services (Gitter, Matrix, IRC) and they all bridge together so anyone can join the conversation anywhere. Makes things pretty nice
<tdeo> neovim? :)
<ikskuh> donniewest: zig community is decentralized. i have no idea how much chats are going on :D
<tdeo> though i think a bunch of people join this irc from the matrix bridge
<Nypsie[m]> donniewest: There's already a bridge between Zig's Matrix and IRC
<tdeo> ignore my first message, misread that one
<Nypsie[m]> In fact, I'm sending this message through the Matrix bridge as we speak :)
<donniewest> That's weird. I'm on the Matrix room and I don't see these same messages?
<fgenesis> ... which means only irc is needed. end of discussion :D
<donniewest> I know Matrix can connect to Freenode, but it's still ultimately separate rooms. I personally prefer IRC, so a bridge to let me see those messages would be great
<Nypsie[m]> Ooooh, you mean like that. That's currently not done, no
<earnestly> That would be done with a bot, essentially. It's not fun "talking" to bots on IRC because, at least, it breaks nick display
<donniewest> Well, if there's interest, I'd be happy to lend a hand :)
<donniewest> Yeah, the nick sync is a bit weird. Neovim's seems to handle it alright but there's still a bit of a disconnect
dch has joined #zig
Miaourt has joined #zig
karrick has joined #zig
JimRM has joined #zig
yrashk has joined #zig
guan has joined #zig
wjlroe has joined #zig
dingenskirchen has quit [Quit: ZNC 1.7.5 - https://znc.in]
dingenskirchen has joined #zig
<nikki93> https://imgur.com/a/39spS3N beginnings of immedate mode dom ui api -- mostly planning on using it to edit properties for the scene i render with webgl
<Nypsie[m]> Cool!
klltkr has quit [Ping timeout: 240 seconds]
st4ll1 has joined #zig
<pixelherodev> Heads up to the ziglibsers that I left the GitHub org; I just deleted all my repos except for the zig branch (which is staying until PRs are merged)
osa1 has quit [Quit: osa1]
jjsullivan__ has joined #zig
<wootehfoot> pixelherodev, you mean you deleted all these repos? https://github.com/ziglibs
<alexnask[m]> No, the ones he had ownership of, these are fro mvarious authors
<alexnask[m]> Not sure which those were
jjsullivan has joined #zig
jjsullivan__ has quit [Ping timeout: 260 seconds]
st4ll1 has quit [Quit: WeeChat 2.9]
ur5us has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
FireFox317 has quit [Ping timeout: 260 seconds]
marnix has quit [Ping timeout: 264 seconds]
<nikki93> https://imgur.com/a/C3IVuiB really digging anonymous struct reflection
<pixelherodev> wootehfoot, alexnask[m]: I didn't delete any organization repos.
<pixelherodev> I delted repos under github.com/pixelherodev/*
<pixelherodev> and I *left the org*
<pixelherodev> deleterd*
<alexnask[m]> ah, okay, mb
<pixelherodev> deleted*
<pixelherodev> Two different things
mmohammadi9812 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
<pixelherodev> alexnask[m]: no worries :)
<torque> <donniewest> I know Matrix can connect to Freenode, but it's still ultimately separate rooms. I personally prefer IRC, so a bridge to let me see those messages would be great <-- I personally disagree with using bridges between different services
<torque> drops the signal to noise ratio like a rock
<nikki93> quick q: how do i convert an integer to a float to multiply by a float? eg. if i have an integer 10, then want to multiply by 0.1 and get 1.0
<alexnask[m]> @intToFloat
<nikki93> i see
<nikki93> thx!
<shachaf> nikki93: Oh, if you're using Windows then I don't know if it'll work, since it uses ptrace.
<nikki93> i'm mostly on linux or mac but i use windows too :)
<nikki93> https://imgur.com/a/5kFMf8f events working :o
g_w1 has quit [Ping timeout: 260 seconds]
<ikskuh> neat!
g_w1 has joined #zig
<nikki93> the inline styles are mostly for quick testing, mostly planning on just setting css classes in code and keeping the styles in css files elsewhere
<pixelherodev> whatcha working on?
<nikki93> just exploring what using zig looks like for web graphics and ui stuff
<nikki93> especially ui for editing those graphics
<nikki93> so that you could do a level editor for a game etc.
<nikki93> the main thing i'm curious about when i get there is abt using zig's reflection and comptime stuff to generate ui for the structs of data
<cr1901_modern> I asked this before, but I'll ask a different way... if I'm using a zig package (regex) that's known to leak memory, what would be a reasonable way to suppress the leak warning output.
<ikskuh> use arena allocator
<cr1901_modern> Okay works for me, I'll see how to use it
<ikskuh> or even better (as told before): fix the library, make a PR, make everyone happy1
wootehfoot has quit [Read error: Connection reset by peer]
<cr1901_modern> I don't have the bandwidth to fix the library
<cr1901_modern> I filed an issue a few weeks ago
<cr1901_modern> In addition, someone smarter than me tried and failed to fix the issue :P
donniewest has quit [Quit: WeeChat 2.9]
<nikki93> https://imgur.com/a/Ilqp9AX ok last quick video post -- showing it with lots of elements
<ikskuh> this is super cool
<tdeo> yeah!
<nikki93> thanks! ^_^ the hard part of the logic is done by http://google.github.io/incremental-dom/, i just hand stuff to that lib
<nikki93> will post this repo up in a sec
<companion_cube> wait, is this in wasm then?
<nikki93> yea! i put the code up here: https://github.com/nikki93/zig-wasm-test
Akuli has quit [Quit: Leaving]
_Vi has quit [Ping timeout: 260 seconds]
<cr1901_modern> Right, since zig reached a nice milestone moving lots of code from C++ to zig land, I'm gonna try compling it.
<cr1901_modern> Let's see what happens
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
<cr1901_modern> 5.2GB for the self-hosted component... eep :o. But looks like I have enough RAM
<cr1901_modern> Also is it normal for the compile of the self-hosted component to take several minutes? It's using 100% of a single core of my CPU. So it's doing work. Just curious
<ifreund> I think that's not abnormal, the stage1 compiler is not efficient
frmdstryr has joined #zig
<cr1901_modern> Finally linking. Took about 5 minutes.
<cr1901_modern> Is the stage0/stage1/etc build process documented? I can of course gleam the basics by reading the source, but if there's docs I'd rather read those
<ifreund> not too much to know, the stage0 compiler is written in C++ and is used to complie the parts of stage1 written in zig then linked with them to form stage1
<ifreund> stage2 is written entirely in zig with an optional dependency on llvm
<ifreund> stage3 is stage2 rebuilt using stage2
<cr1901_modern> optional dep on llvm? Is this to support alternative backends in principle?
<tdeo> stage2 doesn't actually have llvm support yet, it only supports its own backend
<frmdstryr> Can I force zig to somehow do an 8 bit write to a 32bit register?
<frmdstryr> I'm implementing SPI and it is always doing 16-bit writes
<frmdstryr> So if I write 0xFF it's actually writing 0xFF and 0x00 on the wire
<ikskuh> just do the cast as well?
<frmdstryr> The value is already a u8?
<frmdstryr> or do you mean cast the ptr to the register?
<ifreund> yes that
<frmdstryr> Dude... awesome! Hah, thanks!
philtor has quit [Ping timeout: 272 seconds]
<Piraty> jjsullivan: why did you list all the archs in the zig template (your cross PR) instead of just dropping archs= ?
<Piraty> why exclude ppc* for example?
<jjsullivan> I wasn't able to test if ppc works, and armv5te/mips wasn't compiling
<jjsullivan> ppc is probably fine but idk about the others
<jjsullivan> Piraty ^^
utzig has joined #zig
frmdstryr has quit [Ping timeout: 240 seconds]
delaney has joined #zig
<delaney> Hi, I'm trying to get zig running on my work laptop which is unfortu
<delaney> Lately a Mac... got it build from source finally but `zig init-exe` and `-lib` just hang forever
<pixelherodev> cr1901_modern: LLVM dep is for optimizations, basically
<ifreund> and for translate-c
<pixelherodev> For now at least
<ifreund> and zig cc
<cr1901_modern> Is there an alternate IR that- hypothetically speaking, if I wanted to add a backend not in LLVM- I could generate code from in the zig stage 2 compiler?
<tdeo> as i said stage2's not-llvm ir is the only ir, there's no llvm support yet :)
<ifreund> cr1901_modern: sure, stage2 currently does not depend on llvm and generates code directly for multiple architectures
<ifreund> debug builds of zig code will always be entirely self hosted using the bespoke codegen and incremental linking
<cr1901_modern> https://github.com/ziglang/zig/blob/master/src/codegen.zig Ahhh I see, it uses jump table dispatch to implement each part of codegen
<nikki93> delaney: maybe you could try the master build at https://ziglang.org/download/ ? i've just been using the prebuilt ones for mac and it's worked fine for me. didn't try with the latest tho, probs about a couple weeks old
<delaney> Ok I'll try that @nikki93
earnestly has quit [Ping timeout: 260 seconds]
Miaourt has quit [*.net *.split]
wjlroe has quit [*.net *.split]
yrashk has quit [*.net *.split]
JimRM has quit [*.net *.split]
dch has quit [*.net *.split]
karrick has quit [*.net *.split]
guan has quit [*.net *.split]
swills has quit [Quit: swills]