Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
university-logo
Learning Programming with Erlangor Learning Erlang with Ladybirds
Frank Huch
Christian-Albrechts-University of Kiel
15. Oktober 2007
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 1 / 18
university-logo
Learning Erlang with Ladybirds
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 2 / 18
university-logo
Computer Science in Germany
students in computer science in Germany (also Kiel):less than 20% girlscomputer science not taught in every school
Our approach for improvement:One week course introducing computer scienceTalks of research groups, information about studyingcomputer science, discussion with students and femalecomputer scientist from industry, a trip to an IT company, anda programming course with a final project.
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 3 / 18
university-logo
Teaching Programming
Excercises in a nice programming environmentZurich: Programming environment KaraSolve tasks by programming a little ladybird
Advantages: Attractive task, good identification
Programming with: Finite Automata, JavaOur approach: Erlang
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 4 / 18
university-logo
Teaching Programming
Excercises in a nice programming environmentZurich: Programming environment KaraSolve tasks by programming a little ladybird
Advantages: Attractive task, good identification
Programming with: Finite Automata, JavaOur approach: Erlang
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 4 / 18
university-logo
Teaching Programming
Excercises in a nice programming environmentZurich: Programming environment KaraSolve tasks by programming a little ladybirdAdvantages: Attractive task, good identification
Programming with: Finite Automata, JavaOur approach: Erlang
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 4 / 18
university-logo
Teaching Programming
Excercises in a nice programming environmentZurich: Programming environment KaraSolve tasks by programming a little ladybirdAdvantages: Attractive task, good identification
Programming with: Finite Automata, JavaOur approach: Erlang
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 4 / 18
university-logo
Teaching Programming
Excercises in a nice programming environmentZurich: Programming environment KaraSolve tasks by programming a little ladybirdAdvantages: Attractive task, good identification
Programming with: Finite Automata, JavaOur approach: Erlang
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 4 / 18
university-logo
Lessons
basics: sequences, simple commands, case, recursionparameters (variables, integers, booleans)data structures (tuples, lists)modules, concurrency, distributionproject: design and implementation of chat
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 5 / 18
university-logo
Basic Language
Prg ::= Rule Prg| Rule
Rule ::= Func() -> Cmds .Cmds ::= Cmd , Cmds
| CmdCmd ::= go() | take() | mark() | nothing()
| turn(Dir) | Func()| case Dir() of
Pat1 -> e1;. . .
Patn -> enend
Dir ::= left | rigth | frontPat ::= free | shamrock | agaric | tree | border
| _Func ::= [a− z] [a− z,A− Z,0− 9]∗
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 6 / 18
university-logo
Excercises 1
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 7 / 18
university-logo
Excercises 2
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 8 / 18
university-logo
Excercises 3
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 9 / 18
university-logo
Excercises 4
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 10 / 18
university-logo
Non-Tail Recursion
start() -> case front() ofshamrock -> go(), take(),
start(),mark(), go();
_ -> go()end.
Recursion is not difficult.
Recursion is cool!
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 11 / 18
university-logo
Non-Tail Recursion
start() -> case front() ofshamrock -> go(), take(),
start(),mark(), go();
_ -> go()end.
Recursion is not difficult.
Recursion is cool!
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 11 / 18
university-logo
Excercises 5
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 12 / 18
university-logo
Excercises 5
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 12 / 18
university-logo
Excercises 5
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 12 / 18
university-logo
Excercises 5
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 12 / 18
university-logo
Lessons
basics: sequences, simple commands, case, recursionparameters (variables, integers, booleans)data structures (tuples, lists)modules, concurrency, distributionproject: design and implementation of chat
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 13 / 18
university-logo
Excercises 7
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 14 / 18
university-logo
Lessons
basics: sequences, simple commands, case, recursionparameters (variables, integers, booleans)data structures (tuples, lists)modules, concurrency, distributionproject: design and implementation of chat
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 15 / 18
university-logo
Excercises 7
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 16 / 18
university-logo
Lessons
basics: sequences, simple commands, case, recursionparameters (variables, integers, booleans)data structures (tuples, lists)modules, concurrency, distributionproject: design and implementation of chat
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 17 / 18
university-logo
Opportunities of Using Erlang in Our Approach
only one programming languagesimple syntaxno confusing typesabstraction (reuse of function definitions)only recursionavailability of Erlang
Problems:error messagesold-fashioned GUI
Frank Huch (CAU Kiel) Learning Erlang 15. Oktober 2007 18 / 18