# SICP in Clojure - Chapter 5

DevFeed: [SICP in Clojure - Chapter 5](<https://devfeed.tech/articles/sicp-in-clojure-chapter-5-22368.md>)

Original publisher: [Read original article](<http://www.afronski.pl/sicp-in-clojure/2015/10/19/sicp-in-clojure-chapter-5.html>)

Author: Wojtek Gawroński (afronski)

Published: 2015-10-19T14:00:00Z

Content type: tutorial

Language: en

Sources: [Wojtek Gawroński](<https://devfeed.tech/sources/wojtek-gawronski.md>)

Topics: [Clojure](<https://devfeed.tech/topics/clojure.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Lisp](<https://devfeed.tech/topics/lisp.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Hardware](<https://devfeed.tech/topics/hardware.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>)

Tags: [blog-post](<https://devfeed.tech/tags/blog-post.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [canvas](<https://devfeed.tech/tags/canvas.md>), [clojure](<https://devfeed.tech/tags/clojure.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [css](<https://devfeed.tech/tags/css.md>), [css3](<https://devfeed.tech/tags/css3.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [erlang](<https://devfeed.tech/tags/erlang.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [gc](<https://devfeed.tech/tags/gc.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [html](<https://devfeed.tech/tags/html.md>), [html5](<https://devfeed.tech/tags/html5.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [languages](<https://devfeed.tech/tags/languages.md>), [mono](<https://devfeed.tech/tags/mono.md>), [net](<https://devfeed.tech/tags/net.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [sicp](<https://devfeed.tech/tags/sicp.md>), [vagrant](<https://devfeed.tech/tags/vagrant.md>), [webgl](<https://devfeed.tech/tags/webgl.md>)

## AI overview

This blog post discusses Chapter 5 of Structure and Interpretation of Computer Programs through Clojure. It explains register machines, their data paths and controllers, and the relationship between hardware, Lisp-like languages, and compiler construction.

## Source excerpt

SICP in Clojure - Chapter 5 In one of the previous blog posts I have announced that I would like to start a new series of posts. It is a persistent journal from my journey through aforementioned book. I hope that you will enjoy it and find it useful - the main goal is to make this series a place where we can return in future, recall ideas and thoughts that accompanied reading process. Introduction We are heading to the end of the book. It is the last chapter, and in the previous blog post I have already mentioned that last two chapters are really specific. And that is true, especially in terms of 5th chapter's content. High-level Convenience Using high-level languages have many benefits. In terms of Clojure and other Lisp-like languages I would start with an automatic memory management and GC, various data structures or various optimizations, like tail-recursion etc. We do not think very often about how it is implemented, especially at the lowest level - in the hardware. Can you imagine how the hardware should look like, to be capable of running code written in programming language from Lisp family? This is the main topic of the last chapter. Authors are starting with basic theory related to register machines and ending with the recipe for building a compiler. This blog post will be mostly theoretical, and instead of code examples, and exercises related with a topic "How to build a Clojure compiler", we will take a peek under the hood, directly into the language implementation. But first, let's bring some definitions to the table. What is a register machine? Register machine is a type of a computer, which sequentially executes instructions. Those instructions are operating and modifying a set of a memory elements called registers. A typical operation will take operation arguments from registers, and it will push the result of that instruction to another register. When it comes to the designing of such machines, at first you need to create its data paths - which the