TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Rust implementations of abstract algebraic structures

139 点作者 alex_hirner超过 5 年前

2 条评论

reikonomusha超过 5 年前
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 未加载
rklaehn超过 5 年前
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>