Co-dfns VS tigerbeetle

Compare Co-dfns vs tigerbeetle and see what are their differences.

Co-dfns

High-performance, Reliable, and Parallel APL (by Co-dfns)

tigerbeetle

A distributed financial accounting database designed for mission critical safety and performance. [Moved to: https://github.com/tigerbeetledb/tigerbeetle] (by coilhq)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
Co-dfns tigerbeetle
19 37
639 1,012
2.2% -
9.6 9.5
about 10 hours ago over 1 year ago
APL Zig
GNU Affero General Public License v3.0 Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.

Co-dfns

Posts with mentions or reviews of Co-dfns. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-24.
  • Tacit Programming
    3 projects | news.ycombinator.com | 24 Feb 2024
    And if anyone wants an absolute masterclass in tacit programming, have a look at Aaron's Co-dfns compiler. The README has extensive reference material. https://github.com/Co-dfns/Co-dfns/
  • YAML Parser for Dyalog APL
    4 projects | news.ycombinator.com | 8 Jan 2024
    I don't put a lot of stock in the "write-only" accusation. I think it's mostly used by those who don't know APL because, first, it's clever, and second, they can't read the code. However, if I remember I implemented something in J 10 years ago, I will definitely dig out the code because that's the fastest way by far for me to remember how it works.

    This project specifically looks to be done in a flat array style similar to Co-dfns[0]. It's not a very common way to use APL. However, I've maintained an array-based compiler [1] for several years, and don't find that reading is a particular difficulty. Debugging is significantly easier than a scalar compiler, because the computation works on arrays drawn from the entire source code, and it's easy to inspect these and figure out what doesn't match expectations. I wrote most of [2] using a more traditional compiler architecture and it's easier to write and extend but feels about the same for reading and small tweaks. See also my review [3] of the denser compiler and precursor Co-dfns.

    As for being read by others, short snippets are definitely fine. Taking some from the last week or so in the APL Farm, {⍵÷⍨+/|-/¯9 ¯11+.○?2⍵2⍴0} and {(⍸⍣¯1+\⎕IO,⍺)⊂[⎕IO]⍵} seemed to be easily understood. Forum links at [4]; the APL Orchard is viewable without signup and tends to have a lot of code discussion. There are APL codebases with many programmers, but they tend to be very verbose with long names. Something like the YAML parser here with no comments and single-letter names would be hard to get into. I can recognize, say, that c⌿¨⍨←(∨⍀∧∨⍀U⊖)∘(~⊢∊LF⍪WS⍨)¨c trims leading and trailing whitespace from each string in a few seconds, but in other places there are a lot of magic numbers so I get the "what" but not the "why". Eh, as I look over it things are starting to make sense, could probably get through this in an hour or so. But a lot of APLers don't have experience with the patterns used here.

    [0] https://github.com/Co-dfns/Co-dfns

    [1] https://github.com/mlochbaum/BQN/blob/master/src/c.bqn

    [2] https://github.com/mlochbaum/Singeli/blob/master/singeli.bqn

    [3] https://mlochbaum.github.io/BQN/implementation/codfns.html

    [4] https://aplwiki.com/wiki/Chat_rooms_and_forums

  • HVM updates: simplifications, finally runs on GPUs, 80x speedup on RTX 4090
    2 projects | news.ycombinator.com | 7 Oct 2023
    This always seemed like a very interesting project; we need to get to the point where, if things can run in parallel, they must run in parallel to make software more efficient on modern cpu/gpu.

    It won't attract funds, I guess, but it would be far more trivial to make this work with an APL or a Lisp/Scheme. There already is great research for APL[0] and looking at the syntax of HVM-core it seems it is rather easy to knock up a CL DSL. If only there were more hours in a day.

    [0] https://github.com/Co-dfns/Co-dfns

  • APL: An Array Oriented Programming Language (2018)
    10 projects | news.ycombinator.com | 30 Mar 2023
    There are many styles of APL, not just due to its long history, but also because APL is somewhat agnostic to architecture paradigms. You can see heavily imperative code with explicit branching all over the place, strongly functional-style with lots of small functions, even object-oriented style.

    However, given the aesthetic that you express, I think you might like https://github.com/Co-dfns/Co-dfns/. This is hands-down my favorite kind of APL, in which the data flow literally follows the linear code flow.

  • Franz Inc. has moved the whole Allegro CL IDE to a browser-based user interface. Incl. all their Lisp development tools. One can check that out with their Allegro CL Express Edition.
    2 projects | /r/Common_Lisp | 27 Mar 2023
    Which is, as far as I know, unused. (Similarly the gpu compiler.)
  • What would make you try a new language?
    8 projects | /r/ProgrammingLanguages | 29 Jan 2023
    You might be familiar with iKe (grahics), SpecialK (GLSL) and Co-dfns. Also, I am working on bastardized APL for GPU – Fluent. Fluent 1 had backend implemented through Apple Metal Performance Shaders Graph and Fluent 2 has TensorFlowJS backend for now. I care more about having auto differentiation in the lang than running on GPU and do graphics, to be honest.
  • Who is researching array languages these days?
    5 projects | /r/Compilers | 15 Oct 2022
    Aaron hsu did his dissertation on this topic (compiler, thesis), at indiana university in the us.
  • Researchers Develop Transistor-Free Compute-in-Memory Architecture
    2 projects | news.ycombinator.com | 14 Oct 2022
  • Why APL is a language worth knowing
    3 projects | news.ycombinator.com | 31 Mar 2022
    Stories please! What did the closures do to you?

    Hopefully this won't be seen as too combative, but I feel like there are a few people in the array community giving me some pretty strong conclusions that they don't really have the experience to back up (Aaron wrote[0] 17 lines of array compiler, and says the low-abstraction approach he used is the only way to develop sustainably. Cool. I wrote[1] 350 lines of array compiler following his style, and I disagree[2]). At the same time, my experience only goes so far (there's no way I would have invented the array style compiler!), and clearly you arrived at these conclusions somehow. So is there a chance you'd share the observations that led you that way?

    On my end, I was actually introduced to a little object-oriented programming in J when Henry suggested using it for a simulation project. I used it, but I don't think I really got it—just a weird way to organize data. And then in college I had to learn objects-only Java. Not good. But later I worked some with Node.js, and its module system was pretty nice: no name conflicts, easy to share code! Some way into BQN development, I figured out (with some help from a Common Lisp programmer) a way to add modules with an APL-y syntax, and something magic happened. I got objects[3] too! I think I've done about as much OOP in BQN as anywhere else, and I feel like I understand it a lot better now.

    So, this is my experience with Lisp-family features and APL. Fits like a glove, programming is easier and more fun. I mix and match array, functional, and object-oriented styles however I want. Did I lose coherence? When I translate my old J code it comes out shorter and cleaner and without exec (".) everywhere. But I still don't get why I should want the language I use to not support mutability rather than just default to immutability. Did I fail to understand something in J when I had the chance?

    [0] https://github.com/Co-dfns/Co-dfns

    [1] https://github.com/mlochbaum/BQN/blob/master/src/c.bqn

    [2] https://mlochbaum.github.io/BQN/implementation/codfns.html

    [3] https://mlochbaum.github.io/BQN/doc/oop.html

  • Barriers to APL Adoption
    4 projects | /r/apljk | 21 Jan 2022
    Co-dfns feels like an academic project that I won't be able to figure out how to use.

tigerbeetle

Posts with mentions or reviews of tigerbeetle. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-08-10.
  • SQLite Helps You Do Acid
    3 projects | news.ycombinator.com | 10 Aug 2022
    Indeed!

    I was so glad to see you cite not only the Rebello paper but also Protocol-Aware Recovery for Consensus-Based Storage. When I read your first comment, I was about to reply to mention PAR, and then saw you had saved me the trouble!

    UW-Madison are truly the vanguard where consensus hits the disk.

    We implemented Protocol-Aware Recovery for TigerBeetle [1], and I did a talk recently at the Recurse Center diving into PAR, talking about the intersection of global consensus protocol and local storage engine. It's called Let's Remix Distributed Database Design! [2] and owes the big ideas to UW-Madison.

    [1] https://github.com/coilhq/tigerbeetle

    [2] https://www.youtube.com/watch?v=rNmZZLant9o

  • 20 years of payment processing problems
    3 projects | news.ycombinator.com | 18 Jul 2022
    > By shifting business logic to stored procedures you avoid this.

    Thanks, we considered stored procedures to bring the number of database queries down from 18 queries per payment to 1 query per payment. However, that would have provided only an order of magnitude improvement, and brought with it complexity of testing, compared to the state machine [1] we have in TigerBeetle.

    At the same time, the biggest performance bottleneck is not only the multiple roundtrips, but the lack of first-class batching in the interface. What we do in TigerBeetle instead, is we send 8192 transfers in a single network request. This brings the network/disk cost equation down from 1 query per payment, to 1/8192 query per payment. It's like group commit, on steroids.

    [1] https://github.com/coilhq/tigerbeetle/blob/main/src/state_ma...

    > That's also why SQLite is very fast, as it runs in your application's memory as a library. But then your data is tied to the same limitations as the machine the application is on.

    We could have made SQLite distributed, but SQLite also does not solve our storage fault model. For example, misdirected reads/writes, lost reads/writes, bitrot in the middle of the committed log. SQLite was also not explicitly designed to be integrated with a global consensus protocol as per ”Protocol-Aware Recovery for Consensus-Based Storage” from UW-Madison. For example, there are optimizations around storage fault tolerance in the commit log that you can do, or around deterministic storage across replicas for faster recovery, that you can't do with SQLite.

    3 projects | news.ycombinator.com | 18 Jul 2022
    I had the experience of being part of a team in 2020 doing performance and safety analysis on Mojaloop [1], the open-source payments switch. The emphasis was mostly to identify performance bottlenecks. For example, graphing waterfalls of database queries, estimating expected vs actual concurrency, digging into latency spikes, timeout interactions, and missed group commit opportunities.

    However, on the safety front, one of the most challenging issues was guaranteeing the rollback of funds in the event of failure, as part of the two-phase commit money transfer protocol, and coordinating this across multiple SQL queries, database transactions, Kafka queues, even multiple code repositories, especially as different systems experience clock drift or as disks or machines fail.

    You want to ensure that the money either moves, or doesn't move, that it doesn't get lost somewhere in between.

    Most payment systems re-implement all this business logic, again and again, so we extracted this from Mojaloop once-and-for-all, to create TigerBeetle [2], an open-source financial accounting database, that provides multi-AZ replication, automated leader election, and two-phase payments out-of-the-box.

    [1] https://mojaloop.io

    [2] https://github.com/coilhq/tigerbeetle (Zig)

    3 projects | news.ycombinator.com | 18 Jul 2022
    > It sounds like payments might be part of the larger concept of declarative programming (DP)

    Yes, exactly! The idea with TigerBeetle's state machine [1] is to expose double-entry accounting as higher level financial primitives, so that developers can think in terms of declaring transfers from one account to another. The business logic behind the scenes is detailed, but the interfaces and data structures are simple.

    [1] https://github.com/coilhq/tigerbeetle/blob/main/src/state_ma...

    > Maybe TigerBeetle could be generalized to support any multi-step distributed process?

    That's part of the plan, that the distributed database framework of TigerBeetle can be used as a ”distributed Iron Man suit” to support any kind of state machine.

  • How Safe Is Zig?
    8 projects | news.ycombinator.com | 23 Jun 2022
    It's a pleasure. Let me know if you have any more questions about TigerBeetle. Our design doc is also here: https://github.com/coilhq/tigerbeetle/blob/main/docs/DESIGN....
  • Distributed Systems Shibboleths
    3 projects | news.ycombinator.com | 2 May 2022
    > Allowing developers to think about a stream of operations that moves the databases from one legal state to another is super powerful.

    It is super powerful. We used this RSM intuition to test TigerBeetle's strict serializability, by verifying state transitions the instant they happen, instead of trying to piece everything together and verify strict serializability after the test run.

    Here it is in 49 lines of code:

    https://github.com/coilhq/tigerbeetle/blob/477d6df366e2c10fa...

    3 projects | news.ycombinator.com | 2 May 2022
    Surprisingly, some of the most powerful distributed systems algorithms or tools are actually deterministic. They're powerful because they can "load the dice" and so make the distributed system more intuitive for humans to reason about, more resilient to real world network faults, and do all this with more performance.

    For example, Barbara Liskov and James Cowling's deterministic view change [1], which isn't plagued by the latency issues of RAFT's randomized dueling leader problem. Viewstamped Replication Revisited's deterministic view change can react to a failed primary much quicker than RAFT (heartbeat timeouts don't require randomized "padding" as they do in RAFT), commence the leader election, and also ensure that the leader election succeeds without a split vote.

    Determinism makes all that possible.

    Deterministic testing [2][3] is also your best friend when it comes to testing distributed systems.

    [1] I did a talk on VSR, including the benefits of the view change — https://www.youtube.com/watch?v=Wii1LX_ltIs

    [2] FoundationDB are pioneers of deterministic testing — https://www.youtube.com/watch?v=OJb8A6h9jQQ

    [3] TigerBeetle's deterministic simulation tests — https://github.com/coilhq/tigerbeetle#simulation-tests

  • Lies we tell ourselves to keep using Golang
    8 projects | /r/fasterthanlime | 29 Apr 2022
    This is the chasm problem, where people don't use a technology because people aren't using that technology, thus the technology has difficulty gaining adoption. I did see that Zig does have it's own killer app and startup that's using Zig: TigerBeattle.
  • Ask HN: Codebases with great, easy to read code?
    35 projects | news.ycombinator.com | 21 Mar 2022
    Are we allowed to share repos that we've written? :)

    If so, then here's distributed consensus written in Zig:

    https://github.com/coilhq/tigerbeetle/blob/main/src/vsr/repl...

    Something that differentiates this from many other consensus implementations is that there's no networking/multithreading code leaking through, it's all message passing, so that it can be deterministically fuzz tested.

    I learned so much, and had so much fun writing this, that I hope it's an enjoyable read—or please let me know what can be improved!

    35 projects | news.ycombinator.com | 21 Mar 2022
    Control flow statements should always be on their own lines, then it's easy to find all of them by visually scanning top-down, without needing to look all the way down each line.

    [1]: https://github.com/coilhq/tigerbeetle/blob/main/src/vsr/repl...

What are some alternatives?

When comparing Co-dfns and tigerbeetle you can also consider the following projects:

BQN - An APL-like programming language. Self-hosted!

zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

chibicc - A small C compiler

raft - Golang implementation of the Raft consensus protocol

raft-grpc-example - Example code for how to get hashicorp/raft running with gRPC

ngn-apl - An APL interpreter written in JavaScript. Runs in a browser or NodeJS.

viewstamped-replication-made-famous - A $20k consensus challenge based on TigerBeetle's implementation of the pioneering Viewstamped Replication protocol. [Moved to: https://github.com/tigerbeetledb/viewstamped-replication-made-famous]

async-std - Async version of the Rust standard library

LevelDB - LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.

tigerbeetle-io - The examples using TigerBeetle IO struct

v-mode - 🌻 An Emacs major mode for the V programming language.

OkHttp - Square’s meticulous HTTP client for the JVM, Android, and GraalVM.