Jump to content

Functional programming -- 2009-2010 -- info.uvt.ro/Laboratory/Agenda

From Wikiversity

Functional programming (Spring 2010):


As the Functional programming course is an introductory course, the purpose of the laboratory is to put in practice all (or at least the most important) theoretical concepts discussed during the lectures. Therefore THE TOPICS DISCUSSED DURING THE LECTURES ARE MANDATORY AND FORM THE BASE OF OUR WORK. (Unfortunately I can't stress this fact enough...)

Getting back to the subject at hand we cover two major topics:

Before getting any deeper I propose to experiment with the following setup: we could split into two (difficulty / interest) groups:

  • basic -> medium (interest / involved effort into) functional programming:
    • basics of functional programming (tail recursion, lambda, high order functions, basic macros) (at 0.75x speed);
    • exercises with the above (as in synthetic / abstract problems and classic algorithms (sorting, graph, etc.));
    • evaluation based on mid-term + final laboratory tests;
  • medium -> advanced (interest / involved effort into) functional programming:
    • all of the above (but at 2x speed);
    • plus other interesting stuff (closures, domain specific languages, external communication, etc.);
    • plus projects (at own choice);
    • evaluation based on projects (or as above mid-term + final laboratory tests);

Now that we've seen the two setups, here is a simple scenario of what a laboratory should be:

  • basic -> medium functional programming:
    • at the beginning I would answer your questions (if any) that were raised since we've seen ourselves last time;
    • then a short description (more a reminder) about the needed theoretical concepts; (this was covered during the lecture);
    • an example is taken and discussed with the class, and other similar problems are proposed;
    • the students should try to solve the proposed problems;
    • during this time I will answer questions and give help;
    • I will give pointers to what we'll discuss next time;
  • medium -> advanced functional programming:
    • (in the first few laboratories the scenario resembles the one above; but after that the following new scenario will be put into action;)
    • (at the end of each laboratory I will give a list of topics (and references) that are going to be covered in the next laboratory;)
    • (thus at the beginning of each laboratory I assume that the references (or any other relevant material) regarding the topics were (at least) read and (at best) understood;)
    • we shall discuss any questions raised from the reading material, or any other topic related with functional programming;
    • because the reading material are most centered around Lisp, I shall try to present you how these apply (or are already applied) in other programming languages; (code snippets;)
    • we shall make case studies related to existing projects (source code); (real code;)
    • create and discuss together the design and implementation of our own projects;

Medium -> advanced[edit]

Laboratory 1 -- Introduction[edit]

Go to contents.

  • programming paradigms;
  • programming related concepts;
  • functional programming language classification;
  • functional programming language examples;
  • syntax overview;
  • s-expressions;
  • interpreter;
  • code snippets;

Laboratory 2 -- Code abstraction[edit]

Go to contents.

  • control structures;
  • functions;
  • recursion;
  • (maybe tail recursion;)

Laboratory 3 -- Data abstraction[edit]

Go to contents.

  • atoms (symbols, numbers, strings);
  • lists;
  • trees;
  • arrays, tuples, associative arrays;
  • immutability;
  • equality vs identity;
  • functional data-types;

Laboratory 4 -- Functional programming[edit]

Go to contents.

  • high order functions;
  • first class functions;
  • lambda;
  • classic examples (map, fold, etc.)
  • (maybe reimplementation of classic examples (reverse, map, fold, etc.);)
  • closures;
  • currying;

Laboratory 5 -- Tail recursion[edit]

  • (maybe covered in previous labs;)
  • tail recursion;
  • reimplementation of classic examples (reverse, map, fold, etc.)

Laboratory 6 -- Meta-programming[edit]

  • macros;
  • domain specific languages;
  • iterative constructs;
  • lazy evaluation (not quite meta-programming);

Laboratory 7 -- Advanced topics[edit]

  • comparison of Lisp-1 vs Lisp-2;
  • pattern matching;
  • continuations;
  • streams;
  • case study: Erlang;
  • threads;
  • operating system interface;

Laboratory 8 -> 14 -- Projects[edit]

Go to the dedicated page.

Basic -> medium[edit]

  • laboratory 1 -- introduction: go to contents;
  • laboratory 2 -- basic data types and control structures, user defined functions: go to contents;
  • laboratory 3 -- recursion: go to contents;
  • laboratory 4 -- equality vs identity, recursion: go to contents;
  • laboratory 5 -- tail recursion: go to contents;
  • laboratory 6 -- lambda, mapcar and friends: go to contents;
  • laboratory 7 -- do and friends: go to contents;
  • laboratory 8 -- macros: go to contents;