Software necromancy with Perl Dave Lambley dlambley@cpan.org - - PowerPoint PPT Presentation
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.
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.
- Weakish types.
Implied dualvars, predating Perl’s?
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
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
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
Regexp::Grammars
s
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
Phases
- Preprocess text (join line continuations, remove
comments.
- Parse lines to parse tree.
- Flatten parse tree to op list.
- Execute op list.
In summary
- Laziness as a virtue predates Perl 1.0.
But next
- Is Perl dead?
- Is the Perl demoscene dead?
Presenting demo#1
- Code by DLAMBLEY of CPAN.
- Grafix by .. no-one.
- Music by no-one.
Demos and games need hardware
Sources: CSG and Acorn Computer
Source: https://www.khronos.org/opengl/wiki/Rendering_Pipeline_Overview
OpenGL
- SDL.pm recommends OpenGL.pm.
- OpenGL.pm gives you most of OpenGL 1.2.
Source: https://www.khronos.org/opengl/wiki/Rendering_Pipeline_Overview
A vertex shader
A fragment shader
s
Pascal?
- ObjectWindows ++
- Pointer arithmetic ++
- Compiler ++
- IDE ++
- System library --
FreePascal
- Author terrified of leaving DOS.
- https://www.freepascal.org/
- fpc -Mtp foo.pas
- fpc -Mtp -Ci -Co -CR -Cr -Ct -g foo.pas
Artistic license? DFSG??
A new GRAPHWIN.PAS
- “graphwin.pas”
Running it
Does it work?
Grab the code! It works!
- https://github.com/davel/perldemo
- https://github.com/davel/pascal-games
- My customer needs more Perl, talk to me.