frunk
sicmutils
frunk | sicmutils | |
---|---|---|
7 | 13 | |
1,199 | 750 | |
- | 0.0% | |
5.9 | 0.0 | |
3 months ago | about 1 year ago | |
Rust | Clojure | |
MIT License | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
frunk
-
Apply generic function to every tuple element
So rust doesn't support variadics, but I have heard some murmurings around the topic. In the meantime, you can still do a lot with recursive tras. The frunk crate makes working with them a lot easier: In this case
-
Self Referencing structs with different generic types
I think the closest possible approach is the one used in frunk where those consecutive types are nested recursively (creating a linked list on type level basically) and special type is used as the end.
-
Is there a convenient way to convert a struct<T> (where all fields are of type T) into struct<U> where U: From<T>?
I suggest looking into frunk. You could convert the struct into an HList, map over the values to convert and convert into the target struct. README has some relevant examples.
-
Can we make useful streaming APIs that disallow deadlocks?
So a while back I got interested in how rust could provide parallel/concurrent APIs that prevent deadlocking shared state. I now created a Proof-of-Concept stream processing library that attempts to do that. The library makes prodigious use of heterogeneous lists from the frunk library. The basic idea is that you can build a graph by combining source streams as source nodes and mutexes for state, then you can add nodes which subscribe to subsets of the previous nodes using various combinators. You can either
-
constduck: compile-time duck typing and reflection powered by const generics
Hey, #[derive(LabelledGeneric)] from frunk does something like this, but without const generics, so it has odd representations for things like type-level strings (it's represented as a tuple of chars so (a, b, c) is the type-level representation of the string "abc")
-
Symbolics.jl: A Modern Computer Algebra System for a Modern Language
I don't understand why you call it "trickery or "fake". Church encoding of natural numbers is the same technique used in Agda, Coq and Idris to represent the Peano numbers. It's a completely valid encoding and isomorphic to any other representation.
You don't need to use a fixed-length array either - you can used a recursive linked list at the type-level for an unbounded encoding [1]. The Scala library is an example of that; the Github page even has an example of encoding arbitrary units like sheep and wheat.
[1] https://github.com/lloydmeta/frunk
-
Generic associated types encode higher-order functions on types
I wonder if frunk can (ab)use this kind of trick to make their crate even more powerful. IIRC they have a bunch of amazing and horrible workarounds to work with type-level lists.
sicmutils
- Sicmutils: Computer Algebra, Physics and Differential Geometry in Clojure
-
mentat-collective/emmy: The Emmy Computer Algebra System.
They seem to be in the middle of transitioning from the old repo.
-
Ask HN: What Is the SICP of Physics?
There are some good resources here including some nicely formatted HTML versions of the book: https://github.com/sicmutils/sicmutils/wiki/SICM-and-FDG-Lea...
^ The Github repo contains a Clojure version of the Scheme library used by the book.
-
Space Math
If you want to try this out, give the sicmutils Computer Algebra System a go (I’m the maintainer). Repo lives here: https://github.com/sicmutils/sicmutils
The library works in the browser as well, so interactive TeX rendering from Clojure symbolic expressions and functions is available at the quickstart page here: https://nextjournal.com/try/samritchie/sicmutils
-
Math notation library for CojureScript
I am the maintainer of the "sicmutils" computer algebra system in Clojure, and I think that you'll find it very nice for your project: https://github.com/sicmutils/sicmutils
-
A, perhaps, naive question on (Common) Lisp
https://github.com/sicmutils/sicmutils is a really interesting development in the direction(s) you stated in b. Since terms can be rendered in various ways (latex, js, etc.), they can be embedded in documents, web pages, etc. You can go from symbolic expressions to animated dynamic systems with relevant formulae.
-
Literate programming is much more than just commenting code
- multiple stories about the same piece of code, but all with the ability to IMPORT the story as a library
I've been writing sicmutils[0] as a "literate library"; see the automatic differentiation implementation as an example[1].
A talk I gave yesterday at ELS demos a much more powerful host that uses Nextjournal's Clerk to power physics animations, TeX rendering etc, but all derived from a piece of Clojure source that you can pull in as a library, ignoring all of these presentation effects.
Code should perform itself, and it would be great if when people thought "LP" they imagined the full range of media through which that performance could happen.
[0] sicmutils: https://github.com/sicmutils/sicmutils
[1] autodiff namespace: https://github.com/sicmutils/sicmutils/blob/main/src/sicmuti...
[2] Talk code: https://github.com/sritchie/programming-2022
[3] Clerk: https://github.com/nextjournal/clerk
-
Physics in Clojure: Elliptical Paths
Hey, so fun to see this here! These demos feature work from https://github.com/sicmutils/sicmutils and the newly maintained-by-me Mathbox library.
I’m around and happy to answer any questions about the library, future plans, etc.
-
Neural network capable of solving university-level Mathematics problems at scale
Give my SICMUtils computer algebra system a look as well, if you like Lisp / Clojure: https://github.com/sicmutils/sicmutils
Works on the web too, which is a big boost for sharing work.
-
MIT Scheme on Apple Silicon
It is good enough! Almost all code forms from the book live in the tests (see the FDG directory[0], for example), and there are a few nice environments like Nextjournal[1] where everything from the books works in the browser.
The Clojure port is quite fast, faster than the original for all benchmarks GJS has sent me, and more fleshed out. (That will change, as I've been pushing bugfixes and performance improvements back upstream as I go, as a meager gift to GJS for making this huge, amazing library in the first place.)
I actually wrote to GJS this morning asking for instructions on how to compile the original "scmutils", since I have the same problem. He responded saying he'll get back to me this afternoon, so I'll post here once I have details.
If you are still interested in getting the books going with MIT-Scheme, I put a decent amount of work into the exercises using the original codebase here[2], including a dockerized version of mit-scheme[3] and the scmutils package[4] that might be useful.
- [0] https://github.com/sicmutils/sicmutils/tree/main/test/sicmut...
- [1] https://nextjournal.com/try/samritchie/sicmutils/
- [2] https://github.com/sicmutils/sicm-exercises
- [3] https://hub.docker.com/r/sritchie/mit-scheme
- [4] https://hub.docker.com/r/sritchie/mechanics
What are some alternatives?
tyrade - A pure functional language for type-level programming in Rust
sicm-scheme-exercises - Exercises and notes on Structure and Interpretation of Classical Mechanics.
stately-streams - combine mutable state and asynchronous streams without deadlocks
clerk - ⚡️ Moldable Live Programming for Clojure
scroll - Scroll - making scrolling through buffers fun since 2016
ChezScheme - Chez Scheme
Algebird - Abstract Algebra for Scala
clj-maxima - Maxima as a clojure library
typic - Type-safe transmutations between layout-compatible types.
programming-2022 - Talks at the <Programming> 2022 Conference in Porto, Portugal
prop-rs - duck typed objects for rust using const generics