480 karma · joined September 26, 2016
It's very common in Rust to do a big refactor or write a program from scratch and have it work on the first or second try, which may release a good amount of dopamine for some.[0]
Not saying the language is perfect, but it can feel pretty good, to the point of being addictive, while also freeing to know you can think less about the variants and let the compiler do it for you, and the reliability of the created program is usually pretty amazing. It can also be annoying, specially when you're learning it and try doing something in a way that's just not viable in an easy way (e.g. manually creating a Linked List).
[0] https://old.reddit.com/r/rust/comments/uixup6/just_wanted_to...
If it can't infer, it's idiomatic to just give it a hint (no need for turbofish):
let new_vec: Vec<_> = array.into_iter()
.filter(|&x| x != 0)
.map(|x| x * 2)
.collect();
I don't think that's ugly or unreadable.About the Python list comprehension, I answered your sibling, I think you're both right but it also does have it's limitations and that may be personal, but I find chained methods easier to read/understand.
I still feel like chained methods are easier to read/understand, but list comprehensions aren't that bad.
Of course, when you use generics, lifetimes, closures, etc, all on the same line it can become hard to read. But on my experience on "high level" application code, it isn't usually like that. The hardest thing to grep at first for me, coming from python, was the :: for navigating namespaces/modules.
I also find functional style a lot easier to read than Python, because of chaining (dot notation) and the closure syntax.
Python:
array = [1, 0, 2, 3]
new_array = map(
lambda x: x * 2,
filter(
lambda x: x != 0,
array
)
)
Rust: let array = [1, 0, 2, 3];
let new_vec: Vec<_> = array.into_iter()
.filter(|&x| x != 0)
.map(|x| x * 2)
.collect();
I mean, I kind of agree to the criticism, specially when it comes to macros and lifetimes, but I also feel like that's more applicable for low level code or code that uses lots of features that just aren't available in e.g. C, Python or Go.Edit: Collected iterator into Vec
Agree on the "simple way" of warning the user and putting the post on a queue though.
1M * 12 * 10% = 1.2M
500k * 2 * taxes >= 1M
Why do you "have" to add it to GCC? You could only add it to LLVM instead.
https://help.duckduckgo.com/duckduckgo-help-pages/results/so...
"We also of course have more traditional links in the search results, which we also source from multiple partners, though most commonly from Bing (and none from Google)."
I've tried comparing Google, Bing and DDG on a private window before, and I didn't find Bing and DDG more similar than Bing and Google. Searching for monkey: https://news.ycombinator.com/item?id=27598329
I get it, we should all be very cautious when doing destructive actions, but it's also specially easy to be confused by github's repository naming conventions and you're not seeing the actual repository you're making private, just it's name.
I actually find alternativeto so useful that I usually just go directly to it instead of my search engine when looking for FOSS alternatives. Having to go to the alternative page before clicking the official site link is a small hassle compared to finding what's the official from name search, but it used to be better when the description page and the alternative page were the same. If I were to guesa, they probably changed because it would be confusing for people searching for alternatives and finding the software description.
See for example https://github.com/robertohuertasm/apk-decompiler and https://github.com/vaibhavpandeyvpz/apkstudio (only used the first one but the seconds looks practical)
I'm skeptical about their metrics. If I try to access a cloudfare protected site and never manage to finish the infinite captcha look or just change my mind after seeing the captcha, do they consider it a successful block? Even if we think they have some magic way of actually knowing whether all requests are malicious or not:
> That doesn’t mean they are visiting controversial content, but instead that they are automated requests designed to harm our customers. A large percentage of the comment spam, vulnerability scanning, ad click fraud, content scraping, and login scanning comes via the Tor network.
Personally I don't think content scraping and vulnerability scanning are "malicious per se", by that metric even Google (and every other search engine) would be malicious.
For once, I like most of their decisions (except maybe for the layoffs, but they were arguably needed). Some were unfortunate, but they realized that and fixed them publicly. Everyone makes mistakes.
The cognitive burden of having to memorize and look for which variables are new vs which are being modified is simply not worth it in my opinion, even for a scripting language. Maybe for esolangs, simple math or first time learning programming.
In any case, it's a short coming of the language (IMO) but not a deal breaker. We learn to live with it.
I get it, but macOS does not need to do anything hardware-specific to fix security vulnerabilities, they'd only need to patch the old version (which already supports that hardware) and release an update, and only if someone reports a vulnerability. If they planned to group hardware deprecations only every X versions (let's say they'll remove hardware every 5 years), they would have very little work to do to keep those old versions safe.
> I don't think Apple or Windows would be a good choice, if openness is a feature you're looking for.
I agree, but that doesn't mean we shouldn't also push for them to be better. Personally I love linux but I also need mac for iOS development.
Yes, it also applies to MS and possibly many other companies.
Yes. And that is also part of the problem. They also don't patch reported vulnerabilities nor provide a clear path for the community to fix themselves.
> What is different is that Apple is less clear in support periods and often more aggressively leave older hardware behind.
Yes, that amplifies the problem a lot. Many of the abandoned machines are 10-year old but still very suited for daily use. They have 64-bit Core i processors with decent amounts of RAM (such as 8 GB).
There are lots of macs stuck at macOS High Sierra (the last one that supports GPUs without metal), and none of them are receiving any security update.
Even if they had only 1 single customer, that's not an excuse to close the service and allow exporting with just a 4 day notice. People and companies have lots of priorities, and now they've been forced to focus on this instead of whatever they were planning on doing. There should be at least 30 more days of service running, with another 30 days with the service offline but data exporting still available.
It's wasm2c job to ensure that the C generated enforces the WASM memory rules, so I'd say the one sanitizing the code is not clang but wasm2c.
> So how can a reference in a child assume the same lifetime? It can't.
Well actually, it can, because the owned Struct itself (Node) can outlive any borrow. You won't be able to mutate the parent though, as you can't mutate any value that has an active immutable borrow. That's the problem: you can't add the child node as adding it would mutate the parent and the there's an active immutable borrow (in the child node).
This reddit comment[0] has one possible solution[1] to this problem: not saving all of those parent references in the node itself, only adding when you're retrieving it. It also seems a lot better since there's less data in-tree to change if the structure itself changes.
[0] https://old.reddit.com/r/rust/comments/qstlto/rust_data_stru... [1] https://play.rust-lang.org/?version=stable&mode=debug&editio...
[1] https://www.sciencedirect.com/science/article/abs/pii/S13695... [2] https://cfaes.osu.edu/news/articles/higher-carbon-dioxide-le...