Hacker News new | past | comments | ask | show | jobs | submit login

> That's why I think we need languages that make it less mentally taxing for developers to write product software (because the logistics are already complicated), while features like the borrow checker, though cool, increase the mental overhead.

But all Rust do is expose those issues? For example, do you consider a type checker a burden or a help? Is being able to check at compile time that “hey, why are you trying to pass a nullable to a string? This don’t make sense” helpful? I cant count on how many times have saved my time debugging issues.

I agree that Rust is not for everyone. Not everyone will like types even if it good for them. I would argue that a language that can accept dev/random as source to be very popular especially because you can get started very easily even if that means you will spend the rest of your life debugging it.




It's not whether it's a burden or help, those words have connotations associated with them.

The type system is objectively overhead, because it forces you to think about the types in your program, so it consumes mental bandwidth.

You and I might decide the cost is well worth it, but you cannot ignore that there is a cost. In the real world, many companies didn't always want to incur that cost in the beginning, so they built their products using scripting languages, Python/PHP/Ruby, etc and only much later added types via annotations or features of the language. Even C++ recognizes that there is a sizable overhead and introduced auto types.

Your /dev/random example makes no sense because it would not generate a working program, so it would not be popular.

There is no 'good for you'. Is the type system good for you if it slows down your velocity? Are dynamic types good for you if you get an exception deep in the code one hour before launch because someone was adding a string to a number?

There are only trade-offs. You either make the right trade-off (even by luck) given some set of goals and limitations, or you don't and pay the price one way or the other.


>The type system is objectively overhead, because it forces you to think about the types in your program, so it consumes mental bandwidth.

I don't understand this point. Types is an overhead yes, but its an overhead that you _have_ to deal with. Would typing without knowing what letters would come up be a lesser burden? Seeing the code that I just wrote seems to be an overhead too. Types is simply there to tell you what you wrote. Much like when I realized I mistyped `j` instead of `k`, I would also realize that I am trying to append an `Object` to a `number`.

> Your /dev/random example makes no sense because it would not generate a working program, so it would not be popular.

My point is that a language that will literally, and I mean literally, accept any and all source code and execute them is probably going to be popular. Just imagine a language designed with this goal in mind; to make the set of possible program in the language be the entire space of possible sequences of texts. For example,

```

00000what????;

function hello() {

world

}

```

This seems meaningless. But with that mantra in mind we can simply define that any line that is undecipherable be a declaration to an unused string. Why not? So the first line is is simply something like `let _ = "00000what????";` And the second one is simply a function that returns the string `world`. Why? Oh because its so inconvenient to put quotations to declare a string isn't it?

I think you'd agree that this language is horrible. It might be faster to get to a prototype but I personally can't imagine maintaining a codebase written in this language.

Have you considered that this is exactly what JS is like (in spirit)? It defines so many things that would otherwise not be defined in other languages. For example, what does this even mean? Without looking at the spec, tell me what it does?

```

function hello() {

    1.0 + "hello"
}

console.log(hello())

```

Does this program even makes sense? Does this program makes any more sense than something like

```

"helloworld"();

```

Not even JS would compile this, but why not? Why not simply throw an exception here? Something like "function not found"? Since this clearly works

```

const a = {

    "hello": ()=>{console.log("world")}
}

a["hello"]()

```

The set of possible program is JS is much, much larger than any other languages. There's so many little tricks that the language provide that makes it so powerful and so much worse.


Rust can be argued to "expose" the issues compared to manual memory management, but not compared to automatic memory management.

(In the first case there's of course also the caveat of false positives from the borrow checker)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: