Software necromancy with Perl Dave Lambley dlambley@cpan.org - - PowerPoint PPT Presentation

software necromancy with perl
SMART_READER_LITE
LIVE PREVIEW

Software necromancy with Perl Dave Lambley dlambley@cpan.org - - PowerPoint PPT Presentation

Software necromancy with Perl Dave Lambley dlambley@cpan.org Accounting software Informix C-ISAM 1987 Perl 1.0 GCC 1.0 TPS report example Historic 4GL Variables bound to database fields. Schema defined outside code using UI.


slide-1
SLIDE 1

Software necromancy with Perl

Dave Lambley dlambley@cpan.org

slide-2
SLIDE 2

Accounting software

slide-3
SLIDE 3

Informix C-ISAM

slide-4
SLIDE 4

1987

  • Perl 1.0
  • GCC 1.0
slide-5
SLIDE 5

TPS report example

slide-6
SLIDE 6

Historic 4GL

  • Variables bound to database fields.
  • Schema defined outside code using UI.
  • Weakish types.
slide-7
SLIDE 7

Implied dualvars, predating Perl’s?

slide-8
SLIDE 8

Regexp::Grammars

  • Perl 5.10 recursive regexps.
  • Build a parser from familiar regexps.
  • No separate lexical analysis.
  • Mis-parses are slow and hard to debug
slide-9
SLIDE 9

a s s i g n m e n t c

  • n

s t a n t l v a l u e c

  • n

s t a n t = i d e n t i fj e r = t p s _ r e p

  • r

t _ i d

slide-10
SLIDE 10

a s s i g n m e n t c

  • n

s t a n t l v a l u e c

  • n

s t a n t = i d e n t i fj e r = t p s _ r e p

  • r

t _ i d

slide-11
SLIDE 11

Regexp::Grammars

slide-12
SLIDE 12

s

slide-13
SLIDE 13

S e t a c c u m u l a t

  • r
  • n

t p s _ s t a t u s I d e n t i fj e r = t p s _ s t a t u s C

  • m

p a r i s

  • n

e q 1 C

  • n

s t a n t = 1 F

  • l

l

  • w

i n g l i n e S e t a c c u m u l a t

  • r

s e t t p s _ n u m I d e n t i fj e r = t p s _ n u m A d d t

  • a

c c u m u l a t

  • r

+ 1 C

  • n

s t a n t = 1 Mu l t i p l y a c c u m u l a t

  • r

* 3 C

  • n

s t a n t = 3 S t

  • r

e i n v a r i a b l e = t p s _ n u m I d e n t i fj e r = t p s _ n u m S e t a c c u m u l a t

  • r

s e t t p s _ c h e c k

  • u

t I d e n t i fj e r = t p s _ c h e c k

  • u

t A d d t

  • a

c c u m u l a t

  • r

+ 1 C

  • n

s t a n t = 1 S t

  • r

e i n v a r i a b l e = t p s _ c h e c k e d I d e n t i fj e r = t p s _ c h e c k e d

slide-14
SLIDE 14

Phases

  • Preprocess text (join line continuations, remove

comments.

  • Parse lines to parse tree.
  • Flatten parse tree to op list.
  • Execute op list.
slide-15
SLIDE 15
slide-16
SLIDE 16
slide-17
SLIDE 17

In summary

  • Laziness as a virtue predates Perl 1.0.
slide-18
SLIDE 18

But next

  • Is Perl dead?
  • Is the Perl demoscene dead?
slide-19
SLIDE 19

Presenting demo#1

  • Code by DLAMBLEY of CPAN.
  • Grafix by .. no-one.
  • Music by no-one.
slide-20
SLIDE 20

Demos and games need hardware

Sources: CSG and Acorn Computer

slide-21
SLIDE 21

Source: https://www.khronos.org/opengl/wiki/Rendering_Pipeline_Overview

slide-22
SLIDE 22

OpenGL

  • SDL.pm recommends OpenGL.pm.
  • OpenGL.pm gives you most of OpenGL 1.2.
slide-23
SLIDE 23
slide-24
SLIDE 24

Source: https://www.khronos.org/opengl/wiki/Rendering_Pipeline_Overview

slide-25
SLIDE 25

A vertex shader

slide-26
SLIDE 26

A fragment shader

slide-27
SLIDE 27
slide-28
SLIDE 28
slide-29
SLIDE 29

s

slide-30
SLIDE 30

Pascal?

  • ObjectWindows ++
  • Pointer arithmetic ++
  • Compiler ++
  • IDE ++
  • System library --
slide-31
SLIDE 31

FreePascal

  • Author terrified of leaving DOS.
  • https://www.freepascal.org/
  • fpc -Mtp foo.pas
  • fpc -Mtp -Ci -Co -CR -Cr -Ct -g foo.pas
slide-32
SLIDE 32

Artistic license? DFSG??

slide-33
SLIDE 33

A new GRAPHWIN.PAS

  • “graphwin.pas”
slide-34
SLIDE 34

Running it

slide-35
SLIDE 35

Does it work?

slide-36
SLIDE 36

Grab the code! It works!

  • https://github.com/davel/perldemo
  • https://github.com/davel/pascal-games
  • My customer needs more Perl, talk to me.