HNHacker News
TopNewBestAskShowJobs

hechang1997

66 karma · joined August 1, 2017

submissionscomments
hechang1997··on I want extern "fil-C"
Check this out: https://github.com/IntegralPilot/rustc_codegen_jvm

While this cannot compile C/C++, it can serve as a fil-C alternative for unsafe pure rust code.

https://news.ycombinator.com/item?id=49284966

hechang1997··on Lost city discovered beneath Egypt's desert with ancient church
> 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.

hechang1997··on YouTube takes down the Ig Nobel show because of a 1914 recording
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.
hechang1997··on The Largest Gypsy Ghetto in Europe – Stolipinovo, Bulgaria (2016)
I would go so far as saying people are born racist and can only grow out of it.
hechang1997··on Let’s Build a Global Power Grid (2015)
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.
hechang1997··on The Problem of Free Speech in an Age of Disinformation
Ops... Brain just shortcut
hechang1997··on The Problem of Free Speech in an Age of Disinformation
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.
hechang1997··on Swift Algorithms
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.
hechang1997··on Rust Starter Kit 2020
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.
hechang1997··on On the destruction of America’s best high school
Agreed. I think schools that turns bad students into good ones deserve more funding and publicity than schools that turns good students into excellent ones.
hechang1997··on American sued in Thailand over negative Tripadvisor review
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.
hechang1997··on American sued in Thailand over negative Tripadvisor review
https://en.tripadvisor.com.hk/Hotel_Review-g580110-d594766-R...

Here's the resort in question.

hechang1997··on Tor Browser 10
Not in China. Please use a forward proxy if you were to use Tor in China.
hechang1997··on JDK 15
I used it quite a bit for simple scripting before I learned python.
hechang1997··on Japan on Track to Introduce Flying Taxi Services in 2023
If you use electric motor, the noise of an internal combustion engine can be eliminated, although the propellers themselves make huge noise too.
hechang1997··on A step towards new nitrogen products
I think the article is talking about capturing inert N2 from atmosphere directly with benzene, not about nitrogen pollutants like NOx.
hechang1997··on Ammonia as a fuel for compression ignition engines
You can also make it with natural gas and capture the CO2 produced.
hechang1997··on UTF-8 Everywhere
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.
hechang1997··on Two Years with Rust
> 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.

hechang1997··on Two Years with Rust
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.
hechang1997··on Rust 1.42
I found the "Too Many LinkedList" tutorial is very helpful. Try to follow the tutorial by writing your own code.
hechang1997··on Does memory leak? (1995)
Isn't Ada already used in areospace industry?
hechang1997··on Modern workers are at the mercy of ratings
We should start a rating boycott where we rate highest for all ratings.
hechang1997··on Rust Lang in a nutshell
"Too many linkedlists" is an excellent tutorial for understanding ownership IMO.
hechang1997··on Why Rust closures are somewhat hard
https://www.snoyman.com/blog/2018/11/rust-crash-course-05-ru...
hechang1997··on Why Rust closures are somewhat hard
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.

hechang1997··on A Sad Day for Rust
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.
hechang1997··on Engineer says Google fired her for notifying co-workers of right to organize
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.

hechang1997··on China
Also a Chinese here, I think free trade and globalization should be coupled with strong domestic redistribution. Otherwise, inequality will go through the roof.
hechang1997··on Games with Famous Bad Translations into Japanese
This is very strange to me. Isn't Japanese supposedly to be very easy to rhyme due to its very simple phonetics?
Page 1 of 2Next →