Hacker News new | past | comments | ask | show | jobs | submit login

What magic does need to be invoked by the #[derivative] proc macro ?

For parsing Rust into an AST you just use syn, which also supports doing AST folds, and for semi-quoting you just use the quote crate.

For the symbolic differentiation part, you can use any of the hundred symbolic differentiation libraries out there to obtain '3 * x * x' from 'x * x * x'. Pretty much any machine learning framework out there supports AD and symbolic differentiation in some form, by using some libraries already. Swift people are standardizing standard practice, not discovering the americas.

If any of that looks like magic to you, then you might just be lacking the background.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: