news.volyx.in

Show HN: I made a programmable computer from NAND gates (github.com)

420 points by ArchAndStarch · 842 days ago · 73 comments on HN

Article summary

The article presents a programmable computer made entirely from NAND gates, emulated on the web, which is Turing equivalent and has its own CPU, machine code language, assembly language, and programming language. The computer is based on the Jack-VM-Hack platform and features a weakly typed object-oriented programming language called Jack. The article also showcases several example programs, including games and a genetic algorithm, and provides documentation on how to write programs for the computer. The project is an implementation of the Nand to Tetris course and book.

Main themes

  • NAND gates
  • Turing equivalence
  • Programming languages
  • Computer architecture
  • Nand to Tetris course
  • Weakly typed programming

What commenters say

  • Building a physical NAND-to-Tetris computer is feasible but requires dedication and can be challenging to debug.
  • The project is an impressive implementation of the Nand to Tetris course and demonstrates a good understanding of how computers work.
  • The distinction between Turing machines and finite state machines is important in theory, but often ignored in practice due to the large finite memory of real-world computers.
  • The memory system of a Turing machine, including its tape or RAM, is a key factor in its ability to simulate any algorithm, and is different from other states in terms of read/write operations.
  • The Nand to Tetris course is a valuable resource for learning about computer architecture and programming, and can be completed and extended by anyone with sufficient time and focus.
  • The project's use of a weakly typed programming language is a notable aspect of its design, and has implications for the language's expressiveness and ease of use.
  • The halting problem is decidable for linear bounded automata, but not for Turing machines, due to the finite memory of the former.
  • The project's implementation of a genetic algorithm and other example programs demonstrates the capabilities and limitations of the NAND-based computer.