Hacker Newsnew | past | comments | ask | show | jobs | submit | debugnik's commentslogin

"Enabling wrapping behaviour" for signed integers disallows a lot of optimizations based on signed overflow being undefined behaviour, which is a matter of language and compiler design. This says nothing about the cost of checked arithmetic itself on the CPU.

It does, though. UB and associated optimisations wouldn't be an issue if defined behaviour would not have an impact on performance. If the cost would be zero or negligible, the compiler wouldn't need to care and hence warnings like this wouldn't need to be explicitly stated.

This is kind of a thing already in the EU. Under NIS 2, vulnerabilities should be notified to a CSIRT as well as upstream, and the CSIRT shall identify downstream vendors and negotiate a disclosure timeline. I don't know whether they're any good at it or not, though.

Cool to see F# here! Emulators are a great way to learn a language. On first sight you chose well between more or less idiomatic F# for each job.

Some low hanging fruit to reduce allocations: the discriminated unions in Instructions.fs could be [<Struct>], reusing field names to reuse internal fields.

Also, minor nitpick but I'm confused about some of the registers. They are already of type byte, the setters with `a &&& 0xFFuy` don't add anything over `member val A = 0uy with get, set`. I'm guessing this changed over time.


The Register source has this comment:

    // Registers can't be a record type because the values need to be truncated to 8 bits when writing, so setters are needed
    // This is for the web renderer as Fable transpiles uint8 to Number (more than 8 bits) in JS and doesn't apply any truncation
    // Known non-standard behaviour in Fable (https://fable.io/docs/javascript/compatibility.html#numeric-types)
So, I think, it's just conservatively cleaning the data due to Fable's widening via js Number on the web target.

Oof, thanks for pointing that out, I hadn't noticed and I've only ever used F# on .NET.

That's terrible on Fable's part, the least they could do is truncate. I wasn't aware Fable's translation is so naive.


I haven't used Fable much, but apparently it maps .NET arrays to js TypedArray. Presumably you could keep the registers in 8-element array and fable will properly produce a Uint8Array. I'd like to benchmark that.

Fable is great but it has a surprising number of these hidden behaviour changes that are really hard to detect when writing code against it.

It’s really hard to please everyone all of the time on this front.

This kind of thing is why Roc compiles to WASM but not JS.


It's actually discussed in the article in the part where he ports it to fable (he also tried blazor)

I admit I skimmed from there on because I don't find web dev exciting, but you're right, it is. That's a terribly naive translation on Fable's part.

You probably meant Forgejo. Codeberg is a Forgejo instance exclusive for FOSS projects.

My guess is the camera itself was taking photos of shorter exposure and the final image was composed in post-production, yes.

That would be around $7,900 USD.

Posters have a short window to edit the title back.

Spinel would be more interesting if this compiled subset could run side by side with interpreted Ruby, like Pallene does for (slightly modified) Lua.

One of cool things about Factor (and part of why I brought it up) is that it basically does something similar out of the box. There is a full-featured optimizing compiler and a simpler, faster non-optimizing compiler for eval-like functionality. They work seamlessly together in the interactive Factor environment:

https://docs.factorcode.org/content/article-compiler.html


Right now the cost of c interop in ruby is too high. It's actually more perfomant in the general case to rewrite any c lib wrappers in pure ruby these days and let jit do the work

The most recent cartoon Spinel in my mind is from Steven Universe, so I hadn't noticed the Spinel/Ruby (Moon) pun, that made my day.

I never expected SU to come up in HN! Unfortunately, it wouldn't be the best reference...

Did something happen with SU?

Oh, no – I meant Spinel and her tragic past.

WebDAV is kinda bad, and back then it was a big deal that corporate proxies wouldn't forward custom HTTP methods. You could barely trust PUT to work, let alone PROPFIND.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: