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/
drp has quit [Read error: Connection reset by peer]
slice has joined #zig
FireFox317 has quit [Ping timeout: 264 seconds]
slice has quit [Quit: zzz]
slice has joined #zig
_whitelogger has joined #zig
nephele_ has joined #zig
nephele has quit [Ping timeout: 260 seconds]
nephele_ is now known as nephele
marijnfs has joined #zig
marijnfs_ has quit [Ping timeout: 258 seconds]
dddddd has quit [Remote host closed the connection]
frmdstryr has joined #zig
alexnask_ has joined #zig
alexnask has quit [Ping timeout: 265 seconds]
dnmllr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
slice has quit [Quit: zzz]
dnmllr has joined #zig
dnmllr has quit [Client Quit]
dnmllr has joined #zig
dnmllr has quit [Client Quit]
slice has joined #zig
lanodan has quit [Read error: Connection reset by peer]
waleee-cl has quit [Quit: Connection closed for inactivity]
frmdstryr has quit [Quit: Konversation terminated!]
lanodan has joined #zig
slice has quit [Quit: zzz]
slice has joined #zig
antaoiseach has joined #zig
slowtype1 has joined #zig
sanaris has joined #zig
<pixelherodev> Anyone using zls with kakoune / kak-lsp?
cole-h has quit [Quit: Goodbye]
slurpie has quit [Read error: Connection reset by peer]
slurpie_ has joined #zig
<tdeo> yeah
aerona has quit [Quit: Leaving]
foobles has quit [Ping timeout: 245 seconds]
_apg has quit [Remote host closed the connection]
<andrewrk> got the code from the stream working, with no hacks
<pixelherodev> Awesome!
<pixelherodev> :party_hat:
_Vi has joined #zig
<wilsonk> sweet
<andrewrk> minus the extra _start as well
<pixelherodev> Nice!
<pixelherodev> ... I think I'm going to look into cleaning up your x86 backend tonight
<pixelherodev> because it offends me on a deep level :)
<pixelherodev> To be fair, I did the exact same thing early on
<pixelherodev> but my cleaner implementation is *still* over 300 lines currently
<pixelherodev> I think with the way you're doing it, it'd be bigger than any single file in the standard library :P
<pixelherodev> Movs are just the *worst*
<pixelherodev> Oh, and
<pixelherodev> The link to the x64 manuals :P
<pixelherodev> You're going to want a PDF reader that lets you use the table of contents in the sidebar
<pixelherodev> The thing is *massive*
ur5us_ has quit [Ping timeout: 260 seconds]
wootehfoot has joined #zig
slice has quit [Quit: zzz]
moo has joined #zig
daex has quit [Ping timeout: 260 seconds]
daex has joined #zig
bren077s has joined #zig
metaleap has joined #zig
ur5us_ has joined #zig
stripedpajamas has joined #zig
slice has joined #zig
bren077s has quit [Quit: -a- Connection Timed Out]
bren077s has joined #zig
stripedpajamas has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<scientes> pixelherodev, the worst part of that document is that 64-bit as a afterthought
<scientes> they get through 32-bit, and then have this list "this is what changes in 64-bit"
<pixelherodev> Ugh, yeah
<pixelherodev> It's not *terrible* but...
<pixelherodev> Might be worth looking at the AMD ones instead
pystub has joined #zig
pystub has quit [Ping timeout: 240 seconds]
slurpie_ has quit [Ping timeout: 256 seconds]
slice has quit [Quit: zzz]
slice has joined #zig
slurpie_ has joined #zig
ifreund has joined #zig
antaoiseach has quit [Quit: Lost terminal]
<wilsonk> has anyone gotten zigtools/zls working with VScode?
ur5us_ has quit [Ping timeout: 260 seconds]
drp has joined #zig
slurpie_ has quit [Ping timeout: 265 seconds]
cren has joined #zig
drp_ has joined #zig
drp has quit [Ping timeout: 265 seconds]
dermetfan has joined #zig
<cren> Can someone write an example of how to read user input from stdin? I'm looking at the tests for reference but I'm still not sure
<ikskuh> std.io.getStdIn().inStream().readUntilDelimiter*(…, '\n', …);
<ikskuh> there are several flavours of that function
<cren> where do the read bytes go? are they returned by that function?
<ikskuh> that's the thing that'S up to you
<cren> ah wait I see, you have to choose whether they are handled by the allocator or put into an arraylist
<ikskuh> there are flavours that read in a buffer, that allocate, that append to a arraylist
dddddd has joined #zig
<cren> I managed to get input to work, thank you
<ikskuh> :)
slice has quit [Quit: zzz]
rzezeski has quit [Quit: Connection closed for inactivity]
prrls has joined #zig
alexnask_ is now known as alexnask
dermetfan has quit [Ping timeout: 252 seconds]
dddddd has quit [Ping timeout: 260 seconds]
ur5us_ has joined #zig
dddddd has joined #zig
ur5us_ has quit [Ping timeout: 260 seconds]
FireFox317 has joined #zig
phillyiscool has joined #zig
<phillyiscool> Anyone tried their hand at writing a AWS Lambda runtime for Zig yet?
<phillyiscool> If not I might give it a go.
<phillyiscool> Step one would be to take the Bash lambda layer: https://github.com/gkrizek/bash-lambda-layer/blob/master/bootstrap
<phillyiscool> and create a zig function that gets executed
<phillyiscool> if that works then create a zig version of the bootstrap
<phillyiscool> Probably that runtime is too complex, Lambda will give you a smaller one
waleee-cl has joined #zig
xackus has joined #zig
cren has quit [Quit: Ping timeout (120 seconds)]
<pmwhite> I've used kakoune and kak-lsp tiny bit, but not with zig. I don't actually know what zls is though.
<fengb> It’s the latest Zig lsp
<ifreund> i just got it mostly working with kak-lsp, note that you'll need to build it with zig master though
cren has joined #zig
<phillyiscool> I'm trying to do a libcurl hello world and I get this:
<phillyiscool> ./hello.zig:11:36: error: expected type '.cimport:4:11.enum_unnamed_17', found 'c_int' _ = c.curl_easy_setopt(curl, c.CURLOPT_URL, "http://example.com");
<phillyiscool> I don't know how to interpret that (first time using a c library from within zig)
<phillyiscool> Any hint as to how to cast to "'.cimport:4:11.enum_unnamed_17" ?
<ifreund> phillyiscool: use .CURLOPT_URL instead of c.CURLOPT_URL
<phillyiscool> can you explain that?
<ifreund> zig translates two versions of c enums, one is the c.XXX which is just a c_int, and the other is an actual zig enum
<phillyiscool> would you expect a C function to take a c_int and not a zig enum?
<phillyiscool> wouldn't*
<ifreund> the .ENUM_NAME syntax is an enum literal which coerces into the enum type if a varaint with that name is present
<phillyiscool> From this syntax: const c = @cImport({
<ifreund> it takes a c enum in the signature, which gets translated to a zig enum
<phillyiscool> I would expect that imports are all under c, is that not the case?
<ifreund> C also just lets you use use enums like ints though with no cast
<ifreund> it is the case, the full type is probably c.enum_this_is_the_c_enum_name.CURLOPT_URL
<ifreund> but if you use the enum literal you don't need to type out the enum type
<phillyiscool> I guess what I'm asking is, I expect `c` to be a namespace, but it sounds like CURLOPT_URL is a global
<phillyiscool> does that make sense?
<phillyiscool> How does Zig know to pull `.CURLOPT_URL` from the `c` binding?
<ifreund> as I understand it that's not really what's happening
<ifreund> enum literals aren't related to any enum type in particular
<ifreund> but they can coerce into any enum type if the type has a variant with the given name
<mikdusan> the fn signature would be where zig learns what to coerce to
<phillyiscool> Does @cImport translate to an include?
<ifreund> afaik yes
<phillyiscool> ok, that explains how it knows what CURLOPT_URL is
<ifreund> a cimport.zig file is generated and put somewhere in your zig-cahce
<ifreund> then that is included
<fengb> .CURLOPT_URL implies the location’s type
<ifreund> *zig-cache
<fengb> Specifically the leading dot
<fengb> Without it, it’d be global
<phillyiscool> ok, that explains how it knows what CURLOPT_URL is
<phillyiscool> woops
<phillyiscool> duplicate message :)
<phillyiscool> So if it's an include why do I have to type c.curl_easy_init(); and not just curl_easy_init(); ?
<phillyiscool> Is this just special behavior for enums?
<fengb> Unions and structs also have similar behavior
<fengb> Although without a location type, those become anonymous structs or tuples
<fengb> const foo: Foo = .{ .bar = 1 }; // creates a Foo struct
<fengb> const foo = .{ .bar = 1}; // creates an anonymous struct with a bar field (will not match the Foo type)
<phillyiscool> yeah, i know this part
<mikdusan> phillyiscool: that's a common idiom. bring in the C lang stuff and sub-namespace it requiring 'c.whatever' for access. it can be any name you choose.
<phillyiscool> mikdusan but c. isn't required for access, as shown above :)
<mikdusan> c is required for the fn. from the fn, it then permits generic enum-literals for coercion
cren has quit [Ping timeout: 245 seconds]
<phillyiscool> Yeah, that's where my expectations weren't met, I assumed I needed to use c. to access *anything* that the library provided, but apparently it's for functions but not for enums.
<mikdusan> so your fn really wants: c.my_function(c.MyEnum.some_enum)
<mikdusan> and zig lets you do `c.my_function(.some_enum)`
<fengb> That rhymes!
<alexnask> phillyiscool, This is not specific to C import stuff, .enum_literal will coerce to any enum type that has an `enum_literal` field
<mikdusan> it's just sugar. fine tasting sugar, but just sugar
cole-h has joined #zig
<phillyiscool> What's the non sugar version?
<alexnask> hmm idk if I would call it sugar, it has its own type and can exist outside of typed contexts where it gets coerced to a specific enum type
<mikdusan> c.my_function(c.MyEnum.some_enum)
<alexnask> But it is tasty yeah :p
<fengb> Salt
<fengb> Syntax salt?
<phillyiscool> mikdusan, I meant the non-sugar version of .CURLOPT_URL
<mikdusan> sugar might be a bad choice of wording yeah
<mikdusan> phillyiscool: are you able to see the zig generated import file?
<ifreund> it's somewhere in zig-cache, in the o folder
<phillyiscool> there are many files in the o folder
<ifreund> should be called cimport.zig
<phillyiscool> there are several subfolders with cimport.zig files
<phillyiscool> maybe this is it: pub const CURLOPT_URL = @enumToInt(enum_unnamed_17.CURLOPT_URL);
<ifreund> you can nuke the cache and rebuild to get rid of any stale files
<ifreund> yeah so c.enum_unnamed_17.CURLOPT_URL is the sugar free version
<phillyiscool> ah, ok
<fengb> Why is it unnamed? That’s pretty fugly
<phillyiscool> so you would never use the non-sugar version
<ifreund> fengb: happens more than you would think in C code :P
<alexnask> sugar-free is for losers /s
<fengb> Oh right, enums are just a fancy way of doing globals
<mikdusan> I _think_ the explicit version would be `c.curl_easy_setopt(curl, c.enum_unnamed_17.CURLOPT_URL, "http://example.com")`
<ifreund> there are also lots of anon unions
<fengb> How does the function take in an enum if it’s unnamed?
<mikdusan> it is named. it's just named _unnamed :)
<alexnask> Is it actually named _unnamed in the C source?
<fengb> 🤯
<ifreund> probably thanks to the preprocessor
<mikdusan> one day someone will post this cimport.zig so we stop guessing :)
<alexnask> : D
<mikdusan> `pub extern fn curl_easy_setopt(curl: ?*CURL, option: CURLoption, ...) CURLcode;`
<phillyiscool> mikdusan do you mean me? I can do that
<fengb> It’s named!
<fengb> Oh is that a typedef? Do we not use the typedef name?
<mikdusan> `pub const CURLoption = enum_unnamed_17;`
<mikdusan> `const enum_unnamed_17 = extern enum(c_int) {...}`
<fengb> Yeah I think I should make a proposal to use the typedef name if it’s missing
<ifreund> it's a `typdef enum { .. } CURLoption;
<ifreund> fengb: sounds like a good idea to me
<mikdusan> so `c.curl_easy_setopt(curl, c.CURLoption.CURLOPT_URL, "http://example.com")` vs
<mikdusan> `c.curl_easy_setopt(curl, .CURLOPT_URL, "http://example.com")`
<mikdusan> phillyiscool: from there you can see zig knows that it must be type c.CURLoption . and that's how it knows to take a vanilla enum-literal `.anything` and coerce to c.CURLoption . if you used a `.bogus` it would give error
<phillyiscool> yeah it's making a bit more sense now, thanks for your help
dimenus has joined #zig
torque has quit [Read error: Connection reset by peer]
drp_ has quit [Read error: Connection reset by peer]
<mikdusan> anyone here have experience with interval trees?
foobles has joined #zig
<scientes> mikdusan, you could store it as an entry in two red-black trees
<scientes> as long as they are no duplicates
<scientes> or a way to avoid duplicates with other data
<scientes> yeah, interesting problem
<mikdusan> that pages states `A naive approach might be to build two parallel trees... O(n) time` . my use case will have duplicates
<scientes> ...which is no better than brute-force.
<mikdusan> i'm trying to figure out should I go with (augmented) interval tree or range tree
<scientes> ahh yes
<companion_cube> just use sqlite!™
<scientes> more like sqheavy
<companion_cube> ?
<oats> I really like zig's multi-line string syntax
<oats> I think that most languages kinda half-ass this and let it screw up code formatting
<foobles> yeah me too
<ifreund> agree
<ikskuh> oats: i just say C#-Multilines :D
<ikskuh> horrible :D
<ifreund> simple but elegant
<ikskuh> @"""foobles"" is a nickname";
<oats> oh yuck
<ikskuh> yep
<ikskuh> using "" as an escape for
<ikskuh> "
<oats> D:
<foobles> it's funny, in kotlin they use triple quotes, so you get the indentation issues like a bunch of other langs. so in IntelliJ, if you type the """, it will automatically add a `.trimIndent()` to the end of the literall :P
<foobles> thats the preferred way
<ikskuh> i really love lua's way of using "multiline strings"
<foobles> how are they different from other langs?
<ikskuh> anything that starts with "[[" with any number of = gets a multiline string terminated by ]] with the same number of =
<ikskuh> give me a sec
<oats> ikskuh: but code formatting is still bleh :P
<ikskuh> yeah
<foobles> ohhh yeah
<foobles> ikskuh i think C++ and Rust do the same thing
<andrewrk> as far as I'm aware zig is one of the only languages with line-independent tokenization
<ikskuh> but you can always put *any* code into a multiline string but just using "one more ="
<ikskuh> foobles: yeah
<ikskuh> andrewrk: yeah, that's a really nice feature
<fengb> How do lines affect other languages?
<mikdusan> /* ... */
<companion_cube> I guess the tokenizer has to deal with multi-line string literals
<companion_cube> about the only thing I can think of, really
<alehander92> hm, what does line-independent mean
<alehander92> ah, so no multiline stuff
<alehander92> btw
<andrewrk> imagine you are implementing a text editor syntax highlighting and the user has scrolled down to the middle of the document
<andrewrk> in a 10 GiB file
<alehander92> yeah, makes sense, but multiline strings are kinda useful
<andrewrk> you would like to not have to tokenize the entire file
<alehander92> for tests etc
<fengb> Oh
<fengb> That's why Vim syntax highlighting fails :P
<alexnask> alehander92, zig has multiline string literals, lines just all start with \\
<alehander92> ah
<alehander92> but this is still harder, because i cant copy paste something
<andrewrk> fengb, I've never seen it fail on zig source code :D
<ikskuh> andrewrk: if we would be totally crazy, we could parse zig code in parallel
<ikskuh> each line in it's own thread .D
<alehander92> but it makes sense from lang design point, so ok
<alexnask> alehander92, Easier than making sure the indentation is correct and the code doesnt look like crap in my experience
<andrewrk> alehander92, you can still copy paste
<mikdusan> ikskuh: just give each line to the GPU
<alehander92> but yeah, very useful for various tools as well
<ifreund> if you can't copy paste and add a \\ easily you need a new text editor
<ikskuh> mikdusan: lul. syntax highlighting done by the GPU :D
<alehander92> yeah ok i love text editors
<fengb> andrewrk: I've never thought about it and it's been bugging me for awhile. Glad we solved it in Zig :P
<ikskuh> one thing that bugs me about zig multiline is that it does not have a space between \\ and the content
<alehander92> awesome
<alehander92> btw , do you have column-level debug info
<andrewrk> yes
<ikskuh> yes
<alehander92> very offtopic, but just wondered about it for another language
<andrewrk> it's pretty useful when you get a panic on integer overflow and there are multiple operations on the same line
<alehander92> what a good day
<alehander92> oh yeah
<alehander92> that's similar to what we want
<alehander92> basically a *click on this call to jump* feature for our debugger environment
<alehander92> but one can also write such a gdb command actually
phillyiscool has quit [Remote host closed the connection]
dddddd has quit [Remote host closed the connection]
sanaris has quit [Quit: Lost terminal]
cole-h has quit [Quit: Goodbye]
stripedpajamas has joined #zig
decentpenguin has joined #zig
cole-h has joined #zig
dingenskirchen has quit [Read error: Connection reset by peer]
dingenskirchen has joined #zig
stripedpajamas has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dermetfan has joined #zig
rzezeski has joined #zig
<oats> is there any way to have an OutStream field in a struct, but nicely?
<oats> or am I gonna need noisy type params ;_;
<ikskuh> afaik, it's just noisy atm
<alexnask> You could use interface.zig, make an OutStream interface and get MyOutStream.init(any_out_stream)
<alexnask> Obviously reintroducing dynamic dispatch
<oats> I think dynamic dispatch would be an appropriate trade-off for type vars I don't really care about :P
<oats> alexnask: thanks for the idea
<alexnask> Cheers, here is the link https://github.com/alexnask/interface.zig , let me know if it works for you ;)
<ikskuh> what's the current pattern to "convert" []const u8 to [:0]const u8 ?
<ikskuh> reallocate?
<oats> alexnask: heh, I haven't actually used a zig library before
<oats> what's the protocol here?
<oats> just copy-paste? :P
<alexnask> This one is copy pastable and a single file yeah
<alexnask> Idk what the best way to do it is for more involved packages
<alexnask> ikskuh, does std.mem.spanZ not support regular slices?
<ikskuh> tha's the inverse way
<ikskuh> std.mem.dupeZ is what i needed
<alexnask> Ah right
dnmllr has joined #zig
slice has joined #zig
frmdstryr has joined #zig
dingenskirchen1 has joined #zig
<frmdstryr> How can I skip a test? Returning error.SkipZigTest just makes compiling fail with error uneachable code
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen1 is now known as dingenskirchen
prrls has left #zig [#zig]
<dimenus> having @tagName is so immensely useful coming from C
<pmwhite> I'm updating my code to the most recent zig version. I think I fixed all the stuff, but now the compiler is "terminating unexpectedly"
<pmwhite> I don't really know where to look?
frmdstryr has quit [Quit: Konversation terminated!]
<pmwhite> I compiled with --verbose-ir and found out it was an assertion error at analyze.cpp:7111
<alexnask> pmwhite, Unfortunately this is an assert in the IR rendering code
<pmwhite> any guess on what could be triggering it?
<alexnask> Are you compiling zig yourself or did you download a package?
<pmwhite> downloaded the lastest master tar.xz
<pmwhite> from the website
<pmwhite> binary, that is. I did not compile it.
<alexnask> Okay, no worries. Any way you can link to the code so I can repro and get a stacktrace?
<pmwhite> It has some wayland dependencies required in order to build, but if you use Nix, then there is a nix-shell that you can run zig build from.
decentpenguin has quit [Ping timeout: 256 seconds]
<pmwhite> I pushed just now, fyi, so that repo is not compiling at the moment, lol.
<alexnask> Ill figure it out ;) `zig build` is all I need to crash the compiler I assume?
nrdmn has joined #zig
<nrdmn> hello!
<alexnask> hi
<pmwhite> alexnask: yeah, that's all.
Akuli has joined #zig
<alexnask> pmwhite, Ill let you know when I can repro and find some workaround
<pmwhite> sweet, thanks a bunch.
<oats> is it possible to adapt the default build.zig to have another command, say run-debug that sets some kind of comptime global variable?
* oats feels in over his head with build.zig
<alexnask> pmwhite, Not familiar with wayland, where do I get xdg-shell-protocol.c?
<ifreund> alexnask: it's generated using wayland-scanner
<ifreund> idk if pmwhite has it in his build.zig or not
<alexnask> Thanks
<pixelherodev> Ooh, should we have a wayland-scanner->zig?
<pixelherodev> Instead of needing to translate-c, it can just generate zig directly
<ifreund> tdeo made one already :D
<pixelherodev> Nice
<pmwhite> oh, oops. I forgot about that. Run `make`
<ifreund> pmwhite: if you want to scan with your build.zig you can copy mine https://github.com/ifreund/river/blob/master/build.zig
<pmwhite> alexnask: ^
<alexnask> Lol guess I should have checked the makefile :D
<alexnask> I was wondering why it had build.zig and make :P
<pmwhite> to be fair, I did tell you that `zig build` should work.
<pmwhite> ifreund, that sounds like an improvement. I'll probably do that once this issue gets resolved.
slowtype1 is now known as slowtyper
drp has joined #zig
slowtyper has quit [Quit: WeeChat 2.8]
slowtyper has joined #zig
basedtho has quit [Quit: ZNC 1.6.5+deb1+deb9u2 - http://znc.in]
torque has joined #zig
<pixelherodev> Whoa whoa whoa
<pixelherodev> Working on one issue at a time?!
<pixelherodev> ... that actually sounds quite reasonable
<alexnask> Okay I can repro now :D Time to find the bug
zenxhd has joined #zig
<alexnask> pmwhite, I think this is the line that triggers it for some reason: const char_width = renderns.sourceCodeProAtlas.legend['X'].?.size[0];
<alexnask> Yes it will just segfault in another file on the same line if you comment it out.. Time to find out why it triggers it so much :P
<pmwhite> hmmm, interesting.
<pixelherodev> Is there a way to tell zls that a function's casing is deliberate?
<pixelherodev> "Doesn't match style" because I'm deliberately using two kinds of casing to differentiate two classes of operations
<andrewrk> zls complaining about style is of questionable compliance with https://ziglang.org/documentation/master/#Style-Guide which says "These are general rules of thumb; if it makes sense to do something different, do what makes sense."
<alexnask> Good point, we better add options :P
dnmllr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<andrewrk> haha
<alexnask> This is a weird bug
<alexnask> some_global_arr[0], some_global_arr[1] <- fine, some_global_arr[2] <- crash at codegen
<alexnask> some_global_arr is a [128]?T runtime value
<alexnask> >.<
<pmwhite> Hmm, I wonder where you saw that type.
<alexnask> legend: [128]?Glyph,
<alexnask> pmwhite, I have a workaround for you, `var X: usize = 'X';` and array access with [X]
<alexnask> Ill try to repro in a small testcase and open an issue
<alexnask> I cant even reap the beenefits of fixing compilation on wsl
<alexnask> Feelsbadman
<pmwhite> alexnask: just updated the three locations where I do that, but it still doesn't compile. Is it compiling for you?
<alexnask> Yes
<alexnask> I can ship you an elf executable as proof lol
<alexnask> Make sure they are 'var'
<alexnask> Im on master branch if that helps
<pmwhite> Oh, I did const.
<nrdmn> I'm having trouble building zig. It complains about symbols not being found. It seems like zig is not linked against libclang-cpp when it should be?
<pmwhite> Yay! It compiles. Thank you alexnask .
<nrdmn> Full build log: https://susepaste.org/4e982ba7
<alexnask> I just want a screenshot as a reward pmwhite :D
<pixelherodev> I'll patch the style thing in zls
<pixelherodev> I noticed it, I should fix it :)
<nrdmn> cmake says it can't find CLANG_LIBRARIES. When I pass -DCLANG_LIBRARIES=-lclang-cpp to cmake, it successfully links but then outputs ": CommandLine Error: Option 'mc-relax-all' registered more than once!"
<pixelherodev> Linking against clang-cpp is a pain from what I remember
<pixelherodev> I patched my Clang build to generate the many small libraries and linked against those, but I really wouldn't recommend it
<pixelherodev> Someone can probably tell you the *correct* way to solve this
<andrewrk> nrdmn, you have to link against everything statically because llvm, clang, and lld are not all provided dynamically by your package manager
_Vi has quit [Ping timeout: 244 seconds]
dddddd has joined #zig
alexnask has quit [Ping timeout: 256 seconds]
<nrdmn> andrewrk: you mean with 'ZIG_STATIC_LLVM=ON'? because I don't have the static llvm libraries either
<andrewrk> no, no configuration options on zig end's needed. your system package manager has not provided a set of libraries that are compatible with each other
<andrewrk> you will have to compile from from source until such time as your system packages actually work
<fengb> Will stage 2 offer an exclude-LLVM build option?
<pmwhite> alexnask: I haven't found a screenshot program that actually works on Wayland.
<andrewrk> fengb, yeah. other way around actually. -Denable-llvm
<fengb> Ah cool
<pixelherodev> THink I get the style thing working
<fengb> I've made it a point to not play Gameboy games until it runs in my emulator. But there's so many I want to play now :(
<andrewrk> I feel you on that
<fengb> Oh right, you're still shaving that yak
<pixelherodev> ZLS folks: there a place to send a patch? Or is GitHub PR the canonical way to send a patch?
<pixelherodev> Got warn_style opt-in working
<pixelherodev> I mean it was like ten lines but still :P
alexnask has joined #zig
<ifreund> pmwhite: what compositor? grim + slurp has worked great for me on sway
<pixelherodev> Same
<ifreund> works on river too :D
<pixelherodev> grim + slurp = :heart:
<alexnask> pixelherodev, Github PR if that is fine with you
* pixelherodev shrugs
<pixelherodev> I don't exactly like GitHub, but it's not going to kill me to send a PR lol
pystub has joined #zig
foobles has quit [Remote host closed the connection]
Snetry has quit [Quit: left Freenode]
Snetry has joined #zig
bren077s has quit [Quit: -a- Connection Timed Out]
traviss has joined #zig
marler8997 has quit [Quit: Leaving]
<nrdmn> looks like they're not going to change this: https://bugs.gentoo.org/show_bug.cgi?id=710306
bren077s has joined #zig
<traviss> wilsonk, did you have any luck with vscode and zig lsp? did you install this extension https://github.com/zigtools/zls-vscode/releases/download/1.0.0/zls-vscode-1.0.0.vsix ? were you able to build zls?
<ifreund> traviss: did you build zls using the master branch of zig?
<ifreund> there's a bug in std.json that got fixed post-0.6.0 which was causing problems for me using zls built on 0.6.0
<alexnask> Also we rely on the new error tolerant parser that vexu pushed today
<traviss> yes i'm on master maybe a week old. i was able to build zls and got it working with vscode.
<alexnask> Hah, `*guideline*`, touche
tgschultz has joined #zig
<tgschultz> Is there a way to make zig output freestanding in PE/COFF instead of ELF?
stripedpajamas has joined #zig
slurpie has joined #zig
<nrdmn> last time I checked, llvm did not support that
<tgschultz> What a weird thing to be missing.
stripedpajamas has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stripedpajamas has joined #zig
foobles has joined #zig
Pursche01 has joined #zig
foobles has quit [Remote host closed the connection]
<alexnask> Hah, `*guideline*`, touche
<alexnask> woops
pystub has quit [Ping timeout: 272 seconds]
wozeparrot has joined #zig
wozeparrot has quit [Client Quit]
wozeparrot has joined #zig
dnmllr has joined #zig
<wilsonk> traviss: just updated zig from git two minutes ago and built it, then updated and built zls. All went fine. Installed zls-vscode-1.0.0.vsix and it seems to be picked up by vscode as the hover functionality in settings.json states that the option 'zigLanguageClient.path' is the 'path to the zls exe' but zls still doesn't work. It doesn't even syntax highlight a zig file which I would assume would work with no config at all. Not sure what is
<wilsonk> traviss: all I have running for extensions is zls and vim.
<traviss> wilsonk, syntax highlighting is provided by a separate 'zig' extension by tiehuis. i found it by just searching for 'zig'.
<alexnask> wilsonk, zls is a lnaguage server it doesnt do highlighting. You should install vscode-zig for that
<alexnask> Just search for 'zig' by Marc Tiehuis
<wilsonk> ok, or I assume I can use anderfr's? Or does it matter?
<alexnask> I think this one is the most up to date extention but suit yourself
_Vi has joined #zig
<traviss> did you add an entry to settings.json `"zigLanguageClient.path": "/path/to/zls/zig-cache/bin/zls"`
<alexnask> ^
<wilsonk> Oh, nope I think Marc's is required because that just fixed everything. The 'path to zls' also needs to include zls as the executable...so not really just the path to where it is but what it's name is also in the string
<alexnask> Yes you need the exe
<alexnask> Also for an optimal experience I would suggest making a zls.json ile next to the executable
<alexnask> And adding { "zig_std_path": "/path/to/zig/lib/zig" }
<wilsonk> Can you specify these couple things on the github so that others don't run into these same problems? Please ;)
<alexnask> (this is needed to resolve std library imports)
<wilsonk> Yeah, I have the json file there...I thought I should make one up just in case it was needed for the plugin to run. I could tell from the code that there were defaults...but just thought I would do it anyways
<traviss> any luck wilsonk? are you seeing completions from the std lib?
<wilsonk> Looks all good now. Best part is that completions for the std lib work! That was the biggest part missing in metaleap's lsp. The best part about his, that is missing from zls is the hover hints over variables. I can see that you all have the hints for completion...just not the hover part yet
<wilsonk> That is IMO, of course :)
slurpie has quit [Ping timeout: 260 seconds]
<traviss> ok good. :) yeah i agree that hovers and jump to reference would be really nice to haves. big thanks to superaguste and alexnask. nice work guys.
<alexnask> Yes we have lots of work to do
<wilsonk> yeah, std lib completions with the code view and doc view for variables is a huge bonus! Works great, thanks guys!
<alexnask> Cheers, glad you like it. Please keep a mind to zig pr #5353 and recompile when it is merged if you can
<alexnask> There is a bug in the zig parser that can cause it to infinite loop, although its a pretty hard type to make (`arr: 100]u8,` in a struct)
<alexnask> typo*
<wilsonk> ah, ok
<alexnask> keep an eye on*
<alexnask> So many typos >_>
joey152 has joined #zig
bren077s has quit [Read error: Connection reset by peer]
bren077s has joined #zig
<GreaseMonkey> daurnimator: wrt your PR for deflate-for-zig (sorry it's taken so long for me to get back to this), the @intCast()s in block_tree.zig are more or less required right now unless we change the base type in readBitsNoEof (i get integer overflows otherwise), would you rather leave the types in or chagne the base type used for readBitsNoEof?
Akuli has quit [Quit: Leaving]
<ikskuh> hey, short question: why does i386-baseline emit sse instructions?
<mikdusan> p3 was first to support SSE
<ikskuh> hm
<mikdusan> not a reason but just to give idea it goes back quite a ways
<ikskuh> so i have to use baseline-sse-see2 for kernels?
<ikskuh> which seems to work
<fengb> The default CPU for i386 is Pentium 4 for some reason
<fengb> Try with -mcpu=_i386?
slice has quit [Quit: zzz]
<mikdusan> awesome "feature": slow_unaligned_mem_16
<ikskuh> _i386 is broken
<ikskuh> get an LLVM error
<GreaseMonkey> i'd've thought that it was -mcpu=i386
<fengb> _i686?
<fengb> Somewhere there's a working configuration
<GreaseMonkey> might be -march=i386
<GreaseMonkey> what's with the underscores?
<GreaseMonkey> does clang add them in for some bizarre reason?
<fengb> No idea. It's what `zig targets` spits out
<GreaseMonkey> is there a way to make sure one isn't accidentally outputting 64-bit 80386 code
<GreaseMonkey> because AMD64 requires SSE2 and uses it for its floating point calling convention
<ikskuh> x86_64 is not i386
<ikskuh> these are different targets
<fengb> There's a proposal to rename i386 to x86 since that's less confusing
<fengb> -target=i386 -mcpu=_i686 looks so weird
slice has joined #zig
stripedpajamas has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stripedpajamas has joined #zig
<GreaseMonkey> when's -target=i8086 :^)
<nephele> llvm doesn't do 8086 afaik :P
<GreaseMonkey> to be honest Zig is one of the few languages where the code often fits into 640KB of RAM
<nephele> I am looking forward to use zig in the fuuuture to build something fun for my ibm personal computer, but that has "only" 512KB :)
<mikdusan> I'll give you $5.12 for it's keyboard
<ikskuh> mikdusan: remove the point and i'll send you one
slice has quit [Quit: zzz]
Pursche01 has quit [Quit: Connection closed for inactivity]
curtisf has joined #zig
metaleap has quit [Quit: Leaving]
slowtyper has quit [Ping timeout: 256 seconds]
alexnask has quit [Quit: Leaving]
FireFox317 has quit [Ping timeout: 246 seconds]
slurpie has joined #zig
dermetfan has quit [Ping timeout: 260 seconds]
curtisf has quit [Remote host closed the connection]
<stripedpajamas> trying to figure out how to save the hex representation of a []u8 into a var. is (fmt, args) => []const u8 in the std library somewhere ?
<ikskuh> std.fmt.bufPrint
<stripedpajamas> thanks!
slice has joined #zig
<mikdusan> fengb: can you look at #3937? would you say `var vec : @Vector(4, f32) = src[0..4].*;` is correct and this issue can be closed?
<oats> is there anything equivalent to sscanf in the stdlib?
ifreund has quit [Ping timeout: 240 seconds]
<oats> stripedpajamas: there's also fmt.allocPrint if you want to allocate instead