13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions
comment 8y ago · link · parent
I expect rust to encroach on those quite a lot, as well as less system-y C code (such as utils).
It's still early days. Rust is showing a lot of promise, for me personally, when writing high performance web services.
comment 8y ago · link · parent
And lots of big companies use Haskell, just like Rust - Facebook has used it for a while now.
It's important to remember that while rust may dominate the HN headlines, it's still a very niche language. That said, it's also showing a lot of promise in a world that largely dismisses programming languages as being irrelevant.
comment 8y ago · link · parent
Many papers exist but often have conflicting results, or weird methodologies, or extreme artificiality. It's really expensive/ hard to generate good research on this topic that controls for the big variables - you basically need a company that's willing to throw away at on of developer time to build two versions of the same product in both languages, then a metric for measuring success, a way to ensure you take dev skill into account, etc.
So instead it seems a lot more worthwhile to not bother looking for objective research as it won't be found.
I think a better approach is to just use what we have - sense and anecdotes.
From a sensibility standpoint, let's take a step back from rust.
Do we expect fewer memory safety vulnerabilities in Java vs C? Probably yes - Java is a memory safe language with few escape hatches.
So what about Rust vs C? It's a bit less clear as rust has a more oft used escape hatch, but I think we can reason that it's likely to have fewer memory safety bugs.
Would we expect fewer bugs in general? That's much harder to discuss with that approach.
You can look at testaments from Servo devs, and other companies using Rust ( https://www.rust-lang.org/en-US/whitepapers.html ) and their experiences.
comment 8y ago · link · parent
I like rust for a few reasons.
* I really like Rust developers - I've met many, talked with many, and we get along and they've helped me through many technical problems, both big and small.
* I found rust extremely easy to get started with. I knew I'd have to learn the language, I did not also want to learn build tooling, package management, etc. These barriers exist in many other languages, it's frustrating because I just want to focus on programming. Cargo is excellent and I am a huge fan of how rust manages crates.
* I find it very easy to express what I want in rust, to reason about the code, etc. I know when a function might error, I know when I need to handle some unforseen case, I can express how a variable is used, when it is usable, whether it can be mutated. I can cut down on boilerplate with generics and macros.
The last point is what keeps me coming back. I find rust extremely easy to write, because it makes the things I care about easy to express.
comment 8y ago · link · parent
Engineers whose specific job it is to admin infra, yes.
Logging is great, but it's a 'we are owned, how do we get them out' measure - we want to avoid getting to that point.
edit: Of course, this all depends on your threat model, posture, maturity, etc. I'm just saying - we have lots of very good reasons to lock devs out.
comment 8y ago · link · parent
They install bitcoin miners.
They install malware.
They install all sorts of shit.
It's unfortunate but it's true, I've seen it 100x.
We let our devs have local admin at my company but please don't misunderstand the serious risks involved in that decision. We take great measures to ensure that we can do that while still keeping our customers safe.
We would never allow admin AWS access, that's absurd. An attacker on your box would be able to own prod. Sorry that it's an inconvenience! When you manage to solve infosec, hit your ops/sec team up, they'll be happy to hand you the keys after that point.
comment 8y ago · link · parent
Making computers accessible seems like a completely reasonable, sound priority. Yes, computer literacy is something we all need to work towards, but we'll never be in a world where the average person understands PKI, and saying that we should limit accessibility until they do is absurd.
comment 8y ago · link · parent
Types are checked before program execution.
I think this definition is very, very standard, and in keeping with a type theory view.
> Being able to describe and annotate types doesn't make a static type system. A static type system is a way of associating with each valid program a proof that there will be no runtime type errors (or at least that certain entire classes of runtime errors will not occur).
These two statements seem to contradict each other. Adding the type annotations is exactly what allows mypy to associate a proof with code.
I don't think the definition is useless... it seems entirely consistent with gradual typing.
comment 8y ago · link · parent
Formatting is another.
Boilerplate code, for example today I had to implemented code like this:
impl Into<Node> for ProcessNode {
fn into(self) -> Node {
Node {some_boilerplate(self)}
}
}
I had 6 node types. Using multiple cursors I:* Implemented it once
* Duplicated it 5x
* Copied the names of the types I needed to impl for
* Attached a cursor to each impl
* Used ctrl + left/ right to word-jump, and past in the appropriate area
Now it's not like this saved me more than a minute or two, but this sort of thing is extremely common in my experience, across languages.
comment 8y ago · link · parent
But I wasn't doing this for a loop unroll.
I had a fixed size array that I wanted to serialize/ deserialize to/ from capnproto - there are no fixed size arrays in capnproto, so I wrote a message that just had b1, b2, b3... b16, and then some code to pull it out into a statically sized array. It allowed me to pull a bunch of bytes into a much larger statically allocated array without any allocation or bounds checking.
comment 8y ago · link · parent
Multicursor is amazing.
One thing it's been great for:
I have code like:
byte b1 = array[0];
And I want to do this for 16 bytes. Control + D to duplicate 15x. Double tap control, hit up 15 times - now there's a cursor at every row. Hold control, hit right (jump by word), index to end of 'b1' on each line. Ctrl + shift + a, 'increment duplicates' - now every line is 1, 2, 3, 4... 16. `ctrl + right` my way to the index key and do the same thing.
It's awesome.
edit: I just found 'duplicate and increment' :o
comment 8y ago · link · parent
> Yes, you can sometimes figure out what the type of an expression must be, but the ability to do so is incidental and not guaranteed by the language, nor an inherent part of its semantics.
It's not guaranteed with most languages - they build up from primitives, and almost all of them have some sort of soundness holes.
If I have every primitive type in Python correspond to a type in mypy, I don't get how that isn't a basis of a static type system.
It seems like you're talking about the difference between evaluation and a value itself. But mypy types are evaluated...
> The notion that dynamic languages are "unityped" comes from looking at them through the lens of static typing, leading to a disconnect about what "type" means and a correspondingly meaningless answer.
Pretty sure it's just the simple, type-theory way of defining it, and I don't see why we would define types in a way that isn't consistent with type theory.