What can Perl learn from Rebol ?
No Rebol Course
some hobby philosophy
Perl Philosophy


   TIMTOWTDI

 simple and possible

  context sensitive
Philosophy


  TIMTOWTDI

simple and possible

 context sensitive
Quote


    Take a dash of PERL, mix with the cross
  platform compatibilty of a Java, and make it
extremely easy for begi...
A Hobby Philosopher
„Real“ Philosopher
Carl Sassenrath
Carl Sassenrath


- Apple, HP and Commodore
Carl Sassenrath


       - Apple, HP and Commodore

- Pantaray, American Multimedia, Videostream
Carl Sassenrath


       - Apple, HP and Commodore

- Pantaray, American Multimedia, Videostream

          - REBOL Techno...
Carl Sassenrath

    - Amiga OS, IOS, VisCorp ED

              - CDTV

- Amiga Logo, Next Gen. Forth, Rebol
- Distribution
- Browser
Left Click : Start Rebol App
Left Click : Start Rebol App
Rebol App
Rebol App
Rebol App
Rebol App
- Browser
Right Click : Get Meta Data
Rebol Editor
- Browser
Rebol Shell
Carl Sassenrath

    - Amiga OS, IOS, VisCorp ED

              - CDTV

- Amiga Logo, Next Gen. Forth, Rebol
Carl Sassenrath

    - Amiga OS, IOS, VisCorp ED

              - CDTV

- Amiga Logo, Next Gen. Forth, Rebol
●   Lisp, Forth, Logo and Self
●   Lisp, Forth, Logo and Self

●   Lightweight Distributed Computing
●   Lisp, Forth, Logo and Self

●   Lightweight Distributed Computing

●   programming-in-the-small (PITS)
PITS:

~ 800kB binary
1.8 MB for distribution

      Libs
      Tools
      Samples
      Docs
      Links
PITS:

     Remote Editor: 53
Daytime Server Deamon: 61
   bmp2png Converter
  TCP Port Scanner: 98
  Simple Clock App: 10...
PITS:

     Remote Editor: 53
Daytime Server Deamon: 61
   bmp2png Converter
  TCP Port Scanner: 98
  Simple Clock App: 10...
PITS:


view layout [
  f: field btn"Edit"[editor to-url f/text]
]
●   Lisp, Forth, Logo and Self

●   Lightweight Distributed Computing

●   programming-in-the-small (PITS)
●   Lisp, Forth, Logo and Self

●   Lightweight Distributed Computing

     ●   fighting software complexety
●   Lisp, Forth, Logo and Self

●   Lightweight Distributed Computing

     ●   fighting software complexety
Silent Scream: Rebel with a cause
Relative Expression-Based Object Language
Relative Expression-Based Object Language




        eval that like REBOL does:

              back to front
Relative Expression-Based Object Language




       the obvious, don't argue with that
Relative Expression-Based Object Language




             sounds like OOP ?
Relative Expression-Based Object Language



         ●   no OOP like Ruby or Perl 6
Relative Expression-Based Object Language



           ●   no OOP like Ruby or Perl 6

       ●   Object means here just ...
Relative Expression-Based Object Language




       That brings no meaning anyway :)

     There are same principles it's...
Relative Expression-Based Object Language




      Sounds like a functional language ?
Relative Expression-Based Object Language




        (not pure) functional (since 2.0)
Relative Expression-Based Object Language
Relative Expression-Based Object Language


          ●   Thats's the main message
Relative Expression-Based Object Language


            ●   Thats's the main message

       ●   That's how Rebol syntax w...
Relative Expression-Based Object Language


              ●   Thats's the main message

         ●   That's how Rebol synt...
Relative Expression-Based Object Language




      read http://www.perl.org/learn.html

                read %info.txt
Rebol                         Perl 5


read http://www.perl.org/learn.html
          use LWP::Simple;
          get("http:...
Rebol                         Perl 6


 read http://www.perl.org/learn.html
            use HTTP::Client;
HTTP::Client.new...
welcome to the strange land
shock therapy
, forget all you know


            no variables
             no hashes
no precedence table (2 + 3 * 2 == 10)
            ...
All is gone?
You have to know 4 concepts
4 Terms
     words:

 data types:


     series:

refinements:
4 Terms
     words:    typeless data container

 data types:


     series:

refinements:
4 Terms
     words:    variables, routines, buildins

 data types:


     series:

refinements:
4 Terms
     words:     variables, routines, buildins

 data types: integer, string, char, tuple, pair, block,


     seri...
4 Terms
      words:     variables, routines, buildins

  data types: integer, string, char, tuple, pair, block,
money, fi...
4 Terms
      words:     variables, routines, buildins

  data types: integer, string, char, tuple, pair, block,
money, fi...
4 Terms
      words:     variables, routines, buildins

  data types: integer, string, char, tuple, pair, block,
money, fi...
4 Terms
      words:     variables, routines, buildins

  data types: integer, string, char, tuple, pair, block,
money, fi...
Perl               Rebol
    #         =>      ;
   {}         =>     []
  $var =      =>    var:
  $var        =>   :var
...
Perl   Rebol


$a++   a: a + 1
Perl                Rebol


$a = 30 * 3.1415 / 180
sin($a) / cos($a)      tangent 30

sin($a) / cos($a)      tangent/radia...
Perl 6             Rebol

          loop     =>    forever
all, any none @a   =>   all, any []
         prompt    =>      ...
Meta Data

  REBOL [
    Title:
    Date:
    Version:
     ...
  ]
Meta Data

  File: Author: Email: Web: Rights: Requires:

Purpose: { },    Comment: {       },   Notes: {   }

 History: [...
DSL for GUI

  view layout [
       text :rise_time
      button "Quit" #"q" [quit]
  ]
in Perl
use Tkx;

Tkx::button(".b",
    -text => "Hello, world",
    -command => sub { Tkx::destroy(".") },
);

Tkx::pack(...
in Perl
use Prima qw(Application Button);

New Prima::MainWindow(
     text => "Hello, world",
     size => [ 200, 200] ,
...
RebGUI

view layout [
     text :rise_time
    button "Quit" #"q" [quit]
]
DSL for Regex

    expr: [term ["+" | "-"] expr | term]
   term: [factor ["*" | "/"] term | factor]
  factor: [primary "**...
DSL for Regex

parse read
 http://www.gaisma.com/en/location/halle.html
 [
  thru <td class="sunshine"><i>
  copy rise_tim...
Functional DSL

     does

     func

    function
DSL for OOP



    make
Rebol 3

  Open Source

     Unicode

  Debug Hooks

Better GUI Objects
Ideas

Io::All

Perlapi

Modules

 Prima
What we can learn from Rebol?
What we can learn from Rebol?
Upcoming SlideShare
Loading in …5
×

What we can learn from Rebol?

2,223 views

Published on

Aout philosophy and features of Rebol and how get some of the interesting inside of Perl. Held at YAPC::EU 2010 in Pisa.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

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

No notes for slide

What we can learn from Rebol?

  1. 1. What can Perl learn from Rebol ?
  2. 2. No Rebol Course
  3. 3. some hobby philosophy
  4. 4. Perl Philosophy TIMTOWTDI simple and possible context sensitive
  5. 5. Philosophy TIMTOWTDI simple and possible context sensitive
  6. 6. Quote 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 binary 1.8 MB for distribution Libs Tools Samples Docs Links
  33. 33. 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
  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. welcome to the strange land
  57. 57. shock therapy
  58. 58. , forget all you know no variables no hashes no precedence table (2 + 3 * 2 == 10) no builtins no Subroutinen sometimes scopes no name spaces (befor Rebol 3) no Regex (parse)
  59. 59. All is gone?
  60. 60. You have to know 4 concepts
  61. 61. 4 Terms words: data types: series: refinements:
  62. 62. 4 Terms words: typeless data container data types: series: refinements:
  63. 63. 4 Terms words: variables, routines, buildins data types: series: refinements:
  64. 64. 4 Terms words: variables, routines, buildins data types: integer, string, char, tuple, pair, block, series: refinements:
  65. 65. 4 Terms words: variables, routines, buildins data types: integer, string, char, tuple, pair, block, money, file, url, email, tag, binary, date, time, issue series: refinements:
  66. 66. 4 Terms words: variables, routines, buildins data types: integer, string, char, tuple, pair, block, money, file, url, email, tag, binary, date, time, issue series: refinements:
  67. 67. 4 Terms words: variables, routines, buildins data types: integer, string, char, tuple, pair, block, money, file, url, email, tag, binary, date, time, issue series: lists, hashes, code refinements:
  68. 68. 4 Terms words: variables, routines, buildins data types: integer, string, char, tuple, pair, block, money, file, url, email, tag, binary, date, time, issue series: lists, hashes, code refinements: (@ / %) slices / return value
  69. 69. 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
  70. 70. Perl Rebol $a++ a: a + 1
  71. 71. 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));
  72. 72. Perl 6 Rebol loop => forever all, any none @a => all, any [] prompt => ask slurp => read no break in switch Pair als nativer Typ grammars, heavy usage of MMD
  73. 73. Meta Data REBOL [ Title: Date: Version: ... ]
  74. 74. Meta Data File: Author: Email: Web: Rights: Requires: Purpose: { }, Comment: { }, Notes: { } History: [0.1.1 12-Oct-2008 "add to ... path" Library: [ ...
  75. 75. DSL for GUI view layout [ text :rise_time button "Quit" #"q" [quit] ]
  76. 76. in Perl use Tkx; Tkx::button(".b", -text => "Hello, world", -command => sub { Tkx::destroy(".") }, ); Tkx::pack(".b"); Tkx::MainLoop();
  77. 77. 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;
  78. 78. RebGUI view layout [ text :rise_time button "Quit" #"q" [quit] ]
  79. 79. 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
  80. 80. DSL for Regex parse read http://www.gaisma.com/en/location/halle.html [ thru <td class="sunshine"><i> copy rise_time to </i> ]
  81. 81. Functional DSL does func function
  82. 82. DSL for OOP make
  83. 83. Rebol 3 Open Source Unicode Debug Hooks Better GUI Objects
  84. 84. Ideas Io::All Perlapi Modules Prima

×