base64-bytestring
yatima-lang-alpha
Our great sponsors
base64-bytestring | yatima-lang-alpha | |
---|---|---|
1 | 9 | |
45 | 450 | |
- | - | |
4.7 | 0.0 | |
7 months ago | about 1 year ago | |
Haskell | Rust | |
BSD 3-clause "New" or "Revised" License | MIT License |
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.
base64-bytestring
-
Yatima: A programming language for the decentralized web
Sure, if you consider Haskell's runtime (I know that technically GHC /= Haskell, but in practice it's the only Haskell that matters, except maybe something like Asterius) all the primitives are backed by C libraries: https://hackage.haskell.org/package/ghc-prim-0.4.0.0/docs/GH...
Likewise with conventions around pointers, arrays, etc. to the point where if you want to do anything really low-level or performance sensitive in Haskell, you're essentially punching a hole into C. As a random example, within the fast base64bytestring library, you find lots of use of `malloc`, `ForeignPtr` etc.: https://github.com/haskell/base64-bytestring/blob/master/Dat... And of course because this is C there aren't really many safety guarantees here.
The plan with Yatima with its primitives, and eventually when we write an FFI is to integrate with Rust in the same way that Haskell uses C. My hope is that with Yatima's affine types we might even be able to FFI to and from safe Rust (since the borrow checker uses affine types), but this is a little bit of a research project to see how much that works. Even to unsafe Rust though, we have better safety guarantees than C, since unsafe Rust's UB is still more restricted than C's is.
yatima-lang-alpha
- Yatima has received a Web 3.0 Grant!
-
Yatima: A programming language for the decentralized web
Sure, so I do use petgraph for actually visualizing the lambda DAG graphs, since it's got a very nice graphviz integration: https://github.com/yatima-inc/yatima/blob/059b0abccd0ca54b9a....
You can see the output of that here: https://i.redd.it/94zg24fboyv61.png
(N.B. We removed that module from the language core since we're trying to make that no_std, but we're adding it back to our utils crate soon: https://github.com/yatima-inc/yatima/issues/70)
But we can't use petgraph for the actual computational lambda-DAG because of performance. For example, one thing we get by using pointers is constant-time insertion and removal of of parent nodes (every node in the graph points to their parent). We actually wrote our own Doubly-Linked-List in Rust (it can be done!) to store pointers to the parents for this reason: https://github.com/yatima-inc/yatima/blob/main/core/src/dll.....
There's also memory concerns, given that the lambda-DAG collects its own garbage, freeing space allocated for nodes when no longer in use, whereas I believe petgraph is just `Vec` internally, which would require shrinking, and that would also be slow.
All this low-level pointer manipulation was, tbh, a huge amount of work, but the end result is a performant lazy lambda-calculus reducer with sharing in a few thousand lines of Rust, which means fast lambdas on wherever WASM runs.
(That said, I'm a little bit concerned about cache misses with all the pointer chasing we do, but I haven't yet gotten around to profiling different Yatima expressions to measure this. Would be a great project for an OSS contributor too, so I'll probably make a GH issue for it!)
What are some alternatives?
msgpack - Haskell implementation of MessagePack / msgpack.org[Haskell]
matrix.to - A simple stateless privacy-protecting URL redirecting service for Matrix
asn1-encoding - ASN1 Raw/BER/DER/CER reader/writer in haskell
Seed - A Rust framework for creating web apps
data-lens - Haskell 98 Lenses
lunatic - Lunatic is an Erlang-inspired runtime for WebAssembly
cassava-conduit - Conduit interface for cassava [Haskell]
ATS-Xanadu - Bootstrapping ATS3
bimap - Bidirectional mapping between two key types
introit - The Yatima Standard Library
filesystem-trees - Traverse and manipulate directories as lazy rose trees
proto-lens - API for protocol buffers using modern Haskell language and library patterns.