The OCaml MOOC Benjamin Canou, Yann Rgis-Gianas (joint work with - - PowerPoint PPT Presentation

the ocaml mooc benjamin canou yann r gis gianas joint
SMART_READER_LITE
LIVE PREVIEW

The OCaml MOOC Benjamin Canou, Yann Rgis-Gianas (joint work with - - PowerPoint PPT Presentation

The OCaml MOOC Benjamin Canou, Yann Rgis-Gianas (joint work with agdas Bozman, Roberto Di Cosmo, Grgoire Henry and Ralf Treinen) Canterbury, June 22, 2017 Trends in Functional Programming in Education 2017 1 The OCaml MOOC


slide-1
SLIDE 1

🐬

The OCaml MOOC Benjamin Canou, Yann Régis-Gianas (joint work with Çagdas Bozman, Roberto Di Cosmo, Grégoire Henry and Ralf Treinen) Canterbury, June 22, 2017 Trends in Functional Programming in Education 2017 1
slide-2
SLIDE 2

🐬

The OCaml MOOC TFPIE 2017 1 / 22 A humble and ambitious journey 2
slide-3
SLIDE 3

🐬

Humble? The OCaml MOOC TFPIE 2017 2 / 22 — Only 3 key notions of languages from the ML family : — Functional programming, — Static typing with full type inference, and — Algebraic datatypes. — Write medium sized programs of reasonable complexity using OCaml. 3
slide-4
SLIDE 4

🐬

…and Ambitious? The OCaml MOOC TFPIE 2017 3 / 22 — Ensure that the learners who completed the course master the 3 key notions. — …in just 7 weeks. 4
slide-5
SLIDE 5

🐬

The OCaml MOOC TFPIE 2017 4 / 22 ( A secret goal : Retain them all along the course. ) 5
slide-6
SLIDE 6 Who were our students?

🐬

Who were our students? The OCaml MOOC TFPIE 2017 5 / 22 6
slide-7
SLIDE 7

🐬

Where are they from? The OCaml MOOC TFPIE 2017 6 / 22 — 7000 learners enrolled; — from more than 120 countries (France, US, Spain, UK, India and Germany being the top 6); — 2418 actually showed up when the course started. 7
slide-8
SLIDE 8

🐬

How old are they? The OCaml MOOC TFPIE 2017 7 / 22 0.00 0.02 0.04 15 20 25 30 35 40 45 50 55 60 65 70 75 80 Age 8
slide-9
SLIDE 9

🐬

How educated are they? The OCaml MOOC TFPIE 2017 8 / 22 Active Passed Numbers
  • avg. success
Numbers
  • avg. success
High School 255 20.93 32 90.19 Associate 45 21.29 4 86.50 Bachelor 567 26.70 113 87.12 Master 775 37.13 242 86.69 PhD 226 38.00 75 91.44 Elementary 7 26.43 1 100.0 Junior High 65 21.14 9 85.44 Other 40 34.02 11 86.45 N/A 438 34.93 128 89.41 Total 2418 615 Unusual for a MOOC : a lot of students. 9
slide-10
SLIDE 10 How did our students learn?

🐬

How did our students learn? The OCaml MOOC TFPIE 2017 9 / 22 10
slide-11
SLIDE 11

🐬

Study and PRACTICE! The OCaml MOOC TFPIE 2017 10 / 22 — Classic material : slides and videos (42 capsules, ∼6 hours); — State-of-the-art exercise environment; — 55 exercises (7 quizz, 48 automatically graded exercices) and 2 projects. — The total length of our own solutions is around 1500 loc. — One important pedagogical idea : No submission limit and deadlines on the exercises — The consequence : Students are working harder to get a score of 100% 11
slide-12
SLIDE 12 How good was the trip?

🐬

How good was the trip? The OCaml MOOC TFPIE 2017 11 / 22 12
slide-13
SLIDE 13

🐬

The OCaml MOOC TFPIE 2017 12 / 22 Enroll W 1 W 2 W 3 W 4 W 5 W 6 W Proj 1000 2000 3000 4000 5000 6000 7000 Number of students Afuer week 2, we had gathered a stable group of students 13
slide-14
SLIDE 14

🐬

How hard was it for the learners? The OCaml MOOC TFPIE 2017 13 / 22 Weekly efgort (hs/week) per perceived difgiculty Too Easy Easy Just Right Difficult Too Difficult 2 4 6 8 10 A majority of students found the difgiculty just right and spend 8 hours per week on the course! 14
slide-15
SLIDE 15

🐬

How pleasant was the trip? The OCaml MOOC TFPIE 2017 14 / 22
  • Distr. of appreciation
per degree High School Associate Bachelor Master PhD 1 2 3 4 Whatever the level of education, our students seem satisfied. 15
slide-16
SLIDE 16 The Exercise Platform

🐬

The Exercise Platform The OCaml MOOC TFPIE 2017 15 / 22 16
slide-17
SLIDE 17

🐬

A beginner’s IDE in the browser The OCaml MOOC TFPIE 2017 16 / 22 Main features — everything runs inside the browser, nothing to install; — syntax colouring and forced indentation; — OCaml runs inside a separate worker for responsiveness; — incremental, randomized automated grading system; — structured report with pretuy printed test cases; — interactive toplevel for quick testing. We are building a standalone platform from this code : learn-ocaml. 17
slide-18
SLIDE 18

DEMO TIME

DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME DEMO TIME

DEMO TIME

18
slide-19
SLIDE 19

🐬

A minimal grader 1 / 3 The OCaml MOOC TFPIE 2017 17 / 22 Exercise text 1 : <p>Given the type of binary tree in the 2 : prelude , write the following function </p> 3 : <ol> 4 : <li> 5 : <code>size: tree -> int</code> 6 : computes the number of tree elements. 7 : </li> 8 : <li> 9 : <code>height: tree -> int</code> 10 : computes the height of the tree; 11 : </li> 12 : </ol> 19
slide-20
SLIDE 20

🐬

A minimal grader 2 / 3 The OCaml MOOC TFPIE 2017 18 / 22 Prelude 1 : type tree = 2 : | Empty 3 : | Node of tree * int * tree Template 1 : let rec size = "Replace␣by␣your␣code." ;; 2 : let rec height = "Replace␣by␣your␣code." ;; Solution 1 : let rec size = function 2 : | Empty -> 0 3 : | Node (l,_,r) -> 1 + size l + size r ;; 4 : let rec height = function 5 : | Empty -> 0 6 : | Node (l,_,r) -> 7 : 1 + max (height l) (height r) ;; 20
slide-21
SLIDE 21

🐬

A minimal grader 3 / 3 The OCaml MOOC TFPIE 2017 19 / 22 Grader 1 : let sample_tree () = 2 : let rec aux lvl = 3 : match Random.int lvl with 4 : | 0 -> Empty 5 : | _ -> Node (aux (lvl -1), Random.int 100, aux (lvl -1)) 6 : in aux 4 ;; 7 : set_result @@ ast_sanity_check code_ast @@ fun () -> 8 : [ Section 9 : ([ Text "Exercise␣1:␣" ; Code "size"], 10 : test_function_1_against_solution 11 : [%ty: tree -> int] "size" []) ; 12 : Section 13 : ([ Text "Exercise␣2:␣" ; Code "height"], 14 : test_function_1_against_solution 15 : [%ty: tree -> int] "height" []) ] ;; Graders are typed, with local run-time checks where student code is loaded. 21
slide-22
SLIDE 22

🐬

How deep can we probe student code? 1 / 2 The OCaml MOOC TFPIE 2017 20 / 22 Not only the output! — syntax (graders can insert AST rewriting steps) (e.g. write this function using a single match expression); — variable definition and scoping (using the typed AST) (e.g. define this value using at most n local variables); — function definition and application (including partial ones) (e.g. perform this efgect afuer passing the 3rd argument); — side efgects by introspecting references in student code (e.g. randomize this array in place); — complexity evaluation by instrumenting the standard operators (e.g. sort an array using at most n·log(n) accesses); — modules, interfaces and ADTs (turned into module packages by the grader) (e.g. implement this interface for functional tries). 22
slide-23
SLIDE 23

🐬

How deep can we probe student code? 2 / 2 The OCaml MOOC TFPIE 2017 21 / 22 A successful approach : — fair grader size / solution size ratio; — good confidence thanks to static typing of graders; — authors can concentrate on generating good test cases. Technical limitations : — command line toolchain and separate compilation; — system libraries and I/Os (all inside the browser); — synchronous interaction (must conform to the event loop). Main critics : — students don’t write their own types (before ADTs are introduced); — no feedback on the style of the code. 23
slide-24
SLIDE 24

🐬

Conclusion The OCaml MOOC TFPIE 2017 22 / 22 — Let the students try again, and again, and again. — Automatic grading is appreciated by students! — We have trained 600 fresh camlers, ready to contribute to the community! 24
slide-25
SLIDE 25

🐬

The OCaml MOOC Thank you! Trends in Functional Programming in Education 2017 25
slide-26
SLIDE 26

🐬

List of projects and exercises The OCaml MOOC TFPIE 2017 A Solver for Klotski Random Text Generation Integer identifiers String identifiers Simple functions over integers Simple functions over strings Prime numbers Enigma Points and vectors Time on planet Shadokus Finding the minimum Searching for strings in arrays A small typed database Pattern matching exhaustivity A type for array indexes The option type First In First Out Classic functions over lists Symbolic manipulation of arithmetic expressions Tries Type directed programming Balanced binary trees List with an efficient concatenation Advanced patterns Lambda Using first class functions Functions returning functions Optimizing partial applications A small arithmetic interpreter Using and writing the map function Using fold to produce lists Using fold to check predicates Optimising a tree traversal using exceptions Unraveling the automatic grader Printing lists Displaying a Filesystem Hierarchy Printing with loops Producing fine ASCII art Rotating the contents of an array Implementing a stack with an array Implementing mutable lists Simple uses of references Reading lines from the standard input Opening modules Accessing modules and submodules Wrapping functions in a module Type abstraction using a signature Multiset Remove elements from dictionaries Char indexed hashtables 26