HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Patryk27

no profile record

Submissions

Kruci: Post-mortem of a UI library

pwy.io
67 points·by Patryk27·10 miesięcy temu·14 comments

comments

Patryk27
·16 dni temu·discuss
So you’re saying the modules have a suboptimal design for non-Framework laptops.

Sure. But this does not make them proprietary, they work fine with non-Framework laptops as well.
Patryk27
·16 dni temu·discuss
I don’t follow - how are modules based on USB-C proprietary?

My Framework ethernet dongle works perfectly fine with a Mac that I use for work, for instance.
Patryk27
·w zeszłym miesiącu·discuss
> If you really think that switching language is the main driver to get safe programs [...]

I didn't write that.

> [...] the you are on the list of people replaceable by LLMs.

lol, love a high quality discussion

> Memory management is just a part of the problem.

Sure, then using Rust is a step forward, because that's one less thing you have to worry about. Seat belts don't save all people, but a car equipped with seat belts is - on average - safer than a car without seat belts.
Patryk27
·w zeszłym miesiącu·discuss
> They claim it is better just because of the language

I mean, it clearly is better (in certain contexts), see e.g. https://blog.google/security/rust-in-android-move-fast-fix-t...

> We adopted Rust for its security and are seeing a 1000x reduction in memory safety vulnerability density compared to Android’s C and C++ code. But the biggest surprise was Rust's impact on software delivery. With Rust changes having a 4x lower rollback rate and spending 25% less time in code review, the safer path is now also the faster one.
Patryk27
·2 miesiące temu·discuss
Regular expressions are not Turing-complete.
Patryk27
·4 miesiące temu·discuss
There are no comment-based directives in Rust, are there?
Patryk27
·8 miesięcy temu·discuss
> [...] it catches logic errors like this

but Rust's type system did catch this error - and then author decided it's fine to panic if this error happens

> You won't see Go or Java developers making such strong claims about their preferred languages.

yess no Java developer ever said that OOP will solve world hunger
Patryk27
·10 miesięcy temu·discuss
Not the parent commenter, but -- days of week in Polish are a nice example, IMO.

`Środa` means `Wednesday`, but depending on the grammatical case it's going to be translated either to `środa` or `środę` (or five more, but somewhat less likely to appear in UI [1]).

- Next <Wednesday> is 2018-01-03. = Najbliższa <środa> przypada na 2018-01-03.

- This event happens on <Wednesday>. = To zdarzenie ma miejsce w <środę>.

If you mix the variants, it's going to sound very off (but it will be understandable, so there's that).

What's more, days of week have different genders, which affects qualifiers:

- <this> Wednesday = <ta> środa (Wednesday is a "she")

- <this> Monday = <ten> poniedziałek (Monday is a "he")

... together with the grammatical cases affecting the qualifiers:

- <This> Wednesday is crazy. = <Ta> środa jest szalona.

- <This> Thursday is crazy. = <Ten> czwartek jest szalony.

- I'm busy <this> Wednesday. = Jestem zajęty w <tę> środę.

- I'm busy <this> Thursday. = Jestem zajęty w <ten> czwartek.

[1] https://en.wiktionary.org/wiki/%C5%9Broda
Patryk27
·10 miesięcy temu·discuss
This was also covered by 3blue1brown, highly recommend: https://www.youtube.com/watch?v=gB9n2gHsHN4.
Patryk27
·10 miesięcy temu·discuss
Code blocks use Iosevka (slightly configured - https://codeberg.org/pwy/website/src/commit/721438bc7d14789c...).

Screenshots use Berkeley Mono (my "daily driver" font).
Patryk27
·10 miesięcy temu·discuss
> Worrying about things like this without profiling can cause a lot of unnecessary complexity when planning abstractions in Rust.

:+1: - it was mostly about "damn, it _feels_ like there should be a better way".

> You might be able to get away with the lock approach and you may even be able to use Rc<RefCell<_>>, which would get a little speed up.

In this particular case that'd be a bit more awkward, because in the actual game the UI is driven by async fn (the rendering itself is sync, of course, but waiting for input is async, and both happen as a part of the same function).

`spawn_local()` could be a good enough solution for that, though.