this post was submitted on 16 Jul 2023
10 points (100.0% liked)

Rust

6117 readers
10 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
 

crosspostato da: https://lemmy.world/post/1578379

Hi, I Just started working on a Emacs-inspired text editor in Rust.

Being insipred by Emacs, the most important part Is the possibiliy to implement new components.

My ideas were:

  • Rust-based scripting language, like Rhai
  • RustPython (slower, but more compatible and lots of people know Python)
  • PyO3 (Bigger executable and not that fast)
  • Wasm/Wasi (Cross-platform, but I don't know if the compatibility with Rust's hosted functions and structs is good)
  • Other binded language, like V8, Lua or SpiderMonkey
  • Compiled plugins, like .so or .DLL (Fast, but not compatible; there should be Rust plugin frameworks for implementing this, but I don't remember the name)

The elements to analyze are: speednees (consider it's a text editor, so...), easy-to-develop and Cross-platform (if possible, not that important), but the possibility to execute functions in the host Rust program is EXTREMELY important.

Thoughts?

Thanks in Advance.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

I can recommend Lua. It is easy to learn, and easy to embed in a Rust program. With LuaJIT, it should be pretty fast, too.

Of course you can also embed a JavaScript runtime, but then your executable will probably be 50 MB larger. And I'm not a fan of Python.

[–] djtech 1 points 1 year ago

Being honest, I don't really like Lua's syntax, while I love his embeddability.

A JS runtime is way too big in my opinion.

PyO3 + Python is also big, but a little big smaller beaucse the interpreter isn't embedded.


I am currenctly experimenting with both Python and WASM.