HNHacker News
TopNewBestAskShowJobs

veltas

1,822 karma · joined November 16, 2013

veltas.co.uk
submissionscomments
veltas··on Remembering Steve Jobs
There's no 'instead', you can remember them both.
veltas··on Make the most of compiled C loops on the 68000
> Note how gcc is smart enough to detect that the expression ((0xc<<12) | 0xafe) is constant, so it can skip shifts and bitwise assembly operations and just emit the resulting immediate value at line 14. The same goes for the loop condition, gcc emits constant 1280 at line 10 in place of the multiplication 40x32. A classic compiler optimization called constant folding, but nice nonetheless.

This is actually required rather than an optimisation for any C compiler, from early on, as C semantically allows constant expressions rather than just constants to be used for statically allocated sizes, etc. While the 'optimisation' is not guaranteed you'll see even on -O0 the constant was evaluated at compile-time, as it's harder to not fold constant expressions sometimes than it is to just always fold them for the already required constant expression features.

veltas··on Ruby Central Is Not Behaving in Good Faith, and I've Got Receipts
If you don't like him don't go to his talk.
veltas··on Introduction to Programming Languages
Should be called "Introduction to Functional Programming Languages"
veltas··on Public static void main(String[] args) is dead
Which I think most people understood not to do themselves when they encountered their first issue with the precedence of << vs other operators in expressions they wanted to print.
veltas··on Public static void main(String[] args) is dead
0 is guaranteed to mean 'success', although not guaranteed that it's equal to EXIT_SUCCESS, so you can always use 0.
veltas··on Public static void main(String[] args) is dead
I feel the same way about C/C++ having default return of 0 in main() only.
veltas··on Public static void main(String[] args) is dead
I agree, this is the whole point of "Hello world", which is to show the boilerplate required to start a program capable of outputting text, as well as the actual code that outputs that text. It's also the chance to get the build tools setup, people forget that some of the 'boilerplate' is the actions required to build, which often are much more involved for newer tools and frameworks.

You can just say initially e.g. when I learned C++ that "#include <iostream>" can be "mostly ignored for now, but just know iostream stands for Input / Output stream, and this line is necessary to e.g. output with std::cout"; and there are no scars left from this.

veltas··on Contracts for C
There's no VLA in my example.
veltas··on Use singular nouns for database table names
I agree with the article on the basis it's easier to not bother trying to use a convention of plural names as there's a lot of time-wasting edge cases, and generally it's less weird seeing no plural than seeing a plural in the middle of an expression where it doesn't work.
veltas··on Contracts for C
Truly I agree, but if we can add features to improve C codebases without rewriting them then that's a win, and you can just ignore them if you don't like them (as I will), but to the people where this has benefit they can be used.
veltas··on Contracts for C
You can do f(int n, int (*a)[n]) and it does what it looks like, since C99.

https://godbolt.org/z/8dfKMrGqv

veltas··on Action was the best 8-bit programming language
That's why I asked, fishing for surprising but interesting information.
veltas··on Action was the best 8-bit programming language
Any relation to ActionScript?
veltas··on How ChatGPT spoiled my semester (2024)
> That's a very unuseful way of looking at it. It solves nothing.

They're not trying to give you facts that solve things, they're just giving you facts, as they see it. You can do with that info what you will.

veltas··on Tour de France confronts a new threat: Are cyclists using tiny motors?
That video isn't conclusive and there's a lot of debate in the comments. Personally I agree with the people saying it's explainable.
veltas··on 3-JSON
That's what I really meant by saying a parameter, it should be an option/flag that's given explicitly at invocation, or just a different program name.
veltas··on 3-JSON
The environment variable isn't much better, both are akin to using a global var in your reentrant code, but at least STDDATA_FD is less likely to collide than 3.

Can't wait for scripts using this variable for something unrelated to break when they call my scripts.

This should be a parameter or argv[0]-based.

veltas··on I Ported SAP to a 1976 CPU. It Wasn't That Slow
Using IX instead of HL or B even isn't going to break the bank. This code will still beat e.g. the output of SDCC on some normal C code.
veltas··on Springer Nature book on machine learning is full of made-up citations
Unfortunately not surprising, the quality of a lot of textbooks has been bad for a long time. Students aren't discerning and lecturers often don't try the book out themselves.
veltas··on Don’t use “click here” as link text (2001)
Someone tell Wikipedia please, they have a weird sort of moving/hidden hamburger that floats which I've not seen anywhere else, I wonder if there's public stats on activity following the layout update.
veltas··on Qwen VLo: From "Understanding" the World to "Depicting" It
Rather I think machine learning has made a lot more progress 'depicting' the world than 'understanding' it.
veltas··on PWM flicker: Invisible light that's harming our health?
> I drive rarely, but the oncoming headlights are blinding when I do.

I drive a shallow car with old lights, and once I was blocked on a street by a much taller car sitting in front of me with very bright LED lights, and I couldn't see a thing because of the glare. I was unable to manoeuvre out the way because of this. They sat there for a minute or so stubbornly refusing to move for me before finally moving out the way.

veltas··on 10 Years of Betting on Rust
This to teach a lesson about the perils of unnecessary mutability.
veltas··on The Awful German Language (1880)
Have to think of a translation for an EinfacheBeansFabrikBewusstAspektInstanzFabrik
veltas··on Getting Forked by Microsoft
Yes that's exactly what I said :)
veltas··on Getting forked by Microsoft
Sufficient but a good idea to put copyright in all files.

Technically if there's no license found then it should be considered automatically copyrighted, with no permissions to copy. So leaving copyright license out actually makes it less open source.

veltas··on Hacktical C: practical hacker's guide to the C programming language
Credit to Simon Tatham

https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html

veltas··on Writing C for Curl
> So many people will now joke and say something about wide screens being available

And this is a silly point because I want to be able to put 2-3 files side-by-side, on that big monitor. Who are all these people asking for long code that means I don't get more than one file on screen at a time?

veltas··on Calibrated Basic Income by Derek Van Gorder [pdf]
Focusing on 'wealth inequality' usually leads to policies that hurt the economy, and make us all poorer, and actually increase the inequality. It hurts poor people more than the rich when we make bad economic decisions, and this paper proposes just such a decision. What can we do that won't backfire? We need a strong economy to help poor people.
← PreviousPage 7 of 26Next →