Better HN
topnewbestaskshowjobs
Log inSign up

ArrayBoundCheck

-10 karma · joined May 25, 2022 (4y ago) · 165 submissions

Submissions

comment 4y ago · link · parent

I don't 'hate' this but how the heck would google detect something like this? Why do I feel like they're analyzing every word we say in our homes and building some kind of profile (for ad reasons). On second thought I do hate this

comment 4y ago · link · parent

Well if I stopped at want 2 the rest are fullfilled. 2 are maybes and one was a no notification if there are apps. There are plenty of devices with a not to spec web browser and back in the day people use to write java apps for phones which only used the java api. I thought that might be what the app situation might be if there are apps but I'm completely fine with text+contacts being the only app

Actually I forgot one more requirement. I'd like either a headphone jack (or bluetooth) and music player for when I jog

comment 4y ago · link · parent

Why is it $270?? Pinephone is $150-$200

comment 4y ago · link · parent

Why would I pay google with money when I pay in user data?

They know how long my ass is in my chair and my route to various errands. They know if I bike, drive or walk there

comment 4y ago · link · parent

I want a dumber phone. A camera would be nice but I don't need one. All I need it to do is (how do I do a line break? 2 spaces at the end doesn't work)

- Make standard mobile phone calls and text (with a touchscreen)

- Support calls using SIP/VOIP

- Maybe an app or two, specifically signal so I can look at pictures, I don't need video to work

- No notifications (besides text when it's not on silent)

- If possible a really shitty browser that doesn't support JS but can handle searching google+wikipedia

comment 4y ago · link · parent

> I decided that learning the tar file format and making my own tar extractor would probably be faster than waiting for tar. And I was right; before the day was over, I had a working tar extractor, and I had successfully extracted my 1.1TiB tarball.

That's awesome!

I once did the same thing (something else, not a tar). I was on discord at the time and typed in messages about the stupid stuff I noticed while writing my own code. A guy told me I'm an asshole and a shit programmer/personality because I wasn't willing to use stick with/figure out standard tools + blocked me. Which is weird because why wouldn't you want more tools available. I gave away my source at the end

Don't be afraid of writing your own stuff!

comment 4y ago · link · parent

Implementing it without embed. With embed the author says

> It feels like I wasted a lot of my life achieving something so ridiculously basic that it’s almost laughable

Which makes me think I should never get involved with an ISO committee, not something I want done fast at least

comment 4y ago · link · parent

> And we got laughed out of the room for it

I get this every time I talk to programmers about a concept that isn't completely obvious. And some that are completely obvious

comment 4y ago · link · parent

I don't know how people can use the data. There's so much of it! I don't see any harddrives that are 80TB. It seems like people would need some kind of raid setup that can handle 200+TB of uncompressed data

comment 4y ago · link · parent

Are you a programmer? Embed is the easiest feature to implement that I have ever heard

comment 4y ago · link · parent

The very few people who I known worked there seemed to like it. Is there any particular reason why you left? I know one of them said he only left because they were overworking him

comment 4y ago · link · parent

Noone should imagine that. You definitely don't want two threads accessing the same vec or array at one time. Maybe if there's a lock

comment 4y ago · link · parent

> The compiler does not work at that level of resolution. It’s unclear that it should

The correct solution is to never ever use rust. It's a failed experiment that noone noticed failed

comment 4y ago · link · parent

So are you still unsure? Since you said from where you use C headers would absolutely top a reason for me. I hate that bs gruntwork

comment 4y ago · link · parent

> Can you share any compiler benchmarks showing Rust compiles slower than C++?

You got to do this yourself because YMMV

My projects don't use many includes and little templates. So C++ is more than 4x faster. I think in one case it was 10x faster but other people might claim I'm cheating because most people don't write code that way. If you often write template heavy code or need to include many large headers you'll get different results

comment 4y ago · link · parent

What do other people call it? > 50% of the time people don't know what I mean until I show code

comment 4y ago · link · parent

I'm taking a reference to the array the vec is pointing to not the vec. Rust needs to be more fine grain because it's obnoxious and C++ container invalidation is less bad https://news.ycombinator.com/item?id=32188672

comment 4y ago · link · parent

I only understand it because I learned how not to shoot myself in the foot with the canon that is C++

I'll sum up "container invalidation". In C or C++ if you append an array you may cause the array to grow which means it might have a different pointer. You basically can't take an address of an array you're planning to grow. All containers are like that except list I think which I never use

In rust, it's roughly the same idea. The problem is I borrowed something from vec (you can think of it as taking a reference or creating a pointer). I then call a function that is const (you can see here it's &self and not &mut self https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#1911). But that invalidates the borrow like push_back/resize/reserve and such in C++. Which is absolutely ridiculous because it's doesn't modify anything.

It makes me so mad because even the one thing I like about rust is annoying to use. Using an annoying checker, slower compiler, harder to optimize language is too much. I don't shoot myself in the foot in C++ so I'm unable to get a win in rust. For me using rust is more pain than practical

comment 4y ago · link · parent

From what I hear 1. No headers (you can use headers to import C functions. None needed for other zig functions). 2. defer 3. Comptime

comment 4y ago · link · parent

Not sure? I wasn't aware people didn't get this problem. Maybe its the domain I'm in. Uncomment to fix. I have to repeat myself all the time and it's obnoxious (IDK how to show code on this site but heres a link https://play.rust-lang.org/?version=stable&mode=debug&editio...)

comment 4y ago · link · parent

I tried it again in 2021 and it still failed to deal with constant functions. Here's it again in 2022 https://play.rust-lang.org/?version=stable&mode=debug&editio...

comment 4y ago · link · parent

I never tried zig but I want to address something the article wrote

> People struggle with Rust for a number of reasons ... the borrow checker!

The borrow checker was the easiest thing for me to learn and the only thing I liked about rust. Except it's broken. I have to constantly reborrow after calling a constant function. The reason I actually bailed on rust is because it's a worse C++ (compiles slower, executes slower, isn't compatible with C's __thread etc etc), it's a worse webserver (I still use PHP and C#), it's worse for database heavy code, it's not very good for one offs (C# and python are better), it basically cost too much to switch for the broken borrow checker

Also the article at the end doesn't make it clear what he thinks. Usually I read the start and end to see if I'm interested in the topic and I'm not sure if this article is in secret a rant

comment 4y ago · link · parent

A couple years ago I saw a video of a guy filming himself talking to a road maintenance worker. In an angry tone he said they didn't have enough pylons and noone can see them when they drive uphill and they're causing accidents. The worker said policy says to use 3 (or 5 or something) pylons. As the worker was saying it you can hear someone slamming on their breaks. The guy turning his camera and catches a guy who swerved into the fence so he wouldn't hit the workers car or anything

The guy filming immediately says (something like) "you see. That's what I said".

The problem is also policy is made for typical situations and people are trained to ignore problems because its a pain in the butt to deal with policy makers

Under using is probably more common but I wouldnt be surprised if some places used too many that people started ignoring it

-Edit- I think it was this. Apparently my memory isn't very good because I forgot all the cuts https://youtu.be/sCEzEVJkO1U?t=20 Actually at 1m 18s guy says "there's 5 cones". Maybe my memory isnt terrible lol

comment 4y ago · link · parent

That's an everyday mistake

I think the better guess is having people opt into amazon drivers using ring to let themselves in so their package isn't stolen from their porch

comment 4y ago · link · parent

They could have went the C# route, but didn't

comment 4y ago · link · parent

I guess I'll rewrite my original comment here to clarify

I don't know why google created this language. It offers nothing new and I can't see why they'd use this over rust when rust can be used. I don't see why they use this over zig since zig can certainly be used where this language is meant to be used. Zig actually brings something new

Overall google is 0/3 on creating languages that people want to use. Maybe go is useful but I haven't seen enough proof

comment 4y ago · link · parent

This is the 3rd language I know about that google created. I have no idea why they don't use rust with their C++ code base and I don't know why they made this instead of use zig which actually brings something new to the table.

Overall I don't see myself using this. 0/3 google

comment 4y ago · link · parent

> but the annoying part is that the same rules don't get applied across

Yeah! Why do I have to sponsor hires who happen to be not legal citizen. I have to hop all these hops to hire while your local grocery store doesn't have to sponsor anyone! So annoying /s obviously

comment 4y ago · link · parent

> Because sometimes we can learn from history. If a mistake was made at ...

A commit message helping me learn anything that I didn't get from a code comment sounds like a stretch. I'm doubting this

> How do you see if someone modified the test then? I feel like we are maybe misunderstanding eachother

Clearly. I was suggesting I might see commit messages if I'm using git blame to find out if a case was removed from a set of test or if it never existed in the first place. But I don't see how messages would help at all in anything I do. What I'm looking for is far too specific to be in a commit message and this whole thread about using commit messages to learn sounds nonsensical.

123456