News for hackers. Stuff that matters.

thezipcreator

Re:Unsigned Sizes: A Five Year Mistake on Sunday May 03, 2026 @08:54PM (#48003360)
this is possible in rust, albeit with a lot of shenanigans. See this article where someone made a GC in rust where the external references are bound to a specific GC via a unique lifetime: https://kyju.org/blog/tokioconf-2026/
Re:The Cost of Indirection in Rust on Thursday March 12, 2026 @10:15PM (#47359935)
fair enough, I suppose
Re:The Cost of Indirection in Rust on Thursday March 12, 2026 @03:16PM (#47355735)
seems pointless to extract `handle_suspend` here. There are very few reasons to extract code that isn't duplicated in more than one place; it's probably harder to read to extract the handling of the event than to handle it inline.
Re:Zig – Type Resolution Redesign and Language Changes on Thursday March 12, 2026 @03:11PM (#47355662)
> And I don't know any other languages that don't parse a carriage return.

fair enough.

Re:Making WebAssembly a first-class language on the Web on Thursday March 12, 2026 @03:09PM (#47355640)
you can just expose javascript functionality as a component, if need be
Re:Making WebAssembly a first-class language on the Web on Thursday March 12, 2026 @03:08PM (#47355628)
I would think you could treat it as a normal GC reference and then just drop the resource when the GC collects the object.
Re:Zig – Type Resolution Redesign and Language Changes on Thursday March 12, 2026 @01:30AM (#47346867)
I still don't understand how they managed to make a build system as bad as Gradle. It's like they tried to make it as horrible as possible to use.
Re:Zig – Type Resolution Redesign and Language Changes on Thursday March 12, 2026 @01:26AM (#47346847)
sure, but when I've written zig this has never been an issue for me. `defer` makes memory management really easy.

If you want to auto-generate destructors, zig has really good comptime features that can let you do that.

Re:Zig – Type Resolution Redesign and Language Changes on Thursday March 12, 2026 @01:25AM (#47346841)
I'm not sure why you shouldn't make your compiler accept CRs (weird design decision), but fixing it on the user-side isn't exactly hard either. I don't know an editor that doesn't have an option for using LF vs CRLF.

The unused variable warning is legitimately really annoying though and has me inserting `_ = x;` all over the place and then forgetting to delete it, which is imo way worse than just... having it be a warning.

We've had machine translation for a while and I don't think anybody particularly thinks of it as a bad thing? Writing something and then having a machine directly translate it (possibly imperfectly) is a lot different than a machine writing the thing.

Personally I would like people to try learning other languages more (it's hard but rewarding) but you can't learn every language ever, and it is really hard to learn a language to fluency.

Re:Making WebAssembly a first-class language on the Web on Thursday March 12, 2026 @01:03AM (#47346699)
The WASM component model is really cool in that you can export basically anything as a component and use it in basically anything else that can compile to WASM and understand components.

I would love something like this for native applications; I'm so tired having to wear C's skin every time I want to do bind together code written in different languages.

Re:Making WebAssembly a first-class language on the Web on Thursday March 12, 2026 @01:02AM (#47346685)
I disagree. That's how WASM is now, and I guess that's fine, but that's not all it could be. I really think it would be awesome if you could write code for the web in your preferred programming language.
Re:Making WebAssembly a first-class language on the Web on Thursday March 12, 2026 @12:56AM (#47346639)
webassembly components use a borrow checking model[1], so I assume that would be used to manage DOM components?

I'm not exactly sure how this works when binding it to GC languages.

[1] https://component-model.bytecodealliance.org/design/wit.html...

Re:Making WebAssembly a first-class language on the Web on Thursday March 12, 2026 @12:54AM (#47346620)
iirc webassembly components need to explicitly import anything they use, so it should be transparent which dependencies something has by just grepping its WIT for `import`
Re:Living Human Brain Cells Play Doom on a CL1 on Sunday March 08, 2026 @02:29PM (#47299704)
what's with people inventing new torment nexuses every few weeks? could you people just chill, please?
Re:Windows 11 Notepad to support Markdown on Thursday February 26, 2026 @05:29PM (#47172921)
pochastic starrot
Re:The Little Bool of Doom (2025) on Friday February 13, 2026 @06:35AM (#47001597)
`bool` is useful as a communication device; if you just use `int` (or `int32_t` or whatever) then it's not exactly clear that the value can only hold `1` or `0` unless you explicitly say it in the documentation. with `bool`, it's clear from the get-go that it's only ever `true` or `false`.
Re:Ask HN: Tools to Code Using Voice? on Friday February 13, 2026 @05:52AM (#47001319)
cursorless (https://www.cursorless.org/) is basically spoken vim

it isn't for LLMs at all really but if you want to do code editing via voice it seems like it'd be really good for that.

Re:D Programming Language on Friday February 13, 2026 @05:17AM (#47001085)
instead they made (or funded? not exactly sure) il2cpp which is a batshit compiler that compiles IL to C++ for better performance, I guess.

sidenote, I wonder how many other low-level to high-level compilers exist out there. can't be many.

Re:D Programming Language on Friday February 13, 2026 @05:15AM (#47001070)
this is the main issue I think with D, yeah.

regarding kitchen-sink-ness it's at least nowhere near as bad as C++, but that bar is basically below the ground anyway so it's not much to write home about.

Re:D Programming Language on Friday February 13, 2026 @05:14AM (#47001061)
what are you referring to regarding Java? I'm aware C# has AOT (and il2cpp for Unity projects) but I don't recall hearing about any sort of Java native binary that isn't just shipping a VM and java bytecode (ignoring the short-lived GNU java compiler).
Re:Sandboxels on Wednesday February 11, 2026 @10:17PM (#46984509)
this doesn't answer any questions about this game, but I found this GDC talk about Noita pretty interesting: https://www.youtube.com/watch?v=prXuyMCgbTc
Re:Humanity's Last Programming Language on Wednesday February 11, 2026 @10:08PM (#46984438)
not sure if that's a direct comparison to bladerunner. I've not watched/read it but just skimming the wikipedia article, replicants seem to have human-level sapience; I think the comparison was rather to oppressed human underclasses.

regardless, what you say is true and that's an interesting comparison.

Re:Humanity's Last Programming Language on Wednesday February 11, 2026 @10:03PM (#46984413)
did you read the post? I think

> I wonder what underclass of people like that exists today.

was a subtle hint to what you are talking about.

Re:Humanity's Last Programming Language on Wednesday February 11, 2026 @10:01PM (#46984401)
> is longer and more ambiguous than the naive Python implementation

write it in lojban instead, ez

Re:C Isn't a Language on Tuesday February 10, 2026 @04:51AM (#46957455)
> 128 bit ints is definitely a problem though, you don't even get agreement between different compilers on the same os on the same hardware.

you technically have _BitInt(128) in C23, but I'm not sure that would even generate what you expect it to.

Re:C Isn't a Language on Tuesday February 10, 2026 @04:41AM (#46957379)
> C uses pointer casts all over the place to fake generics.

by "C" do you mean users of C? because most of the C code I write I don't use those sorts of techniques; instead I just use the preprocessor to make scuffed generics.[1] Unless you mean in libc itself, where I don't recall any use of pointer casts like that? If I'm missing something, please enlighten me.

[1] see my (probably terrible) dynamic array implementation, for example: https://git.sr.ht/~thezipcreator/xstd/tree/main/item/src/xst...

Re:C and Undefined Behaviour on Tuesday February 10, 2026 @04:26AM (#46957256)
little did we know, to create a time machine all we needed to do was to compile some undefined behavior with the correct compiler
Re:Against fancy ligatures in programming fonts on Tuesday February 10, 2026 @04:02AM (#46957068)
> Are you looking at a != ligature that’s shaped like ≠? Or the actual Unicode character 0x2260, which also looks like ≠?

In many programming languages, ≠ is not going to be a valid operator. In languages that allow unicode identifiers, it would be a bizarre choice to use ≠ inside an identifier, so you shouldn't have to worry about that case either. This holds for pretty much every other operator that gets a ligature. This only matters for languages like Agda, in which case just.. use a different font. You might even be able to automate this depending on your editor.

> They’re guaranteed to be wrong sometimes.

This is true (for example, in C++ I've occasionally had `>` be ligature-ized when it wasn't an operator and was just the end of a template, like `Foo<Bar>`) but it's never really been much of a problem for me; it's easy to ignore.

> If you don’t believe me, try it for 10 or 15 years.

granted I've only been using Fira Code for more like 4 years or so, but I've always preferred it since I've been using it. I really think this is just a matter of personal preference.

> So if you’re preparing your code for others to read—whether on screen or on paper—skip the ligatures.

This I can understand. Ligatures would probably be likely to cause confusion in people who aren't used to them, so I agree that in that situation it's probably best to leave them out.

Re: on Wednesday February 26, 2025 @06:58PM (#43189736)
Honestly, it doesn't look that bad, I could get used to that syntax. It's not really objectively worse nor better than the normal syntax we have in programming languages now.

I think a true AntiLang would also break conventions of how programming itself works too. This just seems like a normal language with weird syntax.

Older »