ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
Ichorio has joined #zig
Ichorio has quit [Ping timeout: 268 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
return0xe has quit [Remote host closed the connection]
davr0s has joined #zig
porky11 has quit [Read error: Connection reset by peer]
return0e has joined #zig
_whitelogger has joined #zig
Ichorio has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
RagingDave has quit [Remote host closed the connection]
Triplefox[m] has quit [Ping timeout: 250 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
porky11 has joined #zig
_whitelogger has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dbandstra has quit [Quit: Leaving]
davr0s has joined #zig
SimonNa has quit [Remote host closed the connection]
SimonNa has joined #zig
<andrewrk>
jfondren, you could use an unknown length pointer to get a nearly identical port
<andrewrk>
ah you are using an unknown length pointer. you can use pointer arithmetic
<andrewrk>
oh you are using pointer arithmetic
<andrewrk>
never mind. your code looks fine to me. I would argue that this code is not elegant, although it's not clear to me what it's trying to do
<andrewrk>
e.g. you could just print a hard coded string which is the answer
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tom1998 has joined #zig
<tom1998>
Hey!
<andrewrk>
hi tom1998
<tom1998>
I'm trying to link with -framework Cocoa on OSX to link GLFW statically, but that seems to segfault the compiler
<tom1998>
I'm linking dynamically just fine, but anyone else had issues with this?
<tom1998>
Hey andrewrk, back with the questions;)
<andrewrk>
the next step to troubleshoot this is for me to try to reproduce the problem on osx, or for you to use a debugger and provide a stack trace
<tom1998>
I can run it through valgrind?
<tom1998>
oh no wait, i don't even have that
<tom1998>
not even sure valgrind is available on osx, i'll run it through gdb when i get back if that's an option(??)
<andrewrk>
in my experience lldb works best on macos
<tom1998>
That'll be the one then, never really used it!
<tom1998>
Hey, whilst I'm here, how can I define a package?
<tom1998>
It's not really documented anywhere AFAIK, but I want to be able to define a folder as a package and have it be importable from anywhere else
<tom1998>
Seems(?) like the way to do this is to make it a 'package'?
<tom1998>
Is it just, pkg-begin "pkg-name" "folder"?
<tom1998>
Oh, for future reference, it's pkg-begin "pkg-name" "folder/index.zig", then pkg-end - why the need for the pkg-begin and pkg-end, what can i put in the middle here?
<andrewrk>
more --pkg-begin arguments
<andrewrk>
it's a tree structure. consider that your dependencies can have dependencies
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lkurusa has joined #zig
davr0s has joined #zig
porky11 has quit [Quit: Leaving]
daurnimator has joined #zig
<daurnimator>
Hi all, I just found zig; you seem to have made the same mis-steps as go and rust. From what I've read so far, it's actually usable as a systems programming language with the potential to replace C
<daurnimator>
uh to ***not*** have made
<daurnimator>
andrewrk:
<daurnimator>
gah, sorry
<andrewrk>
I was gonna say, damn you're coming in here and laying down the law
<andrewrk>
hahaha
<daurnimator>
andrewrk: I'm just reading through the manual now
<daurnimator>
curious if you have builtins that provide details on bitfields?
<daurnimator>
not necessarily for a packed struct. e.g. what if I want to expose a bitfield directly to some C function. I'd love a way to pass along "this char* pointer; this shift; this mask"
<andrewrk>
you want to pass that along to C?
<andrewrk>
you can do that by using @typeInfo on a pointer type and then passing the data to a C function
<daurnimator>
yeah. e.g. if you wanted to expose a bitfield to some other language via the C ABI.
<andrewrk>
right now the bit field information is missing from @typeInfo but there's an issue to add it
<andrewrk>
the type of a bit field pointer has extra metadata like this: `*align(2:3:2) const u32`
<daurnimator>
FWIW I'm about half way through the manual and have seen the `test` syntax a lot; yet it hasn't been introduced. not sure if you want to bring it earlier in the manual? or at least link to it? (or maybe I just missed links)
<andrewrk>
daurnimator, good point. I think the langref should mention it directly after Hello World
<daurnimator>
infact values are introduced before structures/syntax. that's probably a good thing, but probably need to forward reference some things; and use a very limited subset of syntax while introducing values
<daurnimator>
on the other hand, this is a reference manual. I'm probably incorrectly using it as a no-bullshit "getting started" guide
wirelyre has joined #zig
<andrewrk>
it's intended to be both, but due to the nature of the changing language, it won't always succeed at both of those goals until the language is stabilized and I do a final audit
<wirelyre>
I'd be interested in a small code sample with hyperlinks on each syntactic element to the appropriate section
<daurnimator>
misc note: using "dot products" to define "dot syntax" is a little confusing.
<wirelyre>
Just as a quick reference
<wirelyre>
andrewrk: I found issue #1535, "create a linker" today and wanted to ask what the scope of that would be
<wirelyre>
e.g. would *all* builds run that linker, or just debug incremental builds
<andrewrk>
wirelyre, all
<daurnimator>
:( no opt-in fall through in switch
<daurnimator>
while as an expression returning values is odd... I've seen languages with it before (e.g. coffeescript) and it's usually ended up introducing bugs or slowness more than it's been helpful
<wirelyre>
how would that interact with linker scripts? would this require a full implementation of them?
<daurnimator>
Where is truthyness defined? I'm not sure if `0` is considered false or true? -> is it narrowed to bool? That doesn't seem to match the implicit casts section....