News for hackers. Stuff that matters.

hechang1997

Re:I want extern "fil-C" on Friday August 14, 2026 @06:50AM (#49297024)
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

> 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.
I would go so far as saying people are born racist and can only grow out of it.
Re:Let’s Build a Global Power Grid (2015) on Tuesday October 20, 2020 @07:08AM (#24836021)
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.
Re:The Problem of Free Speech in an Age of Disinformation on Sunday October 18, 2020 @09:43AM (#24817823)
Ops... Brain just shortcut
Re:The Problem of Free Speech in an Age of Disinformation on Sunday October 18, 2020 @12:05AM (#24815464)
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.
Re:Swift Algorithms on Thursday October 08, 2020 @07:48AM (#24718202)
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.
Re:Rust Starter Kit 2020 on Tuesday October 06, 2020 @12:31AM (#24694701)
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.
Re:On the destruction of America’s best high school on Tuesday October 06, 2020 @12:03AM (#24694578)
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.
Re:American sued in Thailand over negative Tripadvisor review on Sunday September 27, 2020 @11:44PM (#24612757)
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.
Re:Tor Browser 10 on Wednesday September 23, 2020 @09:08PM (#24574272)
Not in China. Please use a forward proxy if you were to use Tor in China.
Re:JDK 15 on Wednesday September 16, 2020 @10:12AM (#24492871)
I used it quite a bit for simple scripting before I learned python.
Re:Japan on Track to Introduce Flying Taxi Services in 2023 on Saturday September 05, 2020 @09:44AM (#24383466)
If you use electric motor, the noise of an internal combustion engine can be eliminated, although the propellers themselves make huge noise too.
Re:A step towards new nitrogen products on Monday August 24, 2020 @06:35AM (#24259281)
I think the article is talking about capturing inert N2 from atmosphere directly with benzene, not about nitrogen pollutants like NOx.
Re:Ammonia as a fuel for compression ignition engines on Saturday August 22, 2020 @11:17AM (#24244681)
You can also make it with natural gas and capture the CO2 produced.
Re:UTF-8 Everywhere on Tuesday April 14, 2020 @03:31PM (#22870421)
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.
Re:Two Years with Rust on Tuesday March 24, 2020 @01:34AM (#22672259)
> 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.

Re:Two Years with Rust on Tuesday March 24, 2020 @12:52AM (#22672074)
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.
Re:Rust 1.42 on Friday March 13, 2020 @10:15PM (#22572603)
I found the "Too Many LinkedList" tutorial is very helpful. Try to follow the tutorial by writing your own code.
Re:Does memory leak? (1995) on Saturday February 22, 2020 @01:36PM (#22392505)
Isn't Ada already used in areospace industry?
Re:Modern workers are at the mercy of ratings on Friday February 07, 2020 @09:41PM (#22273427)
We should start a rating boycott where we rate highest for all ratings.
Re:Rust Lang in a nutshell on Thursday January 30, 2020 @07:40AM (#22190901)
"Too many linkedlists" is an excellent tutorial for understanding ownership IMO.
Re:Why Rust closures are somewhat hard on Tuesday January 21, 2020 @11:14PM (#22114555)
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.

Re:A Sad Day for Rust on Saturday January 18, 2020 @12:31AM (#22082528)
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.

Re:China on Wednesday November 20, 2019 @08:49PM (#21590704)
Also a Chinese here, I think free trade and globalization should be coupled with strong domestic redistribution. Otherwise, inequality will go through the roof.
Re:Games with Famous Bad Translations into Japanese on Monday November 11, 2019 @06:00AM (#21503761)
This is very strange to me. Isn't Japanese supposedly to be very easy to rhyme due to its very simple phonetics?

Older »