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/
brakmic has quit []
mikdusan__ has joined #zig
Ichorio has joined #zig
Ichorio_ has quit [Ping timeout: 250 seconds]
knebulae has quit [Ping timeout: 240 seconds]
kristate has joined #zig
Ichorio has quit [Ping timeout: 245 seconds]
kristate has quit [Ping timeout: 264 seconds]
gamester has joined #zig
scientes has joined #zig
kristate has joined #zig
<gamester> Hmm. I'm doing "const Foo = builder.addStaticLibrary("Foo", null);", then "Foo.addCSourceFile", then "exe.linkLibrary(Foo)" but when running the executable it needs a libFoo.so shared library
<gamester> .so.0
reductum has quit [Quit: WeeChat 2.4]
<andrewrk> gamester, oh! I forgot about that.
<andrewrk> I can fix that soon. it's just a matter of sending some args to clang
kristate has quit [Remote host closed the connection]
kristate has joined #zig
Vinski has quit [Ping timeout: 264 seconds]
kristate has quit [Ping timeout: 264 seconds]
Vinski has joined #zig
noonien has quit [Quit: Connection closed for inactivity]
reductum has joined #zig
_whitelogger has joined #zig
scientes has quit [Ping timeout: 250 seconds]
_whitelogger has joined #zig
kristate has joined #zig
kristate has quit [Ping timeout: 250 seconds]
brakmic_ has joined #zig
brakmic_ has left #zig [#zig]
brakmic has joined #zig
fsateler_ has joined #zig
fsateler has quit [Ping timeout: 245 seconds]
brakmic_ has joined #zig
brakmic has quit [Ping timeout: 250 seconds]
reductum has quit [Quit: WeeChat 2.4]
very-mediocre has joined #zig
brakmic_ has quit [Read error: Connection reset by peer]
brakmic has joined #zig
kristate has joined #zig
kristate has quit [Ping timeout: 252 seconds]
<gamester> No problem. Also in case you missed it: "const a: ?[*c]i32 = null" crashes the compiler.
dewf has quit [Quit: Leaving]
Ichorio has joined #zig
mikdusan__ has quit [Ping timeout: 256 seconds]
brakmic has quit [Read error: Connection reset by peer]
brakmic_ has joined #zig
kristate has joined #zig
noonien has joined #zig
brakmic_ has quit [Remote host closed the connection]
brakmic has joined #zig
Zaab1t has joined #zig
MajorLag has joined #zig
tgschultz has quit [Ping timeout: 268 seconds]
MajorLag is now known as tgschultz
kristate has quit [Remote host closed the connection]
kristate has joined #zig
mahmudov has joined #zig
gamester has quit [Quit: Leaving]
<andrewrk> fixed
brakmic_ has joined #zig
brakmic has quit [Ping timeout: 245 seconds]
brakmic has joined #zig
brakmic_ has quit [Ping timeout: 255 seconds]
Akuli has joined #zig
Amsel has joined #zig
Amsel has quit [Quit: Page closed]
MajorLag has joined #zig
tgschultz has quit [Ping timeout: 268 seconds]
MajorLag is now known as tgschultz
brakmic has quit [Read error: Connection reset by peer]
brakmic_ has joined #zig
marmotini_ has joined #zig
reductum has joined #zig
brakmic_ has quit [Read error: Connection reset by peer]
brakmic has joined #zig
brakmic has quit [Read error: Connection reset by peer]
brakmic_ has joined #zig
Zaab1t has quit [Quit: bye bye friends]
very-mediocre has quit [Ping timeout: 256 seconds]
<oats> howdy! is it possible to utilize pointers that are defined in a C header library as macros?
<oats> as in, #define foo (uint32_t *)0xb1a4bla4
<andrewrk> hi oats. that may already work now. if it doesn't it's just a few improvements in translate-c.cpp away from working
<oats> sweet
* oats is toying around with trying to run zig programs on an STM32
<oats> I'm using the libopencm3 library
<oats> tangentally related, how's the self-hosted compiler coming along?
<oats> been a while since I've kept up with development
brakmic has joined #zig
<andrewrk> it's on pause, blocking on a couple major language changes
<andrewrk> starting the self hosted compiler served an important purpose which was to try out using coroutines / event based programming. and indeed it needs a rewrite. so I'll do that and then pick the self hosted compiler back up
brakmic_ has quit [Ping timeout: 250 seconds]
<andrewrk> the self hosted compiler is actually going to be a pretty good proof-of-concept for a server, since that's what it will be
<oats> a server?
<oats> that's interesting
<Akuli> is there an std library for dealing with paths? ideally something cross-platform
<Akuli> wooooooooot os.path.join
* Akuli feels at home <3
<Akuli> just like in python
Sahnvour has joined #zig
<Sahnvour> hi, andrewrk, regarding your last comment on https://github.com/ziglang/zig/issues/2029, quote "So no matter how much the call to log gets inlined, still the return address would point to the correct thing." => how can we be sure that the next instruction isn't one resulting from the inlining of `caller_of_log` into `caller_of_caller_of_log` (for example a computation gets simplified), thus having "incorrect" debug info mapping for ou
<andrewrk> Sahnvour, I'm having trouble articulating it, but think about it like this: the machine code gets inlined, but the return address is still pointing to the same machine code
<andrewrk> the return address gets inlined too
fsateler has joined #zig
<daurnimator> andrewrk: say you have: x = 1; add(&x, 1); warn(getLineInfo()); add(&x, 1);
<daurnimator> and `add` is inlined.
<daurnimator> and due to lack of side effects, the adds are coalesced
<daurnimator> does the warn still print the right line number?
<daurnimator> I think it does. but I'm not 100% sure.
<andrewrk> the return address is pointing to the "end" of the thing we are interested in. we don't care about what happens after getLineInfo(), we care about the source that getLineInfo() occurs in
fsateler_ has quit [Ping timeout: 245 seconds]
<andrewrk> so you subtract 1 from the address before looking up the debug info
__Myst__ has joined #zig
<andrewrk> this is what stack trace printing code does, since the stack contains return addresses
<daurnimator> k
<daurnimator> andrewrk: would you say https://github.com/ziglang/zig/issues/577#issuecomment-463851196 is correct then?
<Sahnvour> but as I understand it, there's no guarantee that the result of @returnAddress isn't an instruction that got inlined into the outer caller, and then debug info would give us the function one level higher than desired (in the call tree seen at compile time)
<andrewrk> daurnimator, read Sahnvour's comments in #2029
<daurnimator> andrewrk: i did.
<andrewrk> Sahnvour, I don't think that's possible. can you make a proof of concept? It should be just a dozen lines of code with std.debug.printSourceAtAddress
<Sahnvour> will try
<andrewrk> try it in debug mode with forced inlining. our debug info code doesn't handle optimizations very well yet
<__Myst__> does zig have a language server?
<andrewrk> __Myst__, no but it's planned: https://github.com/ziglang/zig/issues/615
<__Myst__> andrewrk: that last comment worries me
<__Myst__> "custom protocol" -> unusable in most editors
<oats> what's the difference between --library-path and --object?
<oats> (I still don't have a great grasp on how the linker works)
<andrewrk> __Myst__, it'll be fine. same backend, multiple protocols
<daurnimator> __Myst__: see the other bit though: having a proxy of some type that translates to LSP
<__Myst__> daurnimator: that'll be double the work though
<__Myst__> pretty easy to drop it
<andrewrk> won't be double the work. the backend is the bulk of the work. the protocol is a tiny sliver of work
<daurnimator> __Myst__: *shrug*. if they think it's less work and are willing to do it then I have no problem with it
<andrewrk> oats, --library-path gives additional search paths to the linker for --library arguments
<andrewrk> --object is for passing .o files or .a files (.obj .lib on windows)
<andrewrk> I'll clean up the CLI names for these soon
<oats> ah, ok
<__Myst__> /shrug
<oats> so I want just want to use --object /....../libopencm3_stm32f0.a
<Akuli> what is setNoRoSegment() called nowadays? or has the valgrind bug been fixed?
<andrewrk> Akuli, it was fixed in valgrind
<Sahnvour> andrewrk: my worrying is that maybe @returnAddress() will give consistent results, but that these very results would be in "ranges" of instructions that are associated with the caller function (and not the inlined one)
<Akuli> andrewrk, umm... do i need a newer valgrind if i want to valgrind my zig code?
<andrewrk> I don't know what version it was fixed in, but I have 3.14.0
<Akuli> i have 3.12.0 from my package manager :(
<Akuli> and it sure gives lots of question marks without the setNoRoSegment
<__Myst__> Akuli: it is time to compile from source
<andrewrk> valgrind is pretty straightforward to compile from source. it doesn't depend on anything afaik
<daurnimator> Akuli: what distro do you use?
<Akuli> devuan
<Akuli> i just compiled valgrind
<Akuli> lets see if it works
<Akuli> works! :D
<Akuli> thanks :)
<oats> does @cInclude recursively resolve #includes?
<Sahnvour> andrewrk: https://gist.github.com/Sahnvour/abf000581b3958882d3f493012f030f9 you can see that the @returnAddress() from inside `log` is located, as far as debug info is concerned, inside `bar` and not `foo` (from the stack trace)
<daurnimator> Sahnvour: thanks for the example :)
<Sahnvour> (the warn in foo is most probably irrelevant)
noonien has quit [Quit: Connection closed for inactivity]
brakmic has quit [Remote host closed the connection]
Akuli has quit [Quit: Leaving]
brakmic has joined #zig
brakmic has quit [Remote host closed the connection]
brakmic has joined #zig
develonepi3 has quit [Remote host closed the connection]
brakmic has quit [Read error: Connection reset by peer]
brakmic_ has joined #zig
noonien has joined #zig
reductum has quit [Quit: WeeChat 2.4]
brakmic has joined #zig
brakmic_ has quit [Ping timeout: 250 seconds]
brakmic has quit [Ping timeout: 240 seconds]
brakmic has joined #zig
Ichorio has quit [Ping timeout: 250 seconds]
marmotini_ has quit [Remote host closed the connection]
mahmudov has quit [Ping timeout: 246 seconds]
MajorLag has joined #zig
tgschultz has quit [Ping timeout: 245 seconds]
MajorLag is now known as tgschultz
brakmic_ has joined #zig
brakmic has quit [Read error: Connection reset by peer]
<Sahnvour> andrewrk: I'm leaving, please answer on the issue if you find some time to look at my example :) bye everyone
Sahnvour has quit [Quit: Page closed]
brakmic_ has quit []
<oats> I'm trying to compile this little program for my little arm microcontroller, an STM32F0discovery
<oats> that's the build command I'm using
<oats> and here's some errors I'm getting!
<oats> I'm especially confused about it not finding the definition of "puts"
MajorLag has joined #zig
<oats> hmm, I get a different set of errors if I include the object /usr/arm-none-eabi/lib/libc.a
<oats> I don't know if those are new errors or pre-existing errors covered up by the old errors
tgschultz has quit [Ping timeout: 245 seconds]
MajorLag is now known as tgschultz
<oats> I'm punching way above my ability level here :(