Live data from Hacker News

Two years of Rust

blog.rust-lang.org

61–70 of 312 posts

Re: Two years of Rust

#61
post #54

Earlier quoted context omitted.

Just because you don't understand the benefits other people get from a REPL doesn't mean they don't exist.

Just because there are benefits, doesn't make it a deal-breaker.

I didn't say it was a deal breaker?

Your post came off as implying REPLs don't have serious benefits for anyone, which felt a bit presumptuous to me.

Re: Two years of Rust

#62
post #53

Earlier quoted context omitted.

Your site is returning brotli-encoded data even when the browser doesn't support it. At least, I assume that's what it's doing, because the return value is complete garbage and it contains a "Content-Encoding: br" header.

Naturally. Since moving to HTTPS, I have dropped support for gzip, and I will not be re-adding it. There is no benefit in continuing to retain legacy gzip support. Brotli can compress and decode faster than gzip, and it produces smaller file sizes. That Safari still doesn't support Brotli isn't my problem. It's Apple's problem. I'm not going to be yet another site that condones stagnant progress when everyone else ha…

If I were focused so unapologetically on purity over pragmatism at the expense of playing nice with the wider web ecosystem, I would perhaps think twice before holding my site up as a positive example of the state of web development with Rust. You may end up doing more harm than good in the PR department. :)

Re: Two years of Rust

#63
post #43

Earlier quoted context omitted.

If your language doesn't have a REPL, your language is less productive. Deal with it. Oh hardly. As someone who's developed software in Perl, Python, C, Java, C#, Haskell, and a few others besides, a REPL is the one thing I use the least . I've honestly never understood the obsession with it. Is a rapid compile-run-debug cycle important? Absolutely. If I want to test something in isolation, being able to rapidly turn…

I tend to agree, but being able to have a REPL at all is a symptom that your language is capable of an extremely fast compile-run-debug cycle. In other words, if you can't implement a REPL, that's the definition of "less productive language." It's not about the REPL itself but the capability of implementing one. Think about it like this: On your list of languages, which of them would you say is most productive? It de…

> Is the Rust community claiming that the entire history of computing has lead up to this point, where Rust exists, and now nobody needs to write anything in not-Rust? Are people 200 years from now going to write Rust and nothing else?

Let's be clear - the person who said there'd be no reason to write in anything else is an enthusiastic Rust user, but they don't work on Rust & don't represent "the Rust community." They were speaking from their own experience, based on their own balancing of the trade offs as a user. Presumably a REPL doesn't rate very highly for them.

However, the reasons we don't have a REPL are mainly two: the compiler isn't architected for it and code doesn't compile fast. The solutions are:

* Re-architect the compiler to support incremental code input. This is pretty similar to what we need to support IDEs (which we're working on), so possibly this will solve the problem.

* Get a reimplementation of the backend which is a JIT interpreter instead of LLVM, which takes up most of our compiletime. Work is underway on a project called miri, though it isn't officially supported right now.

* Make the typechecking part of the compiler faster. This is underway through a project called chalk.

In other words, a REPL is not impossible, it just isn't a top priority right now. There are other lacking tools that we're working on - IDE integration and auto-formatting for example - maybe after those are done it will be the top of the docket.

Re: Two years of Rust

#64
post #54

Earlier quoted context omitted.

Just because there are benefits, doesn't make it a deal-breaker.

I didn't say it was a deal breaker? Your post came off as implying REPLs don't have serious benefits for anyone, which felt a bit presumptuous to me.

Yup, that's fair.

BTW, I actually stand by your interpretation. I challenge anyone to demonstrate significant productivity gains (as measured by number of lines of tested, production code written) that can be attributed to the availability of a REPL (which was the claim of the poster I was replying to).

I honestly don't buy it. I believe it's a very nice tool for learning a new language, and maybe for exploring an existing codebase, but I can't envision a workflow where a REPL provides significant productivity gains for an experienced, professional software developer that aren't realized in other ways (e.g. writing unit tests).

Re: Two years of Rust

#65
post #10

Earlier quoted context omitted.

> Not being hindered by the compiler telling you what you can and can't do; freeing yourself from the write-compile-debug cycle, reducing it to repl-done; etc. Yeah, I certainly understand various language trade-offs, but in my experience any of these early wins of interpreted languages come back to haunt you at significant cost. I saw someone use the analogy of a credit card on here before: purchases are very easy t…

Yeah, I certainly understand various language trade-offs, but in my experience any of these early wins of interpreted languages come back to haunt you at significant cost. If you understood the wins of untyped languages, you'd be aware that this is often the most optimal path for a startup to take. Get features done now + fix them later is, in hundreds of cases, the way that startups win. It's also a win for people w…

> It's beginning to get tiresome to continually hear the Rust community go on and on about how amazing Rust is and say, with a straight face, that eventually there will be no reason to write anything in not-Rust. Are you serious? The hubris is off the charts.

So a few considerations here: (1) I really have no connection with the Rust community aside from curiosity, so it's quite dishonest to project my opinion onto all of them, and (2) this is very much my personal opinion.

---

I'd still defend the position though. Every language has merits, but especially for a lot of the older ones, there are so many accumulated problems that it's worth considering newer languages just because they're learned so much for the mistakes of their predecessors. For example, I've been doing Ruby for quite a few years now:

* Having so few constraints on implementation (e.g. duck typing) was an interesting concept, but time has proven it to be a nightmare maintainability. It buys you a little early productivity, but any honest person with a huge Ruby codebase can tell you that it's a liability.

* The only way to get truly good performance is to write a C extension. The language's whole implementation and performance-sensitive libraries are all C. Contrast this to modern languages where it's an embarrassment if your compiler is _not_ written in the language itself (Rust, Go, Swift, etc.).

* Core build infrastructure (Bundler) and environment management (rbenv) is maintained separately from the language. It works fine, but the reason it's not more core is not because it's better that way, but because the language's original designers didn't realize they'd be necessary, so they had to be developed separately. This has the effect of making the whole toolchain complex and hard for beginners to understand because none of it is integrated.

* The interpreter starts out faster than a compiler, but it breaks down fast. Codebases in the 100,000s of lines or more will take on the order of 10-100 seconds to start up, and the only way to get back to a fast edit-compile-debug loop is through tricks like Zeus. After you resort to that, unreliable runs and weird loading problems become a part of common life.

These aren't small problems. Also, I'm picking on Ruby here, but you could drill into a lot of existing languages and find flaws that are roughly on this level (JS/Python/C++/Erlang are easy, but even fan favorites like Haskell and Scala have pretty serious ones). Newer languages have their problems too, but rarely anything on this sort of existential scale.

We should stop pretending that all languages are equal with their own share of upsides and downsides. Given decades of language building, it would be disappointing if lessons hadn't been learned. Luckily this isn't the case.

In terms of what we write new projects in given a few years, there are other good contenders, but like I said above, I think that Rust has nailed a performance/safety/productivity/ecosystem compromise that's quite a bit above and beyond most of anything else.

Re: Two years of Rust

#66
post #52
post #33

Earlier quoted context omitted.

Consider how interfaces work and how you would have to implement them. Rust may have a more complicated type system and I suppose enums are more complicated in Rust, but the things I value as simple are more simple in Rust than Go.

What about interfaces? The basic idea of fat pointers with vtables works the same as Rust's trait objects. If you mean the ability to dynamically cast from one interface type to another, which Rust doesn't support - that does require a global list of implemented interfaces per type, but without generics that's not too hard to implement. (In Rust, it would be drastically more complex, verging on impossible to pull off…

When ever you would need to box a trait object in Rust Go automatically performs a heap allocation that is garbaged collected at some point. A bit more is explained here https://research.swtch.com/interfaces Basically there are some property of Go interfaces that make them far more dynamic than traits and implementations in Rust.

Re: Two years of Rust

#67
post #53

Earlier quoted context omitted.

Your site is returning brotli-encoded data even when the browser doesn't support it. At least, I assume that's what it's doing, because the return value is complete garbage and it contains a "Content-Encoding: br" header.

Naturally. Since moving to HTTPS, I have dropped support for gzip, and I will not be re-adding it. There is no benefit in continuing to retain legacy gzip support. Brotli can compress and decode faster than gzip, and it produces smaller file sizes. That Safari still doesn't support Brotli isn't my problem. It's Apple's problem. I'm not going to be yet another site that condones stagnant progress when everyone else ha…

I'm not saying you should support gzip. I'm saying you're sending Brotli-encoded data even when the browser doesn't support it, which results in the browser showing what looks like effectively random bytes. You need to respect the Accept-Encoding header.

Re: Two years of Rust

#68
post #10

Earlier quoted context omitted.

> Not being hindered by the compiler telling you what you can and can't do; freeing yourself from the write-compile-debug cycle, reducing it to repl-done; etc. Yeah, I certainly understand various language trade-offs, but in my experience any of these early wins of interpreted languages come back to haunt you at significant cost. I saw someone use the analogy of a credit card on here before: purchases are very easy t…

Compiled languages can have REPLs too. Common Lisp and Haskell come to mind.

For Haskell, the GHC's compiler and interpreter are very different beasts. The former is well known to be fast, but the latter is fast.

Re: Two years of Rust

#69
post #53

Earlier quoted context omitted.

Naturally. Since moving to HTTPS, I have dropped support for gzip, and I will not be re-adding it. There is no benefit in continuing to retain legacy gzip support. Brotli can compress and decode faster than gzip, and it produces smaller file sizes. That Safari still doesn't support Brotli isn't my problem. It's Apple's problem. I'm not going to be yet another site that condones stagnant progress when everyone else ha…

If I were focused so unapologetically on purity over pragmatism at the expense of playing nice with the wider web ecosystem, I would perhaps think twice before holding my site up as a positive example of the state of web development with Rust. You may end up doing more harm than good in the PR department. :)

I see it as more of an Apple problem. Everyone else's web browser works fine, but Apple's doesn't. The main reason why companies like Apple still don't support Brotli even though the competition has supported it for more than a year now is because too many sites are focused on carrying legacy support for unsupported platforms like Safari. If more sites dropped support for legacy software, Apple would be forced to implement Brotli support and then everyone could benefit.

Re: Two years of Rust

#70
post #67
post #53

Earlier quoted context omitted.

Naturally. Since moving to HTTPS, I have dropped support for gzip, and I will not be re-adding it. There is no benefit in continuing to retain legacy gzip support. Brotli can compress and decode faster than gzip, and it produces smaller file sizes. That Safari still doesn't support Brotli isn't my problem. It's Apple's problem. I'm not going to be yet another site that condones stagnant progress when everyone else ha…

I'm not saying you should support gzip. I'm saying you're sending Brotli-encoded data even when the browser doesn't support it, which results in the browser showing what looks like effectively random bytes. You need to respect the Accept-Encoding header.

That would require that I cache both a gzip and brotli variant of each page and content that is requested. I see no reason to support gzip just because a single company has refused to implement support for Brotli. Firefox, Chrome and Edge all support Brotli. Safari is the one man out. Apple needs more complaints about the lack of Brotli in Safari. Using Safari? Don't. You have Firefox and Chrome on all of your platforms.
Post reply on HN