ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<mjacob>
andrewrk: ok, about the stack size thing:
<mjacob>
you probably already know that determining an exact upper bound for the stack size is impossible in the general case
<mjacob>
one possiblity is to restrict the set of analysable programs
<mjacob>
the other is to (possibly) overapproximate the stack size
<mjacob>
my first question would be which of these two you want to implement
<mjacob>
can the user expect that the calculated stack size will be a tight upper bound?
<mjacob>
(although it is unclear what a *tight* upper bound actually is)
hasen_judy has quit [Remote host closed the connection]
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 246 seconds]
<andrewrk>
mjacob, I think there is value in obtaining an upper bound which is very close to exactly correct
<andrewrk>
one reason that go can get away with a large number of goroutines is that it uses a segmented stack and so stack sizes are smaller
<Elronnd>
pupp: Tail Call Optimization. Basically if the last call of a function is to recurse, then the compiler can optimize it down to a goto and not waste a stack frame
<pupp>
ah, it's that lisp trick. Always thought that just using "for" is simplier.
<Elronnd>
?
<Elronnd>
for is completely different
<Elronnd>
and it's not just a lisp trick. Plenty of lisp implementations don't have TCO (and plenty of implementations for other languages do)
<Elronnd>
pretty sure gcc and clang have TCO for c
<pupp>
I first heard about Tail Call Optimization from a lisp book.
<pupp>
I'm currently using recursion in one place, it iterates parsed http. Not really sure how to do it without recursion.
<pupp>
Need to allocate memory on the side manually, indeed recursion is simplier here.
<pupp>
By the way, how to do a function pointer in zig?
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 246 seconds]
cenomla has joined #zig
ofelas has quit [Quit: shutdown -h now]
dimenus has joined #zig
ryan_ has joined #zig
Mikayil has joined #zig
<Mikayil>
Hello World !
<ryan_>
hello
ryan_ has quit [Client Quit]
Mikayil has quit [Client Quit]
puppp has joined #zig
pupp has quit [Ping timeout: 248 seconds]
tiehuis has joined #zig
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 252 seconds]
ryan__ has joined #zig
ryan__ has quit [Client Quit]
<dimenus>
andrewrk, does the stock 'build-exe' support @cImport/cInclude?
<dimenus>
having issues with a basic hello world example on both current head and 0.1.1 release