ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
_dev_zero has quit [Ping timeout: 248 seconds]
_dev_zero has joined #zig
<pupp>
hm, I'm getting "403 access denied" to default.css on ziglang.org
<tiehuis>
are those clang path additions standard on freebsd?
<Elronnd>
yes
<Elronnd>
I just did pkg install llvm50, with no other modifications
<tiehuis>
okay, i'll make a pull request with those, unless you want to?
<Elronnd>
go ahead
<Elronnd>
dafuq?
<Elronnd>
"/usr/bin/ld: cannot find -lLLVMLTO"
<Elronnd>
but there is a /usr/local/llvm50/lib/libLLVMLTO.a
<tiehuis>
i don't know why it needs to pass '-lLLVMLTO' if you are static linking
<Elronnd>
hmmm
<Elronnd>
if I grep for LLVMLTO it's only present in a couple build cmake cache files
<Elronnd>
yay, I hacked it up to build!
<tiehuis>
awesome, what was the trick?
<Elronnd>
just manually edited the linker script to add -L/usr/local/llvm50/lib
<tiehuis>
that seems a bit of a hack, let me see what what my linker arguments are for a build
<Elronnd>
oh, I also had to edit a couple of other things in the linker script. Apparently it thinks -l/usr/lib/libexecinfo.so is valid (it isn't). So I had to change that to -lexecinfo
<Elronnd>
uh, what?
<Elronnd>
TODO c type size in bits for this target
<Elronnd>
and I'm running it with ./zig build-exe test.zig
<tiehuis>
you probably want to use `--library c` as an argument by the way
<tiehuis>
also, not sure if this will work, but here is a simpler example that may give you something different: https://clbin.com/Tdt5F
<Elronnd>
no dice
<tiehuis>
think i'll spend some time this weekend seeing if i can get these initial hurdles solved a bit better
<tiehuis>
since freebsd isn't too uncommon anyway and it should be quite similar to linux in a lot of cases
<Elronnd>
ok
<Elronnd>
gl!
<tiehuis>
hopefully i can report back to you with some better news!
<Elronnd>
(default clang installed is a really old version so you'll have to isntall a new one from package (or ports))
<tiehuis>
okay, thanks will keep in mind.
winsoff has joined #zig
<winsoff>
What's the big deal with zig
<Elronnd>
it's like c but it sucks less
<Elronnd>
it's the only lang (that I know of) that tries to be an alternative to c rather than an alternative to c++
<winsoff>
Ah, that's kind of nifty.
<winsoff>
So it's not high level?
<Elronnd>
I wouldn't say that
<Elronnd>
(bear in mind, I don't really know zig yet)
<tiehuis>
its not specifically low-level, but it does target a lot of the use-case a low-level language needs to consider (like alignment, packed structures) etc
benq has joined #zig
<tiehuis>
although it provides higher-level features than c, such as adts, nullable, iterators and error types
<Elronnd>
I don't think that's necessarily relevant. C++ provides those things, as do most "c++ alternatives"
<tiehuis>
sure, and they are still suitably low-level for many tasks vs. a language like Java
<Elronnd>
my point is, that I don't think that presence of "low-level" features in a language is necessarily relevant to general useage of it
<Elronnd>
c#, for instance, afaik supports low-level memory features, but I wouldn't want to write a kernel in it
<Elronnd>
same for c++
<winsoff>
So what's wrong with Rust?
hasen_judy has joined #zig
<Elronnd>
it competes with c++ not c
<Elronnd>
(also, nothing *wrong* with it)
<tiehuis>
nothing really, i think it has a different niche personally
pupp has joined #zig
hasen_judy has quit [Ping timeout: 252 seconds]
winsoff has quit [Read error: Connection reset by peer]
winsoff_ has joined #zig
winsoff_ has quit [Changing host]
winsoff_ has joined #zig
eggy_ has joined #zig
eggy_ has quit [Client Quit]
tiehuis has quit [Quit: WeeChat 1.9.1]
benq has quit [Ping timeout: 248 seconds]
pupp has quit [Ping timeout: 240 seconds]
pupp has joined #zig
arBmind has joined #zig
hasen_judy has joined #zig
<hasen_judy>
Congratulations on the first beta release
_dev_zero has quit [Ping timeout: 248 seconds]
hasen_ju_ has joined #zig
hasen_ju_ has quit [Ping timeout: 258 seconds]
_dev_zero has joined #zig
winsoff_ has quit [Quit: Leaving]
hasen_judy has quit [Quit: hasen_judy]
pupp has quit [Read error: Connection reset by peer]
pupp has joined #zig
arBmind1 has joined #zig
arBmind has quit [Ping timeout: 246 seconds]
<pupp>
Wish somebody could write prettyprinter for gdb. For Buf type.
<pupp>
it's definition is in src/buffer.hpp, and ZigList is in src/list.hpp
<andrewrk>
there's code in the compiler that explicitly checks for `main` and doesn't add that bootstrap.zig file. so I'm confused how that got into the build
<andrewrk>
I think we can just check if we are targeting FreeBSD and hard code that value
<Elronnd>
it works!
<andrewrk>
Elronnd, great. you did all the work to get zig working (with libc) on freebsd
<Elronnd>
now that it works, can all the 'os not supported' get removed from stdlib?
<andrewrk>
those were not actually incorrect. whenever those compile errors were happening, we were trying to do something without libc that we would need to add freebsd syscalls for
<andrewrk>
for example the panic implementation was trying to use linux syscalls to read the program exe and get a stack trace
<Elronnd>
ah
<Elronnd>
idea: can an alternate version of stdlib exist that depends on libc, for compatability purposes?
<andrewrk>
I think we have that, and it is @import("std").c
<Elronnd>
ah
<andrewrk>
(some functions missing, but you can look at that file and see how to add more)
<andrewrk>
or you can just import libc with .h files, and everything works except for really fancy #define macros
<Elronnd>
ok
<andrewrk>
Elronnd, for the panic implementation, however, I will add a check to see if you are linking libc, and on the OSes where you would get that error, we can call c.abort()
<Elronnd>
ok
<Elronnd>
how can the linker script be autofixed?
<andrewrk>
oh yeah what was the deal with that?
<Elronnd>
couple of things
<Elronnd>
I had to add -L/path/to/llvm/libraries to it
<Elronnd>
and there was a line, -l/usr/lib/libexecinfo.so.1, which I had to change to -lexecinfo
<andrewrk>
for the first one, try adding to CMakeLists.txt link_directories(${LLVM_LIBDIRS})
<andrewrk>
just after the include_directories(${LLVM_INCLUDE_DIRS})
<Elronnd>
(should it also be for CLANG_LIBDIRS?
<andrewrk>
second one sounds harder to fix. I'll be back later
<andrewrk>
I don't think we have CLANG_LIBDIRS
<Elronnd>
ok
<Elronnd>
how do I run the unittests? 'make test' doesn't do anything
<andrewrk>
Elronnd: the readme has testing instructions
hoppetosse has quit [Ping timeout: 260 seconds]
<andrewrk>
They're going to fail for you since we don't have freebsd support in the standard library
<andrewrk>
If you're interested in contributing, this would be a big way to do that. You could follow the pattern set by linux
<Elronnd>
ok
cenomla has joined #zig
<Elronnd>
yeah it's not working
<Elronnd>
const is_posix = builtin.os != builtin.Os.windows; since this is here, why am I getting errors where it checks if this is posix or windows and errors else?
xoxo has joined #zig
<Elronnd>
hmmm. openSelfExe would require sysctl on freebsd. Is sysctl available in zig's stdlib?
hoppetosse has joined #zig
cenomla has quit [Quit: cenomla]
hoppetosse has quit [Remote host closed the connection]
hoppetosse has joined #zig
cenomla has joined #zig
cenomla has quit [Client Quit]
arBmind has quit [Quit: Leaving.]
hasen_judy has joined #zig
hoppetosse has quit [Ping timeout: 258 seconds]
hasen_judy has quit [Ping timeout: 252 seconds]
_dev_zero has quit [Ping timeout: 248 seconds]
_dev_zero has joined #zig
<andrewrk>
Elronnd, sysctl is probably a freebsd syscall. it would behoove us to look at an open source freebsd libc implementation of sysctl and see what they do
<andrewrk>
have a look at std/os/linux.zig
<andrewrk>
we will likely have something similar for freebsd
hasen_judy has joined #zig
<Elronnd>
andrewrk: *an* open source freebsd libc implementation?
<Elronnd>
how about *the* freebsd libc?
<andrewrk>
Elronnd, my mistake :)
<Elronnd>
(I mean, I think there are other libcs that support fbsd, but easiest is probably the official one since it just has top support fbsd instead of having workarounds for different OSes)