Today we are learning how to call Rust code from Python! code: github.com/letsgetrusty/word_... #rust #programming #tutorial
Жүктеу.....
Пікірлер: 109
@letsgetrusty2 жыл бұрын
📝Get your *FREE Rust cheat sheet* : www.letsgetrusty.com/cheatsheet
@pdblouin2 жыл бұрын
I followed a web guide to use Rust code from within a Python Dash web app. It blows my mind how many different ways there are to do things in programming. Makes it very difficult to learn.
@ZZDryno
2 жыл бұрын
Can you share link?
@johanngambolputty5351
Жыл бұрын
Well it's modular, you learn the bits you need now - now and the bit you need tomorrow - tomorrow... you don't necessarily need to do it all at once
@mysterry2000
Жыл бұрын
Imo it makes it easier to learn since you have an abundance of choices and can choose which one resonates with you the most
@DmitryRomanov
Жыл бұрын
Just breathe and focus on getting the product (and the next obvious step) done. You will figure it out. Discuss it with somebody from time to time. You will find mentor, and it will work out. Do not forget to focus on the goal of your code, and push for getting the result - the code doing the stuff you want - done. Keep the log, write stuff you learn along the way in a form which will help you to reproduce again it if you get lost. And good luck to you in your journey!
@CJCJCJCJ
Жыл бұрын
Difficult? Or just more time consuming. Learning assembly is difficult. Having multiple ways of doing one thing is just called having options.
@utsavbasu25012 жыл бұрын
I am slowly moving over to Rust from C++ since I have come to despise the package management in it. Cargo provides easy-to-use package management, which I love dearly. Now I can focus more on the actual logic than worrying about how to link up my whole code. However, sometimes I wish to access Rust's robustness and 'easy-to-use'-ness through C/C++. So, please, it'll be beneficial if you make a video on how to call Rust from C/C++ and vice versa. PS: I really love your videos. If possible, I would love to get in touch with you to discuss Rust's future prospects and how to improve myself in this language.
@stevenhe3462
2 жыл бұрын
I guess Mozilla has some of the best instructions in their Firefox contribution guides.
@jabuci Жыл бұрын
Important detail: `maturin develop` creates a slow, unoptimized build. Use `maturin develop --release` for fast execution.
@MrMediator242 жыл бұрын
Wow, timing is perfect, just finishing my diploma where I use PyTorch in Rust
@hariangr
2 жыл бұрын
didn't know you can use pytorch on rust, thx u
@MrMediator24
2 жыл бұрын
@@hariangr there's crate tch-rs. Works just like libtorch (since it just bindings for it)
@TRLYx2 жыл бұрын
Love the channel, Bogdan! I kind of just stopped learning Rust until I came across your channel and you’ve reinvigorated my interest. I appreciate your work, my dude!!
@JoshPeak Жыл бұрын
This is such an amazingly concise quick start. Did not realise Maturin existed to bridge the tooling between languages so well. Thank you! 🙏🏻
@jakobdunnebeil90632 жыл бұрын
More guides on how to integrate Rust into other languages like Dart/Flutter would be great!
@WouterStudioHD
2 жыл бұрын
Take a look at flutter_rust_bridge. It’s pretty doable.
@jakobdunnebeil9063
2 жыл бұрын
@@WouterStudioHD Thank you mate
@jesusmtz29 Жыл бұрын
That looks seamless and reasonable. Great demo
@dazealex2 жыл бұрын
Really good content. Short and concise!
@Ryan-xq3kl2 жыл бұрын
Your content has helped me learn rust tremendously well
@mutley11 Жыл бұрын
Wow, I'm constantly diappointed you don't have a merch store or such, because I'm always binge-watching your wonderful content. I would love to see Rust integrated with Lua, as Lua is a wonderful language designed to be embedded into lower-level software environment like C/C++.
@ndil-adjimsoungadoy1245 Жыл бұрын
I love the channel and its definitely helping me fall in love with the language! Could you do a similar video to call rust from Node?
@ThanhHoQuangCSE Жыл бұрын
Great content, some how we need another version too: "Calling Python from Rust"
@mkvalor2 жыл бұрын
Really great content. As I recall, other similar cross language integrations often lose a good bit of performance when jumping between the hidden glue code that allows them to be used together (such as Java with C++). Best practice is to make course-grained functions in the lower-level language (such as rust in this case). This way you do not waste too much time going back and forth across languages before calling the more important function which will do the bulk of the work.
@Ned4782 жыл бұрын
wow, I was looking at tutorials for this a few days ago and couldnt find a great one. Thanks bogdan !
@paulzupan3732 Жыл бұрын
This is quite possibly the coolest thing I’ve ever seen
@EngineerNick Жыл бұрын
This was awesome thankyou :) I'd love more videos integrating with python please! PyO3's type mechanisms for guarding the GIL are unbelievably difficult to understand for more complex tasks... it uses `std::marker::PhantomData` which melted my brain a bit... I gave up trying to understand it.
@JOHNSMITH-ve3rq Жыл бұрын
This but a real life example where we can drop in rust for some kind of expensive function in prod and get some massive juicy speed up
@sig00017 ай бұрын
concise and to the point
@gendrik7542 жыл бұрын
I've already done so from Java and Kotlin. It was even faster than calling normal c or c++ via JNI.
@danielsan9019982 жыл бұрын
an example of using Python from Rust would also be interesting.
@giannialbertoagudeloarbela95232 жыл бұрын
Great video!! Could you please talk about performance or any case that makes it necessary? Thanks!!!
@jongeduard5 ай бұрын
The fact that Rust can build a C compatible shared library, which is what Rust calls a cdylib, is really important. This feature combined with FFI exports enables support not just for C and C++, but for a whole series of other programming languages too. And although I am still quite new to the Rust itself, this realization has already triggered me to explore several things. In this way I know that for Java there is really good JNI crate, and which is also really straightforward to use due to the abstractions in this crate. And if you have ever used JNI in C with the regular header files, and know how much of a serious pain that is to use, then it's actually really great what the authors of the crate have done. But since I am mostly a C# dotnet developer while not being scared to make make hands dirty on low level stuff, I also know how to use libraries with PInvoke, while taking care to use the Cdecl calling convention, mapping correct data type sizes and things like that.
@benshapiro973111 ай бұрын
My brother, u need some sleep. I understand the grind, but remember to get some rest as well!! Great video, going to use some ideas from this video in the project which I’m hoping to leverage into a job, so thank you for this
@wihlarkop2 жыл бұрын
thank you for making this video
@murugarajuperumalla55082 жыл бұрын
Waiting for this
@guanguolin92492 жыл бұрын
I recently tried to use cgo to call rust in the go language, and it worked
@JarradAB15 ай бұрын
Awesome!!!!
@_diversable_ Жыл бұрын
For a similar domain (data science & ML) but different language, check out Rust, Julia, and the Jlrs crate ! Two new languages, when used together, are insanely easy to prototype & develop with ❤
@kuma9239 Жыл бұрын
That is some beautiful tooling. I'm never using c extensions again!
@teagancollyer2 жыл бұрын
Is there any difference between using `pyo3` and `rust-cython` when doing `maturn init`? From what I've understood of pyo3 its using rust-cython anyway. Is one of them more efficient or something.
@after_alec2 жыл бұрын
Do Elixir NIFs next!
@cerulity32k Жыл бұрын
me, using (or trying to use) CUDA, Rust, and Python all for the same project:
@KostiantynSalnykov5 ай бұрын
Nice video 👍 Could you do some examples with WebAssembly development?
@SB-qm5wg Жыл бұрын
How are you getting all that popup info, auto-complete, and syntax checking in VS code?
@jonathanbroadbent1587 Жыл бұрын
I have two programs (one in rust and one in python) that I want to package together for a single functionality. Is it generally better to call python from Rust or Rust from python?
@ashutoshgarg91262 жыл бұрын
Please do Javascript and rust
@DJenriqez
2 жыл бұрын
and tauri,.... :D
@GlobalYoung72 жыл бұрын
thank you
@recsysml Жыл бұрын
Bogdan, what shell do you use? I love the auto complete in it!
@recsysml
Жыл бұрын
Also what is the VSCode extension that helps show these types in Rust. Like in minute 7:41 Bogdan writes 0 and it shows "default: 0"
@aaskxaz45362 жыл бұрын
As a beginner, just trying to watch some Rust: kind of hard to follow when you type and whole screen (because it is zoomed) blinks with completion hints (when you start to write a function and entire docstring pops up).
@konstantinta28032 жыл бұрын
C# and Rust integration
@thebutlah
2 жыл бұрын
Good luck - You have to use pinvoke and write C bindings, which kinda sucks
@konstantinta2803
2 жыл бұрын
@@thebutlah yes, I'm aware of the way using Rust from C#. What about using C# from Rust?
@CuriousSpy2 жыл бұрын
i want to create nodejs package for my work project in rust. Could you please show your vision on how to do it?
@vasylpavuk391 Жыл бұрын
awsome
@lord127902 жыл бұрын
How about nodejs and rust?
@jasonlantz38082 жыл бұрын
sweet.... javascript next...
@alextrotta7962 жыл бұрын
I'd like to see you checkout CXX, for interop between Rust and C++.
@yashinshekh802 Жыл бұрын
now rust and python will take over the world 😅 great video.
@uwuzote2 жыл бұрын
Wow, that's such awesome ability to use Rust in Python, great! It also would be cool to dive into gamedev in Rust. (sorry for bad english)
@PouriyaJamshidi Жыл бұрын
Does calling code like this improve the performance or we're still limited by GIL? For instance, can we benefit from Rust's concurrency and all the other good stuff similar to what Numpy and PyTorch are doing or Python's interpreter gets in the way?
@pokemanic101
Жыл бұрын
Since we are calling outside of Python, I don't see why you wouldn't be able to release the GIL
@PouriyaJamshidi
Жыл бұрын
@@pokemanic101 I think we’re still depending on Python’s interpreter. But I might be wrong.
@KamyarMohajerani2 жыл бұрын
@ 6:31: shouldn’t it be `.or_insert(0)` instead of 1, as it’s incremented at the first occurrence as well?
@KamyarMohajerani
2 жыл бұрын
Never mind I hadn’t watched the whole video lol Thanks for the great work BTW! Your videos are really good.
@Redditard
Жыл бұрын
@@KamyarMohajerani it happens
@xavhow Жыл бұрын
noob here. just wondering which approach is better? 1. python calling rust via pyo binding 2. python calling rust via wasm(wasi)
@sigstackfault9 ай бұрын
could you do LUA?
@scritch9549 Жыл бұрын
This is pretty cool. Does that mean I can control python only APIs by calling python scripts though Rust?
@roussafiomar57412 жыл бұрын
please can you make tuto about do yeet
@jesusmtz29 Жыл бұрын
I can't help see when you call `maturin develop` there's a mention of CPython. What is actually happening? Is maturin converting rust code to C code or is it running truly as rust code?
@Alche_mist
Жыл бұрын
I'm not sure if it's what you want to know, but CPython is the standard interpreter for Python (which itself is written in C). So I'd expect maturin to just hook into CPython (the interpreter) with some commands like "if you notice functions exposed from the Rust package being called, call them in the compiled Rust crate here".
@empyrean-music2 жыл бұрын
I vote for Javascript as next
@praenubilus1980 Жыл бұрын
I want to see the way rust is comile to wasm and them being interoperated by other language. that will apply to more scenarios
@samuelfischer3764 Жыл бұрын
please do c from rust
@stevenhe34622 жыл бұрын
Writing Python modules in Rust is dead easy. Searched on Ruby modules and it is much more complicated.
@JulianBolivarGaleno742 жыл бұрын
Realy excelent video, but how about call C++ libraries on Rust, because are a lot of ML implementations but they are on C++.
@coolbrotherf127 Жыл бұрын
You probably sound like you're talking in another language to anyone who isn't super familiar with these technical terms.
@CT-cx8yi2 жыл бұрын
Rust and RISC-V Assembly Rust and C Rust and Nim Rust and Haskell
@hackermann992 жыл бұрын
I'd like to see Rust code integration in C#
@dmitriidemenev5258
2 жыл бұрын
Добавил в друзья в ВК.
@white5493 Жыл бұрын
it doesn't work without pyenv :(
Жыл бұрын
Replace your Python code with Rust.
@nothingisreal6345 Жыл бұрын
To bad you have to specifically wrap the Rust code. That limits the possible use. It would be better if Python could simply use Rust object code.
@nebularzz4 ай бұрын
why does the facecam kinda look ai generated
@prashantm98564 ай бұрын
Use neovim instead vs code If you are a cool dev❤❤❤
@QmVuamFtaW42 жыл бұрын
why.
@tedp9146
2 жыл бұрын
This is basically how every big Python library works. Python is slow and therefore libraries like numpy have to be written in another language but still have to be provided to Python. It’s basically C/C++ code hidden behind a Python interface. This is the same just with Rust.
@l4fourier75
Жыл бұрын
@@tedp9146 But Rust is for its high level really fast
@Alche_mist
Жыл бұрын
@@l4fourier75 Which is why this makes sense - you want something fast (i.e. Rust, C, C++ or in some cases even Fortran) to do the backend work while you call those fast functions from Python, where it is easy to write (but slow to execute in pure Python - luckily, the fast and easier to optimize language does the hard work on the execution) and thus exploit their power.
@coldsir54062 жыл бұрын
No, please no, I had started to learn rust just because I didn't want to learn python
@l4fourier75
Жыл бұрын
Oh.. is Rust your first programming lang?
@coldsir5406
Жыл бұрын
@@l4fourier75 the second one, I've started with JavaScript when I was 14 yo
@l4fourier75
Жыл бұрын
@@coldsir5406 Cool, i´ve been programming python for four years and think of Python as a simple, easy-to-use language, why are u so afraid? Of course, you don´t want to do anything with Python but for simple backend jobs its the best coice
@coldsir5406
Жыл бұрын
@@l4fourier75 Yes, definitely python is really easy to learn and use but all of us have that mania of trying very hard things and languages and experimenting with it, personally I want to invest my time in something harder to learn but in long run to have performance, that's why I chose Rust. Tbh I chose between python and rust :D. My next language will be go or python.
@l4fourier75
Жыл бұрын
@@coldsir5406 That depends on your purposes, e. g. try to design an explorer with CLI in python so that you are able to do any stuff requiring the explorer can be done by your terminal in a easy way, including a module and project template - that is not easy even if u use Python. But i know what you mean, good luck for u, i would recommend you "The Morpheus Tutorials", who really makes the best python tutorials, but he speaks german.
@kamurashev Жыл бұрын
Why spoil something so great as rust with something so ugly as python.
@gustavojoaquin_arch Жыл бұрын
Zzzzzz Python is dead
@azgan1232 жыл бұрын
if you're going to interop rust with anything why not interop with language thats not an interpreted pile of junk? XD
@shipudentavo
2 жыл бұрын
Because python is one of the most used for things like DataScience and ML.
@azgan123
2 жыл бұрын
@@shipudentavo Its time high time python becomes the least used thing for everything.
@gendrik754
2 жыл бұрын
what about rust interop in some good ol' aot native binaries for graalvm? could increase overall cloud performance
@kevinmcfarlane2752
Жыл бұрын
@@azgan123 That's an ignorant comment. Python has become popular for fields such a ML and Data Science because of the exploratory and iterative nature of those fields. Programming languages are tools. You use appropriate tools for the domain you wish you want to tackle.
@julians.2597
Жыл бұрын
because very unfortunately for data science we're stuck with python for at least the next 5 years, 😪, so I'll do what every responsible programmer this far has done and write as much of the code in a better language and just the glue code in python.
Пікірлер: 109
📝Get your *FREE Rust cheat sheet* : www.letsgetrusty.com/cheatsheet
I followed a web guide to use Rust code from within a Python Dash web app. It blows my mind how many different ways there are to do things in programming. Makes it very difficult to learn.
@ZZDryno
2 жыл бұрын
Can you share link?
@johanngambolputty5351
Жыл бұрын
Well it's modular, you learn the bits you need now - now and the bit you need tomorrow - tomorrow... you don't necessarily need to do it all at once
@mysterry2000
Жыл бұрын
Imo it makes it easier to learn since you have an abundance of choices and can choose which one resonates with you the most
@DmitryRomanov
Жыл бұрын
Just breathe and focus on getting the product (and the next obvious step) done. You will figure it out. Discuss it with somebody from time to time. You will find mentor, and it will work out. Do not forget to focus on the goal of your code, and push for getting the result - the code doing the stuff you want - done. Keep the log, write stuff you learn along the way in a form which will help you to reproduce again it if you get lost. And good luck to you in your journey!
@CJCJCJCJ
Жыл бұрын
Difficult? Or just more time consuming. Learning assembly is difficult. Having multiple ways of doing one thing is just called having options.
I am slowly moving over to Rust from C++ since I have come to despise the package management in it. Cargo provides easy-to-use package management, which I love dearly. Now I can focus more on the actual logic than worrying about how to link up my whole code. However, sometimes I wish to access Rust's robustness and 'easy-to-use'-ness through C/C++. So, please, it'll be beneficial if you make a video on how to call Rust from C/C++ and vice versa. PS: I really love your videos. If possible, I would love to get in touch with you to discuss Rust's future prospects and how to improve myself in this language.
@stevenhe3462
2 жыл бұрын
I guess Mozilla has some of the best instructions in their Firefox contribution guides.
Important detail: `maturin develop` creates a slow, unoptimized build. Use `maturin develop --release` for fast execution.
Wow, timing is perfect, just finishing my diploma where I use PyTorch in Rust
@hariangr
2 жыл бұрын
didn't know you can use pytorch on rust, thx u
@MrMediator24
2 жыл бұрын
@@hariangr there's crate tch-rs. Works just like libtorch (since it just bindings for it)
Love the channel, Bogdan! I kind of just stopped learning Rust until I came across your channel and you’ve reinvigorated my interest. I appreciate your work, my dude!!
This is such an amazingly concise quick start. Did not realise Maturin existed to bridge the tooling between languages so well. Thank you! 🙏🏻
More guides on how to integrate Rust into other languages like Dart/Flutter would be great!
@WouterStudioHD
2 жыл бұрын
Take a look at flutter_rust_bridge. It’s pretty doable.
@jakobdunnebeil9063
2 жыл бұрын
@@WouterStudioHD Thank you mate
That looks seamless and reasonable. Great demo
Really good content. Short and concise!
Your content has helped me learn rust tremendously well
Wow, I'm constantly diappointed you don't have a merch store or such, because I'm always binge-watching your wonderful content. I would love to see Rust integrated with Lua, as Lua is a wonderful language designed to be embedded into lower-level software environment like C/C++.
I love the channel and its definitely helping me fall in love with the language! Could you do a similar video to call rust from Node?
Great content, some how we need another version too: "Calling Python from Rust"
Really great content. As I recall, other similar cross language integrations often lose a good bit of performance when jumping between the hidden glue code that allows them to be used together (such as Java with C++). Best practice is to make course-grained functions in the lower-level language (such as rust in this case). This way you do not waste too much time going back and forth across languages before calling the more important function which will do the bulk of the work.
wow, I was looking at tutorials for this a few days ago and couldnt find a great one. Thanks bogdan !
This is quite possibly the coolest thing I’ve ever seen
This was awesome thankyou :) I'd love more videos integrating with python please! PyO3's type mechanisms for guarding the GIL are unbelievably difficult to understand for more complex tasks... it uses `std::marker::PhantomData` which melted my brain a bit... I gave up trying to understand it.
This but a real life example where we can drop in rust for some kind of expensive function in prod and get some massive juicy speed up
concise and to the point
I've already done so from Java and Kotlin. It was even faster than calling normal c or c++ via JNI.
an example of using Python from Rust would also be interesting.
Great video!! Could you please talk about performance or any case that makes it necessary? Thanks!!!
The fact that Rust can build a C compatible shared library, which is what Rust calls a cdylib, is really important. This feature combined with FFI exports enables support not just for C and C++, but for a whole series of other programming languages too. And although I am still quite new to the Rust itself, this realization has already triggered me to explore several things. In this way I know that for Java there is really good JNI crate, and which is also really straightforward to use due to the abstractions in this crate. And if you have ever used JNI in C with the regular header files, and know how much of a serious pain that is to use, then it's actually really great what the authors of the crate have done. But since I am mostly a C# dotnet developer while not being scared to make make hands dirty on low level stuff, I also know how to use libraries with PInvoke, while taking care to use the Cdecl calling convention, mapping correct data type sizes and things like that.
My brother, u need some sleep. I understand the grind, but remember to get some rest as well!! Great video, going to use some ideas from this video in the project which I’m hoping to leverage into a job, so thank you for this
thank you for making this video
Waiting for this
I recently tried to use cgo to call rust in the go language, and it worked
Awesome!!!!
For a similar domain (data science & ML) but different language, check out Rust, Julia, and the Jlrs crate ! Two new languages, when used together, are insanely easy to prototype & develop with ❤
That is some beautiful tooling. I'm never using c extensions again!
Is there any difference between using `pyo3` and `rust-cython` when doing `maturn init`? From what I've understood of pyo3 its using rust-cython anyway. Is one of them more efficient or something.
Do Elixir NIFs next!
me, using (or trying to use) CUDA, Rust, and Python all for the same project:
Nice video 👍 Could you do some examples with WebAssembly development?
How are you getting all that popup info, auto-complete, and syntax checking in VS code?
I have two programs (one in rust and one in python) that I want to package together for a single functionality. Is it generally better to call python from Rust or Rust from python?
Please do Javascript and rust
@DJenriqez
2 жыл бұрын
and tauri,.... :D
thank you
Bogdan, what shell do you use? I love the auto complete in it!
@recsysml
Жыл бұрын
Also what is the VSCode extension that helps show these types in Rust. Like in minute 7:41 Bogdan writes 0 and it shows "default: 0"
As a beginner, just trying to watch some Rust: kind of hard to follow when you type and whole screen (because it is zoomed) blinks with completion hints (when you start to write a function and entire docstring pops up).
C# and Rust integration
@thebutlah
2 жыл бұрын
Good luck - You have to use pinvoke and write C bindings, which kinda sucks
@konstantinta2803
2 жыл бұрын
@@thebutlah yes, I'm aware of the way using Rust from C#. What about using C# from Rust?
i want to create nodejs package for my work project in rust. Could you please show your vision on how to do it?
awsome
How about nodejs and rust?
sweet.... javascript next...
I'd like to see you checkout CXX, for interop between Rust and C++.
now rust and python will take over the world 😅 great video.
Wow, that's such awesome ability to use Rust in Python, great! It also would be cool to dive into gamedev in Rust. (sorry for bad english)
Does calling code like this improve the performance or we're still limited by GIL? For instance, can we benefit from Rust's concurrency and all the other good stuff similar to what Numpy and PyTorch are doing or Python's interpreter gets in the way?
@pokemanic101
Жыл бұрын
Since we are calling outside of Python, I don't see why you wouldn't be able to release the GIL
@PouriyaJamshidi
Жыл бұрын
@@pokemanic101 I think we’re still depending on Python’s interpreter. But I might be wrong.
@ 6:31: shouldn’t it be `.or_insert(0)` instead of 1, as it’s incremented at the first occurrence as well?
@KamyarMohajerani
2 жыл бұрын
Never mind I hadn’t watched the whole video lol Thanks for the great work BTW! Your videos are really good.
@Redditard
Жыл бұрын
@@KamyarMohajerani it happens
noob here. just wondering which approach is better? 1. python calling rust via pyo binding 2. python calling rust via wasm(wasi)
could you do LUA?
This is pretty cool. Does that mean I can control python only APIs by calling python scripts though Rust?
please can you make tuto about do yeet
I can't help see when you call `maturin develop` there's a mention of CPython. What is actually happening? Is maturin converting rust code to C code or is it running truly as rust code?
@Alche_mist
Жыл бұрын
I'm not sure if it's what you want to know, but CPython is the standard interpreter for Python (which itself is written in C). So I'd expect maturin to just hook into CPython (the interpreter) with some commands like "if you notice functions exposed from the Rust package being called, call them in the compiled Rust crate here".
I vote for Javascript as next
I want to see the way rust is comile to wasm and them being interoperated by other language. that will apply to more scenarios
please do c from rust
Writing Python modules in Rust is dead easy. Searched on Ruby modules and it is much more complicated.
Realy excelent video, but how about call C++ libraries on Rust, because are a lot of ML implementations but they are on C++.
You probably sound like you're talking in another language to anyone who isn't super familiar with these technical terms.
Rust and RISC-V Assembly Rust and C Rust and Nim Rust and Haskell
I'd like to see Rust code integration in C#
@dmitriidemenev5258
2 жыл бұрын
Добавил в друзья в ВК.
it doesn't work without pyenv :(
Replace your Python code with Rust.
To bad you have to specifically wrap the Rust code. That limits the possible use. It would be better if Python could simply use Rust object code.
why does the facecam kinda look ai generated
Use neovim instead vs code If you are a cool dev❤❤❤
why.
@tedp9146
2 жыл бұрын
This is basically how every big Python library works. Python is slow and therefore libraries like numpy have to be written in another language but still have to be provided to Python. It’s basically C/C++ code hidden behind a Python interface. This is the same just with Rust.
@l4fourier75
Жыл бұрын
@@tedp9146 But Rust is for its high level really fast
@Alche_mist
Жыл бұрын
@@l4fourier75 Which is why this makes sense - you want something fast (i.e. Rust, C, C++ or in some cases even Fortran) to do the backend work while you call those fast functions from Python, where it is easy to write (but slow to execute in pure Python - luckily, the fast and easier to optimize language does the hard work on the execution) and thus exploit their power.
No, please no, I had started to learn rust just because I didn't want to learn python
@l4fourier75
Жыл бұрын
Oh.. is Rust your first programming lang?
@coldsir5406
Жыл бұрын
@@l4fourier75 the second one, I've started with JavaScript when I was 14 yo
@l4fourier75
Жыл бұрын
@@coldsir5406 Cool, i´ve been programming python for four years and think of Python as a simple, easy-to-use language, why are u so afraid? Of course, you don´t want to do anything with Python but for simple backend jobs its the best coice
@coldsir5406
Жыл бұрын
@@l4fourier75 Yes, definitely python is really easy to learn and use but all of us have that mania of trying very hard things and languages and experimenting with it, personally I want to invest my time in something harder to learn but in long run to have performance, that's why I chose Rust. Tbh I chose between python and rust :D. My next language will be go or python.
@l4fourier75
Жыл бұрын
@@coldsir5406 That depends on your purposes, e. g. try to design an explorer with CLI in python so that you are able to do any stuff requiring the explorer can be done by your terminal in a easy way, including a module and project template - that is not easy even if u use Python. But i know what you mean, good luck for u, i would recommend you "The Morpheus Tutorials", who really makes the best python tutorials, but he speaks german.
Why spoil something so great as rust with something so ugly as python.
Zzzzzz Python is dead
if you're going to interop rust with anything why not interop with language thats not an interpreted pile of junk? XD
@shipudentavo
2 жыл бұрын
Because python is one of the most used for things like DataScience and ML.
@azgan123
2 жыл бұрын
@@shipudentavo Its time high time python becomes the least used thing for everything.
@gendrik754
2 жыл бұрын
what about rust interop in some good ol' aot native binaries for graalvm? could increase overall cloud performance
@kevinmcfarlane2752
Жыл бұрын
@@azgan123 That's an ignorant comment. Python has become popular for fields such a ML and Data Science because of the exploratory and iterative nature of those fields. Programming languages are tools. You use appropriate tools for the domain you wish you want to tackle.
@julians.2597
Жыл бұрын
because very unfortunately for data science we're stuck with python for at least the next 5 years, 😪, so I'll do what every responsible programmer this far has done and write as much of the code in a better language and just the glue code in python.