The ancient world before computers had stacks or heaps

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • subleq

    16-bit SUBLEQ CPU running eForth - just for fun

  • I wrote a Forth interpreter for a SUBLEQ machine (https://github.com/howerj/subleq), and for a bit-serial machine (https://github.com/howerj/bit-serial), both of which do not have a function call stack which is a requirement of Forth. SUBLEQ also does not allow indirect loading and stores as well and requires self-modifying code to do anything non-trivial. The approach I took for both machines was to build a virtual machine that could do those things, along with cooperative multithreading. The heap, if required, is written in Forth, along with a floating point word-set (various MCUs not having instructions for floating point numbers is still fairly common, and can be implemented as calls to software functions that implement them instead).

    I would imagine that other compilers took a similar approach which wasn't mentioned.

  • bit-serial

    A bit-serial CPU written in VHDL, with a simulator written in C.

  • I wrote a Forth interpreter for a SUBLEQ machine (https://github.com/howerj/subleq), and for a bit-serial machine (https://github.com/howerj/bit-serial), both of which do not have a function call stack which is a requirement of Forth. SUBLEQ also does not allow indirect loading and stores as well and requires self-modifying code to do anything non-trivial. The approach I took for both machines was to build a virtual machine that could do those things, along with cooperative multithreading. The heap, if required, is written in Forth, along with a floating point word-set (various MCUs not having instructions for floating point numbers is still fairly common, and can be implemented as calls to software functions that implement them instead).

    I would imagine that other compilers took a similar approach which wasn't mentioned.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • how-fast-does-it-quicksort

    Benchmarks for quicksort implementations in various languages

  • Well first of all, both are abstract concepts.

    No they aren't. A stack is a specific type of data structure. Recursion isn't even specific to computers.

    in computer science stacks are considered to be an abstract data type

    I think you meant data structure and they aren't both concepts.

    Of course, another way to refer to this kind of a structurally induced data type is to call it recursive.

    You are making a linked list. A node in a traditional linked list has data and a pointer to the next node. This is what you are making here. Just because you over complicate a stack by using a linked list, it doesn't mean a 'stack' and 'recursion' are the same thing.

    Fundamentally this is functional programming silver bullet syndrome. These things really have nothing to do with recursion, they just putting a square peg in a round hole by using recursion for iteration and linked lists.

    It's all fun and games until you get past trivial examples. Then pretending complex iteration and data structures are best done with recursion aren't so fun anymore and you want to control what is actually happening.

    One example is this rust quicksort being 40x faster than haskell

    https://github.com/LightAndLight/how-fast-does-it-quicksort

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts