What Julia Does Right
Don Allen
donaldcallen at gmail.com
Sat Dec 10 02:21:58 UTC 2022
On Thursday, 8 December 2022 at 17:47:42 UTC, Walter Bright wrote:
> Here's a good thought provoking article:
>
> https://viralinstruction.com/posts/goodjulia/
>
> A couple of things stood out for me:
>
>
> 1.
> https://viralinstruction.com/posts/goodjulia/#the_package_manager_is_amazing
>
> I've never thought of a package manager that way.
>
>
> 2. "Rust, for example, may have a wonderfully expressive type
> system, but it's also boilerplate heavy, and its borrowchecker
> makes writing any code that compiles at all quite a time
> investment. An investment, which most of the time gives no
> returns when you're trying to figure how to approach the
> problem in the first place. It's also not entirely clear how I
> would interactively visualise and manipulate a dataset using a
> static language like Rust."
>
> I've always thought that a great strength of D was its
> plasticity, meaning you can easily change data structures and
> algorithms as you're writing and rewriting code. Apparently
> this is much more difficult in Rust, which will inevitably
> result in less efficiency, even if the compiler for it
> generates very good code.
I speak with a fair bit of experience with both Rust and D. In my
opinion, what gives the
writer of the Julia article heartburn about Rust has nothing to
do with static vs. dynamic typing. Rust is difficult to learn
because its insistence upon GC-less memory safety places a
significant memory-management burden on the programmer. That's
what all the ownership rules are about and the notorious
borrow-checker is relentless in enforcing those rules. This is
not a language for prototyping. You have to have a very clear
idea of your design decisions and how they relate to the
ownership/borrowing rules, or you will find yourself in a world
of considerable frustration.
This is much less true of D (and, I'm sure, Go and Nim, with
which I have only a little experience). It's also less true of
Haskell, with which I have a lot of experience, which also has a
demanding compiler. But those demands are mostly about proper use
of Haskell's type system and don't off-load work on the
programmer because there's an empty space where a GC ought to be.
Having said all this, once you learn how to deal with Rust, you
learn where the land-mines are and how to avoid them. Using it
then becomes a more normal experience, but the time and effort to
get to that steady-state is greater than any language I've ever
used in 60+ years of writing code. I will say that the compiler
provides excellent error messages, as well as many Lint-ish
suggestions about eliminating unnecessary and/or unused things
from your code. Cargo is also very solid -- easy to use and well
documented. Once you get your code to compile, it's much like
Haskell -- it works, modulo your own logic errors.
More information about the Digitalmars-d
mailing list