Presentation is loading. Please wait.

Presentation is loading. Please wait.

Agenda About me and Eliza Design Principles Function Concept Type Hierarchy Example (Description, C, Eliza) Function Definition Patterns More Complex.

Similar presentations


Presentation on theme: "Agenda About me and Eliza Design Principles Function Concept Type Hierarchy Example (Description, C, Eliza) Function Definition Patterns More Complex."— Presentation transcript:

1

2 Agenda About me and Eliza Design Principles Function Concept Type Hierarchy Example (Description, C, Eliza) Function Definition Patterns More Complex Example Status and Future

3 About me and Eliza Matthias Huerlemann, Bern, Switzerland SW engineer in a bank, CORBA with PL/1 and J2EE "Eliza" by Prof. Weizenbaum and a bet... http://www.eliza.ch matteo@eliza.ch

4 Design Principles Functional logic No objects Polymorphic and strongly typed 4 Rules: simple, small, swift, smart Bytecode (Parrot 0.1.1 – Perl6) Open Source (GPL) Influence: Prolog, Lisp, Bash, C/C++, Haskell, Curl, Icon

5 Function Concept Classification of Functions into 4 Types: Generator Concentrator Transformer Filter GCTF-Engine

6 Type Hierarchy word val type ident func var sim com dict list obj num string bool any / _ int float

7 Example (Text and C) Sum up all odd numbers between 1 and 10. #include int main(void) { int i, sum = 0; for( i = 1; i < 11; i += 2) sum += i; printf("%d\n", sum); return 0; }

8 Example (Eliza) :do 1 10 2 | + | println Output: >25 Pattern: | |

9 ################################################# # Generated by Eliza Compiler V0.06 (20.10.2004) # Copyright (C) 2000-2004 Matthias Huerlemann.include "runtime.pir".sub _main @MAIN.local PerlUndef a0007__.local PerlUndef a0009__....main_init() __000003: (a0007__) = __do(1, 10, 2).monad3("stat", __000031) (a0009__) = __plus(a0007__).monad1("stat", __000003, __000031) __println(a0009__) end __000031:.print_err() end.end

10 Function Definition :func odd? int -> int !fil {odd? int a = % a 2 | == _1 1, -> a } :odd? 28

11 Patterns | | (transform) | | (filter) | | (first match) | | (2 generators) | ( | ) | | | |

12 More complex Example :func shell.grep file * regex -> - { ::shell { grep file a regex b = with int line in (= line 0, file.open a "r", file.each a | ++ line, rx.match _1 b | println line " : " _1, back) ; err "Can't open file." } }

13 Status and... Actual version: 0.061 First simple programs compiled Code generation to parrot intermediate representation (PIR) works Finish the compiler Build the runtime Lots of documentation

14 ... Future Sample applications as proof of concept Adapter for Perl modules QA functionality with metrics Documentation generation feature Private functions and private data members in namespaces Aspects IDE


Download ppt "Agenda About me and Eliza Design Principles Function Concept Type Hierarchy Example (Description, C, Eliza) Function Definition Patterns More Complex."

Similar presentations


Ads by Google