Silver

Results 99 comments of Silver

@InKryption the usecase I was initially considering when suggesting this was #9938. With decl literals and this both implemented, you'd be able to do stuff like `const foo: ArrayList =...

@wrongnull 1. that looks very difficult to detect in a reliable way 2. if someone's reaching for this syntax, they probably already know about while loops :)

@GalaxySnail `std.fs.path.resolve` and check for `../` at the beginning of the result

For some examples of my last point about blocks: ```zig // Currently const x = a: { var x_var: u32 = 3; // needs a different name because shadowing x_var...

I don't agree that it violates that property. A variable declared as `const` can still never change, but you can introduce a *new* variable named the same thing that can....

I also don't see how this issue is related to #594, that seems to be proposing something very different.

I definitely much prefer the option of `@export` taking a pointer, since it mirrors `@extern` and simplifies the rules.

I'd like to note that it's very easy to write an allocator that's much, much faster than the current `GeneralPurposeAllocator`. My [`BinnedAllocator`](https://gist.github.com/silversquirl/c1e4840048fdf48e669b6eac76d80634) (

I'd also like to suggest renaming the current `GeneralPurposeAllocator` to `DebugAllocator` and introducing a new `FastAllocator` (or maybe `DebugGeneralAllocator` and `FastGeneralAllocator`?). `std.heap.GeneralPurposeAllocator` can then refer to either `DebugAllocator` or `FastAllocator`...

A few examples of how real Zig APIs (mostly from `std`) could benefit from this proposal: - [mach-gpu](https://github.com/hexops/mach-gpu) uses wrappers for several WebGPU structs to convert slices to pointer +...