ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
arBmind has quit [Quit: Leaving.]
return0e has joined #zig
btbytes has joined #zig
btbytes has quit [Client Quit]
cenomla has joined #zig
isd has quit [Quit: Leaving.]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Client Quit]
davr0s has joined #zig
davr0s has quit [Client Quit]
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
noonien has quit [Quit: Connection closed for inactivity]
jordyd has quit [Ping timeout: 246 seconds]
cenomla has quit [Quit: cenomla]
davr0s has joined #zig
mal`` has quit [Quit: Leaving]
mal`` has joined #zig
return0e has quit [Ping timeout: 264 seconds]
epsyloN has joined #zig
ice1000 has joined #zig
zesterer has joined #zig
<ice1000> Hi
<ice1000> Anybody here
<ice1000> How do you guys write Zig
<ice1000> With notepad? With the plain text editing mode of some IDE?
jfo has joined #zig
samthetechieQQYS has joined #zig
samthetechieQQYS has quit [Client Quit]
steveno_ has joined #zig
<MajorLag> I write in Notepad++ with a UDL, no idea.
<MajorLag> *ide
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jfo> I use vim, we've got pretty good syntax coloring support and eventually I'll get around to indenting etc type plugin stuff... https://github.com/zig-lang/zig.vim
Hejsil has joined #zig
<Hejsil> ice1000, with a console and any text editor but nodepad (This is not a joke https://github.com/zig-lang/zig/issues/544)
Hejsil has quit [Quit: Page closed]
jordyd has joined #zig
hoppetosse has joined #zig
<hoppetosse> andrewrk: congrats on 0.2.0!
adagio_ has joined #zig
btbytes has joined #zig
jfo has quit [Ping timeout: 264 seconds]
<MajorLag> That reminds me, I should get arround to uploading my Npp Zig UDL somewhere. My color scheme looks a bit like unicorn vomit, but of course that's user configurable.
<ltr_> andrewrk: can you point me where to read the details on how are you going to implement async await? what are you going to use internally (epoll/kqueue) reactor pattern?etc..
<andrewrk> ice1000, I use vim
<andrewrk> MajorLag, unicorn vomit color scheme sounds incredible
jfo has joined #zig
<MajorLag> andrewrk, a sample: https://img42.com/4ddGg
<andrewrk> ltr_, async/await is done, it works!
<andrewrk> MajorLag, I like it
<andrewrk> ltr_, I have a work in progress TCP server using epoll: https://github.com/zig-lang/zig/blob/wip-async-tcp-server/std/event.zig#L158
<andrewrk> the epoll/kqueue stuff is entirely in userland
<andrewrk> the reason this is WIP is https://github.com/zig-lang/zig/issues/821
jfo has quit [Ping timeout: 246 seconds]
Hejsil has joined #zig
redj_ has joined #zig
<ltr_> main branch?
redj has quit [*.net *.split]
<ltr_> nicer
<ltr_> nice*
jfo has joined #zig
<andrewrk> yes, coroutines, async, await are in the main branch
<andrewrk> the thing I liked is the branch wip-async-tcp-server
<andrewrk> *linked
<andrewrk> here is examples of coroutines in the main branch: https://github.com/zig-lang/zig/blob/master/test/cases/coroutines.zig
<andrewrk> I still need to add documentation for this
<Hejsil> No need. Code is the best documentation!
<andrewrk> hahaha
<andrewrk> documentation is the part where it tells you how it's *supposed* to work
<andrewrk> so you can tell the difference between bugs and features
<jfo> lol
davr0s has joined #zig
jfo has quit [Ping timeout: 248 seconds]
<MajorLag> Anyone interested in a Notepad++ UDL for Zig: http://zig.tgschultz.com/zig.xml
<andrewrk> MajorLag, mind if I throw this up in a repo and put it under the zig-lang org?
<MajorLag> Not at all.
<MajorLag> That goes for anything I throw on zig.tgschultz.com
<andrewrk> cool
<andrewrk> oh neat, you have a unicode library complete with documentation
<MajorLag> "complete"
<MajorLag> I'd have put this all on git, but I don't use it as part of my normal process and I'm lazy.
<andrewrk> I linked to your site on ziglang.org
<andrewrk> at some point I'll have the package manager working well and there can be a nice home for your library
return0e__ has joined #zig
<Hejsil> andrewrk, sooooo, what is the type signature of an async function? Zig tells me this: @compileLog(@typeOf(SliceFn.it)); -> fn(&const []const u8,?&u8)var
<Hejsil> This is SliceFn.it: async fn it(context: &const []const T, item: ?&T) void
<andrewrk> that's a bug, it should have `async` before it
<andrewrk> oh I see what's happening
<andrewrk> what's going on is that async functions require, as part of their type, the allocator struct type
<andrewrk> like this: async(AllocatorType) fn() void
<Hejsil> Aaaaah
<andrewrk> but you're allowed to leave it off and it gets inferred. but that makes it generic
<andrewrk> and then the bug is that generic async fn type name didn't get the async keyword
<Hejsil> I see
<andrewrk> I think in practice everybody is going to use std.mem.Allocator
<andrewrk> but zig the language has no dependency on the standard library
<andrewrk> and I didn't want to break that
<Hejsil> Ye, I can understand? So the generic allocator just need an "alloc" and "free" function?
<andrewrk> yes. although right now, those are named `allocFn` and `freeFn` and must be function pointers
<andrewrk> I may change this to be less esoteric
<Hejsil> I see. I wanted to implement something simular to C# Linq with coroutines, but I might just have come up with at better way to do it without them
<Hejsil> Oooh well, I'll play with couroutines another day
MajorLag has quit [Ping timeout: 245 seconds]
steveno_ has quit [Quit: Leaving]
<jordyd> I'm running macOS 10.13.3 (High Sierra) and I've installed zig via Homebrew. `zig targets` lists my native environment as "unknown". Is this normal?
hoppetosse has quit [Ping timeout: 264 seconds]
<andrewrk> jordyd, that is correct. although perhaps "unknown" should be renamed to "nonspecial"
<jordyd> Ah ok
<jordyd> What are the environments, btw? They appear to be ABIs?
<andrewrk> that is correct
<andrewrk> it's an LLVM concept
<andrewrk> it has to do with the C ABI
<andrewrk> maybe that would be a good thing to rename it to: Environment -> C ABI
<andrewrk> and then "unknown" -> "unspecified" or "generic"
<jordyd> Generic sounds best to me
<jordyd> So what would x86_64-elf translate to? arch=x86_64, os=freestanding, env=gnu?
<andrewrk> x86_64-elf according to gcc?
<andrewrk> I believe "elf" translates to "eabi"
<andrewrk> freestanding? are you working on an OS or embedded device?
<jordyd> Yeah
<andrewrk> cool
<jordyd> GCC calls it x86_64-elf, which is short for x86_64-pc-none-elf I think
<andrewrk> I would try arch=x86_64, os=freestanding, env=eabi first
<andrewrk> I think the environ part doesn't matter much when you're doing an OS because you don't interact with C code
<jordyd> Well, I suppose you wouldn't have to worry about it given anyone using C on your OS would just target whatever ABI you're using
<jordyd> GCC also has an *-eabi which is used for ARM (i.e., armv6-eabi)
<andrewrk> I believe in this case armv6 refers to the arch, not the environ
<andrewrk> you can see armv6 in `zig targets`
<jordyd> Yeah, I mean armv6-eabi would be the target
<jordyd> GCC formats their targets as arch-os-abi mostly
<jordyd> Does LLVM have documentation somewhere on their "environment" concept?
<jordyd> Thanks
<jordyd> Wait, actually, I should be able to ignore the environment and just use "extern" in places where it matters
<andrewrk> I'm not sure exactly what you mean, but if you're running into a specific problem and you can show me some code or output, I can provide suggestions
<jordyd> Basically if I define some function in assembly as `foo` and want to reference it from Zig, would `extern "c" fn foo(): return_type;` work?
<jordyd> Basically I need to either 1) match or disable name mangling and 2) match calling conventions. C++, for example, will disable name mangling and use C's calling conventions by declaring a function as `extern "C"`
<andrewrk> yes that will work. that will give the function the C calling convention
<andrewrk> there is no name mangling
<jordyd> Ah ok
<andrewrk> you can also use a naked function in zig and inline assembly
<andrewrk> jordyd, you saw this right? https://github.com/AndreaOrru/zen
<jordyd> Oh no I didn't
<andrewrk> aiwakura is working on this - it probably will have useful example code for you
<jordyd> Neat thanks for the link
redj_ is now known as redj
<jordyd> Is "inline" a suggestion (like C)?
<andrewrk> jordyd, no, it's a requirement
<andrewrk> if an inline function cannot be inlined, it is a compile error
<jordyd> Nice, that's perfect for little asm one-liners
jfo has joined #zig
jfo has quit [Ping timeout: 263 seconds]
<jacobdufault> ah, I was curious was the zen os was, google search never showed results
<jacobdufault> what the*
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
btbytes has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<andrewrk> jacobdufault, have vscode and cquery installed, and I have compile_commands.json generated
<andrewrk> is there any instructions on how to use vscode-cquery?
<andrewrk> oh I can do it from within vscode
adagio_ has quit [Ping timeout: 260 seconds]
<jacobdufault> hmm? I think most things should just work, let me know if you have any specific questions
<jacobdufault> you'll have to bind keyboard shortcuts for special things like call hierarchy, or you can use the context menu
<andrewrk> I just learned that vscode has an "install extension" feature from within the editor
<andrewrk> very handy
<jacobdufault> ah, yea :)
<jacobdufault> fwiw vscode struggles a little on the 10k+ line files
<andrewrk> oh that's interesting
<andrewrk> it flashed a message about needing to add a specific setting, but it went away before I could memorize what I needed to do
<jacobdufault> for cquery? I'm surprised that message went away
<andrewrk> something about a workspace directory
<jacobdufault> I believe you need to specify cquery.launch.workingDirectory
<andrewrk> that's it!
<andrewrk> oh, that's in the wiki
<jacobdufault> When I eventually get to adding prebuilt binaries that will not be needed
<jacobdufault> but alas, working on CI is not much fun :P
<jacobdufault> fyi: it seems like code lens is often not wanted, `editor.codeLens` can turn it off
<andrewrk> alright let's take this for a test drive
<andrewrk> how did you get that usages count UI?
<jacobdufault> that's code lens
<jacobdufault> `F1: view cquery` to make sure there are no errors, you linked compile_commands.json to the top-level?
<jacobdufault> ie, one above build dir
jfo has joined #zig
<andrewrk> I don't see "view cquery" as an option in the F1 command menu
<andrewrk> yes I linked compile_commands.json at the root source dir
<andrewrk> maybe this version is too old
<andrewrk> hmm no it's 0.0.10
<andrewrk> the cquery commands fail from the F1 menu: 'cquery.freshenIndex' not found
<jacobdufault> ah, when you hit f1 you have to delete the '>'
<jacobdufault> not sure why freshenIndex is failing, did you restart vscode after installing cquery?
<andrewrk> yes
<andrewrk> ok I got it
<andrewrk> I set the cache directory and reloaded the extension
<andrewrk> this is brilliant
<andrewrk> I love the highlighting for the different kinds of things (disabled by default)
<jacobdufault> semantic highlighting is great :)
<jacobdufault> you may see some slowdown with it when editing the large files... I turned it off for zig
jfo has quit [Ping timeout: 246 seconds]
<andrewrk> why are the enum items different colors here? https://i.imgur.com/QrhmlEA.png
<Hejsil> cquery for vscode uses a spectrum of colors for highligting
<Hejsil> Idk why
<andrewrk> but it should use the same color for the same kind of thing right?
<Hejsil> Nono, a spectrum for the same things
<andrewrk> odd
<Hejsil> Different shades of blue for enums in your case
<Hejsil> There is an option to change the color
<Hejsil> Or, the array of colors*
<jacobdufault> rainbow semantic highlighting
<Hejsil> The best
<jacobdufault> :), I liked the feature from kdevelop
<Hejsil> So you can see the different between SomeLargeTypeA and SomeLargeTypeB without reading their names? :)
<Hejsil> That's really the only benifit I can think off for different colors of the same semantic category (or whatever you call it)
<jacobdufault> I think it's most useful on variables so you can see how a variable flows through a function
<Hejsil> Aaaah, that makes sense
<jacobdufault> Maybe it should be off by default for other tings
<jacobdufault> things*
<Hejsil> cquery for Zig when? :)
<Hejsil> Was
<Hejsil> the json PR for cquery, or ctag or how was that
<jacobdufault> the json PR is for cquery
jfo has joined #zig
<Hejsil> I don't remember the specific usecase
<Hejsil> Aah, nice
btbytes has joined #zig
<jacobdufault> I have to write an indexer in cquery though for the json, but it should be pretty straight-forward, plus probably some refactoring since this will be the first non-clang client
btbytes has quit [Client Quit]
<Hejsil> andrewrk, bug or feature? https://pastebin.com/raw/gR5FyYWR :)
<Hejsil> Oooh wait, we don't need the middleman https://pastebin.com/raw/h8QBKjSU
<andrewrk> Hejsil, are you demonstrating writing to an implicit stack variable?
<Hejsil> Yes
<andrewrk> I believe this is related to https://github.com/zig-lang/zig/issues/287
<andrewrk> the code you linked is working as designed
Tobba has quit [*.net *.split]
DuClare has quit [*.net *.split]
DuClare has joined #zig
Tobba has joined #zig
<Hejsil> So im just writing to the memory that was return by makeS i assue
<Hejsil> Alright
<andrewrk> right. and with #287 it will be more explicit where that memory is located
jfo has quit [Ping timeout: 256 seconds]
jfo has joined #zig
cenomla has quit [Quit: cenomla]
return0e__ has quit [Quit: Leaving]
Hejsil has quit [Ping timeout: 260 seconds]
jfo has quit [Ping timeout: 265 seconds]
return0e has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
return0e has quit [Ping timeout: 264 seconds]
return0e has joined #zig