<tgschultz>
For the record andrewrk, I'd rather you reject anything I submit than accept something you think is detremental to zig, so don't feel bad about rejecting my stuff anyway.
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 268 seconds]
fsateler has quit [Read error: Connection reset by peer]
<ltr->
andrewrk: is your plan to implement an lsp server as part of the std lib?, for example i can "start" the server with 'zig run-lsp' ?? so the build.zig will eventually run the main function of the server in a separate process when the editors start?
<ltr->
i like the idea of an lsp server in the standard library , so editors can call and execute build.zig with an special argument to spawn a server
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 272 seconds]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
renatorabelo has quit [Remote host closed the connection]
ltr- has quit [Quit: leaving]
cheesy has quit [Quit: zzz]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
hio has joined #zig
<meowray>
there are many lessons we can learn from clangSema for completion. Its on-the-fly diagnostics is great
ManDeJan has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 268 seconds]
ManDeJan has quit [Ping timeout: 248 seconds]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
laaron has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
cheesy has joined #zig
brakmic has joined #zig
brakmic has quit [Remote host closed the connection]
kristoff_it has joined #zig
brakmic has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
kristoff_it has joined #zig
jjido has joined #zig
kristoff_it has quit [Ping timeout: 258 seconds]
kristoff_it has joined #zig
<daurnimator>
emekankurumeh[m]: you there?
<emekankurumeh[m]>
yes
<daurnimator>
Re: socket module. you've gone with a very classic BSD socket API. I'd like to propose that zig prefers a more modern command buffer approach
<marler8997_>
Is there a library that you could reference that uses such a commmand buffer approach?
<marler8997_>
Also, for any higher level API, I would think it could work on top of the socket api right?
<emekankurumeh[m]>
I suppose midpix would be helpful hrre
<marler8997_>
Sounds like an interesting project, but in the immediate, providing a socket library that supports the BSD style socket API also makes sense in my opinion
<daurnimator>
I think I was the one that told midipix this some of this stuff
<daurnimator>
but yes midipix has some good defines for it
<daurnimator>
and in psxscl he wrote the best windows socket polling piece I've ever seen
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<daurnimator>
marler8997_: yes and no...
<daurnimator>
I think we can do command buffer style now
<emekankurumeh[m]>
it might make sense to ~~steal~~ port some of that stuff from midipix
<daurnimator>
emekankurumeh[m]: note that midipix is GPL.
<marler8997_>
shouldn't we support the basic well-defined officially supported interface first?
<mq32>
daurnimator, what would "command buffer style" exactly be? i know these words from Vulkan, but not in connection to networking
<daurnimator>
so what am I suggesting now?: the socket object should have: socket.queueListen(), socket.queueSend(); socket.queueRead(); etc. method.
<daurnimator>
and then only finally *do* them when you do. socket.exec() or similar
<mq32>
so my primary use case would be .queueReceive(), .exec() ?
<daurnimator>
this will then be easy to write different 'backends' internally that use uring/overlapped IO/raw AFD operations without changing the public API
<emekankurumeh[m]>
do you have a proposal typed up?
<emekankurumeh[m]>
(on the issue tracker)
<daurnimator>
emekankurumeh[m]: I don't think so? I've mentioned it before here on IRC and I think in #2525 ?
<daurnimator>
originally #2525 contained the start of my implementation
kristoff_it has joined #zig
<daurnimator>
but I changed that PR to be just the uring defines.
<emekankurumeh[m]>
also any async stuff would have to be built on top of this stuff right?
<daurnimator>
emekankurumeh[m]: well you'll notice that if you have .queueReceive(), you already sort of have async ;)
<emekankurumeh[m]>
furthermore the traditional BSD style api could be built on top of this right?
<daurnimator>
emekankurumeh[m]: yep
kristoff_it has quit [Ping timeout: 272 seconds]
<daurnimator>
recv() would be .queueReceive() and then .exec()
<emekankurumeh[m]>
I'll try to address some of the comments on the pr and then I'll look into some of this other stuff
<daurnimator>
My branch with this stuff got paused until I see how coroutines end up looking
<emekankurumeh[m]>
most of the code in that pr is from a while ago
<emekankurumeh[m]>
~1400 commits ago
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 246 seconds]
marijnfs__ has joined #zig
kristoff_it has joined #zig
ntgg has quit [Quit: leaving]
kristoff_it has quit [Remote host closed the connection]
kristoff_it has joined #zig
marijnfs__ has quit [Ping timeout: 272 seconds]
marijnfs__ has joined #zig
samtebbs has joined #zig
brakmic has quit [Read error: Connection reset by peer]
brakmic has joined #zig
IntoxicatedHippo has joined #zig
<IntoxicatedHippo>
Does anyone have a NixOS derivation for a recent version of Zig? I'm trying to build it and I'm getting this error: Generating libuserland.a, Unable to create builtin.zig: access denied
<samtebbs>
IntoxicatedHippo: Is that a NixOS-specific error or a general permissions error? I'm pretty sure that andrewrk himself develops on NixOS.
<IntoxicatedHippo>
It's an error from the zig build, but I don't know what within the build causes it or where it's trying to create builtin.zig
<bheads>
but its not document yet, so you need to dig through the code
<bheads>
but to look at the tests at the end of the file
very-mediocre has joined #zig
<dimenus>
bheads: thanks
<bheads>
@dimenus: np
Tetralux__ has joined #zig
Tetralux has quit [Ping timeout: 248 seconds]
Tetralux__ is now known as Tetralux
<IntoxicatedHippo>
What's the name for the files cached in ~/.local/share/zig/stage1/o/ ?
Tetralux has quit [Ping timeout: 268 seconds]
Tetralux has joined #zig
<mikdusan>
IntoxicatedHippo: that's another level of `zig-cache`; feel free to delete `~/.local/share/zig`; zig will populate it as necessary
<IntoxicatedHippo>
It doesn't seem to get updated when -mllvm options change, I'm trying to work out if that's been reported or not
gamester has joined #zig
ibutra has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
very-mediocre has quit [Read error: Connection reset by peer]
very-mediocre1 has joined #zig
<emekankurumeh[m]>
should it?
<IntoxicatedHippo>
I assume there are flags that will change the output, I ran in to an issue here when I tried to use `-llvm-features -sse`: https://github.com/ziglang/zig/pull/2595
ltr- has quit [Ping timeout: 245 seconds]
<mikdusan>
--> "Cached files in ~/.local/share/zig are not updated when --llvm-features flags are changed."
<mikdusan>
is that referring to files like compiler_rt.o and libcompiler_rt.a ?
<IntoxicatedHippo>
Yes
<mikdusan>
i did this, and it seems to confirm: `zig run -mllvm -mcpu=avx hello.zig`
<mikdusan>
noticed this: a new `run.o` was populated in cache. but not `compiler_rt.o` and `libcompiler_rt.a`
<nifker>
where can I find docs for 'builtin'?
<Tetralux>
`zig builtin` may help you (cmdline)
<mikdusan>
nifker: if you're looking for TypeInfo docs; search for `@typeInfo` in zig main doc
<nifker>
I dont seem to be able to access "builtin.Arch.Arm32.v7m" somehow
<emekankurumeh[m]>
it's a tagged union
<nifker>
so I found this line which works but doesnt fit my requirement "exe.setTarget(builtin.Arch{ .aarch64 = builtin.Arch.Arm64.v8 }, builtin.Os.freestanding, builtin.Abi.eabihf);"
<nifker>
but this doesnt "exe.setTarget(builtin.Arch{ .aarch64 = builtin.Arch.Arm64.v8 }, builtin.Os.freestanding, builtin.Abi.eabihf);"
<emekankurumeh[m]>
so you have to do builtin.Arch{ .arm = .v7 }
<emekankurumeh[m]>
are you editing compiler_rt or is this an error from the std that comes shipped with 0.4.0
<nifker>
it comes from there
darithorn has joined #zig
knebulae has quit [Read error: Connection reset by peer]
fengb has quit [Remote host closed the connection]
avoidr has joined #zig
<ibutra>
I want to explore using zig for embedded development on an STM32f3 alongside the HAL which is written in c. This introduces some quiestions:
<ibutra>
1. do build for that target I have to build with.build-lib not build-exe?
<ibutra>
If I build with build-exe the .text reagion (or all reagions for that matter) are empty, not so fo rbuild-lib. Could I just flash the built lib on the controller?
<ibutra>
2. Can I give the zig buildsystem a linker file where I define the memory layout and the layout in .text? This is crucial for stuff like interrupt tables
<andrewrk>
nifker, (looking at your earlier conversation) at this point I'd recommend master over 0.4
<emekankurumeh[m]>
1. can't you just specify in your linker script to keep the text section?
<andrewrk>
ibutra, are you aware of `export` and `@export` in that they are necessary to generate symbols in the output object file?
<ibutra>
nifker, thx I will look into that, it looks helpfull, actually the whole project does
<ibutra>
I am not exactly sure what you mean with that. I want to try to build the whole project with the zig compiler including the c files so the elf will be created by zig, not just a library I want to use from c
very-mediocre has quit [Read error: Connection reset by peer]
<andrewrk>
yes you can do that
<ibutra>
But then I don't need export or do I?
<nifker>
I guess I cant build never versions with an older version of zig
<andrewrk>
build-exe is correct - let us figure out why the text region is empty
very-mediocre has joined #zig
<andrewrk>
nifker, yeah, the project is still young and moving quickly, so that's one downside you'd have to put up with
<andrewrk>
zig is still beta software; to build a non-trivial project in zig will probably mean participating in the development process of zig to some degree (at least by reporting bugs)
<ibutra>
I started with a minimal example trying to build for thumbv7em-standalone-eabihf which is basically just a volatile pointer (so it doens't get optimized away) and some operations on it (additons mainly)
<ibutra>
I am aware of that and not reluctant to participate :)
<ibutra>
But looking at the disassembly now it seems maybe it was still optimized away, because all that is present in the lib file is <std.special.panic>
<ibutra>
I guess I will implement something none trivial and report back.
<andrewrk>
try deleting the `export` keyword there
<andrewrk>
you can see that zig no longer generates code for the function. zig has lazy analysis; anything not reachable from an exported function is not generated
fengb has joined #zig
<andrewrk>
so make sure that your entry point (is it `_start`?) is exported
<nifker>
compiling for thumbv7m works now 👍
<fengb>
There's been major breaking changes since 0.4.0 release. We have a few more before 0.5.0 lands
<ibutra>
Ah, I see, thank you! (it normally is _start, yes)
<fengb>
andrewrk: I apparently know someone who works on Github Sponsor. I'm gonna see what can be done :P
<nifker>
And how can I look at the std documentation?
<ibutra>
Thank you very much it is indeed helpful. Maybe I should actually read the whole documentation and not glance over the parts I thought I don't need right now :)
<fengb>
I've got a controversial proposal: "automatic semicolon insertion" after a closing brace
<very-mediocre>
If JavaScript is any indication, that's gonna be flaky
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<fengb>
JS has too many permutations. I just want 1
<fengb>
Is it worth writing up?
very-mediocre has quit [Read error: Connection reset by peer]
<fengb>
Man, he rage quit :(
very-mediocre has joined #zig
<very-mediocre>
I didn't rage quit :]
<very-mediocre>
my internet is flaky
<very-mediocre>
some edge cases come to mind, like inline array literals e.g. [_]u8{'x', 'y'}, if/while/for blocks
<fengb>
Argh you're right
<very-mediocre>
you can also have { } scoped blocks anywhere if you're so inclined
<very-mediocre>
I wish we didn't have to label a block to break out of it with a value
<fengb>
I wonder how that'd look with a different keyword
<fengb>
I think "break :blk" and "break" are semantically different enough now
<fengb>
Maybe rename the current "break" into "break loop"?
<fengb>
Then a bare "break" can be block based
<very-mediocre>
hm i'm not sure if you can break out of a while/for loop with a value, but if not, then it's not ambiguous
<very-mediocre>
you could just do `const x = { ... break val; };
<fengb>
I think loops can be expressions
<very-mediocre>
maybe I am abnormal but I take forever trying to come up with variable names, especially for a disposable scope
<fengb>
Everyone sucks at naming. Some people don't recognize it :P
<fengb>
`incompatible types: 'u8' and 'void' — const foo = for (x) |a| {`
<fengb>
I guess you can't make an expression
<andrewrk>
the :blk thing is pretty unpopular. unfortunately people are too used to `break` applying to the innermost loop
<andrewrk>
:blk exists because sometimes you need that level of control. and then I simply didn't add any shortcut syntax
<very-mediocre>
yeah, there's no way around the labels for n>1 block depth
<fengb>
It makes sense for nested loops. It's just a little awkward for blocks
<fengb>
I think most languages just work around it by not allowing block breaking
<very-mediocre>
I really like having a block evaluate to a single value though
<very-mediocre>
it's so desirable JS people do inline self-invoking functions
<fengb>
Yeah it's very natural. Especially with switches and stuff
<ibutra>
How do I declare an array of strings? Or any multidimensional array for that matter?
<fengb>
[N][]const u8
<ibutra>
thx
<andrewrk>
that's an array of slices, not a multi-dimensional array
<fengb>
Oh right
<very-mediocre>
if you're lazy you can do a struct that contains an array, for the 2nd dimension
<very-mediocre>
easier to heap-allocate too
<ibutra>
I want to tell the buildsystem all c files it should add and thought the easiest way is to have an array where I put all the paths in and then just iterate over it to addCSourceFile for everyone. In my mind that is an array of strings therefore an array of array
<very-mediocre>
[n]SecondDimensionStruct
<fengb>
Arrays are fixed size. Is your list known at compile time?
<ibutra>
yes
<ibutra>
I just want to save myself from having to type addCSourceFile for every file again :P
Ichorio has joined #zig
<very-mediocre>
not sure if this is supposed to work in zig. I wrote `var x: [5][5]u8 = undefined; x[0][0] = 67;` and it compiled fine
<very-mediocre>
can't test it rn as im in the middle of sthg
<andrewrk>
uh that syntax needs to be updated to [_][]const u8 though
<ibutra>
Thank you, the support here is outstanding!
<ibutra>
ok I think I can do that ;)
<emekankurumeh[m]>
you could even just have the file names and use `++` to append the dirname
<very-mediocre>
andrewrk: dumb question: is that different from what fengb wrote earlier? how is that not an array of slices.
<andrewrk>
very-mediocre, it is, but until the use case was explained we thought ibutra wanted a multi-dimensional array
<very-mediocre>
ah, okay
<andrewrk>
this is why I love use cases :)
<ibutra>
yeah,
<ibutra>
that's why i provided it, I figured there is probably an idiomatic way
lunamn has joined #zig
ibutra has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lunamn_ has quit [Ping timeout: 248 seconds]
<andrewrk>
zig fmt fixes whitespace now
<emekankurumeh[m]>
andrewrk: that was fast
<very-mediocre>
great, CRLF is an annoyance on windows
<andrewrk>
emekankurumeh[m], thanks for the original PR, I wanted to just get it done and add a test, and move the switch cases to one line and not mess up the compiler_rt formatting
<fengb>
I'm always confused when the irc name doesn't match the Github name
<hryx>
thanks for knocking out the whitespace thing quickly emekankurumeh[m] and andrewrk. hopefully will result in less noise on IRC/github now
<fengb>
Is this idiomatic for switching a nullable? `const addr = switch (cmp.active() orelse return null) {`
<fengb>
Feels super weird to have orelse return null squeezed in the middle
<andrewrk>
fengb, it looks good to me
<fengb>
Sounds good
<Tetralux>
I have a slightly related question: You can do `if (optional) |value| { ... }` -- can you do `if (!optional) return;` ?
<Tetralux>
andrewrk, Yeah - Figured. Just wondered if there was a way to check it without assigning it to something.
<andrewrk>
if (optional == null) return;
<Tetralux>
Oh of course! xD
<scientes>
well it is special in the compiler
<scientes>
null is its own type
very-mediocre has quit [Read error: Connection reset by peer]
very-mediocre1 has joined #zig
<Tetralux>
I was curious about how `if (!optional) return` does not work, but `if (optional == null) return` _does_ work
<fengb>
Not operator only works on bools
<very-mediocre1>
I guess optionals do not evaluate to booleans
very-mediocre1 is now known as very-mediocre
<hryx>
nothing casts to boolean (I think)
<scientes>
not even u1
<very-mediocre>
I guess the if statement unwrap is like the "if the unwrap is successful" boolean
<andrewrk>
if-optional is separate syntax
<Tetralux>
Zig borrowing from C# over here :P
<andrewrk>
ideas are cheap. implementation is hard work
<very-mediocre>
also it's easy not to see massive problems with ideas when you're not knee-deep in implementation-land
<very-mediocre>
I keep doing that.
<Tetralux>
Why'dya think I was asking? ;P
<Tetralux>
I'm curious about why's and why nots in things.
laaron has quit [Remote host closed the connection]
laaron has joined #zig
<Tetralux>
Though I am curious what makes that one hard.
<very-mediocre>
re:allocator pattern - at what point should I stop exposing an allocator param and just decide on one?
<andrewrk>
very-mediocre, in your main() function
<very-mediocre>
say I have a component I really really want people to use an ArenaAllocator for
<andrewrk>
yeah then your component should probably make an arena allocator. the self hosted parser does that
<very-mediocre>
okay
<very-mediocre>
specifically I've got a bunch of tree nodes on the heap and deallocating with traversal would be a pain, and the tree itself shouldn't be seen by the library consumer anyway...
marler899749 has joined #zig
<marler899749>
I just noticed that zig seems to be completely statically compiled. Doesn't even use a dynamc loader as an interpreter
<marler899749>
makes sense for a self-contained downloadable compiler....will zig use dynamic linking when it's a package in a package manager?
<Tetralux>
I'm not entirely clear what you mean, but I doubt it.
<andrewrk>
marler8997, yes it will follow the system guidelines
<marler899749>
ok makes sense. I like that it's statically compiled when you just download it. Then you only need one version
<Tetralux>
Oh - by package manager you mean like apt etc?
<andrewrk>
yes
<Tetralux>
Okay - that makes sense then xD
<Tetralux>
I read it as "_the_ package manager".
<Tetralux>
Oops.
<fengb>
very-mediocre: if it's not exposed, you can pass around the arena internally, but the entry function should take the underlying allocator for creating the arena
<scientes>
that makes the @shuffle that I introduced woorse. because its best to use ~ to do indexes from the second vector, and you can't do ~ on comptime_int
<scientes>
(which was rejected)
<fengb>
Do it the C way and put parens around the type :P
<scientes>
yeah that would work too
<scientes>
I have the feeling that it would be confusing that @cast can only do implicit casts, which it looks pretty explicit (but that is already a difference from C)
<fengb>
Does this mean we'll have @cast _and_ @intCast? That feels super weird to me
<gamester>
Don't some languages do this to specify literal types? 1234'i32, 45.5'f32
<gamester>
Maybe they don't, but I find it short and simple
<fengb>
Oh I see (after rereading)
<hryx>
fengb: it's not settled yet. maybe @cast would replace @intCast
<hryx>
if I understand correctly
<fengb>
I like @cast to replace @intCast... but I feel like it could be a bit much for @ptrCast
<hryx>
do they deserve different builtins? if so maybe @scalarCast and @ptrCast or something
<fengb>
I guess technically @ptrCast is non-destructive so that might be a better candidate?
<fengb>
intCast definitely changes the internal representation
<fengb>
(And floatCast)
<hryx>
oh cool, maybe it could be separated by lossy/not. like @cast and @lossyConvert
SimonNa has joined #zig
<Tetralux>
If we had @cast, I'd expect it to be a combination of @intCast, @floatCast, and @ptrCast - so that seems bad considering that we have those already.
<emekankurumeh[m]>
i think `_` in number literals would be a nice thing in zig
<hryx>
Tetralux: you could propose to replace them. I sure they're not sacred or set in stone
wootehfoot has joined #zig
<hryx>
emekankurumeh[m]: wasn't that already rejected?
<emekankurumeh[m]>
was it?
<hryx>
oh jeez, I think I'm remembering a golang/go proposal
<andrewrk>
fengb, @intCast asserts; implicit casting integers never asserts
<hryx>
thanks. perhaps my memory sort of still works
<Tetralux>
Yeah - the whole "you could write 100_00_00" argument - I don't buy that; I'd rather be able to write 1_000_000 than not.
fengb has quit [Ping timeout: 260 seconds]
<Tetralux>
I buy the "but 100000" means the same thing in regardless of where you are"
<Tetralux>
Don't buy that either.
<Tetralux>
You don't read the underscores.
<Tetralux>
They're there for clarity when reading/writing the number.
<Tetralux>
It has the same number of digits regardless of what you do
<Tetralux>
Just as when writing a number with a pen.
<Tetralux>
(100_00_00 == 1,000,000)
<Tetralux>
You may have written the underscores that way because the last four digits in the number you are writing means something special in your code.
<Tetralux>
I don't buy the "but 100000" means... *
<Tetralux>
Interestingly--though I don't know about you--but to me, "1000000" is harder to read than "100_00_00"
<Tetralux>
Not by much mind.
<Tetralux>
Whereas 1_000_000 is positively amazing by comparison.
<emekankurumeh[m]>
we could allow those and have zig fmt enforce one formatting method?
very-mediocre has quit [Read error: Connection reset by peer]
<Tetralux>
That would destroy any meaning in where you put the underscores though.
very-mediocre has joined #zig
<Tetralux>
Maybe that doesn't matter though /shrug
<very-mediocre>
what's your use case for not grouping by 3 digits
<very-mediocre>
i can see 2 nibbles for hex
<Tetralux>
Isn't the burden a positive one? Why would you limit it?
<very-mediocre>
only thing i can think of for decimal is using an int as a bit array
<very-mediocre>
er
<Tetralux>
Maybe you only care about seperating millions.
<very-mediocre>
I dunno, if there are not conceivable use cases then zig fmt would make things easier
<Tetralux>
(..For that particular literal.)
<Tetralux>
Maybe only ten thousands.
<Tetralux>
Indeed
<Tetralux>
For hex
fengb has joined #zig
<Tetralux>
0x11_22_33_44__55_66_77_88
<Tetralux>
(Note the double '_' in the middle)
<ltr->
is going to be posible to do this in the future? : for(buf) functionDeclaredElsewere; ??
ntgg has joined #zig
<fengb>
I think since we're bickering about what is better, having it be simple is the best approach :P
<Tetralux>
Meaning `for(buf) |x| functionDeclaredElsewhere(x)` ?
<ltr->
oh you can omit the {
<Tetralux>
fengb, I'd argue "simple" is just "underscores are allowed in indents"
<fengb>
Simple to compiler/parser
<Tetralux>
ltr-, I believe so.
<Tetralux>
fengb, Sounds simple to me.
<fengb>
And language since there's less to define
<ltr->
Tetralux: yes you can omit them
<Tetralux>
I've even written a parser which parsed underscores in idents; just skip any underscores, done.
<Tetralux>
in numbers*
<fengb>
I'm not saying it's complicated... but it takes a bit more work to support and we're back to bickering about what's better
<very-mediocre>
i don't know that any of this stuff is bickering
<Tetralux>
I mean... "A bit more work" is a bit of a stretch since you're checking if the char is a digit anyway xD
<ntgg>
underscores in numbers makes it much more readable
<Tetralux>
You literally just check for one other char while you're at it.
<Tetralux>
I'm struggling to think of anything simplier XD
<fengb>
n + 1 > n
<Tetralux>
simpler*
<fengb>
nvm
<fengb>
Forget I said anything
<Tetralux>
hahaha
<Tetralux>
I also don't use `zig fmt` so... /shrug.
<very-mediocre>
Really? I adore beautifiers, can type abominable code and have it get fixed automatically
<hryx>
Tetralux: if this is important to you, I suggest formatting a chunk of stdlib the way you want and link to it so that people can visualize the difference
<hryx>
keeping in mind that the proposal has already been rejected in the past
<fengb>
I can't *not* use zig fmt because andrewrk added it to Vim
<Tetralux>
fengb, I'm choosing to ignore that example. ;)
<Tetralux>
fengb, Though I don't really use Vim for editing that much so :p
<Tetralux>
very-mediocre, I don't use them because I usually write code in the way I want for a reason - I don't need a 'beautifier' to undo it all.
<Tetralux>
I'm not sure a uniform way to format code even matters at all.
<Tetralux>
_except_
<Tetralux>
For being able to write sloppily and not care because it'll fmt it.
<Tetralux>
But... /shrug.
<very-mediocre>
I find it relieving to just write awkward stuff really really fast
<Tetralux>
In my experience, it's a little hard to write code _that_ sloppily.
<fengb>
Tetralux: check out the Go ecosystem
<fengb>
And try doing autoformatting for a week
<Tetralux>
fengb, That's how I found I hate them xD
<fengb>
I hated it my first 2 days
<fengb>
Then I started to ignore it
<fengb>
And then I loved it
<very-mediocre>
Tetralux: do you hit the space bar 4n times for indentation?
<fengb>
So much of my life has been wasted by bickering about tabs, trailing commas, etc.
<Tetralux>
Nope - Tab once = 4 spaces.
<Tetralux>
If I did have to do 4 spaces (like I have to in Vim) , I'd either not be a programmer, use hard tabs, or my idents would be 1 space.
<fengb>
I still don't like the Go format style, but it's so much better than everyone having their own style
<Tetralux>
Like - the one place I'd find the beautifier useful is when you want to put fn args onto their own lines.
<Tetralux>
But I can do that already by going to the ',' and multi-cursoring those things.
<fengb>
That's not the pont
<Tetralux>
No it isn't xD
<fengb>
It's not for you reading your own code
<Tetralux>
Give me an example of badly written Zig code that you couldn't read.
<fengb>
It's not even about badly written
<Tetralux>
"badly written" = "badly formatted"
<fengb>
Have you ever hopped on a project where someone yells at you "hey turn off tabs"
<fengb>
Or "braces go on a different line"
<fengb>
Or "add a space between opening function calls"
knebulae has joined #zig
<fengb>
Or a dozen different idiosyncracies that are slightly off from what you're used to
<Tetralux>
I'd argue that if that is important to a project, that they should have a formatter that runs on commits.
<fengb>
Exactly, that's why zig fmt exists
<fengb>
But instead of project based, it's language based
<very-mediocre>
imho zig fmt nails the coding style, and i'm very happy that it handles things smartly, e.g. preserves 1-liners, or breaks up an array declaration into multiple lines only if you have a comma after the last element...
<Tetralux>
If your style is basically what it does anyway, then I can see why you might like it.
<Tetralux>
That thing about "leave a comma after the last element" -- that's useful.
<fengb>
I don't agree with everything zig fmt does, but I agree enough that I'd rather not argue about it
<Tetralux>
That's the example I had in my mind when I said about multi-cursoring things.
<fengb>
(Although I thing zig fmt is better than Go :P)
<Tetralux>
Personally, I'd rather just not have the extra work of having to deal with potential bugs in something I don't need.
<Tetralux>
Simpler my workflow is the better.
<very-mediocre>
well it uses the AST as a source of truth, not much room for "serious" bugs
<fengb>
It's the same parser (or it will be in stage2)
<Tetralux>
> It's the same parser
<Tetralux>
The reading part, I assume you mean.
<Tetralux>
Well - maybe not - because of `zig builtin`.
Ichorio has quit [Ping timeout: 250 seconds]
<Tetralux>
Or does that use `zig fmt` to render it?
<Tetralux>
I imagine it does actually.
<emekankurumeh[m]>
i'm starting to have a growing hatred of windows
<Tetralux>
hehe
<Tetralux>
Sounds about right.
<Tetralux>
Personally, I suspect I'd prefer it if OSes were little more than hypervisors.
<Tetralux>
And programs were little more than just pure x64 code that the hv brokered the actual execution of.
<Tetralux>
more/less.
<Tetralux>
Like - I dunno - but the idea seems worthy of exploration at least.
very-mediocre has left #zig [#zig]
cheesy has joined #zig
brakmic has quit [Read error: Connection reset by peer]
cheesy has quit [Client Quit]
brakmic has joined #zig
jjido has joined #zig
Akuli has quit [Quit: Leaving]
kristoff_it has joined #zig
<fengb>
andrewrk: the compiler is crashing *only* when I do release-safe, fast/small/debug all work. Is this a known problem?
kristoff_it has quit [Ping timeout: 244 seconds]
Flaminator has quit [Disconnected by services]
darithorn has joined #zig
brakmic has quit []
<andrewrk>
fengb, no - would you mind filing an issue?
<fengb>
Sure
SimonNa has quit [Remote host closed the connection]
<fengb>
I feel like all I ever do is complain about bugs :/
<Tetralux>
That is a good thing xD
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]