HNHacker News
TopNewBestAskShowJobs

bilkow

480 karma · joined September 26, 2016

submissionscomments
bilkow··on I've started using Firefox and can never go back to Chrome
By default firefox only prevents content with audio from autoplaying, which I can't think of any way to circumvent and it's probably good enough for most people.
bilkow··on ProtonMail Is Down
A minute ago StackOverflow was also throwing "Oops! Something Bad Happened!" to me on many different pages. I wonder if that's somehow related or just a coincidence.
bilkow··on What it feels like when Rust saves your bacon
Oh yeah, I feel your pain, my brain is really used to Rust/Swift and Python syntax, and when I have to read Typescript/React, C++ or something like Nix, it gets hard for my brain to parse it. Loved the eyesight analogy!
bilkow··on Rust Is Hard, Or: The Misery of Mainstream Programming
Rust's advantages don't stop at concurrency or type safety. In my experience, the type system is actually much more concise and the APIs are a lot more explicit than any other language I've tried. It's clear when the argument you're passing is going to be mutated or not and move semantics help a lot on designing good APIs (not having to remember to close a File or being able to use it after it's closed, for example). Not to mention sum types with pattern matching, being expression based, etc. I also find that Structs and Enums being values instead of references (as opposed to Classes in other languages), reasoning about the code is a lot more straightforward, which goes back to my point about explicit mutability. A huge part of it also goes to great libraries created by the community, that usually cares about API soundness.

It's very common in Rust to do a big refactor or write a program from scratch and have it work on the first or second try, which may release a good amount of dopamine for some.[0]

Not saying the language is perfect, but it can feel pretty good, to the point of being addictive, while also freeing to know you can think less about the variants and let the compiler do it for you, and the reliability of the created program is usually pretty amazing. It can also be annoying, specially when you're learning it and try doing something in a way that's just not viable in an easy way (e.g. manually creating a Linked List).

[0] https://old.reddit.com/r/rust/comments/uixup6/just_wanted_to...

bilkow··on Rust: A Critical Retrospective
It actually needs the & in both my example and your second example, because .filter receives a reference to the item being iterated. Your second example doesn't compile: https://play.rust-lang.org/?version=stable&mode=debug&editio...
bilkow··on Rust: A Critical Retrospective
Oh, yeah, you're right! If you want to collect into a Vec you may need to specify the type, but usually, you can just call `.collect()` and the compiler will infer the correct type (as I suppose you're collecting it to use or return).

If it can't infer, it's idiomatic to just give it a hint (no need for turbofish):

    let new_vec: Vec<_> = array.into_iter()
        .filter(|&x| x != 0)
        .map(|x| x * 2)
        .collect();
I don't think that's ugly or unreadable.

About the Python list comprehension, I answered your sibling, I think you're both right but it also does have it's limitations and that may be personal, but I find chained methods easier to read/understand.

bilkow··on Rust: A Critical Retrospective
I guess you're right, list/generator comprehensions are the idiomatic way to filter and map in python, with the caveat of needing to have it all in a single expression (the same goes for lambda, actually).

I still feel like chained methods are easier to read/understand, but list comprehensions aren't that bad.

bilkow··on Rust: A Critical Retrospective
It looks like I'm on the minority here, but I generally like Rust's syntax and think it's pretty readable.

Of course, when you use generics, lifetimes, closures, etc, all on the same line it can become hard to read. But on my experience on "high level" application code, it isn't usually like that. The hardest thing to grep at first for me, coming from python, was the :: for navigating namespaces/modules.

I also find functional style a lot easier to read than Python, because of chaining (dot notation) and the closure syntax.

Python:

    array = [1, 0, 2, 3]
    new_array = map(
        lambda x: x * 2,
        filter(
            lambda x: x != 0,
            array
        )
    )
Rust:

    let array = [1, 0, 2, 3];
    let new_vec: Vec<_> = array.into_iter()
        .filter(|&x| x != 0)
        .map(|x| x * 2)
        .collect();
I mean, I kind of agree to the criticism, specially when it comes to macros and lifetimes, but I also feel like that's more applicable for low level code or code that uses lots of features that just aren't available in e.g. C, Python or Go.

Edit: Collected iterator into Vec

bilkow··on Twitter blocked my account for a tweet I did not make
A shadowban is IMO worse than an instaban, you still aren't able to post anything, but it will look like you can. It also feels morally wrong to shadowban people and there's no process to appeal, it's not even straightforward to discover you've been shadowbanned, you need a bot or searching for your posts in a private window[0].

Agree on the "simple way" of warning the user and putting the post on a queue though.

[0] https://nerdschalk.com/am-i-shadowbanned-on-reddit/

bilkow··on Overhauling Mario 64's code to reach 30 FPS and render 6x faster on N64 [video]
You shouldn't multiply by 12 if the 500k is yearly. Also what's the 2? 2 engineers? The correct math would be:

1M * 12 * 10% = 1.2M

500k * 2 * taxes >= 1M

bilkow··on Ruby YJIT Ported to Rust
> If I want to design my own CPU, I will have to add it to GCC.

Why do you "have" to add it to GCC? You could only add it to LLVM instead.

bilkow··on “YouTube-dl” and “Pirate Bay” back on DDG
I also find that searching Bing does not result in youtube-dl.org, only the repository, while DDG returns both, but Bing is not the ONLY source for DDG results, at least according to them.

https://help.duckduckgo.com/duckduckgo-help-pages/results/so...

"We also of course have more traditional links in the search results, which we also source from multiple partners, though most commonly from Bing (and none from Google)."

I've tried comparing Google, Bing and DDG on a private window before, and I didn't find Bing and DDG more similar than Bing and Google. Searching for monkey: https://news.ycombinator.com/item?id=27598329

bilkow··on We lost 54k GitHub stars
I find it ironic that some people are blaming the author so bad given that Github has made the same mistake in the past and had to restore it from the backup, making it clear that the UX could be better.

I get it, we should all be very cautious when doing destructive actions, but it's also specially easy to be confused by github's repository naming conventions and you're not seeing the actual repository you're making private, just it's name.

bilkow··on Three areas where Google Search lags behind competitors: code, cooking, travel
> alternativeto

I actually find alternativeto so useful that I usually just go directly to it instead of my search engine when looking for FOSS alternatives. Having to go to the alternative page before clicking the official site link is a small hassle compared to finding what's the official from name search, but it used to be better when the description page and the alternative page were the same. If I were to guesa, they probably changed because it would be confusing for people searching for alternatives and finding the software description.

bilkow··on Cat Printer
You can decompile android apps, which will give mostly the original Java Classes / functions with anonymized names (class A, function b, etc...). Framework classes and methods usually stay pretty much the same.

See for example https://github.com/robertohuertasm/apk-decompiler and https://github.com/vaibhavpandeyvpz/apkstudio (only used the first one but the seconds looks practical)

bilkow··on Arti – An implementation of Tor in Rust
> Based on data across the CloudFlare network, 94% of requests that we see across the Tor network are per se malicious.

I'm skeptical about their metrics. If I try to access a cloudfare protected site and never manage to finish the infinite captcha look or just change my mind after seeing the captcha, do they consider it a successful block? Even if we think they have some magic way of actually knowing whether all requests are malicious or not:

> That doesn’t mean they are visiting controversial content, but instead that they are automated requests designed to harm our customers. A large percentage of the comment spam, vulnerability scanning, ad click fraud, content scraping, and login scanning comes via the Tor network.

Personally I don't think content scraping and vulnerability scanning are "malicious per se", by that metric even Google (and every other search engine) would be malicious.

bilkow··on Firefox 96
Meh, I think all of those points are highly exaggerated by drama, to the point of most of them not even being true.

For once, I like most of their decisions (except maybe for the layoffs, but they were arguably needed). Some were unfortunate, but they realized that and fixed them publicly. Everyone makes mistakes.

bilkow··on 5% of 666 Python repos had comma typo bugs (inc V8, TensorFlow and PyTorch)
Explicit variable declaration is just adding a keyword (such as var or let) when you're declaring a new variable instead of modifying one.

The cognitive burden of having to memorize and look for which variables are new vs which are being modified is simply not worth it in my opinion, even for a scripting language. Maybe for esolangs, simple math or first time learning programming.

In any case, it's a short coming of the language (IMO) but not a deal breaker. We learn to live with it.

bilkow··on UxPlay: AirPlay Unix mirroring server
No, antimof was the original repo, it has just moved. Check the first paragraph of the README (in both the original and new fork).
bilkow··on About the security content of macOS Monterey 12.1
> Not supporting old hardware is something that all companies eventually must do

I get it, but macOS does not need to do anything hardware-specific to fix security vulnerabilities, they'd only need to patch the old version (which already supports that hardware) and release an update, and only if someone reports a vulnerability. If they planned to group hardware deprecations only every X versions (let's say they'll remove hardware every 5 years), they would have very little work to do to keep those old versions safe.

> I don't think Apple or Windows would be a good choice, if openness is a feature you're looking for.

I agree, but that doesn't mean we shouldn't also push for them to be better. Personally I love linux but I also need mac for iOS development.

bilkow··on About the security content of macOS Monterey 12.1
I'm worried by many of the security issues fixed by the linked official apple release notes, including CVE-2021-30939, which indicates that it may be possible for a computer to be compromised by opening images or maybe even accessing its metadata, and many privilege escalations allowing user apps to acquire kernel privileges.
bilkow··on About the security content of macOS Monterey 12.1
Security is not support. If they distributed defective software (with security vulnerabilities), they should fix reported vulnerabilities or at least provide a clear and canonical path for the community to fix it themselves.

Yes, it also applies to MS and possibly many other companies.

bilkow··on About the security content of macOS Monterey 12.1
> That’s not different from the situation with Windows.

Yes. And that is also part of the problem. They also don't patch reported vulnerabilities nor provide a clear path for the community to fix themselves.

> What is different is that Apple is less clear in support periods and often more aggressively leave older hardware behind.

Yes, that amplifies the problem a lot. Many of the abandoned machines are 10-year old but still very suited for daily use. They have 64-bit Core i processors with decent amounts of RAM (such as 8 GB).

bilkow··on About the security content of macOS Monterey 12.1
It actually runs pretty well for most things. The hardware is still good unless you're doing high intensity computing or trying play AAA games on it (for which it was never good anyway).
bilkow··on About the security content of macOS Monterey 12.1
Apple should keep providing security updates for the latest version supported on any machine.

There are lots of macs stuck at macOS High Sierra (the last one that supports GPUs without metal), and none of them are receiving any security update.

bilkow··on Twitter acquires Quill
> Lots of criticism of the short export window, but no one knows how many customers they have.

Even if they had only 1 single customer, that's not an excuse to close the service and allow exporting with just a 4 day notice. People and companies have lots of priorities, and now they've been forced to focus on this instead of whatever they were planning on doing. There should be at least 30 more days of service running, with another 30 days with the service offline but data exporting still available.

bilkow··on WebAssembly and Back Again: Fine-Grained Sandboxing in Firefox 95
As I understand it, clang doesn't have the tools to sanitize WASM. It just emits WASM, which, malicious or benevolent, can't access memory outside its designated memory regions.

It's wasm2c job to ensure that the C generated enforces the WASM memory rules, so I'd say the one sanitizing the code is not clang but wasm2c.

bilkow··on Rust data structures with circular references
I think there is a slight mistake in the article:

> So how can a reference in a child assume the same lifetime? It can't.

Well actually, it can, because the owned Struct itself (Node) can outlive any borrow. You won't be able to mutate the parent though, as you can't mutate any value that has an active immutable borrow. That's the problem: you can't add the child node as adding it would mutate the parent and the there's an active immutable borrow (in the child node).

This reddit comment[0] has one possible solution[1] to this problem: not saving all of those parent references in the node itself, only adding when you're retrieving it. It also seems a lot better since there's less data in-tree to change if the structure itself changes.

[0] https://old.reddit.com/r/rust/comments/qstlto/rust_data_stru... [1] https://play.rust-lang.org/?version=stable&mode=debug&editio...

bilkow··on Notes on privacy and data collection of Matrix.org (2019)
Although optional, matrix actually has identity servers, which allow people to find you via phone number / email.
bilkow··on Global Green Up Slows Warming
There are actually indications that even though some plants may grow faster, their evapotranspiration is decreased[1] and the plants grow fewer valuable nutrients[2].

[1] https://www.sciencedirect.com/science/article/abs/pii/S13695... [2] https://cfaes.osu.edu/news/articles/higher-carbon-dioxide-le...

← PreviousPage 4 of 6Next →