Live data from Hacker News

Was Rust Worth It?

jsoverson.medium.com

581–590 of 736 posts

Re: Was Rust Worth It?

#581
post #336

Earlier quoted context omitted.

what's wrong with XML? Maven XML is a configuration not a programming language.

Is this a joke? XML is horrible to work with, more boilerplate than information. Compare your average maven file to a cargo.toml and tell me which is easier to work with...

For a descriptor verbose is superior. It's way clearer what you're looking at. Matching a named end tag is much easier than matching a }. Also, XSD means you can strictly type and enumerate valid values and you will instantly see if you've written something invalid.

Re: Was Rust Worth It?

#582
post #140

Earlier quoted context omitted.

I'm honestly astounded at how badly many languages have implemented dependency management, particularly when Java basically got this right almost 20 years ago (Maven) and others have made the mistakes that Java fixed. With Maven you get: 1. Flexible version (of requirements) specification; 2. Yes, source code had domain names in packages but that came from Java and you can technically separate that in the dependency…

The dependency management side of Maven is great. OTOH, I was astounded to learn today that Maven recompiles everything if you touch any source file: https://stackoverflow.com/a/49700942 This was solved for C programs since whenever makedepend came out! (I'm guessing the 80s.) (Bonus grief: Maven's useIncrementalCompilation boolean setting does the opposite of what it says in the tin.)

Build and test caching is one of the few compelling advantages that Gradle has over Maven. It's a shame that this is still an issue.

Re: Was Rust Worth It?

#583
post #226

Earlier quoted context omitted.

100% agree. It's unbelievable what a PITA it is dealing with pip or npm compared to Maven even 10 years ago. The descriptors could get convoluted but you could also edit them in an IDE that knew the expected tokens to make things happen.

What’s so hard about “npm install” and “package.json”. It’s dead simple

Maven stores every version of every library you've ever needed in a central location. It doesn't pollute your working directory and it caches between projects. And this is more of a Java thing than a Maven, thing, but backwards compatibility between versions is way easier to manage. There's no incompatible binaries because you changed the node runtime between npm install and running your project.

Re: Was Rust Worth It?

#584
post #455

Earlier quoted context omitted.

I didn't say no decent algorithm in C#, but for each performance sensitive algorithm/data structure there is a C and Java implementation at the least ( in my case Roaring Bitmaps). In C# the solution is half baked or archived or abuses allocation. I think Unity has way more with C# adoption in game dev than innate C# qualities.

This is a classic case of goalpost moving. The reason why so many algorithms are written in Java especially closer to academic side is because most curriculums in comp-sci often straight up not allow using anything else except Java, Python or sometimes C++. Having C# as an alternative in these is a luxury. There are also more people using Java in general. However, this does not make it a better language at solving th…

I'm not moving the goalpost. I explained my examples in another reply. Want to write an engine mostly from scratch in C# and you need libraries that are low on allocation and for niche data/algorithms that games need? You're going to have a bad time(TM).

Sure you could use YAML parser, but it allocates everyone and their mother. Can you find a Fluent localization in C#? Sure, but its outdated and archived. Ok, but basic RoaringBitmap implementation? The repo is archived and not fully complete.

Why C# is used in game dev is incidental. It has more to do with Unity and XNA/FNA than any concrete quality of language modulo value types (but then again, most C# libraries don't focus on avoiding allocation and are just as happy as Java to construct a complicated hierarchy of classes).

Re: Was Rust Worth It?

#585

Earlier quoted context omitted.

> For anything larger than (very) small programs, Rust requires an upfront design stage, due to ownership, that it's not required when developing in GC'ed languages. It's nearly the opposite. For larger programs in Python, you need an upfront design stage because the lack of static typing will allow you to organically accrete classes whose job overlap but interfaces differ. Meanwhile, Rust will smack you over the hea…

> For larger programs in Python, you need an upfront design stage because the lack of static typing will allow you to organically accrete classes whose job overlap but interfaces differ. You can also install pre-commit and mypy, and have static typing.

That's the entire point we're making. Rust's type system forces you to deal with the problem early on and saves time towards the end. It's not like that's impossible with Python with addons like mypy. But Rust's type system goes beyond just data types - lifetimes are also a part of the type system. I don't know how you can tack that on to Python.

Re: Was Rust Worth It?

#586

Earlier quoted context omitted.

Oh, my bad. I should have read the source more closely. I hadn't realized only 32-bit x86 processors were supported.

That's hilarious. Like, the compiler team had ONE GUY that believed in and developed this feature and retired in 1999.

[deleted]

Re: Was Rust Worth It?

#587
post #579

Earlier quoted context omitted.

No, usually you don't. Rust has closures, iterators, generics, different traits for operator overloading, smart pointers, etc. Zig doesn't have any of that. It's very interesting combination of low-level, predictable code, with meta-programming, where you get some of that abstraction back. i.e. Zig does not have generics, but your function can return type, so generic list is just a function which returns a newly crea…

Could you expand on the generics point, please? That sounds interesting but I can't quite get my head around it.

Zig has `comptime` where you effectively generate Zig code at compile time by writing Zig code, no special generics syntax/semantics needed. It is very nice and powerful concept that covers lots of ground that in Rust would belong to the land of procedural macros.

Re: Was Rust Worth It?

#588

Rust is great, but one thing I’d like to see is an interpreted, dynamic, less strict version of it that could be used for prototyping and gradually typed into compiling Rust code. In other words, a new programming language doing to Rust the reverse of what Mojo is trying to do to Python.

Have you ever heard of Rune? Sounds like it might be what you're looking for. https://rune-rs.github.io/posts/rune-0-13-0/

Cool! Thanks!

Re: Was Rust Worth It?

#589

Earlier quoted context omitted.

Good question! There's no single thing, I think, and the things I dislike about it aren't even really technical criticism or the like. They're more... aesthetic? I find the syntax unpleasant, for instance. It's extremely opinionated and a few of those opinions are ones I disagree with. Also, just generally, it tends to make even simple things pretty complex. I understand why and am not really objecting to that, but i…

Which opinions do you disagree with? For transparency, I tend to find myself agreeing with almost all of its models/abstractions.

There are a few, and they aren't something that I can't live with, of course. A great example of the sorts of things I'm talking about are Rust's insistence on camel case and snake case.

Re: Was Rust Worth It?

#590
post #286
post #231

I wrote a lot of rust, but after some years it still feels unproductive. I do a lot of zig now and I am like 10 times more productive with it. I can just concentrate on what I want to code and I never have to wonder what tool or what library to use. I know rust gives memory safety and how important that is, but the ergonomic is really bad. Every time I write some rust I feel limited. I always have to search libraries…

> but the ergonomic is really bad. Every time I write some rust I feel limited. > But I do not think it is a good general purpose language. Remember that this is not a sentiment that's shared by everyone. I use Rust for tasks that need anything more complicated than a shell script. Even my window manager is controlled from a Rust program. I say this as someone who has been programming in Python for nearly two decades…

It's interesting that you bring up Python. I find Rust unpleasant to program in -- and I also find Python unpleasant to program in.

Now I'm wondering about demographics. Are people who love Python more likely to love Rust as well?

Post reply on HN