Readit News logoReadit News
patrec commented on Bypassing Google's big anti-adblock update   0x44.xyz/blog/web-request... · Posted by u/deryilz
zulban · 2 months ago
I don't "bypass" Chrome when they want to melt my brain with their business model, I use Firefox. I don't "bypass" Windows when they want to melt my brain with their business model, I use Linux. No idea why so many "hackers" doing "bypasses" can't instead take action that is simpler, long lasting, and easier. Do people need to jerked around 50 times for 20 years before realizing it will keep happening and their "bypasses" are just temporary bandaids?
patrec · a month ago
And using Google Firefox instead of Google Chrome is more than a temporary bag aid?
patrec commented on Working on databases from prison   turso.tech/blog/working-o... · Posted by u/dvektor
philjohn · 2 months ago
Yep - turns out the Nordic countries had it right all along. When you focus on rehabilitation and not just punishment you get lower redicivism rates. Who would have thought it?
patrec · 2 months ago
Nordic countries have essentially exactly the same 1/3 two year recidivism rate as the US, the one exception being Norway at 1/5, and mostly not for rehabilitation policy reasons.

https://inquisitivebird.xyz/p/the-myth-of-the-nordic-rehabil...

patrec commented on PEP 750 – Template Strings   peps.python.org/pep-0750/... · Posted by u/grep_it
nhumrich · 5 months ago
PEP 501 when originally written (not by me) was intended to be the competing standard against f-strings, and to have been more inline with ES6's template strings. There was debate between the more simple f-string PEP (PEP 498) and PEP 501. Ultimately, it was decided to go with f-strings as a less confusing, more approachable version (and also easier to implement) and to "defer" PEP 501 to "see what happens". Since then, the python internal have also changed, allowing t-strings to be even easier to implement (See PEP 701). We have seen what happens, and now its introduced. f-strings and t-strings are not competing systems. They are different. Similar to ES6 templates and namedTaggedTemplates, they are used for different things while API feels similar intentionally. f-strings are not inferior to t-strings, they are better for most use cases of string templating where what you really want, is just a string.
patrec · 5 months ago
Thanks!

> they are better for most use cases of string templating where what you really want, is just a string.

I think use cases where you want to unconditionally bash a string together are rare. I'd bet that in > 80% of cases the "just a string" really is just a terrible representation for what really is either some tree (html, sql, python, ...) structure or at least requires lazy processing (logging, where you only want to pay for the expensive string formatting and generation if you run at the log level or higher that the relevant logging line is meant to operate).

patrec commented on PEP 750 – Template Strings   peps.python.org/pep-0750/... · Posted by u/grep_it
mardifoufs · 5 months ago
I'm not familiar with ES6 template strings, but why are they better than f-strings? F-strings just work, and work well, in my experience so I'm wondering what I'm missing out on. Especially since the language I use the most is c++... So I guess I don't expect much out of string manipulation lol.
patrec · 5 months ago
The problem with f-strings is that they make an extremely limited use case convenient (bashing unstructured text) and thus people people invariably use them for the less limited use case for which no such covenient mechanism exists. Constructing ASTs (including html and SQL). Or logging (where you want to avoid unconditionally computing some expensive string represenation).

I do this myself. I basically always use the subtl wrong log.warning(f"Unexpected {response=} encountered") and not the correct, and depending on the loglevel cheaper log.warning("Unexpected respone=%s encountered", repsonse). The extra visual noise is typically not worth the extra correctness and performance (I'd obviously not do this in some publically exposed service receiving untrusted inputs).

I'd argue these use cases are in fact more prevalent then the bashing unstructured text use case.

Encouraging people to write injection vulnerabilities or performance and correcness bugs isn't great language design.

patrec commented on PEP 750 – Template Strings   peps.python.org/pep-0750/... · Posted by u/grep_it
nhumrich · 5 months ago
Nick Humrich here, the author who helped rewrite PEP 501 to introduce t-strings, which was the foundation for this PEP. I am not an author on this accepted PEP, but I know this PEP and story pretty well. Let me know if you have any questions.

I am super excited this is finally accepted. I started working on PEP 501 4 years ago.

patrec · 5 months ago
My memory is that ES6's template strings preceded f-strings. If that is correct, do you happen to know why python was saddled with f-strings, which seem like an obviously inferior design, in the first place? We are now at five largely redundant string interpolation systems (%, .format, string.Template, f-string, t-string).
patrec commented on Open Dylan   opendylan.org/... · Posted by u/ofrzeta
pjmlp · 7 months ago
Some of the Dylan's ideas live on Julia, though.

Which has had a good adoption story thus far.

https://info.juliahub.com/case-studies

patrec · 7 months ago
Great point – I should definitely have mentioned Julia as your best bet for playing around with multi-methods. I think it's basically the only language with any eco-system to speak of that has them. Julia also happens to be the only extant language I'm aware of that has a well designed shell interpolation syntax. For resumable exceptions, however, playing around with Dylan or CL remains your best bet, as far as I'm aware of (and Common Lisp at least also integrates them into the interactive development experience).
patrec commented on Open Dylan   opendylan.org/... · Posted by u/ofrzeta
dahart · 7 months ago
I’m curious - what is Dylan really for? Who should use it, and in what situations? I totally could have missed something obvious, but I read through the intro and the ‘Tour’, and it has a lot of detail about what the language is, but not much on when and where to use it. The closest thing seems to be it’s LISP but faster? What are the reasons to choose Dylan over C++, Swift, JavaScript, or Python?
patrec · 7 months ago
Dylan is simply a historical curio, so there are no situations in which anyone should use it apart to study programming language history and to take inspiration from roads not taken. It's basically Common Lisp, with Algol-like syntax, less historical baggage (everything is a class, no weird stuff like prog and so and so forth) and more emphasis on efficient implementation. Unfortunately, it didn't catch on, but it's IMO a nicer language than python (which modelled inheritance rules on Dylan), Java, Javascript or C++.

Here are some interesting things about it:

1. It has an simple but nice trick for avoiding ugly_underscores: a-b is a single symbol, a - b is subtraction.

2. IIRC it was the first non-sexp language with a sophisticated macro system.

3. Like Common Lisp it has multi-methods and resumable exceptions (but unlikely Common Lisp all exceptions are resumable). If you want to play around with either multi methods and resumable exceptions, Common Lisp or Dylan are probably your best bets and Dylan has the advantage of being probably simpler to pick up.

patrec commented on Apollo 8 astronaut William Anders ID'd in WA plane crash   fox13seattle.com/news/wil... · Posted by u/TMWNN
jandrewrogers · a year ago
He went out on his own terms subject to the rules of the way he lived. No excuses. It may not have been his intent to die but he was willing to take the risk. That is the price of true agency.
patrec · a year ago
When you are prepared to die in a plane crash because of your decrepitude, how much risk to others is entailed in a case like this? If the plausible answer is “not that much” I am with you. But nonagenarian self-actualization at the cost of other people’s lives and limbs is a different story.
patrec commented on Framework Laptop 16 Review   phoronix.com/review/frame... · Posted by u/mikece
rollcat · 2 years ago
> I've always found the Macbook Pro keyboards to be "fine," [...]

Have you tried the previous, "butterfly" generation? It should've been criminal to ship that.

patrec · 2 years ago
Personally, I think the butterfly keyboard is great. Assuming, of course, that you got one that does not suffer mechanical reliability issues. This opinion is hardly universal but seems to be shared by quite a few good typists. I'm typing this on a fancy mechanical keyboard, because I care quite a bit about keyboard quality (and consequently hate most laptop keyboards). So it's not that I just don't know better.
patrec commented on Before OpenAI, Sam Altman was fired from Y Combinator by his mentor   washingtonpost.com/techno... · Posted by u/CartyBoston
hn_throwaway_99 · 2 years ago
Did you miss the context of the image in that tweet? It's the famous "I have a particular set of skills..." speech from Taken: https://youtu.be/jZOywn1qArI

In other words, he's basically saying Sam is the best in the world at being a ruthless mofo in these situations and obliterating those who oppose him. "Admiring language", perhaps, but I wouldn't really call that "supportive language".

patrec · 2 years ago
> he's basically saying Sam is the best in the world at being a ruthless mofo in these situations and obliterating those who oppose him

Exactly, it's not all that subtle, so I find it hard to even come up with an alternative interpretation.

u/patrec

KarmaCake day2746June 11, 2016
About
email: replace_vowels_with_leetspeak_version("patrec") + "@gmail.com"
View Original