Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider moving network code to Rust (?) #12

Open
ValorZard opened this issue Feb 21, 2023 · 1 comment
Open

Consider moving network code to Rust (?) #12

ValorZard opened this issue Feb 21, 2023 · 1 comment

Comments

@ValorZard
Copy link

taking a quick look through the code, and it seems as though the code is being run through a custom rollback netcode implementation written in typescript. However, wouldn't typescript be a bit slow? It feels like it would be better to use a network library written in rust, like GGRS

@kettle11
Copy link
Owner

It's a good question and something I've been thinking about as well.

Some thoughts:

  • I don't think Rust would be much faster. While the rollback code is nuanced running it likely isn't a performance bottleneck.
  • Porting to Rust would be great because it'd make it easier to make a version of Tangle that runs on web and native.
  • Some logic / state would still have to live in JavaScript to help avoid extra copies of memory.

Initially I started writing Tangle in Rust but I was finding it easier to iterate on the architecture in TypeScript. Now that I've nailed down the key architectural details it may be easier to try again in Rust.

I should definitely study GGRS, but I'm hesitant to adopt it immediately. Tangle's designed for apps as well as games which leads to different priorities. Like this open issue would be a problem for Tangle: gschup/ggrs#23.

But I suspect GGRS is doing some things better than Tangle to learn from.


Thanks for asking! It's got me thinking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants