Live data from Hacker News

The Rust I wanted had no future

graydon2.dreamwidth.org

341–350 of 523 posts

Re: The Rust I wanted had no future

#341
post #335

Earlier quoted context omitted.

Split the syntax into whether it 1) emits no code (compiler-facing); 2) emits weakly-related code (eg., macros, etc.); 3) emits code close to what's written abstractly (eg., value operations); 4) emits code close to what the machine needs (eg., unsafe code) -- etc. And you'll find about "4 languages" all mixed together.

I still have no idea what you're talking about. Can you give an example? Most "syntax" in AOT, statically typed languages does not directly generate machine code, but it does directly impact what machine code is generated. So there's not a clear distinction in practice. For example, a lot of the syntax is used to control method selection and verification - that's not a "different" syntax or language by most folks' de…

Compare this with lisp, where there's one syntax -- compiler operations are "compile-time" interpretations of the very same syntax.

Or below, let's invent a language where there's (in my sense) "one syntax for everything",

Eg., consider something like,

    const SimpleTrait = trait with:
       val name 

    
    def GenericApiTrait(type T) =
        return new trait with: 
            def response : self -> str

    const MyAPI = GenericApiTrait(SimpleTrait(new class)) with:
        val name = "World"
        def response : self -> str = f"Hello $name!"

    # later on, in the app,

    def calc(x, y) : int, int -> int = 
        return x + y

    # ie., the **same** syntax as that earlier which targets compile-time

    
Here you can see that code with ordinary run-time semantics is used for the compile-time operations of generating a trait and specifying that a class implements that trait (ie., we call the trait-defining function on the class).

Whereas in Rust, the syntax for returning values and "quantifying over types" is radically different.

This is the historical approach (C++, C# .. almost all langs) -- but not one modern innovative langs follow.

I think with as much desire for novelty rust has, cramming it all into its "compile-time syntax" has hobbled it.

A simple uniform language for both c-time and r-time could be used

Re: The Rust I wanted had no future

#342
post #311
post #194

Earlier quoted context omitted.

Honestly I blame the community. The transition was slow (Python 2 was supported in parallel to 3 for a long period of time so there was more than enough time to migrate), relatively easy to do, and brought huge benefits to the ecosystem. It could have been done and forgotten in 2 years if some community members had not been dicks about it.

I blame a lack of tools. JS devs have been transpiling for years now and it works. Python should have released a conversion tool that could automatically convert most stuff and identify the stuff it couldn't convert. This kind of directed upgrade would have made the process much easier for developers to actually accomplish.

I'm confused, because isn't that exactly what they did? What was wrong with 2to3?

https://docs.python.org/3/library/2to3.html

Re: The Rust I wanted had no future

#343

> Explicit lifetimes I never understood that one either. There is always only one "solution" that will make your program compile, so why not just let the compiler figure it out?

I wrote a blog post about this. https://steveklabnik.com/writing/rusts-golden-rule

I did not mention lifetimes, but the principle is the exact same: the lifetime annotations are an API promise, and so inferring them means that a change in the body of the function would change the promise, breaking other code.

Re: The Rust I wanted had no future

#344

I haven’t cared about what Hoare thinks of Rust since 2015. 1. He hasn’t been involved in the language for a long time 2. His vision for the language was completely different compared to how the remaining developers ended up designing it. So if I ended up liking Rust under his “BDFL”ing then it would be for completely different reasons compared to why I like (and dislike) Rust today

Hmm, I had only read a few paragraphs when I wrote that. Now I’ve read through the whole thing and it seems that Hoare agrees with me. How nice.

Re: The Rust I wanted had no future

#345

I love Rust and built some production code with it in the past. But nowadays I want something more simple so that not-so-senior developers can pick it up quickly, and I want flawless tooling, and willing to sacrifice a bit of performance. So basically I often end up with Go. Go is exceptionally great in tooling, ecosystem, any objective metrics like build times or crosscompilation... but I still don't like the langua…

Perhaps you'd be interested in Inko (https://inko-lang.org/). It's obviously not there yet in terms of tooling and what not, but it might scratch an itch for those looking for something a bit like Rust, but easier to use.

Disclaimer: I'm the author of said language :)

Re: The Rust I wanted had no future

#346

I love Rust and built some production code with it in the past. But nowadays I want something more simple so that not-so-senior developers can pick it up quickly, and I want flawless tooling, and willing to sacrifice a bit of performance. So basically I often end up with Go. Go is exceptionally great in tooling, ecosystem, any objective metrics like build times or crosscompilation... but I still don't like the langua…

> If there would be something just like Go, but with a bit more powerful typesystem like Rust has (Option instead of `err != nil`, and so on), and a simplified ML-like language instead of an imperative one... that would be my dream.

Not to be snarky (for once) but

- More powerful type system: that goes against the whole implementation culture behind Go and their wider philosophy

- ML-inspired instead of imperative: goes even more counter to the above

I have never tried Go and I will probably never care to try it, but I have never seen a language which manages to both be (1) simple in the Go-sense and (2) look remotely anything like an ML language.

Re: The Rust I wanted had no future

#347
post #249

Earlier quoted context omitted.

On top of this, there's this bogus mantra in the Rust community that "if it type checks then it works." I've spent of hours interactively debugging Rust code, crawling through tracing output etc, and hours waiting for Rust code to link with mold because I added an eprintln somewhere, so I'm not convinced. I love writing Rust and think it makes my life easier, but there's this stockholm syndrome about compile times. I…

>hours waiting for Rust code to link with mold because I added an eprintln somewhere How is that Rust's fault?

I think the "with mold" comment is expressing that even with the state-of-the-art fastest linker that's generally available for use with Rust, it still is slow. If you used the default linker, it would be even slower.

Re: The Rust I wanted had no future

#348

Haven't followed Rust too much, but I'm always surprised when I hear that Rust is too difficult or not ergonomic. As I understand it is meant to be a systems level language; something you'd use to write kernels, TCP stacks, browsers and ssh daemons. Anyone writing these things today in C or C++ already understands object lifetimes and Rust just adds a static checker for them. In such projects churning out lines of co…

> Why on earth would you try to rewrite python CRUD apps in Rust? Because Rust has a lot of incredibly helpful features that make bigger systems far less of a pain to maintain. I work in Java/Kotlin, and my entirely gut-based estimate is that 66% of problems wouldn't happen in Rust. My big favorites are: - Sane, well-defined, enforced, opt-out error handling - Sane, well-defined, enforced, opt-out handling of "missin…

So... Haskell, OCaml, F#, Elm?

Re: The Rust I wanted had no future

#349
post #224

Earlier quoted context omitted.

>"I mean who'd want to and why bother trying to support that use case" I write my web apps in C++. They tend to be little bit more than just query database / update database. They're exposed as JSON based RPC and can be accessed by JS front end from browser or third party systems we interact with. The performance is stellar and the code size is not much different comparatively to using PHP / Ruby / Python / your_pet_…

Nice. Do you have some open source samples? I would like to see your style!

No. I do not work on opensource projects unfortunately.

Re: The Rust I wanted had no future

#350

Earlier quoted context omitted.

I don't understand the big issue with build times: I have always found that they are almost instant for incremental builds (assuming you use lld or mold).

> I have always found that they are almost instant for incremental builds (assuming you use lld or mold) They are not almost instant once your project grows to a certain size, which is still well within the bounds of a realistic single company’s project (I work on Materialize which is all in rust).

And you have it set up with multiple compile units, shared generics, and lld (or mold ideally)?
Post reply on HN