Tag Archives: CS1101S

Wrapping up CS1101S Programming Methodology

Today is the last lecture of this introductory module for computer science, CS1101S Programming Methodology.
We followed our own JS implementation of SICP.
We learnt the concept of programming – communicating computational processes.
We learnt functional programming.
We learnt higher order functions.
We learnt order of growth to assess the resource requirements.
We learnt iterative processes and recursive processes and space consumption.
We learnt scoping.
We learnt substitution model, environmental model.
We learnt memoization concept.
We learnt OOP implemented in JavaScript.
We learnt lazy evaluation, streams.
We learnt writing a basic meta-interpreter.
So, here we finished the introduction, and move on to the next step, CS2020.

Constructing infinite sequences using stream

In CS1101S today, we are learning to use stream as a way to delay evaluation. In this way, we can use a function to construct an infinite data structures. For example, integers, Fibonacci sequence.
This stream is achieved by modifying the list concept. The head of the stream is a data value, the tail of the stream is a function to wrap the actual tail value. The function could be returning the reference of the stream itself.

Programming languages which will not evaluate the argument until needed are called lazy . For example, Haskell. Ocaml provides annotations.

This concept is very new and interesting for me as so far I have only seen finite data structures. With infinite data structure, we can do maths involving infinity in programming.