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

About rust lib #13

Open
nxdong opened this issue Dec 6, 2023 · 18 comments
Open

About rust lib #13

nxdong opened this issue Dec 6, 2023 · 18 comments
Assignees

Comments

@nxdong
Copy link

nxdong commented Dec 6, 2023

About rust lib:
I had seen Contact mario4tier on github if interested.
i wonder the progression about it.

tks a lot

@mario4tier mario4tier self-assigned this Mar 23, 2024
@mario4tier
Copy link
Member

Sorry no good news.

Unless someone shows up to lead this, it is unlikely to happen within 2024.

Personally, I should have enough experience with Rust by ~2025 (I am actively gaining experience with Rust app with another project while 2024).

@halohsu
Copy link
Contributor

halohsu commented Oct 14, 2024

@mario4tier Hello, I have extensive experience in Rust development. My idea is to wrap the TALIB library through Rust FFI. How can I contribute Rust code to talib?

@mario4tier
Copy link
Member

Sure. You are welcome to contribute with a PR.

For FFI, ideally your change would be isolated into its own directory, therefore making it easier for others to review and merge "without worrying".

As an alternative to FFI, consider that TA-Lib are fairly simple array processing functions. It would be great to tweak tool/gencode to make the source code compatible to native Rust (in same way that the existing code builds in Java, C, C++ and managed C++ after running through a C preprocessor). It is more work, but a more solid contribution that should reward you for the next 25 years 😄 If you can pull this off... you would likely become an admin for TA-Lib (can more freely merge and maintain it).

One way or another, you are OK to proceed with your FFI solution (nobody else working on this approach right now).

@mario4tier
Copy link
Member

@halohsu,

Chad (@chadfurman) is evaluating to generate native Rust. That would be ideal since it would eliminate all "C" tool dependencies for the Rust users... bringing us one step closer to generate a ta-lib-rs crate.

Feel free to join the Native Rust effort or keep going with FFI as an alternative.

@halohsu
Copy link
Contributor

halohsu commented Nov 8, 2024

Good news, hopefully we can all use secure rust code, I wrapped secure talib through ffi, which is time-consuming.

@halohsu
Copy link
Contributor

halohsu commented Nov 8, 2024

Looking forward to talib computing performance built with native rust code. I'm optimistic about the future. I use any infrastructure in the trading broker data center for free, including servers and switches. talib continues to generate revenue for me as strategy core code on low-latency trading systems and low-latency hardware (exanic and x2522). I wrapped talib with ffi just because I was worried about my ability to optimize my C project. Tongda software also has a library similar to talib, using C language development, although the performance is better than talib, but the use of a large number of macros, which leads to later optimization difficulties, I dare not adopt. For now, talib is the only choice and the right one, offering high enough performance and good code optimization. Expect execution latency and performance from talib built with native rust code.
Anyway, I wish all the best.

@mario4tier
Copy link
Member

@halohsu, Thanks for the feedback.

Will be interesting to learn how Native Rust performance will compare to Rust/FFI/C. I do not dare to predict, may eventually need you to measure 😉

** if you can share a few examples of your Rust API, it may inspire us to do the same.

@mrjbq7
Copy link

mrjbq7 commented Nov 13, 2024

It's going to be fun to see whether "rewrite it in Rust" or "rewrite it in Zig" wins this race. :-)

@mario4tier
Copy link
Member

@mrjbq7, glad to see you 😄

I recently fix gen_code and ta_regtest (now works with Linux/autoconf), and doing some refactoring to reduce the "ugliness".

@chadfurman is evaluating what needs to be done for Rust be generated in same way as done for Java.... so there is "hope" to have all the functions working at once. I estimate sometimes within 2025.

The other priority is continuous integration and scripted release (did gain some github actions experience the last ~2 years)... that should help keep all TA-Lib variants "fresher".

@chadfurman
Copy link
Collaborator

chadfurman commented Nov 13, 2024 via email

@mrjbq7
Copy link

mrjbq7 commented Nov 13, 2024 via email

@chadfurman
Copy link
Collaborator

chadfurman commented Nov 13, 2024 via email

@mrjbq7
Copy link

mrjbq7 commented Nov 13, 2024 via email

@mario4tier
Copy link
Member

@mrjbq7 Just to also confirm, the primary goal is a Rust native "Core" library.

Once we get that delivered, we can evaluate if/how it could be used as an "easier" dependency than the stumbling "C library" ( https://github.com/PyO3/maturin ? )

I do not desire stretching us into having multiple competing "high performance" python project. Instead, I feel an alternative installation procedure using only Pypi packages (with wheels) would be welcome by many... and this would ideally be done as part of the project/community you have built over the years.

@mrjbq7
Copy link

mrjbq7 commented Nov 14, 2024 via email

@mario4tier
Copy link
Member

Also, a related issue is some of the Python users apply the “small numbers” patch to their TA-Lib C library to allow doing technical analysis on crypto which sometimes has small prices.

OK, will prioritize including this as a "0.6.0" release by EOY, with updated autoconf (+github to build windows 64-bits binaries). This release will be more about learning what still works or not on various platform.

@mario4tier
Copy link
Member

@mrjbq7 Double checking that we are on the same page. The code in the TA-Lib repos already has that small numbers fix. What is missing is a new ".tar.gz" release. Correct?
image

===

On another subject, made a lot of progress on the Linux support. There is now a ta-lib-0.6.0-src.tar.gz "release candidate" in the directory "dist". Feel free to try, but do not change your installation instructions yet... (it will eventually be release as a Github binary asset).

@mrjbq7
Copy link

mrjbq7 commented Nov 17, 2024 via email

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

5 participants