this post was submitted on 08 Jan 2025
21 points (95.7% liked)

Rust

6187 readers
28 users here now

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

Wormhole

[email protected]

Credits

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

founded 2 years ago
MODERATORS
 

cross-posted from: https://programming.dev/post/23822190

I added this language to my watch list some time ago and forgot about it, until I got a notification about a new release (0.15) yesterday.

I'm someone who is familiar with system languages (C, Rust) and shell languages (Bash, Zsh, ..). But don't have much experience, at a proficient level, with any languages setting in between.

So I gave Koto's language guide a read, and found it to be very well-written, and the premise of the language in general to be interesting. I only got annoyed near the end when I got to @base, because I'm an anti-OOP diehard πŸ˜‰

I hope this one well start to enjoy some adoption.

top 7 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 5 hours ago (1 children)

Oh, very nice. I was searching for an easy to use scripting language for a project I am making. Is it easy for beginners? I am currently using mlua, but it is a bit hacky. I liked Rhai, but it had no real LSP and no asynchronous code support. And also, does it have sandboxing?

[–] [email protected] 2 points 5 hours ago* (last edited 5 hours ago) (1 children)

For embedded languages, you won't find many features for them at all. There's Mun, which seems to be what you want. (It's more meant to be used standalone, but i think it's embeddable)

You should also check out Rune, which doesn't have an LSP, but it's embeddable, and has async support.

PS: I don't think koto has asynchronous support yet. But it seems sandboxed, yes. Can't execute unsafe code, and doesn't have unsafe libraries.

[–] [email protected] 1 points 55 minutes ago
[–] [email protected] 2 points 8 hours ago (1 children)

@BB_C it seems to be designed as a Lua killer amid they don't have C API bridge yet.

[–] [email protected] 1 points 6 hours ago

they don’t have C API bridge yet.

WDYM

cargo add libc

Done 😎

There is an example in the repository showcasing interop with Rust. But I didn't find it compelling enough for people to like. It felt a bit too complex. But maybe the complexity is inherent. I don't know.

[–] [email protected] 5 points 14 hours ago (1 children)
print 'Hello, World!'
# -> Hello, World!

square = |n| n * n
'8 squared is {square 8}'
# -> 8 squared is 64

(2, 4, 6, 8)
  .each square
  .to_list()
# -> [4, 16, 36, 64]

it might be just me, but, from the code snippet, it feels a lot like ruby

[–] [email protected] 2 points 13 hours ago

As someone who doesn't know scripting languages well, what does make the snippet you posted particularly Ruby-ish?

Reading the guide, it felt like a relatively small consistent scripting language, with some Rustic touches. But I probably missed the touches from other languages I don't know.

But then, Rust itself took inspiration from many other languages, including Ruby itself. So, maybe everyone is taking from (or mimicking if you will) everyone.

BTW, that last part can be written as*:

# from iterator import each, to_list
Β» square -> each (2,4,6,8) -> to_list
➝ [4, 16, 36, 64]

which maybe mimics some other functional or functional-influenced language(s).


* may require 0.15.1