this post was submitted on 22 Sep 2026
24 points (100.0% liked)

Rust

8294 readers
54 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] somegeek@programming.dev -1 points 2 days ago

This greatly depends on language design and implementation.

For example, Clojure has all of these and much more, and it's still much simpler and hassle free than rust. The functions are just functions, but the forms and lists that are very powerful.

functions are just

(defn foo [a b] (print "do thing"))

(foo 1 2)

With the power of destructuring that maps provide us, we can have named arguments:

(defn foo [a & {:keys [b c]}] (print a b c))

(foo 1 {:b 2, :c 3})

and for multi-arity functions, there's no special syntax. It's still just plain functions and forms

(def foo
  ([a] (print "I only have one" a)
  ([a b] (print "I have two" a b)))

It also has more advanced ways of polymorphysm with methods and protocols.

It depends on the design of the language.