<daurnimator>
I did a little more work on it but didn't push it up
<g-w1>
nice :)
powerofzero has quit [Ping timeout: 246 seconds]
squeek502 has quit [Remote host closed the connection]
gazler has joined #zig
gazler_ has quit [Ping timeout: 265 seconds]
xackus has joined #zig
xackus__ has quit [Ping timeout: 265 seconds]
cbix is now known as fh
fh is now known as cbix
cbix is now known as fh
fh is now known as cbix
cbix is now known as fh
fh is now known as cbix
cbix is now known as fh
Techcable has joined #zig
fh is now known as cbix
Techcable has quit [Quit: Techcable - The Lounge]
Techcable has joined #zig
_whitelogger has joined #zig
earnestly has quit [Ping timeout: 256 seconds]
purpleLizard has left #zig ["Konversation terminated!"]
cole-h has quit [Ping timeout: 276 seconds]
decentpenguin has quit [Quit: ZNC crashed or something]
decentpenguin has joined #zig
xackus has quit [Ping timeout: 256 seconds]
bitmapper has quit [Quit: Connection closed for inactivity]
waleee-cl has quit [Quit: Connection closed for inactivity]
<mikdusan>
andrewrk: "simplest" option to start publishing zig-macos-aarch64 tarballs is to:
<mikdusan>
- add another azure job on x86_64 macos-10.15 vm
<mikdusan>
- use xcode-12.4 or higher (it's available) to produce arm64 target
<mikdusan>
- built against a llvm+clang+lld that I can spin pretty quickly with arm64 arch target
<mikdusan>
negatives:
<mikdusan>
- no zig build test ability for the ci process
dyeplexer has joined #zig
<mikdusan>
- not built using a zig-boostrap process. we can't do that style (even with system-linker-hack) without changing how zig build-exe and zig cc drivers strips the command-line when it thinks we're cross-compiling
<mikdusan>
also though, zig-bootstrap is, as far as I can tell, broken for x86_64 macos host too. And in order to fix (continue using zig cc/c++) we only have 2 choices: wait for zld and/or improve system-linker-hack enough to get zig-bootstrap working.
<mikdusan>
thoughts?
ur5us_ has joined #zig
shirty has joined #zig
sord937 has joined #zig
shirty has quit [Client Quit]
_whitelogger has joined #zig
mtiljeset[m] has quit [Quit: Idle for 30+ days]
craigo has quit [Ping timeout: 256 seconds]
craigo has joined #zig
hidayat has joined #zig
hidayat has quit [Client Quit]
ur5us_ has quit [Ping timeout: 240 seconds]
ifreund has joined #zig
zupss has joined #zig
ur5us_ has joined #zig
craigo has quit [Remote host closed the connection]
craigo has joined #zig
earnestly has joined #zig
ur5us_ has quit [Ping timeout: 240 seconds]
kbd has joined #zig
<kbd>
So, one can say: `var foo = if(true) "T" else "F";`. Is it possible to use blocks in place of "T"/"F", returning a value from the blocks?
<kbd>
ok: var result = if (flag) b1: { break :b1 "truthy"; } else b2: { break :b2 "falsy"; }; Thanks ifreund.
tane has joined #zig
johannes_ has joined #zig
johannes_ is now known as kenran
xackus has joined #zig
ifreund1 has joined #zig
ifreund2 has joined #zig
gpanders has quit [Remote host closed the connection]
ifreund has quit [Disconnected by services]
ifreund2 is now known as ifreund
gpanders has joined #zig
ifreund1 has quit [Ping timeout: 264 seconds]
mjanssen has joined #zig
<mjanssen>
I know I can make build a dynamic library from the command line with zig build-lib -dynamic. Is there any way to pass the -dynamic from build.zig ?
<ifreund>
pretty sure addSharedLibrary() passes that by default
kenran has quit [Ping timeout: 256 seconds]
<mjanssen>
I tried that, but that requires a version and then failes with a file not found
<mjanssen>
removing zig-cache fixed that
<mjanssen>
so works with addSharedLibrary, thanks
<ifreund>
mjanssen: you can use .unversioned if your use-case doesn't require a version
<mjanssen>
ifreund: thanks
<mjanssen>
it does require a version, so that's OK. Any easy way to pass the version from build.zig to the actual zig code?
<ifreund>
addBuildOption()
<ifreund>
then you can @import("build_options"); in your code
<mjanssen>
ah great thanks
* mjanssen
working on a basic Tcl/Tk dynamic library
txdv has joined #zig
<txdv>
random.init needs a seed, how do I randomly generate a seed? :D
<ifreund>
daurnimator: see the discussion on the PR
<daurnimator>
ifreund: which bit?
<ifreund>
daurnimator: starting with jediscat1's comment I guess
eax has joined #zig
<daurnimator>
ifreund: mmm. I agree with andrew's initial comment
<daurnimator>
I might throw up a PR bringing it back; but without the downside
<ifreund>
I don't have a strong opinion one way or the other, haven't looked closely enough myself for that
<ifreund>
currently fixing more things we broke in #7920 :D
<txdv>
That rewrite was huge
<mjanssen>
any prefered paste site?
<daurnimator>
mjanssen: zig.godbolt.org
dyeplexer has joined #zig
wilsonk_ has joined #zig
wilsonk has quit [Remote host closed the connection]
<mjanssen>
trying to translate a working zig build-lib to zig build. Fails with an unreachable code error: https://zig.godbolt.org/z/n6Te5h
<ifreund>
I see that you're using 0.6.0, you probably want to be using 0.7.1 if not master
<mjanssen>
this was with 0.7.0
<mjanssen>
but I can try with master
<mjanssen>
ah using 0.6.0 lib
<ifreund>
you have to use the same library version as compiler version
<mjanssen>
same error if I remove the system zig and it uses the lib of the compiler
<mjanssen>
I can try with master
<ifreund>
mjanssen: it would help to see your build.zig and the working zig build-lib command
Ashpool has quit [Remote host closed the connection]
<mjanssen>
t's in the paste
<mjanssen>
in the comments
<mjanssen>
lib.linkSystemLibrary("tclstub8.6"); seems to be the offending line
<ifreund>
I don't think you should need addLibPath there
<ifreund>
you could try linkSystemLibraryName instead of linkSystemLibrary to bypass pkg-config
<mjanssen>
indeed addLibPath is not needed
kbd has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<mjanssen>
and changing to linkSystemLibraryName works
ubert1 has joined #zig
eax has quit [Ping timeout: 268 seconds]
johannes_ has joined #zig
eax has joined #zig
<mjanssen>
thanks ifreund. Build works now
<ifreund>
nice :)
bitmapper has joined #zig
<mjanssen>
I have two vars, a,b with types [*c]const u8,comptime_int . I expect if (a!=b) { ... } to be a type error but it's not. Am I missing something?
<daurnimator>
mjanssen: `[*c]` is a C pointer
<daurnimator>
mjanssen: they intentionally work like C pointers... which includes the ability to coerce to an integer I guess
<mjanssen>
hmm ok some playing aroundseems to confirm this
<mjanssen>
good to know
<daurnimator>
though looking closer it might be a bug...
<daurnimator>
`@TypeOf([*c]const u8, comptime_int)` seems to return `type`
<mjanssen>
maybe for the wasm target only? I get a different result if I test it on my machine
craigo has quit [Ping timeout: 260 seconds]
<qbit>
does zig have something similar to 'go fmt' ?
<Nypsie>
zig fmt :)
supercoven has joined #zig
<qbit>
awesome
<qbit>
ty :D
<Nypsie>
np. There's also a language server like gopls if that's something you use.
<tane>
I can't see what version of zig it is programmed against
<tane>
the docs claim I need the master of zig, but errors if I do that
sord937 has quit [Quit: sord937]
cole-h has quit [Ping timeout: 246 seconds]
zags_ has joined #zig
<tane>
ah I see you have just been talking about ZLS lol
<tane>
what I said wasn't related to that :)
zags has quit [Read error: Connection reset by peer]
<Nypsie>
It is programmed against master. But master is such a fast moving target that it's hard to keep up. 1 - 2 weeks ago a PR was merged that completely revamped the AST that ZLS uses as well. ZLS hasn't been updated to reflect that change just yet (There's an open PR for it, but as you can see, 5k loc and it's still WIP :))
<Nypsie>
Aaah ok :)
<tane>
yes, I see
eax has quit [Quit: eax]
<tane>
I wouldn't have changed anything if it hadn't stopped providing completions muh
zags_ has quit [Ping timeout: 256 seconds]
zags has joined #zig
<tane>
at least it doesn't complete "std."
<Nypsie>
You sure you set std's path correctly in zls.json?
powerofzero has joined #zig
<tane>
I am now sure that it wasn't set correctly
<tane>
thanks for the pointer - I don't remember setting it ever but I'm confident that it worked before Oo
<Nypsie>
No problem and who knows haha :D
Akuli has joined #zig
<Nypsie>
andrewrk: Any reason why an inferred errorset return type has the tag `identifier` rather than `error_union`. Is this a regression, or should I manually check if the return type of a function is an inferred error set or an explicit error_union. This is regarding the AST refactoring.
<ifreund>
hmm? Inferred error sets don't have any token, fn foo() !void is what you're talking about right?
<Nypsie>
Correct
<Nypsie>
Ah I should've checked if there was a token for it. In the old format the return type of a function was a union, so it was easy to check if it was an inferred error set or not.
<ifreund>
the node for the return type will have tag error_union I'm pretty sure
<Nypsie>
Nope, only when I do fn foo() anyerror!void
<ifreund>
oh yeah, we only use that for explicit error sets to save memory
<Nypsie>
Aaah ok
<ifreund>
that way we can have fewer nodes
<Nypsie>
Thanks for confirming :)
<Nypsie>
I'll have to manually check for it in zls then
<Nypsie>
(I should've checked render.zig before asking. There's literally a line with: `const maybe bang = ....`
<Nypsie>
Sorry for wasting you guys time
r0bby has quit [*.net *.split]
fireglow has quit [*.net *.split]
drvirgilio has quit [*.net *.split]
oats has quit [*.net *.split]
raggi has quit [*.net *.split]
kwilczynski has quit [*.net *.split]
dutchie has quit [*.net *.split]
jzelinskie has quit [*.net *.split]
dputtick has quit [*.net *.split]
nikki93 has quit [*.net *.split]
karrick has quit [*.net *.split]
rtpg has quit [*.net *.split]
tcsc has quit [*.net *.split]
guan has quit [*.net *.split]
oats has joined #zig
<ifreund>
no worries!
karrick has joined #zig
kwilczynski has joined #zig
rtpg has joined #zig
tcsc has joined #zig
dputtick has joined #zig
jzelinskie has joined #zig
dutchie has joined #zig
guan has joined #zig
fireglow has joined #zig
r0bby has joined #zig
copy has joined #zig
raggi has joined #zig
greaser|q has joined #zig
nikki93 has joined #zig
nikki93 has quit [Changing host]
nikki93 has joined #zig
r0bby has joined #zig
r0bby has quit [Changing host]
r0bby has quit [Max SendQ exceeded]
posixlix has quit [Ping timeout: 240 seconds]
r0bby has joined #zig
drvirgilio has joined #zig
raggi is now known as Guest28388
Snektron has quit [Ping timeout: 258 seconds]
watzon has quit [Ping timeout: 265 seconds]
BitPuffin has quit [Ping timeout: 244 seconds]
tjammer[m] has quit [Ping timeout: 246 seconds]
kameliya[m] has quit [Ping timeout: 246 seconds]
fengb has quit [Ping timeout: 246 seconds]
Nypsie[m] has quit [Ping timeout: 246 seconds]
ifreund_ has quit [Ping timeout: 258 seconds]
<ifreund>
Nypsie: actually it's not really an optimization, it's just how the grammar works:
<tane>
it seems the original PR was motivated by AOC as well :)
<tane>
if simple text parsing functions are missing, people tend to whatever is available, e.g. json
<tane>
I once participated in an optimization challenge and the instance files were distributed as pretty printed (with 4 space identation) JSON files, resulting in 300mb instance files, although the actual content when presented in a simple text format would be 1MB or so
watzon has joined #zig
kbd has joined #zig
BitPuffin has joined #zig
dyeplexer has quit [Remote host closed the connection]
tjammer[m] has joined #zig
Nypsie[m] has joined #zig
fengb has joined #zig
kameliya[m] has joined #zig
arielp has quit [Ping timeout: 260 seconds]
ugla has joined #zig
Guest28388 is now known as raggi
txdv has quit [Ping timeout: 240 seconds]
bbuccianti has joined #zig
Guest24956 has joined #zig
ifreund_ has joined #zig
bitonic has joined #zig
siraben has joined #zig
supercoven has quit [Ping timeout: 245 seconds]
jaens[m] has joined #zig
eax has joined #zig
craigo has joined #zig
powerofzero has quit [Ping timeout: 245 seconds]
arielp has joined #zig
powerofzero has joined #zig
Guest24956 is now known as zmv
zmv is now known as notzmv
zags has quit [Ping timeout: 265 seconds]
<tane>
I think the PR for std.fmt.scan should be redone, I guess returning !usize for the number of matched items would be nice and the typ annotations in the format aren't necessary, only width modifiers etc
<bbuccianti>
how do you alloc on zig?
<bbuccianti>
I want to have a runtime sized array like thing
<s-ol>
or maybe i can adjust the types on the other side
<zags>
iterating arraylist and doing swapRemove seems to run into issues. I guess I should put items scheduled for removal in a separate array and delete that after the loop?
eax has quit [Ping timeout: 268 seconds]
<s-ol>
hm, and now im struggling ahrd to produce an empty '[*]const [*:0]const u8'
<s-ol>
actually... that just means its typed wrong right
<s-ol>
it should be a 0-element array as a C pointer, so it could be literally any value or null