4 ms·
As a D user, I am looking at Rust with curiosity, but haven't yet seen any reasons that would make me switch.
by skocznymroczny 7y ago
As a D user, I am looking at Rust with curiosity, but haven't yet seen any reasons that would make me switch.
- Raveen87 7y agoI think Rust is such a well designed language. But as someone coming from more high-level languages I sometimes feel a bit lost due to not getting as much help from the IDE as I'm used to for C# in Visual Studio and Java in IntelliJ. For Rust I've only tried IntelliJ with the Rust plugin, which seems like the best choice for what I'm after.
- Leace 7y agoRust may hopefully get better autocompletions if they work on their Language Server implementation. C# compiler was explicitly rewritten so that it is IDE friendly and I fully agree with this decision. That said even good, old Java has excellent tooling support that I do miss from all these hip languages (such as Rust).
- steveklabnik 7y agoThe compiler team is planning on following in C#’s footsteps with the rust-analyzer project.
- carlmr 7y agoI can only recommend trying it out. It works comparatively well. The problem with RLS is that it always needs working code to compile in between and it always loses state. I think it's a design issue at the core of RLS. rust-analyzer does this a lot better and faster, but is still in an early stage.
- Leace 7y agoThat would be great! One thing that makes working with a language pleasant is good tooling.
- modernerd 7y agoVS Code support is good too. https://areweideyet.com/ https://areweideyet.com/
- skocznymroczny 7y agoSuch tables are tricky. What does it mean to have syntax highlighting? For languages like C, it means that keywords, numbers and strings are colored differently. But for languages like Java/C# it's not enough, expectations are different. For such languages you expect class names to be colored differently than variable names, and IDEs for other languages rarely provide that.
- tathougies 7y agoThe level of IDE integration has little to do with whether a language is 'high-level'. In fact, the more abstract a language, the more likely it is to be difficult to do complicated analysis.
- vbezhenar 7y agoWhy don't you rewrite D in Rust?
- ben509 7y agoBecause 'R' as a name is already taken. Even if it weren't, it would lead to too many bad pirate jokes.
- AnimalMuppet 7y agoCall it "Dust" instead of "R".
- NikkiA 7y agoCall it 'IronDust', put it on the CLR, and have all of the meta jokes.
- lmm 7y agoSum types (and therefore a nice way to do e.g. validation or error handling). A better OO model (particularly when it comes to secondary concerns like serialization or comparison). Safe scoped resource management (with memory-safety without GC as a secondary benefit). A more standard/better-understood way of doing what D calls "compile-time reflection" (if I understand what D's doing there correctly).
- vbezhenar 7y agoCan you produce a string via compile-time functions and compile that string as a Rust fragment? That was incredibly flexible tool in D. The only thing that comes close is Lisp macroses.
- steveklabnik 7y agoProcedural macros take a list of tokens, and you give a list of tokens back, and they're then compiled. https://doc.rust-lang.org/stable/book/ch19-06-macros.html#how-to-write-a-custom-derive-macro https://doc.rust-lang.org/stable/book/ch19-06-macros.html#ho... (starts with derive, then moves on to attributes. Function-like ones aren't stable yet)
- vbezhenar 7y agoThanks, that's similar, also I would argue that for inexperienced developer just producing desired text would be a simpler solution (but dangerous).
- TheCoelacanth 7y agoIf you use the `quote` crate[1], it's pretty much identical in terms of developer experience. [1] https://github.com/dtolnay/quote https://github.com/dtolnay/quote
- lmm 7y agoIMO the fully general version of that is too flexible to be maintainable; it's better to have more constrained/standardised functionality that lets you solve the problems you'd need it for. Generally there are two kinds of things that you would want to be doing at compile time: producing code to handle the fields of a structure in a generic way (which you can do with frunk), or producing delegating wrappers to handle cross-cutting concerns (which you can do up to a point via the combination of built in delegation and first-class functions, though the lack of HKT does make some cases impossible).