Better HN
topnewbestaskshowjobs
Log inSign up

hechang1997

66 karma · joined Aug 1, 2017 (9y ago) · 43 submissions

Submissions

comment 3mo ago · link · parent

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

comment 4mo ago · link · parent

> 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.

comment 5y ago · link · parent

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.

comment 6y ago · link · parent

I would go so far as saying people are born racist and can only grow out of it.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

Ops... Brain just shortcut

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

https://en.tripadvisor.com.hk/Hotel_Review-g580110-d594766-R...

Here's the resort in question.

comment 6y ago · link · parent

Not in China. Please use a forward proxy if you were to use Tor in China.

comment 6y ago · link · parent

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

comment 6y ago · link · parent

If you use electric motor, the noise of an internal combustion engine can be eliminated, although the propellers themselves make huge noise too.

comment 6y ago · link · parent

I think the article is talking about capturing inert N2 from atmosphere directly with benzene, not about nitrogen pollutants like NOx.

comment 6y ago · link · parent

You can also make it with natural gas and capture the CO2 produced.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

> 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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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

comment 6y ago · link · parent

Isn't Ada already used in areospace industry?

comment 6y ago · link · parent

We should start a rating boycott where we rate highest for all ratings.

comment 6y ago · link · parent

"Too many linkedlists" is an excellent tutorial for understanding ownership IMO.

comment 6y ago · link · parent

https://www.snoyman.com/blog/2018/11/rust-crash-course-05-ru...

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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.

comment 7y ago · link · parent

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

comment 7y ago · link · parent

This is very strange to me. Isn't Japanese supposedly to be very easy to rhyme due to its very simple phonetics?
12