Better HN
topnewbestaskshowjobs
Log inSign up

returningfory2

2,464 karma · joined Jun 25, 2020 (6y ago) · 493 submissions

Submissions

comment 3y ago · link · parent

A complementary idea is to reuse the vector of strings across different calls to `tokenize`. The main loop in the code is of the form:

    {
        std::vector<std::string> tokens = tokenize(line);
        // do work with tokens
    }
which you could change to

    std::vector<std::string> tokens;
    {
        tokens.clear();
        tokenize(line, &tokens);
        // do work with tokens
    }
Combined with your suggestion to use std::string_view, this would mean only O(1) allocations across the program for this part of the code.

comment 3y ago · link · parent

One of the awesome things about Rust is how easy it is to build Rust projects. Looking at the readme, it's a simple `cargo run` to compile and run the project. Versus CPython where you have to worry about Makefiles and configuration and third party libraries in your system.

comment 3y ago · link · parent

So glad to see someone pointing out this phenomenon!

comment 3y ago · link · parent

> Does it though? I think "the industry" has pretty much come around on C being unsafe, and generally not a great choice of language for new projects.

If you look at some of the Rust threads on HN right now [0], you find many commenters claiming that there is no reason to replace C with Rust. It could be a vocal minority, but there's still a sense that "not everyone is on board".

[0] https://news.ycombinator.com/item?id=34788714

comment 3y ago · link · parent

I feel like all the examples you give are actually counter examples to the thesis that Google will decline?

Like, those are all examples of companies which failed to adapt to some new reality. This announcement is Google seeing AI as the next thing and proactively engaging with it.

comment 3y ago · link · parent

All of the comments so far have talked about mechanical things (researching investment vehicles, what percentage to save, etc), but in my experience to move beyond a paycheck-to-paycheck lifestyle the biggest change you need to make is psychological. You can do all the research you want, but if you don't change your mindset around money it won't make any difference.

In my case I was lucky. At the age of 25 I was also living paycheck-to-paycheck, and did an obnoxious 5 week trip around Europe which left me broke and unable to make rent. I had to ask my father for a loan to get me through, and the whole experience of that was humiliating. Especially because I had built up a self image of being financially independent. Within a week of that humiliation I had set up a planning spreadsheet and set up savings goals to never have to beg for money again (and it worked).

Point being that, for me at least, setting up the spreadsheet was the easy part - the hard part was deeply having the psychological shift of "I really need to save money".

comment 3y ago · link · parent

> increasingly vote avoidant society

Turnout for presidential elections has been increasing in the US in the last decades. Also 70 percent is great turnout when compared with other countries.

comment 3y ago · link · parent

The data in this article is simply wrong. Alphabet didn't layoff 10,000 people in November, or announce such a layoff. Looks like it's recycling some low-quality speculative layoff articles and presenting them as facts.

comment 3y ago · link · parent

> I'd also highlight that many professions, e.g. those that have shift work, are nowhere near as lax.

We have two groups of people - tech workers who have a generally great working environment, and shift workers who do not. The idea that in our advanced society we should base our expectations on those who are currently doing worse is frankly absurd. Our aim should be for _everyone_ to have the work-life balance that tech workers have now.

comment 3y ago · link · parent

Yes - my reading of that post is that Waze was a toxic place to work, and the author is annoyed because Google is not.

> Having trouble scheduling meetings because [...] "I’m taking a personal day" drove me crazy.

Yikes.

comment 3y ago · link · parent

I think the point of the article is the other way around: when starting from a language like C that doesn't have bound checking, moving to Rust will involve adding bounds checks and then an argument will be made that this will regress performance. So to test that hypothesis you start with the safe Rust code, and then remove the bounds check to emulate what the C code might be like. If, as in the article, you find that performance is not really affected, then it makes a C-to-Rust migration argument more compelling.

comment 4y ago · link · parent

I feel this plan is really poor use of Rikers Island. Green energy installations can be done anywhere. Being in the middle of New York City (sort of) Rikers has amazing potential as a public park - something like Governors Island 2.

comment 4y ago · link · parent

> ... but can also see its appeal for someone that's not as confident over the minutia.

I think this is mischaracterization of why people choose Rust (and FWIW it comes across as condescending). People choose Rust over C++ partially for the same reason people write unit tests. We accept that no matter how good we are at writing software, we are still fallible, and so we introduce structures around our work to minimize the fallout from that fallibility.

comment 4y ago · link · parent

This is a common response to this issue, but I think there is a logical flaw in it.

Employers don't know ahead of time which employees will leave and which will stay. In order to improve their employee retention, employers have to pay _all_ of their employees more, not just the ones that eventually will leave. This changes the math entirely.

For example, suppose it costs 50% extra to replace someone who leaves. In retrospect, sure, giving the sole employee who leaves a 10% raise each year to retain them makes sense. But if you have to give all of your employees a 10% raise per year, just to retain that one person, it doesn't make financial sense anymore.

To be clear I'm not endorsing this system at all! But from a pure financial perspective it makes sense to me and is why, I suspect, it persists.

comment 4y ago · link · parent

Makes sense, thank you!

comment 4y ago · link · parent

There is a quota for employment-based green cards (typically 140k/year). The number of applicants that apply each year is larger than the quota. So every year the total number of people who have applied but cannot be approved due to the quota gets larger.

Because of the per-country limit of 7%, these queuing dynamics generally only affect people from countries with large number of applications (India, China). But sometimes there will be a backlog for all countries. The current forecast is that there will be a backlog in 2023 in the EB2 category for all countries.

comment 4y ago · link · parent

I think this sounds theoretically reasonable, but in reality it's not like this:

- The cost of sponsoring someone for a green card ($50k?) is low compared to engineering salaries.

- Many companies like Google have great retention and the probability that an employee leaves after getting green card is low.

- Companies that are worried about retention often have employees sign a reimbursement agreement when starting the GC process. Something like, if you leave within 2 years of getting the GC you pay a prorated portion of the legal fees.

- In a tight labor market, GC sponsorship is another benefit like compensation, and companies offer it to hire good people. Over the last few years companies like Amazon have changed their GC policy to sponsor folks from day 1 of employment in order to hire people for whom a GC is that important.

comment 4y ago · link · parent

Genuine question: what does FANGish mean?

comment 4y ago · link · parent

This was exactly my experience growing up in Ireland, and was the primary reason I immigrated to the US after college.

comment 4y ago · link · parent

> There is still only one implementation that defines what the language actually is, and that is Google's protoc.

From the article, it seems this is not true anymore?

> We've built the [new Buf proto] compiler within the buf CLI to accurately match protoc.

comment 4y ago · link · parent

In the neighborhood of New York City I live in, buying a 2 bedroom apartment requires you to have a higher yearly income than $250k (~= £200k). The simple desires of (a) wanting space for family and (b) wanting to live in a specific place, can push you to want to earn higher salaries.

comment 4y ago · link · parent

This is a children's passport; an adult Irish passport is basically the same price as an adult US passport. Given my experience growing up in Ireland, I would guess that the Irish government is subsidizing passports for children.

comment 4y ago · link · parent

> I ran benchmarks [...] matching the regex Ben.*H over 100 concatenated repeats of the King James Bible.

Is there a concern with these kinds of micro-benchmarks, where you repeatedly do the same small operation (matching the same regex), that your results will be skewed by the branch predictor, CPU caches, etc.?

comment 4y ago · link · parent

> any safety checks put into the competing language will have a runtime cost, which often is unacceptable.

Suppose you have bounds checks on array accesses, but your program is 100% correct and the panic case is never hit. Doesn't the branch predictor essentially make the bounds check free? Or very low cost at least?

comment 4y ago · link · parent

Not the parent, but my interpretation of "my Typescript build" would be the build output, not the input to the build process.

comment 4y ago · link · parent

Carbon being "absolutely bathed in the utter fictions of C++" is a feature not a bug.

The goal of Carbon is explicitly _not_ to be a new general purpose programming language. In the docs, the authors even advise people to use Rust instead for greenfield projects. The goal of Carbon is to support migrating existing C++ codebases to some new safer language.

comment 4y ago · link · parent

In that poem I love the description of the room as "one hired box" - always evokes a coffin in my mind.

comment 4y ago · link · parent

> I had heard of Go for many years, but never stuck with it; it gets constant negative press on Hacker News/Reddit

I think on Hacker News it's really fashionable to criticize Go, and this has led to a culture where Go gets significantly more negativity than it deserves.

As technologists, one of our most important jobs is to see through such fashions and judge languages/tools/technologies based on their actual merit.

While gauging sentiment about things on a forum like Hacker News is generally really helpful, it should not be the main basis of our decisions.

comment 4y ago · link · parent

I don't think this is a counter argument at all? If anything, it's reinforcing the argument in the article.

> But there's also something to be said for being able to open up a blank file in a blank folder, writing some lines of code, and running a command to execute said code.

E.g., in Go the tooling is so good that you can just create a file and run it using `go run .`. This is sort of the point the author is making? No need to worry about build systems, dependencies, etc.

comment 4y ago · link · parent

There exists a market equilibrium (2 million regular cars, 300k luxury cars, in the Toyota analogy). You're proposing to construct a regulatory scheme to reach a different equilibrium. Why? What's wrong with the market equilibrium?
1
1314151617