HN user

ii41

101 karma
Posts1
Comments33
View on HN

how is an advanced society handling the practical matters of writing contracts and keeping records without it

By "it" I guess you mean grammatical plurals? It's indeed semantically redundant. Say in a context of contracts, how is "3000.00 dollar" in any way more ambiguous than "3000.00 dollars"? The Chinese language indeed has been supporting an advanced society without grammatical plurals for thousands of years.

disparity between I can’t afford a car, and I will never be able to afford a car is vast

There's no disparity. Either way you're not going to own a car any time soon.

You're not freer when the legal system prevents you to do something because you don't have enough money than when the legal system prevents you from doing that thing for other reasons.

I am using sqlite in my project. It definitely solves problems, but I keep seeing overly arrogant and sometimes even irresponsible statements from their website, and can't really appreciate much of their attitude towards software engineering. The below quote from this CVE page is one more example of such statements.

All historical vulnerabilities reported against SQLite require at least one of these preconditions:

1. ...

2. The attacker can submit a maliciously crafted database file to the application that the application will then open and query.

Few real-world applications meet either of these preconditions, and hence few real-world applications are vulnerable, even if they use older and unpatched versions of SQLite.

This 2. precondition is literally one of the idiomatic usage of sqlite that they've suggested on their site: https://sqlite.org/appfileformat.html

Rust doesn't require you to think about concurrency if you don't use it either. For global variables you just throw in a thread_local. No unsafe required.

The site UI has been going downhill these years. It's become heavy and slow, and the buttons are more and more randomly placed. Like after you search for something in the repo, to go back to the repo front page you needed to click on the most unexpected button.

It's still getting things done, for sure, but no longer pleasant to work with.

Isn't it the other way around? I mean, I keep seeing western people advertising that the ways of living in those countries are wrong and they must change, while I don't often see anyone urging western countries to change their way of living.

About the `if else` producing a value matter. Well, if you look at things that way, C can be said to be syntactic sugar of assembly, as for every C program you can write equivalent assembly. `if else` producing value is very useful because it allows you to write if else wherever a value is expected. You can call methods on an `if else` or pass one as an argument of function. When such an expression is sufficiently complex your equivalent code using non-value-producing `if else` would be a lot more verbose and unreadable.

This is equivalent to the `if let` syntax of Rust. In Rust at least this is treated as a special syntax but not a boolean. I once complained it's kinda confusing that it makes one think the `let` pattern matching syntax is a boolean expression which it is not, and the Rust people replied to me saying yeah it can be a boolean maybe at some point in the future. So yeah whether such syntax makes pattern matching a boolean really is just a matter of whether it's said to be one.

A thing that could be interesting particularly for hn folks: in China, you can sue entities for open source license violation citing American-origin licenses like GPL, and win. There are many such cases. So one can potentially sue e.g. Onyx over their Linux kernel usage and stop their violation. This hasn't happened probably simply because no one cared enough.

Then you have misunderstandings about urban warfare. Bakhmut is urban warfare. It's actually called an urban meat grinder, the worst form of urban warfare. Civilian casualties at Bakhmut is one or two orders of magnitude smaller than total casualties per different sources and estimates. 80% civilian casualties and 50% being women and children is not "at best urban warfare."

Hard to say. Americas have been far less dense in population than the old world, and colonizers brought old world tech with which they immediately could start to make use of the land, so they face far less scarcity. For any group of people this is hugely beneficial to their development and helpful in solving their conflicts. Yet we still see some of world's the worst slavey and genocides there. Also today's Latin American isn't world famous for high living standards.

I was once forced to use older (but not deprecated) LTS Ubuntu and I hated it. New software come out and you're gonna want to use them (often forced to use them), and they of course use newer dependencies. I had to do the distribution maintainer job and package a bunch of software myself.

Your parent comment labeled themselves off-topic but I'd say they were still pretty on it, but you're like way too off-topic. The point isn't whether some country or some people are real communists or not, but that an individual shouldn't be harassed for maintaining open source software and can somehow be linked to some rival of the West.

My question to the FOSS community is why Firefox is not used to build more independent browsers the way Chrome is?

I actually looked into this. Say you consider yourself as part of the FOSS community, and want to build a new browser, and you start to look for your options. The only things readily available as libraries are webkit (currently owned and open sourced by Apple) and webkit-gtk (based on the former). Apple is like Apple and doesn't really want you to use their open source lib, so even though webkit-gtk team made it happen anyway, good luck if you want to do it yourself. If you decide to just use webkit-gtk, you've made a decision similar to lots of other members of the FOSS community in this area (luakit, the Rust webview crate, etc.). Another option is Qt WebEngine. It's based on Chromium. It's part of the Qt ecosystem and though I think you can use it as a standalone library, carving it out still requires some engineering. So these are the options that are available as libraries. And where are the Firefox ones? Servo makes it clear at the beginning of The Servo Book that it isn't available as a library yet. And Gecko? Firefox source doesn't even include a directory named gecko. It's so tightly coupled with the other parts that you'll need a lot of engineering to carve it out. And this is in contrast to Blink, the engine of Chromium, which is nicely placed in its own directory, having its own webpage with some learning resources.

I think this solves his problem. He said he wants a read function that turns the unsafe buffer into a safe buffer, and this API does that.

IIRC it's not that hard to convince the compiler to give you a safe buffer from a MaybeUninit. However, this type has really lengthy docs and makes you question everything you do with it. Thinking through all this is painful but it's not like you don't have to it with C.

Before opening up in 70s, China had acquired the ability to build by itself: huge numbers of machine guns and grenades, tanks, fighter planes, rockets and satellites (aka missiles), nukes.

These minus nukes and missiles plus battleships is pre-WWII Japan.

This may be helpful if you're curious why so many countries that choose free market instead of Communism after WWII are still not industrialized today.

If the "just a string" is html, sql, python, etc., the programmer is making a mistake as string interpolation shouldn't be used for those things in the first place, and I really hope < 80% cases of "just a string" are among those.

"just a string" where the string really is just a string is really, really common though. Python is the go-to language for a lot of people (including me) if they just want to bash together a one-time-use script that will never see input from other people, and f-strings are incredibly useful in such cases for generating filenames, debugging messages, etc.

I'm shocked by that they took the class/struct differentiation from swift. I HATED it when I had to deal with it in the past when working with swift. What's wrong with letting the programmer take the reference whenever they want to? Why do I have to change the whole class when I find something that makes me think it's better to have it passed by value? Why do I have to deal with the complexity of 2 kinds of custom types, with all the existing delicacies of a modern type system? Why on the earth would someone think this is a good idea that is worth taking? Can someone educate me on this?

Here in China, linguists consider the different Western "languages" to be dialects, and believe that the Western governments, for political reasons, make people think they speak different languages than their neighbors, so that they cannot unite.

I'm just joking, but what you say is as absurd as my joke. Western linguists don't consider the dialects different languages. If they do, they do it for political reasons. Accept that there are different ways of thinking and the real world never has to submit to how you define concepts like "a language", and not everything China surprises you with has something to do with politics.

Edit: I realized that my joke was closer to reality than parent's comment: https://en.wikipedia.org/wiki/Serbo-Croatian

tang ping is just an internet slang. Didn't expect it to have a wikipedia page.

In China, the "normal" is "to try to be the best". For example, less than half of Chinese students can make it into a "good college" (in China there's a very specific definition of a "good college"), but if you didn't make it, like more than 50% of your peers, that's enough to say that you're "bad at studying".

tang ping basically means quiting this kind of culture and accepting that one's normal. Buying a house and settling down in a city that's not Beijing or Shanghai, like 90% of people do.

It has nothing to do with social withdrawal.

South Korea is currently at war with North Korea in what is known as the Korean War.

China and the US also fought in what is known as the Korean War.

You can't claim SK and NK are at war with each other while implying China and US are not at war with each other. It's exactly the same war.

The whole thing is just stupid.

I am reading Kuang's Babel right now, the Chinese version, published in China, by a publisher that would be called "state-owned" when it appears in a Western report.

I have read Neil Gaiman's work that was published the same way before.

And still, the Hugo people be like: let's censor them because they mention China.

But's let's still spotlight Robert Sawyer even though he wrote a whole trilogy that can't be more anti-PRC [1].

Meanwhile, a bunch of other people be like: Chengdu is China, Xinjiang is China, China doesn't do things to muslims in Xinjiang that the US and Israel do to muslims in the Middle East, so let's protest Sci-fi events in Chengdu!

And now we have a purge on the Hugo organizers.

Disclaimer: I'm a Chinese mainlander Sci-fi reader and I have a view on China that most of HN will likely disagree with.

[1] https://en.wikipedia.org/wiki/WWW_Trilogy

structs in Swift are the same as structs in Rust, and a class is a heap-allocated reference counted box, like an Arc<Box<T>>.

Yeah, and by representing the differences this way, Rust allows you to easily decide whether an object is used directly or is wrapped in a rc box when its used, instead of when it's defined, often not by you, and when you change your mind you don't need to change all methods or functions than mutates it and all their call sites.

Result builders are a language feature and not part of SwiftUI

I admit that this is the first time I see the term result builders. This is never mentioned in any SwiftUI documentation I've seen, so I guess I should extend my complaint to include quality of docs :p. Whatever this is called you seem to agree that the syntax is hacked and it can get hard to understand what something means