HNHacker News
TopNewBestAskShowJobs

veltas

1,822 karma · joined November 16, 2013

veltas.co.uk
submissionscomments
veltas··on I keep bouncing off the Scheme language
Is it possible you're too stupid to write scheme? Because that's where I think I am, I've also tried and failed to write it a few times.
veltas··on Show HN: Tight C, a systems language with 10 keywords
Very nice work for how small the source code is, and this is a relatively good design for the language.

I will say to criticise that I started scratching my head when I got to the standard library. The functions should really just be C's standard library. I know there's lots of baggage but e.g. remembering that 'print(s)' will print with a newline and 'printn(s)' won't, this is just putting a barrier to entry that's not necessary. Sure, have some new functions for slices, but if you can help it use more conventional names from C.

veltas··on Saying goodbye to asm.js
> If you maintain a site that uses asm.js, nothing will break. asm.js is just a subset of plain JavaScript, so the code keeps running through our regular JIT just like any other script.

And this is still a killer feature of asm.js, even if it's not 'supported' it's still implicitly supported.

EDIT: And also seriously just thanks to the people who invented asm.js, it was a brilliant idea, but it makes sense that it's not worth optimizing anymore.

veltas··on Everything in C is undefined behavior
> Completely ignoring the other phrases I quoted, which (taken at face value) contradict your reading.

You are taking them out of context (literally this is what you describe here, taking at face value a smaller quote).

I think your approach to interpreting the spec is not correct. This isn't code, it's a spec: it needs to be read in full context (even though a good spec would certainly be written in a less context-sensitive way, this is not a perfect spec -- have you ever seen one?). You're not a computer or a machine, you need to read it more like a human, even though we're all trained on the concrete mechanics of computer programming. Yes, even though it's describing a programming language, believe it or not. All specs have flaws and need nuance in those situations or you will either (for language specs) write code that doesn't work anywhere, or you will write a compiler that breaks code matching what the authors of the spec intended to allow.

> Right now it looks like you have an impression of UB that doesn't match reality.

I have an impression of UB that is not the convention, my post is criticising the convention. I am trying to give context and nuance where it is unfortunately lacking and now apparently quite relevant to lots of people. This can't change reality of current compilers, but maybe it can serve as a lesson in history.

veltas··on Everything in C is undefined behavior
When would optimizing correct code be harmed by not abusing UB (beyond its original intent, e.g. array access should be without overhead of checking for overflow)?
veltas··on Everything in C is undefined behavior
It's not that your article specifically discusses this aspect, but I think it's an important part of the conversation that's being overlooked by commentators, that we've twisted the original intent of UB and made unnecessary work for ourselves. There's been too much scaremongering about UB that's gone beyond the real concerns. If you only fear UB and don't understand it then you are worse off for trying to write safe C or C++.
veltas··on Everything in C is undefined behavior
So it's just as useful as when your stack area ends with a page that will segfault on access, or your CPU will raise an interrupt if stack pointer goes beyond a particular address?

It's not safe though because throwing an exception, panicking, etc, is still a denial of service. It's just more deterministic than silently overwriting the heap instead. If the program is critical then you need to be able to statically prove the full size of the stack, which you can do with C and C++ with the right tools and restrictions.

veltas··on Everything in C is undefined behavior
What's bad is when your compiler writers and most of the people involved in standardisation are reading it adversarially.
veltas··on Everything in C is undefined behavior
Notice though "ignoring the situation" thru "documented manner characteristic of the environment". Even though truly you can read this in an uncharitable way, you could also try and understand the intent of this paragraph, and I think reading it for its intents is always the best way to interpret a language standard when the wording is ambiguous or soft, especially if you're writing a compiler.

I don't think you could sincerely argue that this definition intends to allow the compiler to totally rewrite your code because of one guaranteed UB detected on line 5, just that it would be good to print a diagnostic if it can be detected, and if not to do what's "characteristic of the environment". Does that make sense?

veltas··on Everything in C is undefined behavior
Although some people, like Bjarne Stroustrup, object to the term C/C++, it's a bit like Richard Stallman objecting to the term "Linux". The fact is it can mean "C or C++", and I wouldn't assume the author thinks they're the same, but they're talking about both of them together in the same sentence. This seems reasonable given this is about undefined behavior, and it's trivial to accidentally write UB-inducing code in C++ even with modern style (although I'd say you should catch most trivial cases with e.g. ubsan, and a lot of bad cases would be avoided with e.g. ranges, so I think the article is exaggerating the issue).
veltas··on Everything in C is undefined behavior
From the ANSI C standard:

  3.16 undefined behavior: Behavior, upon use of a nonportable or erroneous program construct, of erroneous data, or of indeterminately valued objects, for which this International Standard imposes no requirements.  Permissible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment (with or without the issuance of a diagnostic message).
Is it just me or did compiler writers apply overly legalistic interpretation to the "no requirements" part in this paragraph? The intent here is extremely clear, that undefined behavior means you're doing something not intended or specified by the language, but that the consequence of this should be somewhat bounded or as expected for the target machine. This is closer to our old school understanding of UB.

By 'bounded', this obviously ignores the security consequences of e.g. buffer overflows, but just because UB can be exploited doesn't mean it's appropriate for e.g. the compiler to exploit it too, that clearly violates the intent of this paragraph.

veltas··on Why is it called Kent House?
This adds a little context behind why when I lived in Bromley I was always told to write "Kent" on post, even though I wasn't in Kent. Apparently it was indeed fully in Kent at some point.
veltas··on SecurityBaseline.eu
Just responding to comment about European countries using decimal separator.
veltas··on SecurityBaseline.eu
Not in e.g. UK.
veltas··on Googlebook
Google don't dogfood so I'm not interested. I remember when the Pixel Fold came out asking people at Google and nobody had one. Have fun, but if nobody at Google will use this why should I?
veltas··on From Supabase to Clerk to Better Auth
> A hard lesson you learn building a complex system is that its reliability is the minimum of the combined reliability of its critical parts.

More like "its failures are the total of its critical components' failures" when you've got two nines on your least reliable component so most likely any critical component failure will be exclusive.

veltas··on Let's Buy Spirit Air
> PROPOSED ONLY: Profit shares would scale with pledge amount under the proposed structure. This is not a confirmed financial instrument. Nothing here constitutes an offer of securities.

There's no way they could get away with something significantly different, right? Like anything else they'd just be liable for being sued?

veltas··on How Mark Klein told the EFF about Room 641A [book excerpt]
Re their decision to leave X.
veltas··on How Mark Klein told the EFF about Room 641A [book excerpt]
Back then the EFF cared about privacy, now they care about virtue signalling.
veltas··on Claude Code refuses requests or charges extra if your commits mention "OpenClaw"
If it matters then it needs to be open source.
veltas··on How to be anti-social – a guide to incoherent and isolating social experiences
Can I be your friend please.

Also this document is basically just how I act, or how I would still act if I was less self-aware; some combination of the two.

I suspect the author may have written this partly as a self-critique.

veltas··on Casus Belli Engineering
Just want to say I really like the style for this page, simple and understated but attractive.
veltas··on The secrets of the Shinkansen
.
veltas··on Second Revision of 6502 Laptop
Okay what if something else had prevented something better than a 6502 being mass market available?
veltas··on F-15E jet shot down over Iran
"The West", don't lump us all in.
veltas··on CodingFont: A game to help you pick a coding font
Why not Deja Vu Sans Mono? That was the default for years and it's what a lot of us are used to.
veltas··on Unit: A self-replicating Forth mesh agent running in a browser tab
Could do with examples relating to the "self-replicating" nature.

Also should indicate it's case-insensitive, and the tutorial should be more permissive about how you type the examples e.g. typing lower case should be okay.

Missing a lot of basic words like HERE and , but I'm guessing this is to do with limitations of the underlying memory model, but there's not a lot of info on how to achieve arrays/lists without it.

veltas··on Social media bans and digital curfews to be trialled on UK teenagers
I'm sure parents back in the day thought the same about video games. You're lumping a lot of kids together there, maybe some of them will become journalists... Maybe social media is the only media that will even be relevant in 20 years when their career gets serious.
veltas··on Social media bans and digital curfews to be trialled on UK teenagers
They said same about video games but it turns out I didn't just want to play them, I also invested crazy amounts of time learning how to make them. Best time to spend crazy hours pursuing something you care about before the busy schedule of an adult saps all that away. It got me ahead. Not everyone just wants quick fixes.
veltas··on Social media bans and digital curfews to be trialled on UK teenagers
I think you understood my point and you understand the reasons for the act. But I'm just protesting on behalf of the kids that will pretty much have their lives ruined or made worse for this decision, for what it's worth.
← PreviousPage 3 of 26Next →