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/
daurnimator has joined #zig
layneson has quit [Quit: WeeChat 2.8]
afon has joined #zig
<andrewrk> I can't remember what I'm supposed to do to get command line tools working again after updating to macOS Catalina 10.15.4
<andrewrk> it didn't "just work"
afon has left #zig [#zig]
ur5us has quit [Ping timeout: 260 seconds]
<fengb> Oh hey, I figured out a silly workaround for defining tuples: https://godbolt.org/z/reR4Zs
ur5us has joined #zig
r4pr0n has quit [Quit: r4pr0n]
<daurnimator> fengb: assuming a `u1` casts to your thing...
<fengb> I feel pretty dirty doing this
<andrewrk> fengb, how about a struct instead of a tuple?
<fengb> That's what I have right now but this is betterer
easyAnalyst has joined #zig
<fengb> (Actually this is terrible, I'll just wait for real tuples)
nephele_ has quit [Ping timeout: 265 seconds]
nephele has joined #zig
<fengb> We have "wasm32-freestanding-musl" on the bootstrap list. Shouldn't that be wasi instead?
<andrewrk> it should probably be removed. that list is the result of `zig targets | jq .libc`
<andrewrk> I wonder who is going to be the person who gets zig building with emscripten and makes a wsam build of zig for ziglang.org/play
<andrewrk> I've been resisting the urge to do it
<mikdusan> andrewrk, re: macOS 10.15.4, just install Xcode 11.4 and then launch it once. it should automatically ask you to authorize installing command-line tools
<andrewrk> thanks mikdusan, that worked
<andrewrk> although it's stuck on 11.3.x with no update available
<daurnimator> mikdusan: does `xcode-select --install` on command line do the same thing?
<mikdusan> daurnimator: I believe so.
<mikdusan> andrewrk: 11.4 should be available from app store. but, you can manually download it if you have free developer account (do you?)
<andrewrk> shouldn't it get updated via the system software update?
<mikdusan> it should if it's marked as managed by app store
<andrewrk> I believe that is the case
easyAnalyst has quit [Ping timeout: 265 seconds]
<daurnimator> fengb: what if I have a 0 bit type? :)
mahmudov has quit [Remote host closed the connection]
darithorn has joined #zig
<fengb> You ever come back to a project after a few weeks and pray that your test coverage is good enoguh even though you know it isn't? :P
<andrewrk> I've made it into March for the release notes
darithorn has quit [Remote host closed the connection]
darithorn has joined #zig
jicksaw has quit [Quit: ZNC is kill]
jicksaw has joined #zig
<fengb> 🎉 almost there!
<andrewrk> yeah that's just the outline though, then I have to actually type it up 😅
<fengb> Oh... oof
easyAnalyst has joined #zig
<BaroqueLarouche> wow it's huge
waleee-cl has quit [Quit: Connection closed for inactivity]
<andrewrk> can't wait to be done with this and start making progress on the next release cycle
easyAnalyst has quit [Quit: Leaving]
joey152 has quit [Quit: Leaving]
<andrewrk> What is the closest thing out there available now that is a RISC-V System-on-a-Chip that is analagous to Raspberry Pi or BeagleBone
<shakesoda> andrewrk: there's a sifive board that fits that description i think
<andrewrk> HiFive Unleashed looks neat but it does not have e.g. HDMI or another way to output video/audio
<shakesoda> video out on risc-v is a bad situation
<andrewrk> why's that?
darithorn has quit [Remote host closed the connection]
<shakesoda> i've only seen people do it by plugging in a radeon
<shakesoda> which works on exactly one expensive configuration and i think needs driver hacks
<shakesoda> haven't seen any risc v stuff with integrated gpu of any kind yet
<andrewrk> integrated gpu, yeah I guess that's what I want. I guess that's another problem where there isn't really a non-proprietary integrated gpu
<andrewrk> maybe I'll just suck it up and learn how to use the VideoCore on the rpi
darithorn has joined #zig
darithorn has quit [Remote host closed the connection]
darithorn has joined #zig
darithorn has quit [Remote host closed the connection]
darithorn has joined #zig
darithorn has quit [Remote host closed the connection]
traviss has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 260 seconds]
<shakesoda> andrewrk: do it!
<shakesoda> the videocore is pretty neat, imo
<shakesoda> my pi zero shenanigans have involved poking the hardware compositor to get gles layered separately over my linux fb console
<shakesoda> haven't quite gotten in so far as playing with the mailbox stuff in kernel space though
<shakesoda> looked into it, have not touched it
edr has quit [Quit: ZNC 1.6.5 - http://znc.in]
zfoo has quit [Remote host closed the connection]
cole-h has quit [Quit: Goodbye]
MajorLag has joined #zig
tgschultz has quit [Ping timeout: 265 seconds]
MajorLag is now known as tgschultz
dermetfan has joined #zig
mierenhoop has joined #zig
_Vi has joined #zig
mierenhoop has quit [Quit: leaving]
ur5us has joined #zig
_Vi has quit [Ping timeout: 265 seconds]
<Yardanico> so, a very stupid question - is there a std function to check if a string contains a substring, or I just need to do it manually with a loop?
<Yardanico> ah, std.mem.indexOf and std.ascii.indexOfIgnoreCase
dddddd has quit [Ping timeout: 256 seconds]
FireFox317 has joined #zig
Ichorio has joined #zig
<livcd> Yardanico you traitor!
<Yardanico> livcd: XD
<Yardanico> nim + zig is good because you can have
<Yardanico> nim c --cpu:arm -d:danger --cc:zig --passC:"-target arm-linux-musleabi" --passL:"-target arm-linux-musleabi" main.nim
Ichorio has quit [Read error: Connection reset by peer]
ur5us has quit [Ping timeout: 260 seconds]
daex has quit [Ping timeout: 265 seconds]
_Vi has joined #zig
frett27_ has joined #zig
daex has joined #zig
<FireFox317> does someone know it i am allowed to use a zig mascotte as my profile picture?
<ikskuh> FireFox317: i think you have to ask the creator of the image?
<ikskuh> or look at the licence
<ikskuh> CC BY-SA 4.0
<FireFox317> hmm im not a license pro but: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).
<FireFox317> yes indeed
<ikskuh> you may even use the ziguana in your own works, but you have to use a similar licence
<ikskuh> and you have to credit people for their work
frett27_ has quit [Ping timeout: 256 seconds]
<FireFox317> i see, but for example when im using the logo as a profile picture for a youtube profile, how can i mention that xd
<ikskuh> profile description for example
<afontain_> note that there is projects that try not to allow that. It may be the case with cargo, rust and firefox.
<FireFox317> okay thanks guys! :)
<daurnimator> yeah zig is over-permissive for the logo IMO
<ikskuh> daurnimator: yeah, probably
<ikskuh> but it's nice to print and spread stickers with the word of Zig :D
<ikskuh> have to order a new batch for the hacker spaces and demoparties i'm at
<daurnimator> yes indeed. for lua we ask people to send an email for permission first
<daurnimator> pretty simple; but stops egegious misuse
<ikskuh> ah yeah
<ikskuh> that's a nice solution as well
<daurnimator> ... like the occasional person that comes long; makes a fork of the language; and calls it lua 6.0
<ikskuh> 😱
<daurnimator> "no you can't call your totally different fork the same thing"
<ikskuh> btw, a friend of mine always complains that Lua does not try to promote sandboxing
<ikskuh> do you know if that has any specific reasons?
<afontain_> on the other hand, forbidding calling non-official rust/zig/whatever with a few patches "rust" or "zig" is annoying for linux distributions
<afontain_> distributions will totally want to fix breakage, and when need be, will patch the software.
<daurnimator> ikskuh: define promote
<ikskuh> her words were like: "yeah they say we cannot guarantee that nobody can break out of a lua sandbox (_ENV or similar)"
<daurnimator> its up to the libraries/function that you expose to your sandbox
<daurnimator> yes lua could make it easier to tell you with are safe/not
<ikskuh> yeah that was my thought as well
<daurnimator> there's a few other things that could be made better for sandboxing too; e.g. I've suggested a scoped string metatable
<daurnimator> (the problem is that strings have a single table of methods: if you wanted to expose a sandbox without those methods you would have to patch on entry/exit which is painful; or remove them entirely which means you can't use perfectly cromulent libraries)
<ikskuh> ouch, good to know :)
frett27_ has joined #zig
<Yardanico> is it possible to pass --strip (like with zig programs) to "zig cc"?
<Yardanico> that would be pretty useful since otherwise I'd have to cross-compile binutils for the same arch just to get "strip" for that target
ur5us has joined #zig
ifreund has joined #zig
<FireFox317> Yardanico, currently if you dont pass -g the binary will be stripped i think
<Yardanico> well I think Nim passes that itself, gonna check it. also - what can be the reason for "file" saying that "src/client: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-arm.so.1, with debug_info, not stripped"
<Yardanico> but I built with -static so it shouldn't be dynamically linked, "ldd" also says it's not a dynamic executable
<Yardanico> but "file" says it's dynamically linked
mahmudov has joined #zig
<ikskuh> Yardanico: file has only the options to pattern-match
<ikskuh> it tries to give some text output based on bytes/bits in the file header
<ikskuh> it's not always precise
marijnfs has joined #zig
<Yardanico> well I'm just not sure if "zig cc" also statically bundles musl in the binary because when building a simple static hello-world binary in Zig for "arm-linux-musleabi" it runs file in termux (on my aarch64 device), but when using "zig cc" to build a nim app with libressl statically linked it doesn't want to execute ("./main: No such file or directory" which usually means that some libs for it are missing)
<Yardanico> s/runs file/runs fine
<Yardanico> but libressl itself is compiled with "zig cc" without issues (statically) and linked too (the binary is quite big, also I can confirm that it's inside the binary by "strings")
<Yardanico> but "strings file_with_libressl" shows that it has "/lib/ld-musl-arm.so.1" inside of it
<Yardanico> even though I provided "-static" argument
marijnfs has quit [Quit: Lost terminal]
neceve has joined #zig
neceve has quit [Client Quit]
neceve has joined #zig
_whitelogger has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
FireFox317 has quit [Ping timeout: 260 seconds]
<Yardanico> I explained it in https://github.com/ziglang/zig/issues/4986
<ikskuh> 4 days till release *hype*
frett27_ has quit [Ping timeout: 256 seconds]
zfoo has joined #zig
<zfoo> is there any site available to help find libraries written in zig? I'm curious if anyone has written a json emitter yet.
<Yardanico> you can do "language:zig your_search" on github
<Yardanico> although not all Zig libs are on github
<zfoo> cool, thanks
<Yardanico> there's also std.json but idk if it's what you need
<ikskuh> zfoo: std.json probably?
<ikskuh> ;)
<ikskuh> it even has auto-serializer/deserializer
<zfoo> oh, sounds like what I need
jjido has joined #zig
waleee-cl has joined #zig
<fengb> I think we should be cognizant of how our community develops and avoid becoming exclusive or elitist
nycex has quit [Remote host closed the connection]
nycex has joined #zig
<ikskuh> fengb, wow, that's a wall of text
<fengb> I like waking up to stuff like this :P
<fengb> Gives me motivation to stay awake but not leave the bed
<ikskuh> i have read some of it, but don't have the headspace for that right now
<ikskuh> do you have a tl;dr?
<Yardanico> well I'm skimming through it and basically it talks about how Elm core devs can use things like native modules themselves but restrict for everyone else, or even 'Instead of a process, you are told you need to build trust with the core developers (which I’ve spectacularly failed at). “Elm is built on relationships”.'
<fengb> Elm core is elitist and insular
<companion_cube> the language founder(s) influence the culture
<companion_cube> so, unless andrewrk becomes mysteriously insular and elitist I think Zig should be good
<fengb> Yep, I’m liking the direction so far
<companion_cube> (the core team, too, not just him)
<ikskuh> <companion_cube> the language founder(s) influence the culture
<ikskuh> yeah that's true for all projects
<companion_cube> and the early adopters, too
<fengb> But Rust has also had similar problems and that’s more of a community problem
<companion_cube> so y'all be nice :p
<Yardanico> yeah, for small languages this is really important
<ikskuh> and i really like the community here, you're all cool!
<ikskuh> ♥
<fengb> Oh crap it’s me!
<companion_cube> not sure rust is elitist, it's more over-proletyzing
<nephele> ah, lord farquat
<pmwhite> It's pretty long. I started reading when there were no messages after initial link, and I just got back after stopping halfway through.
<pmwhite> Entirely for the purposes of being constructive, I was trying to think of aspects of zig's development that might have a similar problem to the elm community. I thought of the whole tabs ban, which seems the most similar to the authoritarian attitude that the post was criticizing. To be balanced, I'll also say that I don't find the tabs ban all that significant nor was was the decision all that authoritarian, even though I
<pmwhite> personally do disagree with the need for a ban.
decentpenguin has joined #zig
<ikskuh> pmwhite: the tab ban has the simple reason to prevent all discussion and will be lifted with 1.0 afaik
<companion_cube> so zig fmt will have a config file, I imagine
<ikskuh> companion_cube: i'd rather have zig fmt be config-free, but just allow tabs in the compiler
<nephele> pmwhite, tabs aren't banned... the stage2(?) compiled just does not support them
<pmwhite> Ah, nice. I didn't know either of those things. I approve.
<companion_cube> ahah now bikeshedding on the bikeshedding ✔
<ikskuh> meta-bikeshedding! :D
<fengb> There won't ever be config for zig fmt
<nephele> can i store my e-scooter in the bikeshed? or do i need an e-shed for that?
<fengb> It's like go fmt. It just is
<pmwhite> I would actually be completely fine if zig fmt doesn't support a config file.
<ikskuh> fengb: yeah i like the argument they use (or at least, andrew quoted)
<ikskuh> "go fmt is nobodys favourite, but because of that, it's everybodys faviourite"
<ikskuh> or something like that
<fengb> Same. I absolutely hated Go's conventions and a week later I just didn't care
<gchristensen> sometimes go fmt is wrong, but at the same time it is always right
<fengb> It's always wrong. But it's consistently wrong :P
<gchristensen> :D
<ifreund> at least go fmt uses tabs though :D
<fengb> Like I said, consistently wrong 🙃
<ikskuh> oh no, it started! :D
<ikskuh> let's just hop to another topic!
<ikskuh> what have you coded in zig this week?
<pmwhite> zig fmt does a lot, but one thing it does not do is auto line wrapping
<ikskuh> on purpose
<ifreund> i'm still working on my wayland compositor, started layer_shell support today
<ikskuh> you can decide when to wrap
<ikskuh> trailing comma: wrap
<fengb> I kinda like it that way. Otherwise we start bikeshedding 80 vs 100 vs 120
<nephele> ikskuh, maybe i will steal SyrupThinker's code, to make a microcode chainloader for efi :3
<ikskuh> no trailing comma: no wrap
<ifreund> yeah the trailing comman thing is brilliant imo
<ikskuh> ifreund: absolutely!
<ikskuh> nephele: nice, for what purpose?
<ikskuh> ifreund: neat as well :)
<pmwhite> I agree, but i think it'd be a cool option to auto wrap at 80 characters or something.
<ifreund> nah that's the job of your text editor
<pmwhite> Formatters help me stop internally bikeshedding abouty own code.
<nephele> to allow hobby os to just use it once on boot ;), my computer has a nice bug where the amd processor just crashes randomly during runtime unless you apply a microcode update
<pmwhite> Auto wrapping meaning do the comma thing.
<ikskuh> nephele: ouch
<ifreund> pmwhite: again, you should be able to configure your editor to do that
<ikskuh> i'm still porting my UI stuff to zig
<ikskuh> started to drop the C++ based parser/layout compiler and started rewriting it in zig
<ikskuh> imagine! the zig coded parser is shorter than the flex file :D
<pmwhite> ifreund: maybe...
<ifreund> there's a good reason zig has been designed to be easy to parse, it makes simple tooling much easier to write
edr has joined #zig
<pmwhite> I'll buy that. If the line ends with a semicolon and a paren, then insert a comma before the paren?
<companion_cube> also, simple grammar makes it easier to have an error-tolerant parser, which is important for LSP
<ikskuh> oh yeah
<ikskuh> this is gonna be fun for me to make my parser have error recovering :D
<companion_cube> and AST, right? need an "invalid AST" node to represent these errors
<ikskuh> don't know, my stuff is too simple for an AST :D
<ikskuh> but i have to idea how to implement an LSP
<pmwhite> For vim, a full LSP server is less preferable than a fast "zig-complete main.zig 13 67" command that just spits out possible completions, since vim already has built-in autocomplete features.
<ikskuh> pmwhite: yeah i use the speculative thing that's built into VSCode
<companion_cube> pmwhite: that's also what LSP is for…
<ikskuh> which just gives you a list of possible matches already used in the file
<companion_cube> neovim has/will have builtin support for lsp
<pmwhite> I know LSP does that, but if you can make an LSP server, than you can make my tool, right? :)
<companion_cube> but with lsp you can build the tool once, and use it in all editors
<pmwhite> I haven't had amazing experiences with LSP, but maybe I've just never tried hard enough to set it up right.
<pmwhite> I also haven't switched to neovim yet. I probably should...
<fengb> I haven’t either
xnor1 has joined #zig
<fengb> Of course I barely use vim features. nvi or bust 🦖
<ifreund> i use kakoune because it's better :P
<fengb> Dems fightin werdz
<xnor1> hello, new to zig and I've got a couple of questions. first off, doc says struct may be automatically passed by reference instead of by value. I assume the pass-by-value semantics are preserved even if it's passed by reference under the hood (memcpy on write?)
<companion_cube> imho LSP makes fringe editors like kakoune a lot more viable
<pmwhite> I am tempted to switch to kak. Seems like it might be better.
<fengb> xnor1: args are always constant so there’s no real semantics
<xnor1> and can the user enforce passing by value other than "extern" (which seems a bit of a strange keyword for C ABI)
<ifreund> pmwhite: my transition from vim was easier than I thought it would be, kakoune does a much better job of making features discoverable imo
<xnor1> is there some online zig playground/compiler available to try out things?
<fengb> I think I theres a proposal for noalias
<ifreund> it's also easier to understand due to the orthagonal design, but i think im a little off topic for this channel
<fengb> godbolt.org is the closest to a playground
poga has quit [Ping timeout: 265 seconds]
<pmwhite> ifreund: hear me out on one potential criticism of kak that I don't actually know if I agree with. I saw a video once of someone saying to generally avoid visual mode in vim since it leads to nonrepeatable operations. Kak seems to me to be completely visual mode based, so if the video's point is a good point, then I would think kak is worse.
<ifreund> i'd say you don't need to repeat things if you do them all at once, I also don't think it makes things non-repeatable
<ifreund> if anything it makes writing macros far easier
<xnor1> fengb: just says "no assembly generated"
<fengb> Oh Zig is lazy. You need to convince the compiler to output something
<ifreund> for example, by printing something
<fengb> Easiest way is to do `pub fn main()` and reference your code
<fengb> Note that this site is designed for comparing assembly, not a general playground, so it's not as nice as it could be
<xnor1> what is .{} ?
<pmwhite> ifreund: good answer. I'd like to try kak again and get better at it.
<pmwhite> An empty tuple.
<xnor1> the documentation never explains this, but already uses it in hello world
<xnor1> and "tuple" is not mentioned once
<xnor1> (which I don't believe it is)
<fengb> Hmm, I suppose we missed the documentation when we added tuples :/
<Yardanico> ctrl+f in docs for "tuple" gives 0 results :P
<fengb> andrewrk is currently working on release notes so hopefully we'll have a nice blurb on tuples soon
jjido has quit [Quit: Connection closed for inactivity]
<ifreund> is my understanding correct that tuples are like a comptime-only array that allows mixed types?
<fengb> Eh... they're more like structs with magic fields that can coerce into arrays if all the types are the same
<companion_cube> structs with anonymous fields from 0 to n-1…
<ifreund> but you dont access the field by name like a struct
<fengb> .{ 0, 1, 2 } == struct { .@"0" = 0, .@"1" = 1, .@"2" = 2 }
<fengb> You actually can
<ifreund> oh, cool
<companion_cube> tuples and structs are really the same, except on the surface level
<companion_cube> product types!
<fengb> There's a little bit of work to make it indexable but you can do silly things like `.{ 0, 1 }.@"0"`
<xnor1> it's quite weird syntax, why is there a dot?
<companion_cube> for the grammar to be unambiguous
<ifreund> that's accessing a field of the struct
<ifreund> like .{ .orange = 1, .blue = 2 }.orange
<xnor1> why not tuple { 1, 2, 3 }, analogous to struct { ... } ?
<fengb> Because I was cheating. It's actually .{ .foo = 1 } to build an anon struct
<fengb> Right now, tuples can only be anonymous but there's an accepted proposal to have declared tuple types too
<xnor1> why does this compile: var x : i32 = undefined; try stdout.print("Hello, {}!\n", .{x});
<fengb> There’s no undefined check yet in the compiler. I think that’s on the roadmap
<fengb> Right now using undefined like that only guarantees you’ll get 0xaaaa in debug mode
<fengb> Oh and Zig is unsafe so the compiler might never catch that. We usually handle things like that with a runtime safety check
<companion_cube> `= undefined` explicitly means you know what you're doing anyway :)
<fengb> We should use comical keywords
<fengb> x = tharbedragons
<companion_cube> `var x: i32 = yolo_it_dude;`
<ikskuh> var x: u32 = i_know_what_im_doing_trust_me;
<fengb> nasaldemons
<companion_cube> `var x: i32 = i_am_a_debian_dev;`
<ikskuh> doSmething() orelse not_gonna_happen;
poga has joined #zig
marijnfs has quit [Quit: Lost terminal]
marijnfs has joined #zig
bjorkintosh has joined #zig
Spex_guy has joined #zig
<fengb> Maybe I shouldn't have done -j12. My laptop is barely usable now :(
<fengb> I forgot how bad stuttering used to be before multiple cores lol
<fengb> I wish there's a generic "folding at home" solution that lets me plug arbitrary computers together and just magically divvy up any work
<companion_cube> the syncthing of CPU sharing… that'd be nice
<companion_cube> fengb: write it in Zig, and there's your killer app
<fengb> Sounds easy enough 🙃
<companion_cube> (syncthing is my favorite Go thing, and the reason I believe you can write useful stuff in Go :p)
<fengb> I think Go is very productive and useful despite some decisions
<fengb> It’s actually my least favorite language that I’ll keep using >_>
marijnfs has quit [Quit: Lost terminal]
ifreund has quit [Quit: WeeChat 2.8]
ifreund has joined #zig
xnor1 has quit [Quit: WeeChat 2.8]
ifreund has quit [Quit: WeeChat 2.8]
ifreund has joined #zig
<ikskuh> hmm
<ikskuh> i'm having a CSS like language
<ikskuh> right now i support /* css comments */
<ikskuh> but i think about adding // cpp comments
<ikskuh> what do you guys think?
<fengb> Zig doesn't even support `/* comments */` >_>
<ikskuh> yeah
<ikskuh> i made /* */ because it was easier to implement in FLEX
<ikskuh> but now that i'm using a hand written parser, it just doesn't mater
<fengb> You should support all the comments. /* */ // # ; --
jmiven has quit [Quit: riboute !]
<ikskuh> haha
<ikskuh> no
jmiven has joined #zig
jmiven has quit [Client Quit]
jmiven has joined #zig
<fengb> `"${foo^}"` is a bashism :(
mahmudov has quit [Ping timeout: 240 seconds]
marijnfs has joined #zig
<ikskuh> oh yeah
cole-h has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
mahmudov has joined #zig
TheLemonMan has joined #zig
bjorkintosh has left #zig ["Leaving"]
marijnfs has quit [Ping timeout: 264 seconds]
marijnfs has joined #zig
joey152 has joined #zig
waleee-cl has joined #zig
dermetfan has quit [Ping timeout: 246 seconds]
octetta has joined #zig
layneson has joined #zig
<ifreund> is there a reason I'm missing for std.TailQueue to have allocateNode/destroyNode rather than just expecting the user to call allocator.create/destroy directly?
<ikskuh> it's more flexible
<ikskuh> there are functions with allocation afaik
<ikskuh> but you can move values between different queues for example
<ifreund> i fail to see how this is any different than calling it directly https://paste.rs/wa2
<ifreund> e.g. allocator.create(std.TailQueue(u32).Node);
dermetfan has joined #zig
layneson has quit [Quit: WeeChat 2.8]
<ifreund> honestly i feel like the current situation kindof violates "Only one obvious way to do things."
<ikskuh> for TailQueue?
<ifreund> both TailQueue and SinglyLinkedList have these methods, which directly call the passed allocator and return the result
<ifreund> i see two obvious ways of doing things, allocating the Node yourself with allocator.create() or calling TailQueue.allocateNode(allocator)
<ikskuh> yeah, i don't use those functions
<fengb> Arguably the first isn’t as obvious if you glance through the list of functions and fields
<ifreund> it could easily be added to the documentation
<fengb> lol documentation :P
<ikskuh> i thought i had documented a queue
<ikskuh> because it wasn't obvious at all how memory management is supposed to work :D
<ifreund> both TailQueue and SinglyLinkedList have full doc comments
<ikskuh> yeah
zfoo has quit [Remote host closed the connection]
gazler_ has joined #zig
gazler has quit [Read error: Connection reset by peer]
slowtyper has quit [Quit: WeeChat 2.7.1]
slowtyper has joined #zig
zfoo has joined #zig
<andrewrk> FireFox317, it's intended that you would be able to use the logo and mascot for that purpose
<andrewrk> Basically the only thing that is not allowed is for companies to lie about their relationship to the Zig project, or whether the Zig project endorses them
<Yardanico> wow
meowray is now known as \u
\u is now known as meowray
Akuli has joined #zig
neceve has quit [Ping timeout: 256 seconds]
decentpenguin has quit [Quit: decentpenguin]
slowtyper has quit [Quit: WeeChat 2.7.1]
dingenskirchen has quit [Remote host closed the connection]
xackus has joined #zig
xackus__ has joined #zig
xackus has quit [Remote host closed the connection]
xackus__ has quit [Client Quit]
xackus has joined #zig
FireFox317 has joined #zig
<FireFox317> andrewrk, ah good to hear! ziggy is awesome <3
<fengb> Zero > Ziggy. (ง'̀-'́)ง
<xackus> andrewrk, should I remove ArrayList functions that were already deprecated before the latest API change?
<andrewrk> xackus, by remove you mean `pub const foo = @compileError();` right?
<xackus> yes
<andrewrk> yes, although this will be an annoying breaking change, better to do it before 0.6.0 than after
<FireFox317> andrewrk, are the types of every statement in a function available when we do dump_analysis?
<andrewrk> yes
<andrewrk> you'll have to do some work to figure out how to map IR instructions to statements
<andrewrk> but each IR instruction knows which AST node it was generated based on
<andrewrk> sorry, let me clarify: dump analysis currently does not emit this information, but if you're asking if the information is available and could be added to the dump, the answer is yes
<andrewrk> this would likely substantially increase the size of the dump, and so if added it should probably be behind a flag
<FireFox317> i actually meant if it could be added indeed (if the data is available), i was looking around but wasn't clear if that was actually possible
<andrewrk> you would have to iterate over basic blocks and ir instructions, similar to what happens in codegen.cpp
<FireFox317> okay, will try some stuff. want to get a prototype working of hovering over a statement and showing the type in vscode xd
<FireFox317> but this is some helpful info, thanks!
<andrewrk> np, excited to see what you come up with
marijnfs has quit [Quit: Lost terminal]
casaca has joined #zig
dirkson has quit [Ping timeout: 240 seconds]
dimenus has joined #zig
<dimenus> do pointers to arrays no longer coarse into slices?
<andrewrk> they do
<dimenus> *coerce
<andrewrk> it's especially important they do since slicing with comptime indexes now gives you a pointer to an array
<dimenus> error: expected type '[]u8', found '*const [15]u8'
<andrewrk> it's the constness
<dimenus> ah
<andrewrk> the error could be improved with a note that explains it
<andrewrk> there's a framework in place for this but only partially implemented
dermetfan has quit [Ping timeout: 246 seconds]
<andrewrk> unrelated: I love how excited people are to work on the compiler, language stuff, and IDE integrations. I really should focus on getting self-hosted to the point where it is contributor friendly
<dimenus> hmm, still getting the same error after changing it to var
<fengb> Literals are now const unless you assign them
<BaroqueLarouche> sounds like you should use @embedFile instead of embedding your data like that
<fengb> I think that was true before but the compiler didn’t check properly
dingenskirchen has joined #zig
<fengb> Doing `foo = &[_]T{}` generates a pointer to const array because the memory isn’t explicitly assigned
<dimenus> i had const before, andrew said the constness was the problem
<dimenus> oh wow, i'm dumb
<fengb> You changed the pointer to var, but the memory space is still const because it’s not assigned anywhere
<dimenus> XD
<andrewrk> ok, but now the question on everybody's minds: can we see this game in action? :D
<BaroqueLarouche> did something say game development ?
<BaroqueLarouche> *someone
<ifreund> that paste looked pretty suspicious :D
<andrewrk> dimenus leaked level data! https://bpaste.net/JFYQ
<dimenus> hah!
<andrewrk> dimenus, you might want to change the inner slices to be arrays here
<andrewrk> no need for double indirection right? since the inner arrays are same sized
<dimenus> good point
<andrewrk> and e.g. the length does not need to be stored
<BaroqueLarouche> do you really need those array to be two dimensional ?
<andrewrk> a 2d array is still 1d in memory
<ifreund> ^
<andrewrk> (if you do what I said about making them arrays instead of slices)
<dimenus> no, i need the indirection - they're not all the same size
<andrewrk> ah ok
<dimenus> the top two are the same size, then the next two, and the last one is the base
FireFox317 has quit [Ping timeout: 256 seconds]
<dimenus> andrewrk: the inner arrays are the same size in each level, but the consumer takes a `[]const []const u8`
<dimenus> anyway, it's compiling successfully now, thanks everyone
Akuli has quit [Quit: Leaving]
<dimenus> fengb: that makes more sense that it's a compilation error now
FireFox317 has joined #zig
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
ur5us has joined #zig
ifreund has quit [Ping timeout: 265 seconds]
<FireFox317> andrewrk, do you have a small amount of time to help me with docs generation (it broke :( )? i know you are really busy with release notes, so please don't hesitate to say no :)
dermetfan has joined #zig
_Vi has quit [Ping timeout: 265 seconds]
gpanders has quit [Ping timeout: 260 seconds]
dimenus has quit [Quit: Leaving]
dermetfan has quit [Ping timeout: 246 seconds]
gpanders has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
HollMax has joined #zig
Xavi92 has joined #zig
<Xavi92> Hi! Just found about the Zig programming language and has sparked some interest to me. Are the similarities to Rust coincidential?
<shakesoda> not in the least
<ikskuh> hey Xavi92 :)
ur5us has joined #zig
<Xavi92> shakesoda: well, function signatures look pretty much the same: "fn name(param: type) -> return_type"
<ikskuh> i think it's just the current style of languages
<ikskuh> C++ allows this style too, go uses it too
FireFox317 has quit [Ping timeout: 265 seconds]
<ikskuh> pascal style declarations have a lot of advantages
<shakesoda> haxe and ts use the form too
<ikskuh> yeah
<fengb> I think Odin’s creator blogged about the different types of declarations
<ikskuh> you can make your return type dependent on parameters
HollMax has quit [Remote host closed the connection]
<Xavi92> I guess not, but does Zig assume variables as immutable by default, as in Rust?
<Xavi92> That's one of the features I appreciate a lot from Rust and always missed in C
<fengb> Function arguments are const. Variables are declared with either var or const
<andrewrk> you are encouraged to use const by default
<Xavi92> Yeah, this is getting more interesting every second
tgschultz has quit [Quit: Going offline, see ya! (www.adiirc.com)]
HollMax has joined #zig
<HollMax> Hi! I'm trying out reflection with `@typeInfo`, but I get `concurrent modification, Unable to dump stack trace: debug info stripped` during compilation
<ikskuh> hey HollMax
<ikskuh> welcome, you have encountered a compiler bug
<HollMax> 0.5.0
<HollMax> should I try master?
<ikskuh> yeah
<ikskuh> that's usually better
<ikskuh> but prepare for a lot of changes!
<HollMax> is there a way to run a for loop comptime without making it inline?
<ikskuh> you can use a while with a comptime var
<HollMax> that might work
<ikskuh> or you can execute the whole block just comptime
<ikskuh> comptime { for() {} }
<HollMax> I'm trying to print member names of types
<HollMax> my end-goal is to graft namespaces onto C libraries
<HollMax> and I'm trying to print names of all functions for now
<HollMax> I haven't found anything for comptime printing
<andrewrk> HollMax, the 0.6.0 release is Monday. so using master at this point makes a lot of sense, and you can switch to 0.6.0 on monday
<HollMax> oh, that would be a happy easter
<HollMax> but I'll try while with comptime var first