HNHacker News
TopNewBestAskShowJobs

nyberg

737 karma · joined July 19, 2018

submissionscomments
nyberg··on Modern C++ for C Programmers (2018)
Rather, the underlying OS requires an array of bytes terminated by 0 which can be hidden behind a decent API. The type being poor at expressing this is not a limitation of the OS but of the C type system. E.g in zig this would be `[*:0]u8` which is "a pointer to a region of memory of unknown length terminated by a 0 sentinel value". It's still a pointer but nothing says the type system can't track more state around it.
nyberg··on iOS 14.6 device hacked with a zero-click iMessage exploit to install Pegasus
And you run the risk or introducing new bugs as memory bugs aren't the only bugs there are plus rust doesn't catch all of them.
nyberg··on Brave, the false sensation of privacy
Use GNU GUIX to manage it. It's been packaged for quite a while now
nyberg··on TDD from the Factorio Team
This sounds a lot lke like minikanren (https://github.com/webyrd/Barliman) where you give test cases and Idris2 (https://github.com/idris-lang/Idris2) where you give type constraints as a tool for building programs.
nyberg··on Sharing learnings about our image cropping algorithm
I find that calling it a `racist algorithm` doesn't really do it any good unless the behaviour was intentional. This is a case of poor training data the same as google image classification messing up with tags.
nyberg··on An intro to Zig's integer casting for C programmers
You can also use `@compileLog(@TypeOf(some_function))` or the same for the result. Type inference mostly makes it easier to change the types involved without having to update every single variable binding which would often be rather error prone in languages with implicit casts.

The other gain here is with duck-typing as being less explicit allows you to write more generic code which will often do what you want as long as the shape fits without `void*` which gives up on type safety.

nyberg··on Why I rewrote my Rust keyboard firmware in Zig: consistency, mastery, and fun
Can the "safety is lower priority than rust" trend stop? Zig is not less concerned with safety and will catch illegal behaviour at runtime for that which isn't caught at compile-time. It's only ReleaseSmall and ReleaseFast that elide this where you're able to toggle safety checks via a builtin if you wish. There's ongoing work to provide more of it within the standard library with the GeneralPurposeAllocator being an example of it.
nyberg··on Why I rewrote my Rust keyboard firmware in Zig: consistency, mastery, and fun
`comptime for (someslice) |capture| {};` is already a valid expression so it would conflict along with `inline while` being the other form.

The majority of uses of it in unrolling duck-typing cases will most likely be replaced by [1] which allows the same but with `switch` instead. Thus `inline for` will be left for loop unrolling and possibly in use with `inline switch` where it matters.

[1]: https://github.com/ziglang/zig/issues/7224

nyberg··on Cyclic dependencies are evil (2013)
But how would you build the first GCC in that chain?
nyberg··on Gimp is 25 years old today
Names can mean multiple things to different groups and if one had to cater to every group which finds a name non fitting then you'd end up spending more time on name changes than actual development as in some context any name can be seen as offensive. This isn't strictly useful and to non-native english speakers the connection between the offensive meaning and the name would most likely never occur as it's use in such is obscure (for one, this is where I first learned of it).

Currently there's a large number of resources that refer to the program as GIMP which are unlikely to be updated if the name changed and thus making years worth of guides, tutorials, and so on harder to find unless you know to search for (which if you do... the name change is meaningless as you'll still see GIMP). Harassing GIMP over the name is hardly a way to get things moving forwards and only sparks a negative environment. Should you find the name to make the software unusable then it would be better to focus your attention on the fork which changes the name rather than continuing to contribute a negative to the positive news of GIMP turning 25.

nyberg··on Weboob
You're comparing a tool which you have source for and control over with a service which is out of your control. The comparison is of apples and oranges.

Compare something like flow [1], reason [2], or prepack[3] as it's tools which serves you rather than the company behind it with access to the source which is the same as the case for weboob if you want to compare against facebook. I don't see an issue with using them though as they don't collect data on you.

[1]: https://github.com/facebook/flow

[2]: https://github.com/facebook/reason

[3]: https://github.com/facebook/prepack

[4]: https://github.com/majestrate/XD

nyberg··on Reviewing the worst piece of code ever
Code is a medium for communication of concepts and solutions between humans first and for the machine second. Code generation input still requires a specification which is the code you feed into the inference engine even if it's of a higher abstraction than the generated output. In the end you're still stuck with code regardless and someone has to understand how it acomplishes what it does.

Now I can agree that having decent documentation or even literate programming [1][2] contribute in large to understanding but it's never a replacement for clean and maintainable code. It's the same as architecture where if you're sloppy with the designing a bridge it can (and often will) come crashing down resulting in high expenses and lives lost over something that could have been prevented had others been able to understand the design and question the practices. The same applies to code.

[1]: https://cs61.seas.harvard.edu/site/pdf/p384-bentley.pdf [2]: https://jhidding.github.io/adhesion-code/

nyberg··on Weboob
Why it's a good filter. It deters a large portion of those that attack someone based of silly jokes the authors may have made in the past or present and would judge without speaking to the person before hand to get a better view of who they actually are.

Judge the code for technical merit and not the assumed character of the author. Denying work based on social correctness only curbs engineering and scientific progress in the long run over bikeshedding matters.

nyberg··on Weboob
It's a great filter for those that care more about names than code.
nyberg··on Announcing The Zig Software Foundation
If you look at [1] and [2] it's strikingly clear why not tabs, stage1 is for building one program that is the next state compiler so while it's possible to build other programs you're expected to wait for it's completion before all of the minor features (tabs, crlf, etc) are available. Also, I find that the "hard tabs" complaints are rather silly provided the following is stated on the wiki:

Hard tabs are not accepted by stage1 because:

- It doesn't need to. All of the self-hosted compiler source is formatted with zig fmt and so there are no hard tabs. The complexity of dealing with hard tabs need not be present in stage1.

- zig fmt is not fully stable yet; use of zig fmt is not yet ubiquitous. If stage1 accepted hard tabs, then in practice, there would be accidental mixing of tabs and spaces.

[1]: https://github.com/ziglang/zig/wiki/FAQ#why-does-zig-force-m... [2]: https://github.com/ziglang/zig/issues/544g

nyberg··on Linux 5.8 Formally Adds the Inclusive Terminology Guidelines
This kind of thing is what I see all the time and it's just exhausting at this point. One is always apparently blind as quick as they present a view of things not always being so bad without a legal document to direct behaviour. It's the assumption that people are barbarians by default and need to be herded like cattle rather than the possibility of them having some decency at all that I find the most saddening. You can have a welcoming and inclusive community without such a document and having one doesn't make you much more inclusive as it's people rather than the document that provide what you're asking for.

Trust until broken and gratitude for upholding good values is the path to a better community along with giving a chance to do better. Quick punishment only leaves a sour taste for everyone.

Also, a good rule is to wait 5-10 minutes or more and see if what you've written aligns with what and how you want to say it or at least expanding on your point a bit further to avoid being misinterpreted.

nyberg··on Linux 5.8 Formally Adds the Inclusive Terminology Guidelines
> I think we should get used to the idea of just letting stuff like this happen. What's the downside? Is it really so hard to type "main" instead of "master"?

> If someone were to open an issue "Please change master to main," and they were genuine about the request, I'd be like ... ok. And that would be the end of it. It's a s/master/main/g. Sure, whatever.

Not at all, it's just a question of who will pay to update all code and documentation to follow the new naming standards. That's not only the documentation of the project in question but also resolving issues when refering to external sources which also use master/slave terminology such as the MBus and related tooling.

> Why not let them?

Will they pay someone to make the changes or do they expect smaller places to shell out money to fix a non issue to avoid being associated with something they've never had any relation to? No? No change unless they either do the work themselves or pay for the cost of changing it.

> From my point of view, this is a big ball of "whatever, who cares, just do it." But my mind is open: can you convince me that it's important to resist this trend? Without invoking slippery-slope arguments?

There isn't really much of an argument for implementing it other than being pushed into exile by others if you don't. Resisting it would mostly come down to the cost of yet another cosmetic change that does nothing other than cost hours of work with no real reason than some being "offended" by well established terms.

In the end, this is a change where I just don't see the merit of. In the end it seems to be the practice of banning being easier than understanding what it's actually used for and comming up with a solid argument for change. It's not the burden of those sitting on `master` branches to explain why not but rather those suggesting this change to provide at least something which hints to the change being worth the effort.

nyberg··on Curl will now output JSON
It's nice but I don't think json is such a great format for it. The overhead of parsing it is incredibly annoying along with being unable to pack binary data which is what unix tools can deal with to some extent
nyberg··on Clear Your Terminal in Style
I don't think it does. If one blindly copies a command to their terminal, this is a good lesson not to do so. Too many projects suggest `curl foo | sh` as the "quick and ready to go" method for installation which is equally as bad as rm -rf in the wild.
nyberg··on Was Knuth Really Framed?
One such program that I know of and use in conjunction with pandoc is enTangleD[1] which supports editing on both at the cost of comments embedded in the source to keep track of blocks. All that's really required is folding of the comments to get half way to the desired IDE.

[1]: https://entangled.github.io

nyberg··on Was Knuth Really Framed?
And some of it is absolutely terrible with several tools overlapping in use cases along with unclear perfornance hints. Even worse is the combination performing worse which may not matter on small inputs but has a huge impact when you crank up the size. Then there's the issue of understanding why performance suffers and in what cases it's better to roll your own custom solution that better fits the problem.

Reuse saves work when your problem maps perfectly to existing tools while what may seem like a minor difference will propagate down your program to end in countless issues from a codebase you don't know.

nyberg··on Stallman Still Heading the GNU Project
'none' is in the set of prefered presented in the text you quoted and in the example disclaimer.

Well I live in Europe as I'm Swedish; in the UK it's common to say "bless you" while in Sweden we usually say "prosit" (the two I've spent a significant portion of my life in). The former would even be from those not following Christian traditions but rather as stated before. This seems to reflect the trend in quite a few others in Europe such as Spain, Ireland, Wales (UK), etc.

Again, most of it isn't an attempt at "converting" or even some other hidden motive. It may be different in other parts of the world but from the places I've lived in Europe it's been as I've stated.

nyberg··on Stallman Still Heading the GNU Project
It's hardly bad behaviour to wish someone well and it's never been. One shouldn't have to add "and if you do not follow the same then interpret your deity (if any)" to a conversation as the recipent may interpret under their prefered deity as they wish. It's rather sad that even an act of kindness is now seen as bad behaviour simply from refusal to accept that we have different ways of showing it.

As for culture, sure, every single one is at some point guilty of crimes against humanity such as in my country [1], [2], etc and we must be able to look past those things as otherwise it's impossible to change for the better.

We will be different, have different beliefs, different sexuality, different colours of skin, and different languages to convey our thoughts. If we continue to see even an act of kindness as hostile then I don't have much hope people will ever get over differences. It shouldn't be different if they're Christian, Sunni, or any else and extend their greeting in their way to you along with their own way of wishing you well. What matters most is the intention rather than if they're from the same faith as you.

[1]: https://en.wikipedia.org/wiki/Compulsory_sterilisation_in_Sw... [2]: https://en.wikipedia.org/wiki/Midsummer_crisis

nyberg··on In Defense of Richard Stallman
And at what point did Stallamn ever say that "raping children" was ok? There are very few with that mindset and they certainly haven't shown themselves here so I don't understand why you highlight it other than to try and coerce others into joining the witch hunt.

What stallman pointed out was the inaccurate definition of a specific term and possibly wanting a fair and accurate description of the events of someone he knew. He's previously taken issue with inconsistency which could place and 17 year old in prison on their 18th birthday if they're already in a relationship with someone even born just a few days apart depending on which country they're in. He also stressed that placing Minsky at the same level as Epstien is wrong unless there's evidence Minsky was completely in on the deal (which there seems to be none as far as I'm aware).

The many other things seem to be lacking in evidence. The earlier point of women unwilling to report men in high positions just means a lack of evidence thus no justice can be had. It's the same as not reporting a robbery. Nobody can do anything if nobody knows it ever happened (outside of those involved).

I do agree that there should be some work within helping victims report without feeling as vulnrable to the point of keeping it to themselves but I don't think media outlash is the right tool for this. Nor do I think trying to socially hang those that comment on the topic is the right thing to do. All it does is prevent the much needed discussion around what the terms actually mean and if we can be more accurate in their definitiion to provide a better framework for dealing with such cases.

nyberg··on Stallman Still Heading the GNU Project
It's not really pushing religion as it is an act of kindness. I don't really understand why someone would find it offensive for wishing them better health as it's the intention that counts rather than what faith you hold.

I'm not religious at all and I still say "bless you" since it's from the culture I grew up with of wishing others well. If anyone finds that offensive then they certainly have more issues than I do.

nyberg··on Stallman Still Heading the GNU Project
> I too am autistic

So am I and I often come off as awkward with a list of misinterpretations to the point of having a "do not interact with this person as they won't understand" list to avoid it.

His behaviour is typical of someone with an foot on the spectrum and I don't see too much oddity in his behaviour. He's obsessed with meaning of words, comes off the wrong way, seemingly no social manners by most standards yet it's incredibly consistent which hints to different interpretations of social interaction.

His behaviour isn't "problematic" in this case, rather, it's correct in a desire for exactness.

nyberg··on Kik, once valued at $1B, is to be closed
Matrix groups are searchable and (at least riot) makes it relatively simple.
nyberg··on Why I Prefer Functional Programming
That is why the importance of being terse but following the rule of not going too far with nesting and pointfree is so valuable. I don't share your difficulty to follow the flow of the program as usually the name of the function, type, and documentation say all you need to know about it.

That said, I find it difficult to follow what is happening when using several variables as you're then likely doing something wrong in the complexity of the function. A function should say much with very little and control flow should be clear instantly. The only thing outside of this would be a procedure which do-notation allows one to express.

Imperative programming is already within Haskell with do-notation an it's composition is that of imperative. Mixing functional with something else makes it much harder to make use of combinators and other forms which ends in more messy code (in my experience). If one could go pure functional without do-notation emulating the "C monoid" it would be rather nice.

nyberg··on GNU Guix 1.0
Which is great. Means you have a clean install that's sure to be reproducible. There's always the option to keep your own channel of non-free packages if you really need them.
nyberg··on Online pornography age checks for UK web users [video]
Wondering if they'll have deals such as "buy one get one free" for them. Wouldn't be shocked if they've planned it already.
← PreviousPage 3 of 4Next →