hmemcpy / milewski-ctfp-pdf

Bartosz Milewski's 'Category Theory for Programmers' unofficial PDF and LaTeX source
https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
Other
11.02k stars 597 forks source link

Use Rust as an alternative of C++? #310

Open HaoYang670 opened 1 year ago

HaoYang670 commented 1 year ago

We have had several alternative versions for Haskell, such as OCaml, Scala ... . Is it a good idea to create a Rust version as an alternative of C++?

drupol commented 1 year ago

IMHO, I would definitely say yes.

omentic commented 1 year ago

I think it would be interesting as Rust has a far more graceful type system than C++, and so the examples are bound to more closely look like Haskell. I am currently rewriting the C++ snippets in Nim as I go on my fork, for what it's worth.

However: the current design of this book is not set up to facilitate replacing the C++ examples as it is with the Haskell ones. Both Rust and Nim are imperative languages and so would indeed need to replace the imperative examples: and in addition, a fair amount of prose assumes that the imperative examples are indeed in C++. (This is also a problem with the Haskell examples: I see the Scala/OCaml/Reason versions have "solved" this by simply appending their examples under the Haskell ones.)

I think the best way to do this and what I will make a PR for Nim for (if desired and if I finish it) is to maintain separate forks of the book and link them from the main README here.