TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Rust implementations of abstract algebraic structures

139 pointsby alex_hirnerover 5 years ago

2 comments

reikonomushaover 5 years ago
In my opinion, the best way to learn about abstract algebraic structures is to sit down with a book and write some proofs. That’s the purpose of these structures, to provide a minimal language for describing the behavior of mathematical objects for the purpose of exposition or proof. For example, prove that given any element g of a finite group G that there exists a positive integer k such that g^k is the identity element.<p>“Implementing” (with big scare quotes) algebraic structures by essentially implementing what appear to be “interfaces” (or traits or type classes or ...) might give you a brief “aha!” about what an abstract algebraic structure is on the surface, but won’t give much insight or practical use beyond that. Critically, one of the many hugely lacking aspects in this approach to implementing these structures in a language like Rust (or Haskell or ...) is that one needs to prove that these interfaces satisfy the axiomatic laws of the structure.<p>I maintain a library that allows one to compute with groups of permutations. The entire library—thousands of lines of fiddly code—is dedicated to one and only one algebraic structure (the group) on one and only one kind of object (the permutation). Countless papers have been written about just this combination, and should give you some appreciation for the depth of this subject. Slapping on a “identity” and “mul” implementation to a “Permutation” object doesn’t do justice.
评论 #21732123 未加载
评论 #21764594 未加载
评论 #21732594 未加载
评论 #21738598 未加载
rklaehnover 5 years ago
Looks very nice and straightforward. Otherwise, seems similar to alga: <a href="https:&#x2F;&#x2F;docs.rs&#x2F;alga&#x2F;0.9.2&#x2F;alga&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.rs&#x2F;alga&#x2F;0.9.2&#x2F;alga&#x2F;</a>