Was können wir von Rebol lernen?

901 views

Published on

Rebol hat strikt überprüfte Datentypen und erlaubt einfache Definition einer eigenen DSL. Daher kennt es viele Kontexte und ist unglaublich ausdrucksstark. Rebolprogramme können so kurz werden, daß selbst Perl etwas davon lernen kann.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
901
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Was können wir von Rebol lernen?

  1. 1. Was kann Perl von Rebol lernen?
  2. 2. Kein Rebol Lehrgang
  3. 3. etwas Hobbyphilosophie
  4. 4. Perl Philosophie TIMTOWTDI simple and possible context sensitive
  5. 5. Philosophie TIMTOWTDI simple and possible context sensitive
  6. 6. Zitat Take a dash of PERL, mix with the cross platform compatibilty of a Java, and make it extremely easy for beginners to start coding, and you get the general idea.
  7. 7. A Hobby Philosopher
  8. 8. „Real“ Philosopher
  9. 9. Carl Sassenrath
  10. 10. Carl Sassenrath - Apple, HP and Commodore
  11. 11. Carl Sassenrath - Apple, HP and Commodore - Pantaray, American Multimedia, Videostream
  12. 12. Carl Sassenrath - Apple, HP and Commodore - Pantaray, American Multimedia, Videostream - REBOL Technologies
  13. 13. Carl Sassenrath - Amiga OS, IOS, VisCorp ED - CDTV - Amiga Logo, Next Gen. Forth, Rebol
  14. 14. - Distribution
  15. 15. - Browser
  16. 16. Left Click : Start Rebol App
  17. 17. Left Click : Start Rebol App
  18. 18. Rebol App
  19. 19. Rebol App
  20. 20. Rebol App
  21. 21. Rebol App
  22. 22. - Browser
  23. 23. Right Click : Get Meta Data
  24. 24. Rebol Editor
  25. 25. - Browser
  26. 26. Rebol Shell
  27. 27. Carl Sassenrath - Amiga OS, IOS, VisCorp ED - CDTV - Amiga Logo, Next Gen. Forth, Rebol
  28. 28. Carl Sassenrath - Amiga OS, IOS, VisCorp ED - CDTV - Amiga Logo, Next Gen. Forth, Rebol
  29. 29. ● Lisp, Forth, Logo and Self
  30. 30. ● Lisp, Forth, Logo and Self ● Lightweight Distributed Computing
  31. 31. ● Lisp, Forth, Logo and Self ● Lightweight Distributed Computing ● programming-in-the-small (PITS)
  32. 32. PITS: ~ 800kB Interpreter 1.8 MB für die Distribution Libs Tools Samples Docs Links
  33. 33. PITS: Remote Editor: 53 Daytime Server Deamon: 61 bmp2png Konverter TCP Port Scanner: 98 einfache Uhr App: 106 minimaler Email Client: 130 einfacher Bildbetrachter: 132
  34. 34. PITS: Remote Editor: 53 Daytime Server Deamon: 61 bmp2png Converter TCP Port Scanner: 98 Simple Clock App: 106 Minimal Email Client: 130 Simple Picture Viewer: 132
  35. 35. PITS: view layout [ f: field btn"Edit"[editor to-url f/text] ]
  36. 36. ● Lisp, Forth, Logo and Self ● Lightweight Distributed Computing ● programming-in-the-small (PITS)
  37. 37. ● Lisp, Forth, Logo and Self ● Lightweight Distributed Computing ● fighting software complexety
  38. 38. ● Lisp, Forth, Logo and Self ● Lightweight Distributed Computing ● fighting software complexety
  39. 39. Silent Scream: Rebel with a cause
  40. 40. Relative Expression-Based Object Language
  41. 41. Relative Expression-Based Object Language eval that like REBOL does: back to front
  42. 42. Relative Expression-Based Object Language the obvious, don't argue with that
  43. 43. Relative Expression-Based Object Language sounds like OOP ?
  44. 44. Relative Expression-Based Object Language ● no OOP like Ruby or Perl 6
  45. 45. Relative Expression-Based Object Language ● no OOP like Ruby or Perl 6 ● Object means here just „thing“
  46. 46. Relative Expression-Based Object Language That brings no meaning anyway :) There are same principles it's based on
  47. 47. Relative Expression-Based Object Language Sounds like a functional language ?
  48. 48. Relative Expression-Based Object Language (not pure) functional (since 2.0)
  49. 49. Relative Expression-Based Object Language
  50. 50. Relative Expression-Based Object Language ● Thats's the main message
  51. 51. Relative Expression-Based Object Language ● Thats's the main message ● That's how Rebol syntax works
  52. 52. Relative Expression-Based Object Language ● Thats's the main message ● That's how Rebol syntax works ● In Perl we call that context sensitive
  53. 53. Relative Expression-Based Object Language read http://www.perl.org/learn.html read %info.txt
  54. 54. Rebol Perl 5 read http://www.perl.org/learn.html use LWP::Simple; get("http://www.perl.org/learn.html"); text: read %info.txt use File::Slurp; my $text = slurp( 'info.txt' ) ;
  55. 55. Rebol Perl 6 read http://www.perl.org/learn.html use HTTP::Client; HTTP::Client.new.get("http://www.perl.org/learn.html"); text: read %info.txt my $text = slurp( 'info.txt' ) ;
  56. 56. Rebol messages: read nntp://news.server.dom/comp.lang.rebol
  57. 57. Rebol messages: read nntp://news.server.dom/comp.lang.rebol image: read/binary http://www.page.dom/image.jpg write/binary %image.jpg image
  58. 58. welcome to the strange land
  59. 59. shock therapy
  60. 60. , vergiss was du weißt keine Variablen keine Hashes Keine Vorrangtabelle (2 + 3 * 2 == 10) keine Builtins keine Subroutinen manchmal lexikalische räume keine Namensräume (vor Rebol 3) keine Regex (parse)
  61. 61. Alles weg?
  62. 62. 4 Begriffe müsst ihr verstehen
  63. 63. 4 Begriffe worte: data types: series: refinements:
  64. 64. 4 Begriffe worte: typenloser Datenkontainer data types: series: refinements:
  65. 65. 4 Begriffe worte: Variablen, Routinen, Builtins data types: series: refinements:
  66. 66. 4 Begriffe worte: Variablen, Routinen, Builtins data types: integer, string, char, tuple, pair, block, series: refinements:
  67. 67. 4 Begriffe worte: Variablen, Routinen, Builtins data types: integer, string, char, tuple, pair, block, money, file, url, email, tag, binary, date, time, issue series: refinements:
  68. 68. 4 Begriffe worte: Variablen, Routinen, Builtins data types: integer, string, char, tuple, pair, block, money, file, url, email, tag, binary, date, time, issue series: refinements:
  69. 69. 4 Begriffe worte: Variablen, Routinen, Builtins data types: integer, string, char, tuple, pair, block, money, file, url, email, tag, binary, date, time, issue serien: Listen, Hashes, Codeblöcke refinements:
  70. 70. 4 Begriffe worte: Variablen, Routinen, Builtins data types: integer, string, char, tuple, pair, block, money, file, url, email, tag, binary, date, time, issue series: Listen, Hashes, Codeblöcke refinements: (@ / %) slices / return value
  71. 71. Perl Rebol # => ; {} => [] $var = => var: $var => :var eval $var => var $var[3] => var/3 $var{'sub'} => var/sub sub() => sub sub($p,$m) => sub p m
  72. 72. Perl Rebol print => print say => prin $var = => var:
  73. 73. Perl Rebol $a++ a: a + 1
  74. 74. Perl Rebol $a = 30 * 3.1415 / 180 sin($a) / cos($a) tangent 30 sin($a) / cos($a) tangent/radians 30 use Math::Trig; tan(deg2rad(30));
  75. 75. Perl 6 Rebol loop => forever all, any none @a => all, any [] prompt => ask slurp => read kein break in switch Pair als nativer Typ grammars, viel MMD
  76. 76. Meta Data REBOL [ Title: Date: Version: ... ]
  77. 77. Meta Data File: Author: Email: Web: Rights: Requires: Purpose: { }, Comment: { }, Notes: { } History: [0.1.1 12-Oct-2008 "add to ... path" Library: [ ...
  78. 78. DSL for GUI view layout [ text :rise_time button "Quit" #"q" [quit] ]
  79. 79. in Perl use Tkx; Tkx::button(".b", -text => "Hello, world", -command => sub { Tkx::destroy(".") }, ); Tkx::pack(".b"); Tkx::MainLoop();
  80. 80. in Perl use Prima qw(Application Button); New Prima::MainWindow( text => "Hello, world", size => [ 200, 200] , )-> insert( Button => centered => 1, text => "Hello, world", onClick => sub { $::application->close } , ); run Prima;
  81. 81. RebGUI view layout [ text :rise_time button "Quit" #"q" [quit] ]
  82. 82. DSL for Regex expr: [term ["+" | "-"] expr | term] term: [factor ["*" | "/"] term | factor] factor: [primary "**" factor | primary] primary: [some digit | "(" expr ")"] digit: charset "0123456789" probe parse "1 + 2 * ( 3 - 2 ) / 4" expr == true
  83. 83. DSL for Regex parse read http://www.gaisma.com/en/location/halle.html [ thru <td class="sunshine"><i> copy rise_time to </i> ]
  84. 84. funktionale DSL does func function
  85. 85. DSL für OOP make
  86. 86. Rebol 3 Open Source Unicode Debug Hooks bessere GUI Objekte
  87. 87. Ideen Io::All Contextual::Return Prima
  88. 88. Ideen Perlapi Module Distributionen

×