HNHacker News
TopNewBestAskShowJobs

fluffything

2,917 karma · joined April 21, 2019

submissionscomments
fluffything··on Lenovo to Certify ThinkPad and ThinkStation Workstation Portfolio for Linux
I have a Lenovo Thinkpad Yoga that claims to be certified by both Lenovo and Canonical for Ubuntu.

Finger print sensor doesn't work, the fans are super loud all the time, audio doesn't work (requires a newer Linux kernel than the one shipped in the latest Ubuntu), EFI problems, sleep, hibernate, fast-boot, restore from hibernate problems, battery life on Linux is horrible...

So at least the certification for Ubuntu is completely worthless. Reading the first comments in the Ubuntu forums from a year ago and the evolution of the Arch Wiki for my laptop, I have a hard time believing that somebody actually tested it before releasing the laptop. At best, somebody looked at the spec sheet and said "we have supported similar hardware before, this is good to go".

1 year later, the laptop is almost in a barely usable state. Canonical broke Audio support (soundcard not detected anymore) with 19.04 and did not fixed it before 20.04, essentially telling users to wait till the next Ubuntu release due to in 6 months. The only officially supported version is a 4 year old custom 16.04 that I never got the chance of trying, but this should tell you a lot about "long term" support of Canonical and Lenovo for these machines.

The only ones that should be getting any praise are the dozens of volunteers that have been screwed by both Lenovo and Canonical into buying one of these and have made their work and support time available to others for free.

If you want to buy a Linux laptop, avoid Lenovo like the plague. They have absolutely zero quality assurance for Linux.

EDIT: link to certification: https://certification.ubuntu.com/hardware/201906-27127

what a worthless bag of bytes.

fluffything··on Pros and Cons of Nim
Not bad for a bot, tell your master that your coherency levels are well down.
fluffything··on Seven years later, I bought a new MacBook. For the first time, I don't love it
yes it does, she never removes it
fluffything··on Seven years later, I bought a new MacBook. For the first time, I don't love it
I have a Thinkpad Yoga 3rd gen with Linux that she loves, so she'll probably migrate to that.

I use my old macbook air 90% of the time, and the yoga so 10% of the time. So at least she gets to use it every now and then.

fluffything··on Seven years later, I bought a new MacBook. For the first time, I don't love it
I've offered to help, but she doesn't want to mess with configuration. I've posted in other threads how she "fixed" it.

She actually bought one of those keyboard covers, cut off the touchbar part, and fixed it with tape.

She literally has a crappy piece of plastic on top of her keyboard that physically prevents here from accidentally touching the touchbar. A 10 dollar hack on a 2k$ machine.

I don't think she will buy an expensive Apple product, ever.

fluffything··on Seven years later, I bought a new MacBook. For the first time, I don't love it
I also still have the same MacBook air as the author and have been wanting to upgrade for... 2 years or so.

Not only the Webcam is a downgrade. You also loose Magsafe. Not a big loss, but a downgrade none the less.

> The touchbar. [...] Regular users probably find it useful and cute.

No they don't. My GF bought herself a new Macbook because... she has an iPhone and thought "For what I use the computer, any computer suffices". She just needs a laptop for browsing the web and replying to emails, and got a 2k$ machine for it...

Anyways, it turns out she is super annoyed at the Touchbar because it registers accidental presses when she press a number key... so her windows will just scramble around in the middle of a sentence, and she hates that.

I'm trying to convince her to sell it used, take a couple of hundred dollars price hit, and buy something that would make her happier. For her needs, literally any laptop would do.

Any laptop but Apple's. I also thought that the Touchbar was only a "show" gimmick to get non-pro users buy pro laptops, but for users that can't figure out how to turn it off, its something that makes them regret buying an Apple product, which at least with my GF, its a first.

fluffything··on The Concurnas Programming Language
Most languages implement these as a library.
fluffything··on Pros and Cons of Nim
When Rust 1.0 was released it had in the order of hundreds of developers doing work here and there.

When Rust started as a hobby project it was a one man effort, but it was also a project with ~1 user. It grew developers before actually growing users, and for a while, it had more developers than users.

fluffything··on The use of `class` for things that should be simple free functions
> If we’re talking about an algorithm as a class, the state managed by the class is algorithm state, not the data the algorithm acts on.

I was only talking about algorithm state here. Check, for example, how the C++ string searching algorithms work to get a feeling of how these APIs work in the wild. For an example of this gone wrong, look no further than C++ stable_search, which does not let the user reuse the merge sort buffer across searches.

fluffything··on Common Rust Lifetime Misconceptions
> True. The usual solution is to force-instantiate them against archetype classes.

This is correct, but you not only need to make sure that they accept an archetype class, you also need to make sure that they reject all others.

This often requires writing and instantiating a substantial amount of code for testing purposes, which often ends up as large or larger than the actual logic itself.

I suppose you already know the pain of doing this, but for those who do not, it is like testing a function in python for all possible inputs. Can be done, but is a lot of work.

In practice, most generic C++ code is not tested in this way due to how painful it is to do so.

So what in Rust takes no work, takes a huge amount of effort in C++.

fluffything··on The use of `class` for things that should be simple free functions
Why? The main advantage of passing a state as an argument is letting the user control the state. If you need an array as state, the user might want to put the array on the stack, or the heap, or in static memory, or protected behind a mutex somewhere...

It doesn't really matter that much how things are actually implemented: most languages are flexible enough that you can do this with a class or a function or even implement the algorithm as a generic interface. But if you want the algorithm implementation to be reusable, you have to remove as many assumptions about the state as possible because otherwise some users won't be able to use your algorithm.

If you pick up a class, and the class owns the state, now you need to make the class generic to allow the user to customize the state, you need to allow the user to break the state invariants, to be able to unsafely read and write from it, because otherwise you are forcing the user to read into a separate buffer, and then make a copy to your class, etc.

Somebody that knows how to avoid all these issues when writing their algorithm as a class, probably also knows that by just using a function most of these issues just cannot happen anymore (or are much harder to introduce).

You can also write the algorithm as a function, that takes some generic state, and provide a "class wrapper" for convenience, so that those who don't want to customize anything don't have to. But then your class doesn't implement the algorithm anymore, it just wraps it.

fluffything··on Chromium project finds that 70% of security defects are memory safety problems
I disagree in that it requires no skill: it requires the user to avoid doing the obvious thing:

    vector<int> foo {...};
and heap allocate a vector on the heap with `new` (without using a smart pointer), and then avoiding your linters warnings about this (e.g. clang-tidy).

If this is common in your place of work, I truly pity you.

Also, trading a call to `free` for a second call to malloc, and a second pointer indirection to the vector elements, isn't a very effective way of improving performance to beat the JVM. The whole idea behind leaking memory is doing less operations, not more :D

In Rust, leaking "the right way" is trivial (mem::forget is safe), but in C++, leaking the stack allocated vector probably requires putting it behind an union or aligned_storage or similar.

fluffything··on MacOS Catalina: Slow by Design?
I use Arch with Sway.
fluffything··on MacOS Catalina: Slow by Design?
It just doesn't connect / mount at all. Last time I tried to debug it, this was caused due to a too old samba protocol version being used on the Windows side.

On MacOSX, I just click on connect to server, and it works for me "as is".

fluffything··on Common Rust Lifetime Misconceptions
> Wrong.

Indeed, thanks for the correction!

> it seems to me that they are more similar than different.

I think the Haskell vs Python comparison is accurate. Rust generics are strongly typed (definitions are checked), while C++ templates are "weakly" typed (type checked when they are instantiated). In C++ it is trivial to write templates that will never type check when instantiated, while in Rust this is impossible.

fluffything··on Chromium project finds that 70% of security defects are memory safety problems
The claim is probably that idiomatic code in one case is faster than idiomatic code in the other, not that you can't write C++ code that isn't equally fast.

For example, if you use `std::vector` or `std::unique_ptr` you would be deallocating memory when those go out of scope. The JVM might actually never do that, e.g., if the program terminates before sufficient memory pressure arises.

Writing Rust code that leaks a `std::vector` is trivial, but doing the same in C++ actually requires some skill.

fluffything··on Chromium project finds that 70% of security defects are memory safety problems
&mut T does not mean what you think it means

&mut T means that there is only one pointer (the &mut T) that will be used to access some memory. You can have as many other pointers to that memory as you want, as long as you don't invalidate the first one.

This code is safe:

    let mut foo = 13_i32;
    let x: &mut i32 = &mut foo; // First &mut
    {
        let y: &mut i32 = unsafe { std::mem::transmute(x as *mut i32) }; // Second &mut T (copy)
        *y = 42; // Write through second
    }
    dbg!(*x); // Read through first
You can run this under miri here: https://play.rust-lang.org/?version=stable&mode=release&edit...
fluffything··on Chromium project finds that 70% of security defects are memory safety problems
Chromium, Mozilla, and Microsoft have posted studies that attribute ~70% of their security vulnerabilities to memory safety.

I'm not sure which point you are trying to make, but yes, 100%-70% = 30%, i.e., there are many security vulnerabilities in Firefox, Chrome and Windows that are not attributed to memory safety by these projects, and preventing memory unsafety wouldn't remove all of them (at most "only" 70% of them).

Nobody is claiming here that fixing memory unsafety in software fixes hardware bugs, nor anything about OpenSSH or other projects, and your anecdotes do not show how many security vulnerabilities are caused in those projects due to memory unsafety.

fluffything··on Common Rust Lifetime Misconceptions
Pretty much all misconceptions named there can be avoided by following the advice that every Rust programmer will give you: read the damn book, it will save you a lot of time.

If you are in the category of users that never RTFM, then I guess this article might be for you, but then kind of by definition, you won't read this article either, so...

---

For example, in C++ a generic `T` can only mean an owned type:

    template<class T> void foo(T t);
    template<class T> void bar(T& t);
You can't pass `foo` a reference to `T`, you'd need to pass it an owned type like `foo(std::ref(t))` instead or similar.

In Rust, when you write

    fn foo<T>(t: T);
you can call `foo` with an owned type or a reference, no problems, generic types are... well... generic.

So if you start writing Rust code with a C++ background without reading the book, then you might probably think that generics in Rust work like templates in C++. One couldn't be more wrong about this, they are in fact completely different language features. They might solve very similar problems, but they are as different as Python is from Haskell.

fluffything··on MacOS Catalina: Slow by Design?
Most of the apps that sell well originate from a developer solving a need they had, on the system they were using.

If this drives developers from OSX to other OSes, chances are they will develop apps for those OSes first.

Apple is too big to fail at this point, but driving developers away from your platform isn't a very clever strategy. You never know when you are going to hit a tipping point, and after you notice and people stop using macosx for development its already too late.

It took me ~150 hours to migrate to Linux, but my user and developer experience on Linux is much better than on MacOSX (emacs daemon "just works"!!!), so after all that work I wouldn't consider switching to OSX in the next 5 years at least. I had a Macbook air 2012, and because Apple still hasn't released a laptop that isn't a downgrade from that in some sense (keyboard, magsafe, ...) I've went with a think pad instead. Tiny details, like having a webcam that doesn't suck now prevent me from going back to OSX.

fluffything··on MacOS Catalina: Slow by Design?
I've partially switched from MacOS X to Linux now that wayland pipewire is reaching a mostly functional state and am quite happy with it.

It took me maybe 150 hours to do the switch though during quarantine, and I still haven't managed to be able to properly connect to SMB at work...

fluffything··on Programming Inside a Container
You can run a, e.g., jupyter notebook inside the container, and connect to it with your web-browser.
fluffything··on Automattic invests in Matrix
I'm used to a single pw system, where on account creation the system generates a recovery key, that I can save or not.
fluffything··on Germany's data chief tells ministries WhatsApp is a no-go
> This is all valid if you need a GmbH. But if you are building a website you can do without.

If you are doing that alone sure, but if you need to hire people and only have equity to pay them, things will get sketchy quickly without some kind of legal entity.

> On the other hand, since you have 25k, where else but in your startup can you invest your money and expect high profits? If anything, your family does not only rely on you but you can rely on your family to start a company. Your children depend on you showing them how to take risks and be successful.

High profits are the reward for high risk, and high risks do by necessity materialize very often - otherwise they wouldn't be high.

Also, high risks aren't necessarily rewarded with high profits - there are many risks that just aren't worth taking.

Those are the true lessons for the children: assess the risk, asses the profits, and decide whether taking the risk is worth it _for you_. Every person is different and has a different risk tolerance, there is no right answer to the question of whether a risk is worth taking.

A 25 year old joining a startup is taking a smaller risk than a 30 year old simply because they are investing less (their time is worth less, they have less to lose, etc.). The profits are also higher for a 25 year old: 1 year of failed startup experience at 25 can have a huge impact on your human capital long term - if you are a manager at 30, and jump to a startup that fails people will just think that you hugely miscalculated a risk. That might actually hurt your human capital.

fluffything··on Simple Personal Finance Tracking with GnuCash
> I see so many people categorizing everything with spreadsheets and budget apps and I just ask myself... why?

I was saving 30% of my income per month, and wanted to save at least 50%. So I decided to measure my expending, and try to cut it off without actually impacting my quality of life.

I discovered that substantial parts of my expending were going to: warm and cold water (2x the national avg per person), electricity bill, take-away food, transportation, health insurance.

I changed all the water taps with ones with a lower volume rate "by default" (you have to go out of your way to open them to the max), replaced all bulbs with LEDs, decided to only go for take away once per week but get the nicest and most expensive one instead, bought a bike for commuting, and changed health insurance and electricity providers to similar ones, but much cheaper.

Those were minimal changes in lifestyle that bumped my saving ratio from 30% to 60%.

Without measuring, I would probably would have taken a bunch of random actions that would have impacted my lifestyle more, and not delivered such a big jump.

I don't routinely use these apps, but if you want to continuously optimize your expending, measuring it is step 0.

fluffything··on Defold game engine source now available and free to use for commercial games
EULAs are not laws
fluffything··on Defold game engine source now available and free to use for commercial games
You seem to be confusing whether something is "open source" with "what kind of license does the code have".

Something being "open source" does not imply anything about its license.

Suggesting that only GPL-like software is allowed to use the term "open source" is crazy. It doesn't reflect the world we live in at all: there are thousands of projects on github without a license, or with some "free for non-military use"-type of license, or MIT/BSD-like licenses...

EDIT: "the obvious meaning for the expression “open source software”—and the one most people seem to think it means—is “You can look at the source code.” (Richard Stallman, GNU Philosophy: https://www.gnu.org/philosophy/open-source-misses-the-point.... ). Not that Stallman did much better with "free software", which as the article argues, has the obvious meaning that 'the software is "for free"'.

Having to avoid expressions like "free software" or "open source" because two organizations decided to appropriate common english expressions to give them a complicated meaning is nuts.

fluffything··on Germany's data chief tells ministries WhatsApp is a no-go
> You are dead in the water if you don't have that amount of money in advance as a buffer

In Germany, yes.

The people that usually have the high-enough risk tolerance to build a startup are usually broke college graduates. For a group of 3 broke college graduates each with 10k Euros in debt from BaFoG, coming up with 25k Euros just to try an idea that in the vast majority of cases will not succeed is pretty much impossible.

I finished my masters in germany debt free with 22 years old. The first time I got 25k in the bank was when I was almost 30, that's after working 7 years full time as an employee.

My risk tolerance at 30 is completely different from the one I had at 22. At 22 I could have "lost" 1 or 2 years building a startup that fails, living with 500 Euros a month or less in a shared apartment with my university buddies, waiting tables to pay the bills in between, no problem.

But now that I have 25k ? There is no way in the world I would quit my job to start a company. I have a family that depends on me, and other things I can invest those 25k in (car, house, pension fund, ...).

If you want fresh and broke college students with nothing to do to attempt a moonshot, those moonshots need to be almost free. Only 1 out of every 10.00 or 100.000 moonshots will land your country a profitable company, so you need to have a lot of them.

Requiring people to come up with 25k euros upfront is nuts. If you already had a couple of moonshots succeed, and each moonshot created a generation of 300 millionaires like it happens in the valley, then chances are that some of these risk-friendly and nostalgic millionaires will sponsor some of these startups is high. But Germany would need to somehow create that ecosystem first.

fluffything··on Germany's data chief tells ministries WhatsApp is a no-go
> You'll taxate them not on the share price that the share had when you got them, but the one it has when it went public.

Imagine getting 1 million euros in shares, that you want to hold on for a couple of years because you believe they will be worth 10 million euros then. Well, to do that, you need to first pay 500k Euros in taxes (where you get them from is not the tax office problem). Then, if the stock goes from 1 to ten million, you need to again pay taxes on the 9 million win that you made (25%).

fluffything··on Germany's data chief tells ministries WhatsApp is a no-go
> However, that's for an independent legal entity. If you want to start a business, you can simply register a business, even online [2] for about 25 to 100 euros. If you don't have wealth to protect you don't need a legal entity anyway.

I'm not sure I follow. If your startup isn't even an independent legal entity, AFAICT you can't pay your employees with equity (e.g. stock options).

If you could, the risk would be super high. If the startup is an independent entity and the CEO screws up (e.g. goes to jail), you can replace it. But if it is a completely private business owned by one single person and that person doesn't want to be replaced, then whatever equity you had is now worthless.

← PreviousPage 14 of 31Next →