ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
schme245 has quit [Remote host closed the connection]
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
porky11 has quit [Ping timeout: 240 seconds]
return0e has quit [Ping timeout: 240 seconds]
porky11 has joined #zig
porky11 has quit [Remote host closed the connection]
kristate has quit [Remote host closed the connection]
kristate has joined #zig
hooo has joined #zig
darithorn has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Ping timeout: 240 seconds]
_whitelogger has joined #zig
_whitelogger has joined #zig
schme245 has joined #zig
schme245 has quit [Remote host closed the connection]
kristate has joined #zig
schme245 has joined #zig
kristate has quit [Remote host closed the connection]
return0e has joined #zig
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
return0e has quit [Remote host closed the connection]
return0e has joined #zig
Flaminator has joined #zig
steveno has joined #zig
kristate has joined #zig
schme245 has quit [Remote host closed the connection]
kristate has quit [Ping timeout: 244 seconds]
steveno has quit [Ping timeout: 250 seconds]
steveno has joined #zig
halosghost has joined #zig
steveno has quit [Ping timeout: 264 seconds]
Avila has joined #zig
schme245 has joined #zig
schme245 has quit [Remote host closed the connection]
steveno has joined #zig
Ichorio has joined #zig
<donpdonp> andrewrk: can you say more about "zig provides memcpy (and more)" re: webassembly? is there an implementation of malloc for webasm in the zig codebase somewhere?
<emekankurumeh[m]> for wasm wouldn't you just want a FixedBufferAllocator because wasm doesn't support heap allocation?
<donpdonp> emekankurumeh[m]: that makes sense, though im not familiar with all the mechanisms zig provides.
<donpdonp> im just trying to get a hello-world.zig to build. from earlier: "as soon as i add var bytes : [255]u8 = undefined; ... the wasm tries to import 'memcpy'"
<emekankurumeh[m]> documentation is an issue that's being worked on.
<donpdonp> var x = std.heap.FixedBufferAllocator.init(bytes[0..]); => in function __zig_return_error void (%StackTrace*): WebAssembly hasn't implemented __builtin_return_address
<donpdonp> being this early to webasm is very educational :)
wootehfoot has joined #zig
Zaab1t has joined #zig
steveno has quit [Ping timeout: 268 seconds]
Zaab1t has quit [Quit: bye bye friends]
steveno has joined #zig
Marumoto has joined #zig
<Marumoto> Is there a statically allocated list in the standard library?
<halosghost> list meaning a linked list?
<halosghost> if so, what do you mean by statically-allocated?
<halosghost> if not, what do you mean by `list`? :)
<Marumoto> Basically like struct List { int elements[32]; int num_elements; }
<Marumoto> where the capacity is specified at compile time
<Marumoto> array/vector
<halosghost> oh
<halosghost> why not just use an array?
<MajorLag> That's just an array in Zig. `const list: [32]i32 = undefined;`. length is had by `list.len`;
<Marumoto> they just have a capacity right?
<Marumoto> oh
<halosghost> what MajorLag said :)
<Marumoto> I've just looked at zig for 2 seconds
<MajorLag> unless you want a variable number of elements within a fixed buffer size
<Marumoto> yeah
<MajorLag> you could then use your list structure, or an ArrayList w/ a FixedBufferAllocator.
<halosghost> no context was given, but I'd suspect that, for most cases, an array is sufficient
<halosghost> 🤷
<halosghost> YMMV
<MajorLag> `var buffer: [32 * @sizeOf(i32)]u8 = undefined;` `var fba = std.heap.FixedBufferAllocator.init(buffer);` `var list = ArrayList(i32).init(fba);` `list.append(42);` `const count = list.len;`
<Marumoto> ooh, thats great
<Marumoto> that looks like what I want
<Marumoto> thanks
steveno_ has joined #zig
steveno has quit [Ping timeout: 264 seconds]
Avila has quit [Quit: Leaving]
wootehfoot has quit [Ping timeout: 245 seconds]
halosghost has quit [Quit: WeeChat 2.3]
wootehfoot has joined #zig
steveno_ has quit [Remote host closed the connection]
Ichorio has quit [Ping timeout: 240 seconds]
wootehfoot has quit [Read error: Connection reset by peer]