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/
<mikdusan> scientes: did it dump somewhere around ir_analyze_bin_op_cmp() ?
<scientes> yeah, but in get_vector_type
<scientes> inside of LLVM
<mikdusan> yup ok that's what i have on macOs
<mikdusan> LLVMABISizeOfType
<scientes> yep
<scientes> fixed
<scientes> oo nice "comptime vector overflow shows the index",
<scientes> i need to do that for the safety i added
<mikdusan> btw on macOS i had to _disable_ aslr to get exception in lldb
<scientes> is there any easy way to run just the compiler error tests?
<mikdusan> yes
<mikdusan> `zig build test-compile-errors`
<scientes> /home/shawn/git/zig-simd/build/lib/zig/std/special/start.zig:134:35: error: root source file has no member called 'main'
<scientes> got it
_whitelogger has joined #zig
utzig has quit [Quit: leaving]
ky0ko has quit [Quit: WeeChat 2.5]
ntgg has joined #zig
marijnfs has joined #zig
marijnfs__ has quit [Ping timeout: 244 seconds]
ntgg has quit [Ping timeout: 246 seconds]
hio has joined #zig
<daurnimator> Is there a way to test on arm64 without a physical device?
<mikdusan> darithorn: i have never tried this, but looks promising: https://github.com/WorksOnArm/cluster
<mikdusan> whups wrong tag
<mikdusan> daurnimator: i have never tried this maybe worth a look? https://github.com/WorksOnArm/cluster
return0e_ has joined #zig
return0e has quit [Ping timeout: 245 seconds]
<daurnimator> mikdusan: applied...
<daurnimator> thanks
<mikdusan> so like `make -j54` :)
<daurnimator> mikdusan: I just need to test some things on an arm64 device with lots of address space...
<mikdusan> ah. > 4GB ?
<daurnimator> mikdusan: >256TB.
<mikdusan> ah yes i just saw the issue
Ichorio_ has joined #zig
fubd has joined #zig
<fubd> ack, keep getting bit by the usingnamespace bugs a la https://github.com/ziglang/zig/issues/2747
Ichorio has quit [Ping timeout: 264 seconds]
mipri has joined #zig
ntgg has joined #zig
fubd has quit [Remote host closed the connection]
<ntgg> i'm getting an issue with `std.SegmentedList`, saying that in std/segmented_list.zig:160:59 it expected type u6, found usize
<ntgg> also the assertion at std/segmented_list.zig:82 fails
<ntgg> i'm trying to use std.parse
<daurnimator> emekankurumeh[m]: something I'm not sure I mentioned. the "command buffer" style of things lets us automatically do things like TCP Fast Open. I just re-came across https://gist.github.com/daurnimator/3f2cfef6f4101e432313 which is back from when I was thinking about this stuff
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
ntgg has quit [Ping timeout: 258 seconds]
ntgg has joined #zig
darithorn has quit [Quit: Leaving]
Ichorio_ has quit [Ping timeout: 264 seconds]
kristoff_it has joined #zig
jethron has joined #zig
kristoff_it has quit [Ping timeout: 248 seconds]
StateOff has joined #zig
jethron has quit [Remote host closed the connection]
knebulae has quit [Read error: Connection reset by peer]
<ntgg> is there a way to convert a f64 into a []const u8?
ntgg has quit [Ping timeout: 246 seconds]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 246 seconds]
squiddlebit has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
StateOff has quit [Quit: Leaving]
<daurnimator> niftynei: std.mem.asBytes ?
Summertime has quit [Quit: Sunsetting.]
<daurnimator> ntgg ^^
Summertime has joined #zig
<daurnimator> :( that feeling when you read C++ after staring at Zig
<daurnimator> (and worse.... an academic's C++ code)
<daurnimator> with preprocessor tricks
<daurnimator> and lots of operator overloading
<daurnimator> and templates
<daurnimator> :(
<daurnimator> `zig translate-c++` when? :P
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 258 seconds]
tgschultz has quit [Ping timeout: 258 seconds]
tgschultz has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 268 seconds]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
kristoff_it has joined #zig
<gonz_> I think you laid out the time frame perfectly in the lines preceding that one :D
<emekankurumeh[m]> fubd: I thought that was fixed in af86614
kristoff_it has quit [Ping timeout: 246 seconds]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 246 seconds]
<daurnimator> oooooo, I came up with evil
<Tetralux> Excellent! Please share it with me x)
<daurnimator> writing now...
squiddlebit has quit [Quit: WeeChat 1.9.1]
fubd has joined #zig
wootehfoot has joined #zig
<fubd> emekankurumeh[m]: ah, you're right, thanks for the reminder
fubd has quit [Remote host closed the connection]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
_whitelogger has joined #zig
ntgg has joined #zig
MajorLag has joined #zig
tgschultz has quit [Ping timeout: 244 seconds]
MajorLag is now known as tgschultz
<ntgg> I have a function that returns `[]const u8` and in some branches of the switch it returns [_]u8 and in others it returns []u8, how do I get this to work?
<ntgg> Currently says incompatible types
<hryx> ntgg: there's an issue for that: https://github.com/ziglang/zig/issues/2749
<hryx> ntgg: see the description for a workaround. you can explicitly slice the array. But note that if you return a slice from your function, be careful that it doesn't point to a stale stack address
Ichorio has joined #zig
<ntgg> hryx: Thanks, the workaround works for what I am doing
<scientes> also, I have had plenty of times where the cache just doesn't work
<scientes> and i have to manually clear it
<scientes> when the compiler changes
<scientes> oh nvm
<hryx> scientes: andrew has mentioned a few times that there are no known bugs with the cache and clearing it is never a solution to recommend. def open an issue if you find problems with the cache
<scientes> well there is a real one i noticed
<scientes> which is that zig0 tries and fails to use the cache
<scientes> because it is written in zig
<hryx> did an issue get opened?
<hryx> (mainly my point was we shouldn't recommend clearing cache in any scenario)
<Tetralux> I had to delete it the other day because it was taking up 127MB...
<Tetralux> My setup for that is a little non-standard though.
<hryx> that doesn't seem very big to me
<hryx> I see
<Tetralux> It is when you're in Dropbox and only have <100MB left in it :3
<scientes> just use git
<hryx> wait.... you're syncing a zig project directory in dropbox?
<scientes> git is alot more friendly than those type of things
<Tetralux> It's less of a project, and more of where I keep my Zig programs that I'm fiddling with.
<Tetralux> Often single files I run.
<Tetralux> As for git, that feel a little too heavyweight for this.
<Tetralux> Managing git commits for that seems too much work.
<Tetralux> Besides which, I don't have private repos.
<Tetralux> If I did, then maybe I'd consider it.
<Tetralux> Though, the auto-sync ability of Dropbox would be hard to lose.
<Tetralux> I like how I can just install it on a newly formatted computer and just have everything there.
ntgg has quit [Ping timeout: 245 seconds]
<Tetralux> I just wish there was a Google Drive client that was multiplatform, supported by Google, stored everything encrypted, and _just worked_, like DB does.
<Tetralux> Unless there is and I'm not aware of it.
<Tetralux> Only you have three times the space on that.
<scientes> that's why I refuse to have two laptops at the same time
<scientes> its to much work
<scientes> or a desktop+laptop
<Tetralux> If Google Drive had a decent client that just worked, I'd probably use it to keep all my projects.
<Tetralux> Sadly, that's only true on Windows.
<Tetralux> If even that.
<Tetralux> I haven't used it in a little while.
<scientes> just use a USB ssd
<scientes> simple
<scientes> easy
<scientes> much faster
<Tetralux> The cloud has redundancy that I don't have to think about xD
<scientes> that's why important stuff goes into git
<Tetralux> Beside which
<Tetralux> I can sync across multiple systems simulataenously.
<Tetralux> Can't do that with a usb without farting with networking stuff.
<scientes> just ssh
<scientes> i use sftp all the time
<Tetralux> There's an auto-sync client that uses sftp?
<Tetralux> And a server that works on Windows.)
<gonz_> Tetralux: Why not just pay for Dropbox, then? You get an insane amount of space.
<gonz_> Or do you pay and still manage to use all of it?
<Tetralux> *smiles* So far I haven't needed to pay for it.
<Tetralux> At some point I might though.
<Tetralux> But if I can get by without it - /shrug.
<Tetralux> Besides which, if there's a way to trivially set up sftp on windows and just have it work as well.
<Tetralux> That's better for me.
<Tetralux> I could even write a server in Zig ;)
<Tetralux> My impression is that FTP isn't that complicated.
<Tetralux> Maybe I'm wrong about though.
<scientes> sftp is not the same thing
<Tetralux> I know.
<Tetralux> There's obv encryption involved and stuff.
<scientes> I find windows a waste of time in every way
<Tetralux> I'm only on Windows because I play games at 165 Hz.
<Tetralux> Linux can't do that without massive input lag yet.
<Tetralux> I tried it.
<Tetralux> And it's a pain to actually make it all work reliably.
<Tetralux> Wine's making progress though.
<Tetralux> So one day.
<Tetralux> Not only with input lag
<Tetralux> But when you fullscreen, it doesn't "activate" the refresh rate.
<Tetralux> In the same way that Windows doesn't if you're in windowed mode.
<Tetralux> It's like it's borderless.
<Tetralux> That won't wash with me.
<Tetralux> If all the software I ever need to use works flawlessly with Wine.
<Tetralux> And games run at 165 Hz just fine.
<Tetralux> Then I may switch.
<Tetralux> I actually have PopOs dual-booted rn.
<Tetralux> That's how I tested what I just said xD
<Sahnvour> Tetralux: for your files on dropbox, can't you juste use zig with --cache-dir set to something else ?
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
<Tetralux> I could... but then I'd have to pass that for every invocation of every compilation.
<Tetralux> And then if I forget even once, I have to rm it. xD
<Tetralux> I could make a batch script or something.. but no cross platform and just... ugh.
<gonz_> So a `ZIG_CACHE_DIRECTORY` env var it is, then
<gonz_> If you rely so heavily on Dropbox I still think buying it is the most convenient solution
<gonz_> You get 2TB
<dec05eba> i use linux with a 60hz 4k monitor and 144hz monitor and it's fine, however on windows i get screen tearing that i cant fix in any way
<Sahnvour> an alias might do the trick
<dec05eba> never would i have though screen tearing would be an issue on windows but not on linux
<Tetralux> dec05eba: Likewise... That sounds... odd.
tgschultz has quit [Ping timeout: 246 seconds]
tgschultz has joined #zig
kristoff_it has joined #zig
tgschultz has quit [Ping timeout: 245 seconds]
kristoff_it has quit [Ping timeout: 244 seconds]
tgschultz has joined #zig
slice has quit [Ping timeout: 250 seconds]
Pho75 has joined #zig
slice has joined #zig
<Pho75> hi all. I'm trying to build zig compiler from github on ubuntu but build is failing. cmake is defaulting to llvm-8, is that too new? If so how to I get cmake to use llvm-4? thanks
<Tetralux> You need 8.
<Pho75> so it's just an upstream bug that's causing this build error?
<Pho75> /usr/lib/llvm-8/include/llvm/ADT/ArrayRef.h:102:37: error: initializing ‘llvm::ArrayRef<long unsigned int>::Data’ from ‘std::initializer_list<long unsigned int>::begin’ does not extend the lifetime of the underlying array [-Werror=init-list-lifetime]
bkleiner has joined #zig
darithorn has joined #zig
tgschultz has quit [Ping timeout: 245 seconds]
<Tetralux> You have clang right?
<Pho75> yes i do
tgschultz has joined #zig
Pho75 has quit [Ping timeout: 245 seconds]
Akuli has joined #zig
<mikdusan> fyi: Pho75 expierienced an error message I have observed with gcc >= 9.1.0
<scientes> const v: u32 = 5;
<scientes> const x = @splat(4, v);
<scientes> who do i have to do to get the type of v populated in stage1?
<scientes> its null
<scientes> when it is clearly there
<mmx870> ><daurnimator> Is there a way to test on arm64 without a physical device?
<mmx870> Qemu?
<scientes> daurnimator, scaleway
<scientes> you can get a arm64 VPS for 3eu/mo
<scientes> just be aware those are 64-bit only
<scientes> can can't run 32-bit code
marijnfs_ has joined #zig
marijnfs_ has quit [Client Quit]
marijnfs_ has joined #zig
ntgg has joined #zig
kristoff_it has joined #zig
dec05eba has quit [Quit: Lost terminal]
fsateler has quit [Ping timeout: 245 seconds]
Poetastrophe has joined #zig
fsateler has joined #zig
marijnfs_ has quit [Ping timeout: 250 seconds]
marijnfs_ has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
occivink has quit [Quit: WeeChat 2.4]
ntgg has quit [Ping timeout: 272 seconds]
occivink has joined #zig
Akuli has quit [Quit: Leaving]
dec05eba has joined #zig
<Poetastrophe> Hello guys I am just getting into Zig and I need to build LLVM from source. I followed the instructions on the Zig wiki, under POSIX:https://github.com/ziglang/zig/wiki/How-to-build-LLVM%2C-libclang%2C-and-liblld-from-sourceWhere I try to compile llvm-8.0.0.srcBut all I am getting is that the cmake cannot find LLVMs headers:$ make installfatal erro
<Poetastrophe> r: llvm/Demangle/Demangle.h: No such file or directory #include "llvm/Demangle/Demangle.h" ^~~~~~~~~~~~~~~~~~~~~~~~~~compilation terminated.make[2]: *** [lib/Demangle/CM
<Poetastrophe> akeFiles/LLVMDemangle.dir/build.make:63: lib/Demangle/CMakeFiles/LLVMDemangle.dir/ItaniumDemangle.cpp.o] Error 1make[1]: *** [CMakeFiles/Makefile2:876: lib/Demangle/CMakeFiles/LLVMDemangle.dir/all] Error 2make: *** [Makefile:152: all] Error 2Can anyone help me out?
<dec05eba> any reason you are building zig from source rather than using the release binary on zig website?
<Poetastrophe> Mostly if I want to experiment a bit with the Zig source and libraries
<Poetastrophe> I see the spacing is quite confusing in my original post. Here is a gist: https://gist.github.com/Poetastrophe/10a6bb88072ee05dddccdde7dce5511c
Tetralux has quit [Read error: Connection reset by peer]
dec05eba has quit [Quit: Lost terminal]
Tetralux has joined #zig
Tetralux has quit [Read error: Connection reset by peer]
Tetralux has joined #zig
Poetastrophe has left #zig [#zig]
<darithorn> Poetastrophe if you mean the standard library the zig compiler uses the source directly, so you can edit it and use the changes immediately
Poetastrophe has joined #zig
marijnfs_ has quit [Ping timeout: 264 seconds]
<andrewrk> Poetastrophe, please double check that you followed the directions, they do work
<andrewrk> unrelated, I just got this working: https://gist.github.com/andrewrk/8db59a66ca8719d7b6297271bca754ca
<scientes> andrewrk, awesome!
<andrewrk> scientes, I also figured out how async fn pointer calls can work
<scientes> I made good progress on SIMD today
<scientes> lots of bugs
<scientes> and tests
<hryx> what's new in the async gist? (pardon my ignorance of async zig stuff, I haven't used it yet)
<hryx> is it the @Frame() part?
<andrewrk> hryx, this has all the llvm stuff ripped out
<scientes> because it was ill-conceived
<hryx> oh shoot! that's awesome
<andrewrk> i'll add master branch for comparison
<scientes> it made the mistake of trying to allocate memory as part of the API
<hryx> I forgot it was previously relying on LLVM features
<scientes> having llvm features isn't a bad idea, but they were done wrong
<scientes> and should be removed
<Sahnvour> it's also nice in the event of adding another backend
<andrewrk> well first of all master branch gives "error: async function call from non-async caller requires allocator parameter" for this example
<andrewrk> I agree with scientes on this one
<andrewrk> yeah and good point Sahnvour
<scientes> oh, I also got some pushback on asking llvm to implement the C ABI
<scientes> the point was that you cant really take the C ABI out of codegen
<scientes> because it is so tightly integrated
<scientes> with things like sizeof() and offsetof()
<andrewrk> hryx, I updated https://gist.github.com/andrewrk/8db59a66ca8719d7b6297271bca754ca with the equivalent master branch code for comparison
<andrewrk> you can tell a difference just by sheer line count differences
<hryx> I was just admiring that! very nice indeed
<andrewrk> not to mention the `optnone`... that was sad
<hryx> did optnone mean "no optimizations for any async function/coroutine"?
<andrewrk> and this is *before* LLVM does the "coroutine splitting pass" and making it bloated!
<andrewrk> hryx, yes
<hryx> great work, I didn't realize there would be such progress on coroutine rewrite already
<hryx> unrelated: another contributor and I indepdendently worked on the primitive value vs. keyword thing: https://github.com/ziglang/zig/pull/2926
<andrewrk> nice work
<hryx> theirs is simpler than mine though
<hryx> also mine doesn't build yet, heh. So I might just concede to their implementation and try tackling a different issue
<andrewrk> that sounds reasonable
<hryx> cool - I was thinking of trying anonymous struct literals
<andrewrk> btw hryx all tests passing in the llvm9 branch - I just did a test run against a debug build of llvm/clang/lld 9. it took 19 hours
<hryx> but obviously I haven't been able to stop thinking about "multibuild" since your last stream
<hryx> oh nice!
<emekankurumeh[m]> nice!
<Sahnvour> time to get tests in parallel :P
<andrewrk> anonymous struct literals would be challenging, but rewarding
<hryx> just enough time to brew a strong cup of coffee
<andrewrk> I think you could do it hryx
<andrewrk> that one will require dealing with result location semantics
<hryx> great! would enum literals be a reasonable place to start looking for inspiration?
<andrewrk> hryx, I think that solving https://github.com/ziglang/zig/issues/2749 is a prerequisite for anonymous struct literals
<hryx> ahh yes
<emekankurumeh[m]> does zig compile all files into a single object?
<hryx> ok, why don't I take a look at #2749 first then
<andrewrk> hryx, it's a tricky issue, it will be difficult (but it must be done)
<andrewrk> emekankurumeh[m], yes, stage1 does that
<hryx> roger that. I poked at the result location concept in ir.cpp briefly and will most certainly have a few questions along the way
<andrewrk> zig provides no guarantees about what files go in what objects. self-hosted takes advantage of this to do incremental builds
<andrewrk> hryx, there will almost certainly be some bugs to fix with regards to result location stuff along the way
<andrewrk> godspeed
<emekankurumeh[m]> is parallel compilation a goal for zig?
<andrewrk> yes emekankurumeh[m]
<hryx> (**)7
<andrewrk> for debug builds. for release builds, not necessarily. deterministic builds is a higher priority
<andrewrk> deterministic/reproducible
<andrewrk> I don't think stage1 should ever deal with threads
<andrewrk> just keep it simple and debuggable so we can get to self-hosted
<scientes> yes
<Sahnvour> this reminds me we did not make this issue about reproducible builds andrewrk (or I missed it)
<scientes> but build.zig might use threads
<andrewrk> yeah once we have better event-based support (async/await) then the child process API can be greatly improved
<emekankurumeh[m]> oh yeah when I was writing a simple threadpool in zig I was getting some weird errors from zig
<scientes> anyone know an editor that can match Makefile endif and else statements?
mipri has quit [Quit: Lost terminal]
andrewrk has quit [Ping timeout: 268 seconds]
<emekankurumeh[m]> is the new `@Frame` stuff going to be generic like `promise`?
wootehfoot has joined #zig
andrewrk has joined #zig
Ichorio has quit [Ping timeout: 264 seconds]
allan0 has quit [Ping timeout: 258 seconds]
donpdonp has quit [Quit: WeeChat 2.4]
donpdonp has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
ltriant has joined #zig
Poetastrophe has quit [Ping timeout: 260 seconds]
kristoff_it has quit [Ping timeout: 246 seconds]
<daurnimator> emekankurumeh[m]: what do you mean by "generic"?
<daurnimator> andrewrk: also, DESTDIR gets prefixed onto the install prefix
kristoff_it has joined #zig
<daurnimator> --> 'prefix' is where the built files should assume any hard coded paths start from (e.g. /usr vs /usr/local vs /opt/myprog). 'DESTDIR' is where the destination rootfs is mounted.
kristoff_it has quit [Ping timeout: 248 seconds]
mipri has joined #zig