It's about choosing the right tool for the job. The job is programming and the tool is rust
programming
-
Post about programming, interesting repos, learning to program, etc. Let's try to keep free software posts in the c/libre comm unless the post is about the programming/is to the repo.
-
Do not doxx yourself by posting a repo that is yours and in any way leads to your personally identifying information. Use reports if necessary to alert mods to a potential doxxing.
-
Be kind, keep struggle sessions focused on the topic of programming.
one true leftist, static typing
Static typing > dynamic typing, imo. I mostly work with C/C++
I’m an ancom.
Static is always better than dynamic.
You haven’t felt true pain than trying to debug a 20 year old Perl script to find out that someone accidentally passed in one to many zeros to a function which caused all the arguments to be off by one and the dynamic checker just rolled with it and blew up silently.
I think making dynamic languages so common for web apps is the real sin tbh, so many different types of data to deal with, where casting between different data types often causes unsound states and horrible inconsistencies. I'd go to bat in favor of dynamic typing for writing small scripts for automating simple tasks, but I have no clue how it became the standard for everything.
It's because Python and JS became the big web development languages and both of them use dynamic typing. Though Python tries to do a sort of inferred typing system with PEP standards and now type hinting.
I think in principle, having a loosely typed language is good, but in practice no one really follows the rules well enough. It puts too much trust in the programmer to do type checking themselves.
It would be best if it was static by default, and allowed for dynamic types to exist for handling weird inputs gracefully instead of immediately throwing type errors.
Marxist-Leninist, static typing for the win! You will use Rust, and you will like it, or else...
(Segmentation faults, null pointer dereferences, data races, garbage collector latency spikes)
ML. I almost completely write in Julia so my take is going to be a bit wonky/abnormal. For the kinds of stuff I write, having the option to static is great sometimes, but it makes it vastly easier to have the ability to dynamically type. If I had to worry about types more than I do it would probably result in a 33% increase in programming time.
static rust enthusiast, probably more of an ml type but i don't advocate any specific tendency.
reminder to everyone to not get into actual sectarianism in the comments.
ML. Static typing is great but sometimes I want to be more vague especially when I'm dealing with big ass template classes. auto
comes in handy big time. C++. Although if I'm writing in C the decision is basically made for me
Ever tried Rust? It has a pretty smart type inference engine that actually gives you feedback and in many IDEs you can have it autofill its inferences. Only time it kinda borks up is with iterators which tend to have extremely long type names since there might be multiple layers of generics and specifiers. But you can do something like let res: Vec<_> = some_iterator.collect()
and it figures out what goes in the _ for you.
I haven't but Rust is definitely growing in the embedded space. I'll actually have to check it out sometime soon
It's growing everywhere
Hexbear runs on Rust, even, and I've found it pretty fun to peruse the repo and learn some things from it.
Lol, ML forged in the fires of Haskell and spreading the gospel of Rust here.
Actually writing Rust for my job now. It’s nice.
ML. Dynamic, though i do use type hints most of the time
(i mostly use gdscript)
Ancom in favor of static typing. I avoid reassigning variables at all, let alone with an object of a different type.
I'm also mostly in favor of static typing, but I think the major usecase of dynamic typing is having a broad sort of polymorphism, where you're free to think of variables just as what they can or can't do, even if they're immutable. Of course that behavior can still be implemented with statically typed languages with interfaces/traits but it's more work. It's worth noting that it is also much safer, and it helps you iron out your model's inconsistencies, where dynamic typing often hides that you're doing something that fundamentally shouldn't make sense.
Good post. Strongly prefer static typing. Red not black. I like Typescript. Unfortunately I mostly write in Solidity, which has godawful type systems (only got typedefs like a year ago), no real objects, and no polymorphic structs.