ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
howru has joined #zig
<GitHub83> [zig] andrewrk opened pull request #1053: Pointer Reform: proper slicing and indexing (master...pointer-reform-slicing) https://git.io/vh4ct
howru has quit [Client Quit]
howru has joined #zig
cenomla has joined #zig
davr0s has joined #zig
clownpriest has joined #zig
SergeiMinaev has joined #zig
clownpriest has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
clownpriest has joined #zig
SergeiMinaev has quit [Client Quit]
cenomla has quit [Quit: cenomla]
darithorn has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
clownpriest has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
clownpriest has joined #zig
SimonNa has quit [Read error: Connection reset by peer]
<GitHub58> [zig] andrewrk closed pull request #1053: Pointer Reform: proper slicing and indexing (master...pointer-reform-slicing) https://git.io/vh4ct
<GitHub27> [zig] andrewrk pushed 1 new commit to master: https://git.io/vh486
<GitHub27> zig/master e53b683 Andrew Kelley: Pointer Reform: proper slicing and indexing (#1053)...
dbandstra has joined #zig
clownpriest has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
howru has quit [Ping timeout: 256 seconds]
SimonNa has joined #zig
howru has joined #zig
JinShil has joined #zig
<GitHub79> [zig] jayschwa opened pull request #1056: WIP: Add snapcraft.yaml (master...snapcraft) https://git.io/vh4Ef
kristate has joined #zig
dbandstra has quit [Quit: Leaving]
kristate has quit [Ping timeout: 260 seconds]
darithorn has quit [Quit: Leaving]
rkeene has quit [Ping timeout: 248 seconds]
rkeene has joined #zig
Hejsil has joined #zig
<Hejsil> When exporting to C, is it best to declare all pointer arguments nullable?
<Hejsil> Or will Zig generate some wrapper that asserts that pointers are not null if I use not null pointers?
<Hejsil> andrewrk
quc has joined #zig
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
howru has quit [Ping timeout: 245 seconds]
howru has joined #zig
JinShil has quit [Quit: Leaving]
davr0s has joined #zig
howru has quit [Read error: Connection reset by peer]
howru has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
howru has quit [Read error: Connection reset by peer]
howru has joined #zig
davr0s has joined #zig
howru has quit [Read error: Connection reset by peer]
howru has joined #zig
<GitHub136> [zig] Hejsil opened pull request #1057: Rename integer literal type and float literal type (master...comptime-int) https://git.io/vh49d
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
very-mediocre has joined #zig
odc has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
dosler has joined #zig
dosler has quit [Client Quit]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
very-mediocre has quit [Ping timeout: 260 seconds]
clownpriest has joined #zig
clownpriest has quit [Ping timeout: 255 seconds]
return0e_ has quit [Read error: Connection reset by peer]
return0e has joined #zig
eeee has joined #zig
eeee has quit [Client Quit]
clownpriest has joined #zig
<andrewrk> Hejsil, best to use pointers in the same way you would for zig code
<andrewrk> importing .h files unfortunately gives only nullable unknown length pointers
<andrewrk> but the other way around is no problem
<andrewrk> we can add nonnull GNU attributes and stuff
<GitHub111> [zig] andrewrk closed pull request #1057: Rename integer literal type and float literal type (master...comptime-int) https://git.io/vh49d
<GitHub42> [zig] andrewrk pushed 1 new commit to master: https://git.io/vhB3o
<GitHub42> zig/master 677eaf2 Andrew Kelley: Merge pull request #1057 from ziglang/comptime-int...
<clownpriest> allocating an array with size specified at runtime, how do?
<clownpriest> unable to evaluate constant expression
<clownpriest> const border = [m+1]u32{} = undefined;
<andrewrk> allocator.alloc(Type, count)
<clownpriest> excellent
kristate has joined #zig
Hejsil_ has joined #zig
<Hejsil_> andrewrk, Aah right! Forgot about the notnull attribute in C
<andrewrk> Hejsil_, potentially we could even figure out a way to annotate unknown length vs single item pointers in a way that would allow us to recover the information in translate-c
<andrewrk> for example we could use a typedef with a custom annotation
<andrewrk> and you would want to manually perform this annotation before running translate-c for the porting use case
<andrewrk> because the generated code would be much nicer. same thing for nullables
kristate_ has joined #zig
kristate has quit [Quit: Page closed]
kristate_ is now known as kristate
<GitHub115> [zig] andrewrk pushed 1 new commit to master: https://git.io/vhBCX
<GitHub115> zig/master 7a09482 Andrew Kelley: fix crash when evaluating return type has compile error...
darithorn has joined #zig
Ichorio has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
noonien has joined #zig
davr0s has joined #zig
nc-x[m] has joined #zig
jjido has joined #zig
kristate has quit [Remote host closed the connection]
mzo has joined #zig
dbandstra2 has joined #zig
bheads_ has joined #zig
return0e has quit [Read error: Connection reset by peer]
return0e has joined #zig
bheads__ has quit [Ping timeout: 265 seconds]
Ichorio has quit [Ping timeout: 245 seconds]
mzo has quit [Ping timeout: 260 seconds]
kristate has joined #zig
kristate has quit [Ping timeout: 264 seconds]
return0e has quit [Read error: Connection reset by peer]
return0e has joined #zig
return0e has quit [Read error: Connection reset by peer]
return0e has joined #zig
<clownpriest> any suggestions on how i could allocate a module-level global hashmap and initialize it at compile time?
<clownpriest> or pointers to existing code that does something similar
<clownpriest> searching through zig compiler repo isn't turning up useful examples (tho i could be searching for the wrong thing)
<andrewrk> clownpriest, that's a really fun idea that afaik nobody has explored yet
<andrewrk> the current std lib hash map uses the heap for memory exclusively
<andrewrk> are you intending it to be read-only at runtime?
<clownpriest> yup
<andrewrk> this would be a good use case to explore trying to compute a perfect hash at comptime
Hejsil_ has quit [Quit: Page closed]
jjido has quit [Ping timeout: 240 seconds]
<clownpriest> i'm not too well versed in compilers, but i'm assuming that if all the data is known at compile time, then it should be doable
<clownpriest> especially with the input i'm using (just raw u8's for both key and value, super simple hash function, wouldn't even really call it a hash)
<clownpriest> i could get my job done without a hashmap atm, just use pairs of static arrays and keep track of offsets, but feels like this sort of thing could be cool
howru has quit [Quit: WeeChat 2.1]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
<dbandstra2> could someone take a few minutes to look at something? i have some code that's crashing and i'm 75% sure it's not my fault
<dbandstra2> it's in a test so (hopefully) can be replicated
<dbandstra2> but anyway std.mem.eql is failing when (i think) it shouldn't be. the |item| part of the for loop is yielding random garbage (but it goes away if i add a debug print!)
<andrewrk> dbandstra2, I'll have a look in a few moments
<dbandstra2> thanks
noonien has quit [Quit: Connection closed for inactivity]
clownpriest has quit [Ping timeout: 245 seconds]
bheads__ has joined #zig
bheads_ has quit [Ping timeout: 240 seconds]
<pancake> hi
<pancake> i cant build zig from git on mac
<pancake> /Users/pancake/prg/zig/deps/lld/wasm/WriterUtils.h:27:16: error: use of overloaded operator '==' is ambiguous (with operand types 'const llvm::wasm::WasmSignature' and
<pancake> zig/deps/lld/include/lld/Core/SymbolTable.h:68:20: error: no member named 'HashString' in namespace 'llvm' return llvm::HashStr...
<andrewrk> are you using the system compiler? what macos version?
<pancake> 10.13.5
<pancake> cmake -D CLANG_INCLUDE_DIRS=/usr/local/Cellar/llvm/HEAD-9016627/include/ -D LLVM_LIBRARIES=/usr/local/Cellar/llvm/HEAD-9016627/lib ..
<andrewrk> HEAD-9016627 is not llvm@6
<pancake> i dont have this directory. ill run reinstall llvm@6
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pancake> thanks :)
<andrewrk> pancake, did it work?
<pancake> almost finished to build 85%
<andrewrk> good
<pancake> link fails
<pancake> 1m doing clean build
<andrewrk> what cmake line did you use?
<pancake> cmake -D CLANG_INCLUDE_DIRS=/usr/local/Cellar/llvm/6.0.0/include -D LLVM_LIBRARIES=/usr/local/Cellar/llvm/6.0.0/lib ..
<andrewrk> that is not the cmake line suggested in the readme
<pancake> works. sorry
cenomla has joined #zig
<GitHub54> [zig] andrewrk pushed 1 new commit to master: https://git.io/vhRGq
<GitHub54> zig/master 652f4bd Andrew Kelley: disallow unknown-length pointer to opaque...
<andrewrk> no worries
cenomla has quit [Quit: cenomla]
quc has quit [Ping timeout: 256 seconds]
<dbandstra2> andrewrk: nevermind, i found the problem. another one of those struct copying "footguns"
kristate has joined #zig
<dbandstra2> memorialized in a gist, maybe we should have a "gallery of footguns" someday https://gist.github.com/dbandstra/5bcc81c3e07ff637ef3e62e097a8ebcd
<andrewrk> there's an issue for this