Replies: 3 comments 5 replies
-
You can compile Rust code to a C like library |
Beta Was this translation helpful? Give feedback.
3 replies
-
Just so we are on the same hook there: I will not replace the Dart code with some package. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Rust is not complicated. With references to go vs rust code |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I think I should put it here (bc this forum thing is part of the org, not the lanis-mobile project)
My (tiny) problem
Always rewriting the same lanis scraping shit in every languages is kinda dumb. I want to have a fully implemented JavaScript and Python library but it's double the work. So what if we write it in one language and make interfaces for it in other languages?
Solution
We need a programming language which compiles to a C-like library but is also not hostile to the existence of the human species (Rust programmers are from some distant type 3 alien civilization) and I think Go is the way to go.
I've heard its fast to write like Python but hasn't the same bullshit as Python and it's also easy enough for intermediate programmers bc there exists also Pointers(?) (that means it's not so safe as Rust but it also has a garbage collector) so not for beginners.
Here's a link how to use Go in various languages: https://github.com/vladimirvivien/go-cshared-examples but without nice interfaces you're practically raw-dogging a C library in another language.
So you can use it theoretically in C, C++, Rust, Zig, Python, JavaScript runtimes (in WebAssembly maybe vanilla? would be funny), Java, Ruby, Kotlin, Dart, C#, PHP and more.
You could also do the same thing with Rust. It has a lot of advantages like full safety (and speed but it isn't so important here) but it's a hard language. This also shouldn't replace the Rust library (bc of full safety for other Rust projects, right? idk) and lanis-mobile "internal" library.
I'll look into that, looks interesting bc I've never done something like this. Number of people which use a lanis python/javascript library in the end? Probably not many.
Beta Was this translation helpful? Give feedback.
All reactions