Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions

@insanitybit
Submissions

comment 9y ago · link · parent

OK, well it's a bug that you can expect to exist in compilers in the future because every mainstream C compiler is going to optimize around UB. So... who cares?

comment 9y ago · link · parent

>where the same crowd who vilified IE

It's a different crowd, I think.

comment 9y ago · link · parent

Last time I looked at reason it was totally new and there was no tooling etc. I got little support from the gitter or whatever it was.

Have things changed? It really interested me at the time.

comment 9y ago · link · parent

Yeah, there's actually a fair amount of conflicting research in the area. But it's out there.

comment 9y ago · link · parent

Have you looked for research?

https://sites.google.com/site/stefanhanenberg/ https://link.springer.com/article/10.1007%2Fs10664-013-9289-...

The above papers are not about FP but about static type systems (there tends to be lots of crossover), but I think you'll find that what it really comes down to is guarantees provided by a language. I would be surprised if similar research that focused solely on purity did not exist.

This is an incredibly difficult area to study. "Better software" is a difficult metric, and even a more meaningful metric is incredibly hard to measure. For a field as young as CS it's no wonder that the research into this is still immature, so we largely have to rely on anecdotal evidence and common sense.

So yeah we have some research and we have some basic common sense and we have people demonstrating through their projects that it has worked well for them.

More to the authors point - what they are really talking about here is modularization being a benefit to a moving codebase. Their quotes, their 'argument from authority', is mostly about modularization. Their argument is that functional programming lends itself to modularization by limiting state space and focusing on composition.

comment 9y ago · link · parent

I just attempted to open a 2MB file in gedit and it took about 25 seconds to load enough to click into some text. Attempting to edit it did not go well and the process effectively hung.

I opened the file in intellij and it's performing admirably but there is noticeable lag when entering input. Keep in mind that features were disabled automatically due to the file size.

2MB may not be very representative for all files, but when having to jump into generated protobuf class files I've certainly wished my IDE could handle the load. I can't tell you what data structures these IDEs are using internally though.

And, again, the fact that features had to be disabled in intellij really says a lot. With more power, you can have more features, you can get feedback faster in your IDE, you can have more linters, more plugins, etc. That's a huge benefit to having fast software. Performance is enabling.

comment 9y ago · link · parent

Given a long string it will make insertion into the middle of text fast. Have you ever opened a file in Atom, added one character, and the whole thing locks up? That's the use case this solves, among others.

comment 9y ago · link · parent

As they say, when they first started with COD they had tons of scaling issues because they had never had so many before, but Erlang caused relatively few of their issues.

comment 9y ago · link · parent

What concurrency patterns have you found yourself unable to express using actors?

comment 9y ago · link · parent

Message passing in Erlang will be a fair amount more expensive - Erlang and C++ have far, far more differences in terms of performance than just message passing vs shared memory.

You're better off comparing C++ and Pony. At that point, a message enqueue is 3 atomic instructions, not too bad. The benefit is trivial concurrency.

comment 9y ago · link · parent

If I visit website A it should not know that I also visited website B. HTTP or HTTPS is irrelevant - they are totally separate connections and this does not assume anyone is in the middle.

Of course, there are attacks that already work using cache timing, but that isn't a good thing.

comment 9y ago · link · parent

I've written 1 to 1 (algorithm) code from Python to Rust and seen orders of magnitude performance/ memory difference. This was not a 'rewrite it with lessons learned' this was 'rewrite it as similarly as possible'. It is the language (and runtime).

comment 9y ago · link · parent

I didn't realize you were recommending to use sel4, I assumed you meant they should have proven theirs using similar methods.

comment 9y ago · link · parent

I'm only commenting on seL4's approach not being very viable. I'm not advocating for C++ in the kernel either.

comment 9y ago · link · parent

I wouldn't use SEL4 as an argument. It is completely unreasonable to build a production kernel the way they did - it took them ages to get what they had. Google is probably looking to develop features/ move code a lot faster than is possible using their technique.

Good coding practices take no time to implement, you learn it once and you write that way. It is not bullet proof, neither are capabilities. Still, at least they're practical.

comment 9y ago · link · parent

> Writing unsafe Rust instead of unsafe C is not giving you any real advantage for the existing projects, as long as the state is as it is.

Your argument hinges pretty heavily on this. It's incorrect. The reality is that unsafe code in rust is not like unsafe code in C. First, it's bounded to a module. Second, you can grep for it (huge). Third, you still have less UB in unsafe rust than in C.

I've never written code in rust that required unsafe, after many thousands of lines.

> Is safely rewriting a crypto library which is useful in real project still a too big task to be taken?

https://github.com/ctz/rustls

?????????????

> But I'd like to see a real life case of its success too.

Ripgrep is a nice one to point to. There's redox too. Tons of rust code out there.

comment 9y ago · link · parent

> The good news is that I joined Cloudflare two weeks ago, who is a big Cap'n Proto user, and it looks like I'll have more time and justification to do releases there

That's great news, thanks for the disclaimer/ info.

comment 9y ago · link · parent

The quote wasn't really about null - that's just the talk he was giving. It was about checked array indexing.

I would also say there really is no comparison between null, which escapes typechecking, and unwrap, which does not. But that's not my point, nor is it Hoare's. It's that we blame people for problems that are better solved by languages.

comment 9y ago · link · parent

" ... a programming language designer should be responsible for the mistakes that are made by the programmers using the language. [...] It's very easy to persuade the customers of your language that everything that goes wrong is their fault and not yours. I rejected that..."

- Tony Hoar

I think this is a particularly solid point by Tony Hoare (made during his talk on 'the billion dollar mistake', null).

We find it very easy to blame developers for mistakes that really shouldn't have been possible to make ta all.

comment 9y ago · link · parent

OK, I should have said garbage collector, not runtime.

comment 9y ago · link · parent

As far as I am aware Ada is not memory safe without a runtime and with the presence of non-static memory. So you either have a runtime, no deallocation, or unsafety.

comment 9y ago · link · parent

That's a pretty impressive response - committing to fuzzing with AFL, improving current fuzzing test coverage, adding new coding guidelines, and a paid security audit.

In regards to 4 (valgrind) perhaps utilizing other sanitizers would be a good idea.

Awesome that they tested whether those methods would actually have caught this bug - and multiple did. That's a smart metric.

And a writeup about TMP and compile time safety to boot.

I'm struggling to come up with anything more that I'd want in a disclosure.

comment 9y ago · link · parent

Who said anything about CPU? Slack's going to make DNS requests, multiple TCP requests most likely. That's network IO, multiple orders of magnitude slower than reading from disk - which is (at most, it may just read small file from disk and unpack in memory - I don't know) what TempleOS does.

Slack's app has to display images, render scrolling, respond to network events, store and load application state like your preferences and theme, etc. Assuming it does these things - I use the web client.

Slack also has to support multiple operating systems, so it may make technology choices around that.

It's really not hard at all to see why Slack would be much slower than an OS that basically does nothing to boot up.

It's not hard at all to see why Windows, which supports tons of hardware, would be larger on disk and slower to unpack as it boots - lots of drivers and services need to start up to support all of the things that make it not TempleOS.

comment 9y ago · link · parent

> What's Slack doing compared to a full (if primitive) OS and userland?

Connecting to the internet.

comment 9y ago · link · parent

Microservices do not feel like a premature optimization. It does not feel premature to make architectural decisions around scaling based on the entirely realistic proposition that you will have more customers in the future than you do today. Architecture is exactly the area you want to get right since it's a pain to optimize when you have a weak architecture.
1
158159160
164