Rust-like scripting language

Don't think Ruby was just Rails. The Rails framework made it popular and fashionable. But Ruby is a very nice language all by itself. It may be less popular than Python now, but for little scripting here and there, where bash is too cumbersome and where speed is not needed, I very much like it.

I have no idea what Rails is.

So many languages, so little time. It might have been a hard job to convince me to try yet another scripting language, no matter how good it was.

I had promised myself never to waste another minute of my life getting into yet another language, of any kind.

But then came Rust. The first language since ALGOL to offer genuinely new and practically useful features, what with it's emphasis on correctness and performance.

1 Like

Objective-C. The objective part of it is entirely dynamic. It's even more dynamic than the compile-time syntax and type checks suggest. The runtime doesn't care about types, and is more dynamic than Python.

3 Likes

That's a great example. I was shocked to learn that monkey-patching the Objective-C runtime is possible. And horrified to hear that one of our developers did it in a production project. :disappointed:

The expressiveness of Ruby went on to inspire so many languages, including Rust. The language itself is a little to magical for my taste, and in fact has kept me from successfully learning Ruby-derived languages like Elixir. Whatever Rust got from Ruby has been great.

1 Like

FWIW, You can use cartesian_product :

use itertools::Itertools;

fn main() {
    for (x, y) in (0..10).cartesian_product(0..5) {
        println!("{}; {}", x, y);
    }
}

Or if you use ndarray, just sum the two matrices.

1 Like

You are replying to me, I'm not sure what a need cartesian product for.

Can I use ndarray to sum the two arrays as I have shown in posts above? Note that it adds b[j][i] to a[i][j].

Something else to consider is cling—from CERN—and how it is used in some games as its scripting language & engine.

I.e., C++

So we could do the same for Rust. Maybe have some things which execute in a certain context and some default imports and uses.