HNHacker News
TopNewBestAskShowJobs

ArrayBoundCheck

-10 karma · joined May 25, 2022

submissionscomments
ArrayBoundCheck··on Stop saying “They shouldn't have invested more than they could afford to lose”
> 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

ArrayBoundCheck··on Writing your own search engine is hard (2004)
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
ArrayBoundCheck··on Embed is in C23
Are you a programmer? Embed is the easiest feature to implement that I have ever heard
ArrayBoundCheck··on Leaked documents reveal Amazon’s process to review employees’ worth to Amazon
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
ArrayBoundCheck··on Some Thoughts on Zig
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
ArrayBoundCheck··on Some Thoughts on Zig
> 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

ArrayBoundCheck··on Some Thoughts on Zig
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
ArrayBoundCheck··on Some Thoughts on Zig
> 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

ArrayBoundCheck··on Some Thoughts on Zig
What do other people call it? > 50% of the time people don't know what I mean until I show code
ArrayBoundCheck··on Some Thoughts on Zig
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
ArrayBoundCheck··on Some Thoughts on Zig
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

ArrayBoundCheck··on Some Thoughts on Zig
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
ArrayBoundCheck··on Some Thoughts on Zig
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...)
ArrayBoundCheck··on Some Thoughts on Zig
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...
ArrayBoundCheck··on Some Thoughts on Zig
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

ArrayBoundCheck··on Why we ignore thousands of daily car crashes
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

ArrayBoundCheck··on Amazon memo: Here’s why we should acquire Ring (2017)
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

ArrayBoundCheck··on Carbon Language: An experimental successor to C++
They could have went the C# route, but didn't
ArrayBoundCheck··on Carbon Language: An experimental successor to C++
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

ArrayBoundCheck··on Carbon Language: An experimental successor to C++
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

ArrayBoundCheck··on FCC: TikTok is unacceptable security risk and should be removed from app stores
> 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

ArrayBoundCheck··on Git log is not a changelog
> 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.

ArrayBoundCheck··on Git log is not a changelog
(Mostly a rhetorical question) I'll probably never be able to do that if it's based on karma but my question is, if I stop saying things that get my comments flagged but proceed to get into negative ranking (ex: -50 or maybe -100 if I get on an unlucky roll) will I be banned by the system automatically? I assumed so which was the other reason that annoyed me
ArrayBoundCheck··on Git log is not a changelog
Some of those comments were in response to people calling me a liar with upvotes on their comments and downvotes on mine. It's incredibly irritating and frustrating when it appears those accusing me of lying not suffer any consequences.

For example (one that you linked to) a person said I was wrong and his comment wasn't flagged yet when I asked him to stop replying to my comments (many of my comments in the thread weren't on his comments) mine gets flagged https://news.ycombinator.com/item?id=32086054

ArrayBoundCheck··on Why am I excited about WebAssembly?
> IMO the main selling point of WASM is its predictable performance.

Not once in my entire life have I heard anyone say this

Almost always its either about it being faster or so they can use a language that isn't JS. And both are those have dubious value because I seen wasm be slower and people complain a lot about lack of tool support. Which is why the other day I claimed very few people use it. I seen many try it once or twice and not want to go through it again

ArrayBoundCheck··on Git log is not a changelog
Why would I want to do that? Usually if there's a problem I'll either write a new test or see if someone modified a test I thought was covering the case

Usually people 'own' a file or part of the system so that wouldn't really be happening anyway

ArrayBoundCheck··on Git log is not a changelog
I'm starting to understand why. It appears my workflow has the information other people would want from a git log elsewhere (test, specs, examples, etc)
ArrayBoundCheck··on Git log is not a changelog
I set a breakpoint and run the test suite for that answer
ArrayBoundCheck··on Git log is not a changelog
You didn't answer why. My code passes all the unit test and we almost always have real code using it immediately. The function works. Why am I reading it? The only thing I read are bug reports (usually a spec problem, not normally a logic bug) and new features, or test outputs
ArrayBoundCheck··on Git log is not a changelog
Why are you searching a year or more back? Is this using git blame?
← PreviousPage 3 of 5Next →