HN user

hechang1997

65 karma
Posts0
Comments42
View on HN
No posts found.

It's easy to forget how different the Middle East looked before the conquest of Islam starting in 600 AD.

It’s easy to forget because it’s a fabricated perspective. Islamic/Arabian conquest of MENA isn’t really that different from what Romans or Persians did. That region is literally the source of human civilization (in the Old World at least) and had seen empires come and go ever since the Bronze Age, and along with them all sorts of cultures and religions. What fundamentally changed the dynamics of the region is not the islamic conquest but the shift of the center of the global trade away from Middle East and the Mediterranean to the Western Europe.

It's YouTube that's the perpetrator of the tragedy of the commons here. There must be a mandatory expiration of any intellectual property into the public domain after a set amount of time and/or after the owner died and the state should first and foremost protect the intellectual property of the public domain, that is, prevent any party from claiming it exclusively and punish any offenders.

Not sure how this could work geopolitically. You need to able to build it to prevent a country from having the ability to hold another country hostage by cutting another country out of the network.

Yes, currently the 2nd amendment only guarentees that no censorship comes from government. We need a stronger guarantee: no censorship on any public discourse from any party. Not any kind, because even well intentioned censorship causes problems! Using reddit as an example: suppose there is a subreddit A that discuss news and politics, and the mods ban racist comments. If you are a racist, will you change your racist way if you found your post banned? No, of course not. You would just be indignant and find/make another subreddit B that is more tolerant of racism. The subreddit B is provided the same tools subreddit A uses for censoring racist posts, and abuse these tools to censor any voices that argue against racism. You can no longer be convinced to abandon racism because you are stuck in your comfort zone and anyone who argue against racism are just SJW or special snowflakes in your eyes and their opinions are automatically dismissed by your brain.

Swift Algorithms 6 years ago

I saw posts on r/rust talking about making a rust-like language for non system programming. I think Swift fits exactly that purpose, only frustrated by Apple giving it Windows support a decade after it's creation.

That depends though. In Java/C# dereferencing a null reference is a runtime error and you can pinpoint exactly where it happened. In C++/Rust, dereferencing null pointers is undefined behavior since the compiler makes assumptions that a dereferenced pointer cannot be null.

The law is unjust. The anti-defammation law was used to stifle press freedom and suppress journalists. It doesn't matter whether it's lawful in Thailand or not, freedom of speech without the fear of persecution is a part of the International Covenant on Civil and Political Rights. (Whether you think it has a legal basis or not, it's the only thing we can look up to when authoritarian governments can pass whatever stipulation they want and call it legal.) In this case, I believe the owner of the resort has no ill intention, however, it is using an unjust instrument to inflict a questionable punishment on other people.

JDK 15 6 years ago

I used it quite a bit for simple scripting before I learned python.

UTF-8 Everywhere 6 years ago

That complexity comes from the fact that you are using non ASCII characters. UTF8 is a superset of standard ASCII. If you are using only standard ASCII characters, they're exactly the same thing.

Also the whole language suffers from being a weird mix of C-like statement syntax and FP-like expression syntax

I quite like this though. All other expression based languages like MLs and Haskell use indentation, making it very hard to parse. To me, Rust's syntax allows very granular control. I wish more things in the language can become expressions, like the let expression, for/while loop.

I don't think you can have shared IPC memory in rust. You have to use message passing. Of course you are on your own completely, and there will be weird logic bugs when you mess it up. However, there won't be any memory corruptions.

Rust 1.42 6 years ago

I found the "Too Many LinkedList" tutorial is very helpful. Try to follow the tutorial by writing your own code.

This article does a great job explaining the subtleties about rust closures.

A subtle point often missed is that if you want the anonymous structure of your closure itself to own a value, so that you can have a closure with a `'static` lifetime (which lives forever) that still could be called multiple times, you must use move keyword. If you just move the values into the closure manually, your closure will be a `FnOnce` since the compiler will mistakenly believe that you want to move that value each time the closure gets invoked, which can only happen once if the moved value doesn't implement `Copy`. In constrast, if you use the `move` keyword, compiler will correctly move the value into the anonymous structure of the closure itself during its construction, and the closure will be a `FuMut` and/or `Fn` as long as you don't consume the said value in the closure.

A Sad Day for Rust 7 years ago

It is actually easier to introduce an undefined behavior in unsafe rust than in C, since rust use the guarantee that two mutable references living that the same time cannot aliase to optimize code.

It's so disingenuous to call out employees advancing their agenda when the corporations themselves are constantly abusing their power to advance their agenda.

And the risk of people abusing power to advance their personal agenda is NOT something that would get passed easily once discovered.

Yes, it is. It get discovered all the time and no one gives a sh*t about it.

China 7 years ago

Also a Chinese here, I think free trade and globalization should be coupled with strong domestic redistribution. Otherwise, inequality will go through the roof.