SICP with Julia/Pluto
Contact
Prof. Dr. Claus Möbus
Room: A02 2-226
claus.moebus@uol.de
-------------------------------------------
Secretary
Manuela Wüstefeld
Room: A02 2-228
Tel: +49 441 / 798-4520
manuela.wuestefeld@uol.de
-------------------------------------------
SICP with Julia/Pluto
Quotes
Two Julia pearls
*While trying once again to find if there was any Julia version of the Classic Computer Science Problems
by David Kopec (there are versions in Python, Java, Rust, JavaScript and others in GitHub - davecom/ClassicComputerScienceProblemsInPython: Source Code for the Book Classic Computer Science Problems in Python 9), I found these very important pearls from @CMoebus in JULIA Projects // University of Oldenburg 25 a Julia application of the SICP and of the ISLR2, both using Pluto.jl
.*
SICP with Julia/Pluto
- A Learning Diary with Pluto -
Motivation
From Scheme ((lambda (x) (x x)) (lambda (x) (x x))) to Julia (x → x(x)) (x → x(x))
This is my personal diary when learning the scientific computer language Julia by exploring the mile-stone computer programming book SICP. The book’s html-version is here and the pdf compiled from TeX source can be found here. This online version is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. This is also true for our project, here.
I used Lisp and especially Scheme regularly from time to time. I loved Scheme for its elegance and minimalism. But for production purposes in various cognitive science projects I had to use other languages for pragmatic reasons, like Fortran, Prolog, R, Javascript, Bugs, Stan, WebPPL and even Python. But I was always looking for a language as elegant as Scheme but with greater usability and richer eco system.
Several years ago David Barber gave me a hint to try Julia. There I stumbled across the probabilistic programming languages Gen.jl and Turing.jl, both embedded in Julia. This was the kicking event to self-study Julia in small steps embedded in a project-centered approach.
The original SICP is expected to be the accompanying study-guide. All SICP-Scheme-scripts are reconstructed in Julia in a stepwise manner. Furthermore idiomatic Julia scripts are added to demonstrate solutions made possible by advanced Julia features. Pluto.jl is used both as an ide and as a learning environment. It enforces a declarative style and offers reactive notebooks very suitable for experimental and explorative studies.
In the end it is guaranteed that the learner has acquired several competencies. S|he is competent in understanding basic CS-concepts (like FP, OOP, DSL,...), reading Scheme-scripts, and developing new code in Julia/Pluto.jl.
Learners expecting a gamified learning environment (https://en.wikipedia.org/wiki/Gamification_of_learning) will be disappointed. This is a rather academic (dry ;) ) learning experience. So your intrinsic motivation in studying Julia should be rather high.
The time investment needed is not trivial. Of course this depends on the preknowledge, the aspiration of the learner, and the motivation to solve the SICP-exercises. We estimate that a newbee to programming needs 1-3 hours/day over a 12 month period (2 semesters), whereas an expert (in say Python) will need only a few weeks.
C.M.
P.S.: The electronic version of SICP can be found as html here: https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/full-text/book/book.html and as pdf here: https://web.mit.edu/6.001/6.037/sicp.pdf
Structure And Interpretation of Computer Programs (= SICP) in Julia
Building Abstractions with Procedures
The Elements of Programming
Procedures and the Processes They Generate
Formulating Abstractions with Higher-Order Procedures
- Procedures as Arguments
- Procedures as Arguments: Basics (e.g. Cantor Set, Integration à la Riemann & Lebesgue (NonSICP))
- NonSICP: Cognitive First Choice Models
- NonSICP: Regression First Choice Models
- Constructing Procedures Using Lambda
- Procedures as General Methods
- Procedures as Returned Values
- NonSICP: Removing Recursion with the Fixed-point Y-Operator
- NonSICP: You Could Have Invented Monads
- Procedures as Arguments
Building Abstractions with Data
- Introduction to Data Abstraction
- Hierarchical Data and the Closure Property
- Symbolic Data
- Multiple Representations for Abstract Data
- Systems with Generic Operations
Modularity, Objects, and State
- Assignment and Local State
- Local State Variables
- The Benefit of Introducing Assignment
- The Costs of Introducing Assignment
- The Environment Model of Evaluation
- Modeling with Mutable Data
- Mutable List Structure
- Representing Queues...
- Representing Tables
- A Simulator for Digital Circuits: DSL + Event Driven Simulation
- Propagation of Constraints: DSL + Relational Programmming
- Concurrency: Time is of the Essence
- Streams
- Streams Are Delayed Lists
- Infinite Streams
- Exploiting The Stream Paradigm
- Streams and Delayed Evaluation
- Modularity of Functional Programs and Modularity of Objects
- Assignment and Local State
Metalinuistic Abstraction
Computing with Register Machines
-------------------------------------------------------------------------------------------------------------
This is a draft under the Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license. Comments, improvement and issue reports are welcome: claus.moebus(@)uol.de
-------------------------------------------------------------------------------------------------------------