rhaiscript / rhai

Rhai - An embedded scripting language for Rust.
https://crates.io/crates/rhai
Apache License 2.0
3.73k stars 175 forks source link

add rhai code example to readme #449

Closed gbaranski closed 2 years ago

gbaranski commented 2 years ago

Hi, I was doing some research on embeddable programming languages, and I've found rhai, but i can't find any example of how this language looks like, it'd be great to add one, gluon adds examples such as hello world or fibonacci

schungx commented 2 years ago

There is a folder examples where you'd find some standard Rust samples such as hello world. In the scripts folder you'd find standard Rhai sample scripts such as Fibonacci.

gbaranski commented 2 years ago

There is a folder examples where you'd find some standard Rust samples such as hello world. In the scripts folder you'd find standard Rhai sample scripts such as Fibonacci.

Yes, but shouldn't that be in README to make it easier for new users?

schungx commented 2 years ago

There is also... you know... and entire Book, with a link in the README...

gbaranski commented 2 years ago

There is also... you know... and entire Book, with a link in the README...

try to put yourself as a someone who makes research on which embedded programming language to use, and want's only languages that are similar to OCaml, so he can easily chose which languages look like OCaml after simply looking through README, without going into subfolders.

yes there's a link to a book, but there are also many other links which makes it harder to notice. image

schungx commented 2 years ago

Well, I would say this is quite clear...

image

But you're right. Probably a sample Rhai script as an example in the README would work well to let the user know what kind of language he's looking at...

schungx commented 2 years ago

I have added an Example section in the README, which will go live for later versions.

https://github.com/rhaiscript/rhai/tree/bug-fixes

gbaranski commented 2 years ago

Looks great, thanks