3 ms·
> the new for will work on any higher-order function with the appropriate signature In the end this makes Rust loops look like Ruby loops. May I restate that «
by gioele 15y ago
> the new for will work on any higher-order function with the appropriate signature
In the end this makes Rust loops look like Ruby loops. May I restate that «widely used programming languages are modified until they resemble Ruby» (https://news.ycombinator.com/item?id=3448277 https://news.ycombinator.com/item?id=3448277) or CLispScript (https://news.ycombinator.com/item?id=3448826 https://news.ycombinator.com/item?id=3448826).
What I do not understand of the late "scripting" languages (Dart, Rust) is why they don't just modify Ruby to have a stricter type system and call it done? That or just abandon the scripting mindset and go for more purely functional languages with non-C-like syntaxes like Haskell or OCaml.
- andolanra 15y agoRust is emphatically not a scripting language. It is a systems language with many features drawn from functional languages (e.g. tagged unions for data types, pattern matching, a type class system, type inference) as well as a strong type system with the addition of type states, which are assertions tracked by the compiler. Yes, its syntax is C-like, but I'd assert that it has more in common with OCaml than Dart. With that in mind, the suggestion that it'd be more worthwhile to strap static types onto Ruby is like looking at engineers designing an aerodynamic, fuel-efficient, high-speed dragster and suggesting they stick a bigger engine in a sedan and call it done. Yes, Rust has adopted a feature superficially similar to Ruby's; that does not mean it wishes to fill the same niche or that Ruby's goals align with Rust's in any significant way.
- riffraff 15y agoI didn't downvote you but I guess you are getting some hate for considering rust a scripting language, since it has none of the features traditionally associated with such languages (simple vm or interpreter, dynamic typing, no compile step). I think you may be confusing it with something else.