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> andrewrk: hmmmm. you added errors but not error unions?
<daurnimator> andrewrk: also you broke the escaping :(
<andrewrk> how is that possible?
<daurnimator> error.@"foo\"bar"
<andrewrk> oh, you mean I didn't implement it correctly in the first place
<andrewrk> the other thing I noticed is that tagged unions don't get emitted correctly
<daurnimator> yeah sorry, I meant "you broke the invariant that you can't escape into invalid json without a custom trait"
<andrewrk> the tag is missing so you can't serialize/deserialize
<daurnimator> see the comment on the union thing
<daurnimator> `// try each of the union fields until we find one that matches`
<daurnimator> andrewrk: what I was working on last night: http://sprunge.us/ScNVXB
<andrewrk> information is lost during serialisation
<andrewrk> anyway good point about error.@"foo\"bar"
<daurnimator> andrewrk: a serialisation can't infer what to use as the tag field; so if you need to emit the tag you'd have to implement a jsonStringify trait.
<daurnimator> I hope to have a jsonParse trait working soon
<andrewrk> if it's a tagged union, then the tag can be used as the tag
Biolunar has joined #zig
<daurnimator> ?
<andrewrk> {"tag": "tag_name", "payload": ...}
<daurnimator> `struct { foo: union { .A = u32, .B = struct { x: u8, y: u8 } } }` -> serialise how?
<daurnimator> that's just inventing "tag" and "payload" as special fields
<daurnimator> which isn't going to interoperate with (m)any JSON documents out there
<andrewrk> ok I see what you were going for
<daurnimator> I added union support to express the common situation that you want to parse `{"foo": bool|number|object_with_key_bar}`
<pixelherodev> Wha'ts the ZLS change that was supposed to be here now? Local labels?
<pixelherodev> ... oh wait
* pixelherodev facepalsm
<pixelherodev> s/sm/ms
<pixelherodev> I did a dumb ignore me
<pixelherodev> ... okay now I'm worried
layneson has joined #zig
<pixelherodev> local vars dno't seem to be workign with ZLS :(
<pixelherodev> gahh
<pixelherodev> s/no/on s/gn/ng
<pixelherodev> Ahhh okay, it doesn't recognize packages yet
<pixelherodev> patch time...
haliucinas has quit [Read error: Connection reset by peer]
haliucinas has joined #zig
ifreund has quit [Ping timeout: 272 seconds]
cole-h_ has joined #zig
nephele_ has joined #zig
ur5us has quit [Remote host closed the connection]
ur5us has joined #zig
nephele has quit [Ping timeout: 244 seconds]
nephele_ is now known as nephele
xilef has joined #zig
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 265 seconds]
slurpie has quit [Ping timeout: 246 seconds]
kristoff_it has quit [Ping timeout: 240 seconds]
stripedpajamas has joined #zig
Bekwnn has joined #zig
wozeparrot has quit [Ping timeout: 258 seconds]
cole-h has quit [Quit: Goodbye]
cole-h_ is now known as cole-h
slice has quit [Quit: zzz]
slice has joined #zig
slice has quit [Client Quit]
<pixelherodev> Okay, two patches to work on for ZLS: packages, and structures
<pixelherodev> instances*
reductum has joined #zig
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
xackus has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
cole-h has quit [Client Quit]
cole-h has joined #zig
reductum has quit [Ping timeout: 265 seconds]
<pixelherodev> To any ZLS folks: what's the easiest way to access debug output?
slice has joined #zig
aerona has quit [Quit: Leaving]
layneson has quit [Quit: WeeChat 2.8]
knebulae has quit [Ping timeout: 240 seconds]
dddddd has quit [Ping timeout: 265 seconds]
stripedpajamas has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stripedpajamas has joined #zig
nycex has quit [Remote host closed the connection]
nycex has joined #zig
dingenskirchen1 has joined #zig
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen1 is now known as dingenskirchen
AlecTaylor has quit [Quit: Leaving]
slowtyper has quit [Ping timeout: 272 seconds]
xackus has quit [Ping timeout: 265 seconds]
slowtyper has joined #zig
<pixelherodev> Hmm, I can actually skip a proper register allocator for now
<pixelherodev> Short-term, I can use a really simplistic "assign until we run out or are done" allocator
<pixelherodev> Which means more functionality with which to test a good allocator later on
_Vi has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
daex has quit [Ping timeout: 256 seconds]
daex has joined #zig
drewr has quit [Ping timeout: 260 seconds]
wootehfoot has joined #zig
cole-h has quit [Quit: Goodbye]
stripedpajamas has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
slurpie has joined #zig
dermetfan has joined #zig
xilef has quit [Ping timeout: 272 seconds]
Bekwnn has quit [Ping timeout: 245 seconds]
daex has quit [Ping timeout: 265 seconds]
daex has joined #zig
xilef has joined #zig
reductum has joined #zig
reductum has quit [Client Quit]
gpanders has quit [Ping timeout: 256 seconds]
gpanders has joined #zig
xilef has quit [Ping timeout: 265 seconds]
slice has quit [Quit: zzz]
_Vi has quit [Ping timeout: 240 seconds]
hooo has joined #zig
<hooo> hi guys, I thought I'd share some criticism for zig here
<hooo> This: `std.debug.warn("hello world", .{});` is completely and utterly insane.
<torque> what is insane about it?
<hooo> you dont actually think that I want to write that giant line everytime I want to print something, right? I could somehow get behind the weird .{} syntax - potentially - but not the general verbosity
<torque> well, you could print "hi world" if you don't want to have to type so much
<hooo> kk, I'll wait until somebody more serious comes along
<daurnimator> hooo: what sort of answer are you looking for?
<daurnimator> "yes its not super easy to type"
<hooo> "yes sir, we are working to fix this for you asap"
<hooo> I state that with a bit of humor but yeah
<torque> you didn't really mention what you think should be fixed about it, and "it's too long" is far too generic a complaint to be particularly useful
<hooo> there are several indications that Zig is going to hard fail soon
<hooo> the tab issue is another objectively false stance
<bgiannan> `const warn = std.debug.warn;` there you go
<torque> you could bind the "warn" function to a shorter variable name as mentioned above
<daurnimator> I think I find the number of special characters it the annoying bit: periods, commas, parentheses and curly braces.... its too much
<daurnimator> I'm used to e.g. `print(asd)` in lua or `printf("%p\n", asd)` in C, which was already a bit too much.... and then zig's is longer
<daurnimator> even `console.log(asd)` in javascript is a bit much
<hooo> yes bgiannan, I know what it is. The point is that it's not the default and it has actually gotten worse over the lifetime of zig's project
<hooo> so clearly the project has no intention of going into the right direction
<daurnimator> I wonder if we can something like lua does with LUA_INIT and have some automatically injected piece of zig code in all scopes?
<daurnimator> ZIG_MAIN_PREFIX='usingnamespace @import("/home/daurnimator/.zigsnippet");`
<bgiannan> hooo, right like System.out.println stopped Java from being popular
<hooo> that was 20 years ago, that wouldn't fly anymore today
<torque> namespaces are a good thing, and you can opt-out of them trivially anyway
<bgiannan> if std.debug.warn being too long, and hard tabs are your only points against zig i think we're fine3
<hooo> no they arent my only points, they are canary in the coalmine
<bgiannan> so use something else?
<hooo> const one_plus_one: i32 = 1 + 1;
<hooo> warn("1 + 1 = {}\n", .{one_plus_one});
<hooo> why would I possibly have to wrap the variable in .{} before I can print it?
<hooo> The only reason why I even bring this up is because I'm not convinced that it will never get fixed
<hooo> it's so obviously wrong and insane but nobody sees it
<bgiannan> the .{} is fairly recent actually
<torque> why is it wrong and insane?
<hooo> now*
<bgiannan> i wasn't for it but i don't see it as a huge issue
<torque> you're throwing a lot of strong language around without any actual arguments?
<hooo> none of these things are huge issues, but put them all together and it makes it huge
<torque> while I agree that syntactically I think it's a bit clunky, semantically it makes a lot of sense
<torque> the language does not have variadic functions, so functions that must take an indeterminate number of arguments (e.g. a string formatting function) take a tuple as a structured collection of ordered arguments
<jhamren> almost my first time here, is it common with such rude persons as hooo?
<bgiannan> jhamren, it's not
<jhamren> alright, good
<jhamren> ty
<torque> this incidentally makes the edge-case scenario of no additional arguments (and therefore an empty tuple) stand out a bit more
<GreaseMonkey> an easy way to deal to the std.debug.warn thing is, well
<GreaseMonkey> const warn = std.debug.warn;
<GreaseMonkey> there we go, now you only need to type warn("Hello World!\n", .{});
<torque> note that the language is still under design and is open to reasonable, well-explained design suggestions, but hooting and hollering about it being insane and wrong isn't really going to change a lot of minds very effectively
<jhamren> isn't there a std.log proposal as well?
<torque> for example, it may be reasonable to suggest a vararg-like syntax at the call site that implicitly wraps arguments in a tuple (though this introduces its own complications for the definitions)
ur5us has joined #zig
<alehander92> hooo, i think with modern ide-s
<alehander92> and autocompletion, having a bit longer code is not too bad
<alehander92> even if i also dislike depending on autocompletion
<alehander92> but e.g. python also did `a %s %d' % (a, b)`
<alehander92> look: a tuple for formatting
<alehander92> yeah, it uses `()` not `.{}` but not too different
<hooo> alehander92: that's always the same argument and it doesnt turn out to be true for endusers. I really dont want to write .{} instead of (). It may seem like a small thing but it all adds up
<alehander92> yeah, trust me, i dont like verbosity
<alehander92> but after all language consistency is much bigger in the whole picture
<GreaseMonkey> one of Python's biggest mistakes was its tuple syntax
<alehander92> now, if you just dont like `.{}` syntax, this means this should be changed in the whole language
<GreaseMonkey> seriously, i'd rather type .{} than deal with yet another case where something silently was a tuple without me noticing
ifreund has joined #zig
<daurnimator> alehander92: I don't want to require the crutch of an IDE
<alehander92> well, i meant any editor with autocomplete
<alehander92> but i do agree
<jhamren> is there anything on the roadmap wrt editor support like autocompletion?
<jhamren> crutches or not, it will be popular
<alehander92> wouldn't you just have lsp support?
dddddd has joined #zig
<jhamren> yeah, I assume so.
<dermetfan> daurnimator: Thanks for lua-http. We use it at work to configure a Jitsi server. Noticed I had seen your name before...
<daurnimator> dermetfan: it needs some love :(
<daurnimator> Have sort of lost interest in it lately
<dermetfan> Understandably when there's zig ;) We just do some simple requests with it so it's fine
puzzleddev has joined #zig
<daurnimator> there's not a good windows story for it; I sort of hope zig might close that loop
<daurnimator> otherwise I learned that robust conection reuse is *hard*. so hard that no one has done it while keeping a fully featured client
puzzleddev has quit [Read error: Connection reset by peer]
alexnask has joined #zig
puzzleddev has joined #zig
<wilsonk> jhamren: zls has some autocompletion and it is probably the lsp that is furthest along
<daurnimator> dermetfan: still though; nice to be recognized; and thanks for the compliment
<jhamren> wilsonk: ah, i see, thanks
stripedpajamas has joined #zig
<alexnask> jhamren, I believe it is planned for the stage 2 compiler to eventually include a language server itself
<jhamren> understandably not a high prio thing, just curious and spoiled by Go.
<alexnask> I would use zls or zig-lsp for now
<alexnask> zls supports a lot of the basic completions, I will add "go to definition" today. Not sure how far along zig-lsp is
cow-orker has quit [Remote host closed the connection]
<jhamren> the basic things get you to like 80% of the way luckily.
_Vi has joined #zig
stripedpajamas has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow-orker has joined #zig
FireFox317 has joined #zig
<FireFox317> hooo, also if you just want to print something without formatting in the case of hello world, you can just make a different warn function that only takes a slice of bytes as input, such that you dont have to type the empty tuple.
<daurnimator> `pub fn p(x: var) void { std.debug.warn("{}\n", .{x}); }` seems like it could be useful
<mq32> daurnimator: my browser tells me that std.debug.warn is not a valid domain :(
ur5us has quit [Ping timeout: 256 seconds]
<alexnask> .warn tld when?
<daurnimator> only costs 150K
THFKA4 has quit [Remote host closed the connection]
FireFox317 has quit [Remote host closed the connection]
<mq32> I'm laughing waaay to hard at this site
<mq32> great satire
<ifreund> lol
<ifreund> just noticed the author names :D
<alexnask> wilsonk, any way you can check if it still crashes with https://github.com/zigtools/zls/pull/53 ?
<alexnask> I think the other issue is also fixed by it. At least `panic` specifically completes fine for me
<alexnask> (nvm misread the second issue, I didnt know about `;` deleting the snippets in other language servers, I will look into it)
<daurnimator> so... you know how I was saying how complex http headers are when you try and be robust?
<daurnimator> alexnask: ^ bad news...
<joepie91> mq32: you call it satire, I call it something I have genuinely seen people expect... :(
<joepie91> *so many times* I have had to explain to people that "hasn't had updates for 2 years" sometimes just means that the package is done, not that it's been abandoned...
<alexnask> daurnimator, What a treat /s
<daurnimator> and have I mentioned how the spec is different per http version?
<daurnimator> so do we want content-length semantics for http 0.9, 1.0, 1.1, 2.0 or 3?
<alexnask> Im happy I've never had to know the difference :D
<daurnimator> alexnask: so.... what do we implement for ZLS?
<alexnask> I'm guessing most if not all clients do HTTP/1.1 style (?)
<alexnask> I'll have to look at some other servers and see what they do
<alexnask> Like clangd or something
<daurnimator> I'm going to guess the answer is incorrectly
<alexnask> lol
r4pr0n has joined #zig
bitmapper has joined #zig
<bitmapper> so i found sorta a way to get zig to work with llvm 10 on macos?
<bitmapper> you need to link with libPolly and libPollyISL in llvm
dimenus has joined #zig
<jhamren> bitmapper: I think that issue is already in the setup instructions, albeit abit hidden
<bitmapper> yeah it's mentioned
<pixelherodev> alexnask: Is it worth trying out your PR + vexu's Zig patch in current state and providing more feedback? Or should I wait until it's finished?
<pixelherodev> daurnimator: if everyone does it the same way, then arguably it's the spec that's incorrect
<pixelherodev> If everyone agrees on HTTP/1.1, but the spec says "use whatever," the spec's in the wrong IMO
<alexnask> It's missing some of the newest features and fixes. It doesn't improve much from a user's standpoint except for a couple of completions that dont trigger on master
<pixelherodev> Yeah, which I think I'm missing :(
<pixelherodev> Probably worth waiting though
<alexnask> It wont fix stuff like the allocator example you gave earlier (looking into this specific case now)
<pixelherodev> The biggest issue I have right now is accessing fields of a generic type
<daurnimator> pixelherodev: its more a problem with a slowly diverging spec
<alexnask> It will just correctly trigger for stuff like `functionCall().`
<pixelherodev> ... it doesn't for me
<daurnimator> pixelherodev: language server A may work with LSP clients X and Y, but not Z. while language server B may work with LSP clients Y and Z, but not X
<alexnask> I mean with the PR (and for functions with supported return types)
<pixelherodev> Ahh, yeah
<pixelherodev> With the PR :)
<pixelherodev> Define "supported return type?"
<pixelherodev> Does `type` count?
<alexnask> pixelherodev, Yes generic types aren't supported atm this is definitely a priority item on my todo list
<pixelherodev> :( gotcha
<daurnimator> pixelherodev: and yeah: I asked for clarification in the spec... and they closed the issue
<pixelherodev> Thanks :)
<pixelherodev> daurnimator: yeah I saw
<pixelherodev> That was ridiculous
<alexnask> No, types that would trigger completions if you did `someVar: TheType` now
<alexnask> (with `someVar.`)
<pixelherodev> I appreciate all the work you've put into it, ZLS is awesome :)
<alexnask> I will be working on go to definition today then will tackle at least the simplest form of generic stuff (like functions with single return statements that return types)
<alehander92> sounds interesting
<alehander92> how do you guys limit compilation time : hardcoded instruction limit or?
<alexnask> Obviously if you switch over comptime parameters, do some calculation and decide to return a type this way I wont really be able to help you without making a compiler :P
<alehander92> sorry if all those are answered in the manual, i am maybe too chatty these days
<alexnask> alehander92, The compiler has a limit on branches on any given comptime calculation
<alehander92> ok, can i change it
<alehander92> and what happens if it e.g. changes between versions
<alexnask> You can request more with the @setEvalBranchQuota builtin
<alehander92> thanks
<alehander92> so do you have like a repl based on the interpreter?
<daurnimator> no
<pixelherodev> FTFY s/no/not yet
<pixelherodev> :)
<daurnimator> s/not yet/not anymore/
<daurnimator> jimmi wrote one at one point
<daurnimator> IIRC
<pixelherodev> Huh
<pixelherodev> Also not yet :P
<pixelherodev> Okays, time to finish hello world with Thor and then get back to work on Zig stage2...
<pixelherodev> Ohhh, I see what was going on in insert mode
<alehander92> huh interesting
<pixelherodev> Errors aren't showing up because ZLS isn't processing changes the way it does new documents
<alehander92> yeah, maybe a low-level-code-running repl is more useful
<pixelherodev> So it works if I close and reopen, but not as I type
<daurnimator> alehander92: you might call e.g. gdb that.
<alehander92> yeah i just read about swift llvm + repl
<alehander92> but i dont see how: i am trying to imagine for nim
<alehander92> but how to add a custom function
<alehander92> except for reloading a dll etc
<daurnimator> alehander92: sorry I might be missing context: what are you talking/asking about?
xackus has joined #zig
<alehander92> about using gdb as a repl-like tool for languages like zig, nim, c
<daurnimator> theres a few ways to go about that
<alehander92> it's easy to call/manipulate, achievable to interpret other manipulations
<daurnimator> the first thing to note is that gdb is very scriptable with python
<daurnimator> so you can essentially "do anything"
<alehander92> yes, my job consists of that :D
<daurnimator> now... that's probably not what you want to do for *most* cases
<daurnimator> in a debugger like gdb it's more practical to think in terms of what's inside of artifacts (e.g. ELF files)
<daurnimator> --> you can call and introspect symbols in ELF files
<alehander92> ok.
<daurnimator> so if you want to compile a snippet on the fly: you'll need to compile it to an ELF file, and then make the symbols available from it available in the interpreter
<alehander92> smart
<alehander92> so in this case there is another problem
<alehander92> you want to redefine `a`
<alehander92> and `b` is calling `a`
<daurnimator> note: I just made everything up just then off the top of my head. I'm not talking from experience here
<alehander92> so you need to change somehow the reference in `b`'s instructions
<alehander92> of course another option is to maybe nop-pad
<alehander92> all functions
<alehander92> and basically replace the existing definition
<alehander92> if there is enough place
<daurnimator> couple of possible ideas: 1. maybe gdb does some magic symbol search path thing. 2. use the GOT. 3. always go via symbol table?
<alehander92> hm, maybe GOT is a good option
<alehander92> but replacing the function directly seems also ok to me
<alehander92> for many cases
<alehander92> basically you need to maintain a dependence tree of that stuff tho, so you know what to update each time
<daurnimator> and now we're getting into the territory of how the new zig incremental compiler works
<daurnimator> :)
<daurnimator> all roads lead to rome?
<daurnimator> or something.....
<alehander92> in nim what people did was compiling most code to different `.so`-s and adding something like a trampoline(? terminology) between changeable definitions
<alehander92> so one can do hot code reloading and on theory repl based on that
<alehander92> but i wondered if the debugger approach can somehow simplify that
<daurnimator> alehander92: maybe watch some of andrew's recent streams?
<alehander92> yeah, i planned to do that
<pixelherodev> Yeah, incremental compilation is nice
<alehander92> i need to learn more about `got`, `elf` anyway: thanks for the pointers
<pixelherodev> 0xDEADBEEF
<pixelherodev> 0x948FA8E8
<pixelherodev> 0xA8FC6A011
<pixelherodev> (sorry)
<alehander92> yeah but
<alehander92> because i am thinking of adding IC/parallel to a toy compiler of mine, i wondered about repl: and i feel its mixing stuff a bit
<alehander92> as you need to combine CT caching with RT info caching/state there
<alehander92> which is not obvious
<daurnimator> one thing I've been meaning to investigate in the area is dwarf abuse
<pixelherodev> That's what incremental compilation needs to do too
<alehander92> well, it doesn't really care for runtime state, does it
<daurnimator> IIRC the dwarf format is a turing complete VM
<pixelherodev> RT state is left alone in the ELF, true
<alehander92> you can run it in a loop, so you can easily update stuff, but you start the newcompiled program with fresh state each time
<daurnimator> ==> you can probably compile compile-time functions into DWARF so that you can just run them in a debugger
<pixelherodev> not necessarily
<pixelherodev> One goal is to update the binary while it's running
<alehander92> yeah, hot code reloading
<pixelherodev> e.g. pause the executable, perform incremental compilation and override memory
<daurnimator> pixelherodev: that's not even possible with W^X is it?
<alehander92> but yeah, would this work
<pixelherodev> ... W^X?
* pixelherodev is confused
<alehander92> daurnimator hmm *gets compile-compile-confused*
<pixelherodev> AHh, that's true, yeah
<pixelherodev> There are solutions though
<daurnimator> alehander92: compile-time code => functions that run at compile time (in C this would be macros)
<pixelherodev> daurnimator: would probably have to attach to the binary the way GDB does
<pixelherodev> Not sure how GDB does it, but it proves that it's possible
<daurnimator> pixelherodev: ptrace
<pixelherodev> GDB can also modify the program though
<pixelherodev> You can e.g. update variables and suc - oh right
<pixelherodev> That's in the *data* section
<pixelherodev> Not write-protected
<pixelherodev> One option would be to map in new code sections and unmap old ones?
<daurnimator> yep. that's called dlclose/dlopen ;)
<alehander92> daurnimator sorry!
<pixelherodev> Not quite what I meant
<pixelherodev> I mean, similar concept, yeah
<daurnimator> pixelherodev: why not? that's how I've done "hot code reloading" in C before
<alehander92> but how would this work , like thiose functions are using an interpreter
<pixelherodev> But I mean that we could just disable W^X
<pixelherodev> daurnimator: because an easier option is available?
<alexnask> `one thing I've been meaning to investigate in the area is dwarf abuse` this sounds so funny without context
<daurnimator> pixelherodev: it's not something you can disable. at least not easily (e.g. with a single process)
<pixelherodev> ... I mean, I basically do that for my JITs
foobles has joined #zig
<alehander92> hm, guys, you write JITs
<pixelherodev> The idea being that you store the code as data, MAP in executable | writable pages, copy the "data" to that section, jump in
<pixelherodev> It'd require a custom start() function, and the equivalent using linksection(".codeasdata") with a custom linker script
<pixelherodev> alehander92: I do :)
<daurnimator> pixelherodev: I'm not 100% sure if it works, but you'd mremap a page to writable; edit it; then mremap it back to executable. however you have to be 100% sure you're not currently executing that page
<daurnimator> (if that doesn't work; then I at least know you can unmap and then map in new memory)
<pixelherodev> Right, suspending the process is the tricky part
<pixelherodev> What I'm suggesting is a bit different though
<pixelherodev> Instead of remapping pages, you map them in *at process start*
<daurnimator> that's just being a dynamic linker :p
<pixelherodev> That is, you have the *entire code section* marked as writable *by the process itself* upon startup
<pixelherodev> Yeah, basically
<alehander92> ok guys, but isn't it easier to just use reloading shared objects
<pixelherodev> Yeah, easier, sure
<alehander92> automatically behind the scenes
<pixelherodev> Depends
<pixelherodev> That would unload data too
<pixelherodev> The idea here is to preserve data while running
<alehander92> because i'd love to replace binaries dynamically , sounds fun, but obviously also with traps
<daurnimator> indeed
<pixelherodev> I mean, you could probably use incremental compilation to a SO with a thin wrapper, but that's the kind of hot reloading that requires careful work to maintain runtime data
<alehander92> well this depends on how you implement it
<daurnimator> and you might want to read the musl posts on the idea
<pixelherodev> I'm trying to devise a way to maintain runtime data autonomously as part of the hot swapping process
<daurnimator> musl purpossefully doesn't implement dlclose because the semantics are icky/impossible
<pixelherodev> True
<pixelherodev> But glibc is, unfortunately, the norm right now
<pixelherodev> Plus we need to be able to support other OSes, which might have unknown or undefined semantics
<pixelherodev> We can't depend on host behavior
<daurnimator> ?
<daurnimator> it doesn't matter if dlclose is a no-op though
<daurnimator> it just means you waste memory keeping dead code around
<alehander92> ok, why don't you use llvm's jit btw?
<alehander92> this is literally another of the ideas for our nim repl
<pixelherodev> Because we don't want to depend on LLVM
<alehander92> ah
<pixelherodev> We're working towards removing it as a dependency
<pixelherodev> Also, not gonna lie
<pixelherodev> LLVM kinda sucks
<alehander92> yeah
<alehander92> i mean its a big dependency
<alehander92> but it does give you cool stuff, right
<pixelherodev> I'm working on an alternate LLVM backend
<pixelherodev> But still
<daurnimator> pixelherodev: that's not entirely true
<pixelherodev> I hope to be able to use my LLVM parser and transformer as an input to my JIT
<alehander92> i thouight you would need your own fast to compile debugging backend
<daurnimator> alehander92: we're not removing LLVM at all
<alehander92> and llvm for releases?
<pixelherodev> We're working towards removing it as a *required* dependency
<pixelherodev> For stage2
<alehander92> yeah, exactly
<pixelherodev> ?
<pixelherodev> I mean, it's probably always going to be a stage1 dependency
<pixelherodev> And it's potentially going to be an optional dependency for stage2
<daurnimator> yeah; that's better: LLVM is going to be an *optional* dependency
<pixelherodev> Which means we don't really *depend* on it at all ;)
<daurnimator> which isn't at all a reason to not make e.g. LLVM's JIT an optional dependency
<fengb> It’s still gonna be our optimizing backend for the foreseeable future
<alehander92> what about cranelift?
<daurnimator> for now, it's really just what people want to work on
<daurnimator> andrew is working on a debug-friendly incremental compiler.
<daurnimator> if anyone was to step up and say "I know GIMPLE; I'm going to write a GCC zig backend" we'd certainly help them out where we could
dimenus has quit [Quit: WeeChat 2.8]
<pixelherodev> I'm working on a self-hosted Zig backend separate from stage2
* pixelherodev shrugs
<fengb> It might be easier to have a C backend and pump that through GCC :P
<pixelherodev> Not really
<pixelherodev> Well, not for me
<pixelherodev> Ohhh, you mean then a GCC frontend?
<pixelherodev> Yeah, probably lol
<pixelherodev> Heck, I could probably write a crappy C backend in a matter of days if I really wanted to
<pixelherodev> The hard part would be to ensure that semantics are 100% correct
<pixelherodev> and it'd be hellishly inefficient
<pixelherodev> I find that writing backends is actually quite simpmle
<pixelherodev> s/simpmle/simple
<pixelherodev> Writing *good* backends is a whole different story :P
<alehander92> interesting
<alehander92> i can write a backend for fun
<alehander92> backend to .. javascript
<pixelherodev> Anyways, I'mma get back to work now
<alehander92> targetting*
puzzleddev_ has joined #zig
puzzleddev has quit [Ping timeout: 265 seconds]
<pmwhite> So, with ZLS in kakoune (though probably more general than that editor), when I type "std." I get an autocomplete list as expected. If I start typing one of the entries, say "ascii", then the entry itself actually disappears from the list of entries, even though it ought to be one of the only ones. Has anyone else experienced this?
bitmapper has quit [Read error: Connection reset by peer]
bitmapper has joined #zig
dermetfan has quit [Ping timeout: 240 seconds]
<r4pr0n> pmwhite: are you using latest master?
<alexnask> ^
cole-h has joined #zig
gpanders has quit [Ping timeout: 265 seconds]
gpanders has joined #zig
cole-h has quit [Client Quit]
cole-h has joined #zig
<plumm> pmwhite not sure if you saw but theres a pr to fix that
Akuli has joined #zig
slurpie has quit [Ping timeout: 265 seconds]
<pmwhite> As of mid-yesterday I was using master.
<mq32> pmwhite: that is sadly not helpful wit ZLS *laugh*
<mq32> those guys are an fire!
greenfork has joined #zig
<r4pr0n> pmwhite: try to pull current master, that will most likely fix it
<pmwhite> plumm: I followed the repo on GitHub yesterday, so I am aware of that lol. I didn't see a PR for that specifically, so i must have missed it
<plumm> It was discussed in discord and posted there
<r4pr0n> yeah it was merged on the course of a minute
<plumm> O dam
<pmwhite> Ah, well done folks
dermetfan has joined #zig
cole-h has quit [Quit: Goodbye]
stripedpajamas has joined #zig
bitmapper has quit []
cole-h has joined #zig
dermetfan has quit [Ping timeout: 256 seconds]
<pmwhite> What is the deal with the snippets? Doesn't look like kak-lsp recognizes them by default
<ifreund> pmwhite: you can disable them by making a zls.json file with the right keys
<pmwhite> Yah, I know, but I kind of want to use them if I can.
<pmwhite> I guess this isn't the right place to ask though.
<alexnask> I dont really know which clients support them, they should probably be off by default
<alexnask> The ${N} things are tab stops, you can tab through them in editors that support them
<greenfork> pmwhite, do you have by chance the config for your kakoune? I'm not sure I can set it up with zls myself, could use an example
GoorMoon has joined #zig
<ifreund> plus adding zig to the list of filetypes for which kak-lsp is loaded
<greenfork> ifreund, thanks a lot, I think I can figure it out from here
<pmwhite> Yup, same. Also, I have been manually running :lsp-enable to turn it on. You can probably do something more automatic though
<ifreund> i use a hook based on filetype
redj has joined #zig
GoorMoon has quit [Remote host closed the connection]
<r4pr0n> btw alexnask , are you currently implementing gotodefinition or why is your dev branch called like that?
<alexnask> I was finishing off a zig PR, I will start goto definition soon yeah :)
<r4pr0n> that's great! thanks for all your and superaugustes work on zls, it's great to see you progressing so fast 😄
<ifreund> yeah yall are crazy
<andrewrk> :D
<andrewrk> can't wait to try this
<pixelherodev> Yeah it's awesome
wozeparrot has joined #zig
dermetfan has joined #zig
<r4pr0n> does anyone know of a library for zig comparable to this rust crate? https://crates.io/crates/directories
<andrewrk> I don't think there is one yet
<mq32> i have interest in such a library as well
<mq32> r4pr0n, what's your main OS?
<r4pr0n> linux
<mq32> damn *laughing*
<mq32> i'm on linux as well
<mq32> but we have code for the Known Folders for windows as well
<pixelherodev> It should be straightforward to port such a library from e.g. C
<r4pr0n> yeah
<pixelherodev> There's a single header library for C that does that IIRC
<r4pr0n> what might be interesting is a possibility to use the xdg part also on macos since afaik most cli applications use xdg on macos and gui applications use the other ones
<mq32> hm, care to join forces?
<r4pr0n> yeah, we can do that
<mq32> i'm a bit busy now, but will be back later, i'll PM you
<r4pr0n> ok but i'm not in the us so it's 7pm for me right now, i might not be there in a few hours
<pixelherodev> Nooo, don't take it to PMs! We need to know every bit of progress! :P
<r4pr0n> ok, will post full diffs of every commit in here :P
<Akuli> one thing to keep in mind: directory names can be translated if the system is not english
<Akuli> for example, i have no ~/Music/ but i have ~/Musiikki/
<alexnask> On windows the translated system paths are valid but so are the english names
<nycex> there is a place where you set those locations thought Akuli
<nycex> either it was an env variable or an file iirc
<pixelherodev> r4pr0n: perfect!
<mq32> r4pr0n: it's 8pm here, you have one hour more than i do :D
<mq32> Akuli: good point! But note that for example windows has an API to query the location of ".Music"
<r4pr0n> oh well, I just thought it would be like 2pm or something for you so later would be your evening when i'm sleeping but that would be ok then i guess
<mq32> for linux, there's the XDG spec
<mq32> i just stopped working and want to play soe minecraft and watch videos, will be back in an hour or so
<Akuli> yeah, my point was that you should use api or read spec instead of hard-coding ~/Music/
<mq32> yeah sure
<mq32> but thanks Akuli for that thing, i'll set up a Ubuntu and Manjaro VM in German and $OtherLanguage to verify this
wootehfoot has quit [Read error: Connection reset by peer]
nycex- has joined #zig
nycex has quit [Ping timeout: 240 seconds]
nycex- is now known as nycex
<BaroqueLarouche> Just created a task to track PE link in stage 2: https://github.com/ziglang/zig/issues/5374
* BaroqueLarouche uploaded an image: image.png (135KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/PFpIjwimjoLHQwZoXFDzbDfx >
<BaroqueLarouche> Since I never done any of this stuff, I found that it's better that I rewrite coff.zig from scratch so I understand the format better
<pixelherodev> That makes sense
<pixelherodev> That's basically how I learned x86 codegen
<pixelherodev> I've now written about three different backends lol
<pixelherodev> Only one of them can be found anywhere on the internet
<BaroqueLarouche> pixelherodev: lol
<pixelherodev> The other two are... well, let's just say that if I released those I'd be embarassed to ever show my face in public again xD
<pixelherodev> tdeo: `request failed: Post "https://discord.com/api/v6/channels/606246764651085829/messages": io: read/write on closed pipe`
<pixelherodev> :(
waleee-cl has joined #zig
<tdeo> #ircdiscord :p
<tdeo> that's a bug in the library i'm using probably though
<pixelherodev> Oh right there's an actual channel!
dingenskirchen has quit [Ping timeout: 246 seconds]
dingenskirchen has joined #zig
stripedpajamas has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stripedpajamas has joined #zig
* mq32 pokes r4pr0n
* pixelherodev pokes mq32
<mq32> why must some youtube videos be longer than you wwant? :D
* mq32 is watching a LP for 2.5h now :D
<mq32> also started reading about the standard directory stuff
<r4pr0n> uh yeah i'm there
<mq32> i looked at the rust crate a bit
<mq32> i think we pretty much need an API consisting of two things only:
<mq32> an enumeration SpecialFolder
<mq32> and a function
<pixelherodev> Ooh, or
<mq32> fn get(*std.mem.Allocator, folder: SpecialFolder ) ![]const u8
<r4pr0n> yeah sounds good
<pixelherodev> `comptime val: enum_literal` (if (std.mem.eql(u8, @name(val))`
<r4pr0n> you wanna talk about it in pm though?
<pixelherodev> s/val/folder/g
cole-h_ has joined #zig
<r4pr0n> pixelherodev: oh you actually want us talk about it here?
<mq32> yeah, will probably spam the holw channel otherwise :D
<r4pr0n> thought you were ironic
<pixelherodev> I mean, yeah?
<pixelherodev> Why not?
cole-h has quit [Quit: Goodbye]
<pixelherodev> I was joking, but also serious
<r4pr0n> is it possible to make a three-people-chat in irc somehow?
<mq32> sure
<pixelherodev> Wait really? sure
<mq32> /join #zig-specialfolder
<pixelherodev> Ah that's true :P
<pixelherodev> Or
<pixelherodev> /join #zigsf
<mq32> IRC is ad-hoc
<pixelherodev> :P
<mq32> first channel it is. period.
<r4pr0n> yeah, of course, *that* is possible
<r4pr0n> well then lets go to mq32s channel
<pixelherodev> mq32: yeah :P
<pixelherodev> I was joking
mq32 is now known as ikskuh
cole-h has joined #zig
kradnoel has joined #zig
kradnoel has quit [Read error: Connection reset by peer]
cole-h has quit [Ping timeout: 256 seconds]
cole-h has joined #zig
cole-h has quit [Client Quit]
cole-h has joined #zig
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
cole-h has quit [Client Quit]
cole-h has joined #zig
<alexnask> wilsonk, About the ';' completion thing, which server does this? I need to take a look to see what they do, can't find anything relevant in docs
slice has joined #zig
<pixelherodev> ; completion?
<alexnask> Bad phrasing but they know what I mean :D Apparently some other servers will let you tab in a function snippet then immediately typing ';' will delete the snippet
Akuli has quit [Quit: Leaving]
ur5us has joined #zig
<foobles> i really gotta get back working on the compiler :/
<foobles> feels bad not doing anythnig in a while
<foobles> i suppose i have got to get wsl set up, or maybe i should just focus on other issues for a while >_>
<alexnask> Plenty of stdlib stuff to do too if ir.cpp is a bit much atm :D
<foobles> yeah that could be a fun distraction for a bit!
<foobles> good suggestion
<foobles> hmm i wonder if I could do something really evil, to find the assertion error.
<foobles> undo the import of stdassert.h, and define my own assert macro
<foobles> that prints out line numbre and file name
<alexnask> that could work for sure
<alexnask> You dont even need to remove the include
<alexnask> Just redefine it
<alexnask> C preprocessor ftw /s
<foobles> :DDDDDDDD
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
mokafolio has quit [Client Quit]
<squeek502_> very cool
slurpie has joined #zig
<andrewrk> I'll run it on my personal machine for a week or so to babysit it, then I'll move it to a vps
mokafolio has joined #zig
<alexnask> "ok fine I'll use actual commas" :(
<ikskuh> btw, there's a new player in town!
<ikskuh> new team on github for community library projects
<andrewrk> neat
<ikskuh> similar to the zigtools org, but for libraries
<ikskuh> ping me, nycex or r4pr0n if you wanna join and do community library efforts there
<alexnask> 👍
<pixelherodev> "ok fine I'll use actual commas" lol
[rg] has joined #zig
<andrewrk> alright so what else should we track? std lib tests probably
<andrewrk> the self-hosted compiler of course
<andrewrk> oh, the crypto algorithms
<andrewrk> json parsing and serializing
mokafolio has quit [Quit: Bye Bye!]
<andrewrk> it's pretty easy to write a benchmark with this framework: https://github.com/ziglang/gotta-go-fast/blob/master/benchmarks/self-hosted-parser/main.zig
<pixelherodev> I was about to look
<pixelherodev> then I yelled at myself
<pixelherodev> *later*
<pixelherodev> No more distractions
<pixelherodev> I just wasted like two hours :(
<fengb> Will this test compile speed or runtime speed?
<andrewrk> it'll test whatever you put inside the run() function
<ikskuh> zig submodule add https://github.com/ziglibs/known-folders
<ikskuh> andrewrk, why doesn't this owrk?! :D
<ikskuh> *laughs*
<andrewrk> fengb, if you want to use it to test compile speed, then you would execute a child proecss in the run() function
<fengb> An neat
<fengb> I can't tipe
mokafolio has joined #zig
thePiGrepper has joined #zig
xackus has quit [Ping timeout: 260 seconds]
slice has quit [Quit: zzz]
puzzleddev_ has quit [Quit: Leaving]
thePiGrepper has left #zig [#zig]
mokafolio has quit [Quit: Bye Bye!]
_Vi has quit [Ping timeout: 252 seconds]
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
mokafolio has joined #zig
[rg] has left #zig ["Konversation terminated!"]
dermetfan has quit [Ping timeout: 256 seconds]
hooo has quit [Quit: Connection closed for inactivity]
slice has joined #zig
cole-h has quit [Quit: Goodbye]