ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/docs/pws2004/goofed.mgp
Revision: 1.1
Committed: Sun Jun 27 20:13:36 2004 UTC (22 years, 3 months ago) by root
Branch: MAIN
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 %include "std.mgp"
2     %%default 1 bimage "gtk/gtk-window.jpg" 1024x768, center
3     %page
4     %%bimage "gtk/screenshot.jpg" 1600x1200
5    
6     %center
7     GOOFED
8    
9    
10     %center
11     Generic
12     Object
13     Oriented
14     Flexible
15     Extensible
16     Daemon
17    
18     Perl embedden... einmal anders!
19    
20     %page
21    
22     Wozu?
23    
24     %pause
25     Ersetzen eines bestehenden Servers
26     %pause
27     Langzeitstabilität
28     %pause
29     Effizienz & Skalierbarkeit
30     %pause
31     Algorithmen sollten einfach und klar ausdrückbar sein
32     %pause
33    
34     Vor- u. Nachteile von Perl:
35     %pause
36     Perl besitzt viele nützliche Module
37     %pause
38     Perl hat viele Abhängigkeiten (externe Dateien...)
39     %pause
40     Perl wird nicht häufig embeddet => wenig Beispiele
41     %pause
42     Perl stabil? Ja, aber nicht automatisch...
43    
44     %page
45    
46     Eckpunke der Implementation
47    
48     %pause
49     Einzelnes Binary
50     %pause
51     keine externen Dateien
52     %pause
53     auch nicht zur Laufzeit, wie PAR
54     %pause
55     Kein komplexes Build-System
56     %pause
57     Feste Perl-Version: Upgrade == Kopfschmerzen
58     %pause
59     Perl-Sourcen integriert
60     %pause
61     Ausgewählte Module
62     %pause
63     Coro
64    
65     %page
66    
67     Microperl
68    
69     %pause
70     µperl, bzw. uperl ist Teil der Perl-Distribution
71     %pause
72     README.micro, Makefile.micro, uconfig.sh
73     %pause
74     sehr spartanisch: C89 + ein bisschen POSIX
75    
76     %pause
77     Tuning
78     %font "t5"
79     <= -DPERL_CORE -DPERL_MICRO -DSTANDARD_C
80     -DPERL_USE_SAFE_PUTENV
81     => -DPERL_CORE=1 -DPERL_MICRO=1
82    
83     %pause
84     vi uconfig.sh
85    
86     %page
87    
88     Ergebnis
89    
90    
91     %pause
92     libuperl.a
93    
94     %pause
95     microperl
96    
97     %pause
98     Config.pm
99    
100     %page
101    
102     Bibliotheksdateien
103    
104     %font "t3"
105     UPERL = uperl/microperl -Ilib-perl
106    
107     src/libfiles.c: s/gen_libfiles extensions
108     $(UPERL) s/gen_libfiles >$@
109     %font "s"
110    
111     %pause
112     gen_libfiles erzeugt src/libfiles.c:
113    
114     %font "t3"
115     const char *embed_files[] = {
116     /* 0 */
117     "\025Attribute/Handlers.pm\000\000\030Apackage Attribute::Handlers;\01...
118     " "data eq 'ARRAY';\012\011\011\011\\$data = [ \\$data ] unless \\$wa...
119     ...
120     ,
121     };
122    
123     const int embed_file_num = 208;
124    
125     %page
126    
127     Module mit XS-Dateien
128    
129     %pause
130     ExtUtils::MakeMaker bietet Support für in-Tree-Builds
131     %pause
132     %font "t5"
133     $TOP/uperl/microperl -I$TOP/lib-perl
134     Makefile.PL INSTALLDIRS=perl
135     PERL_CORE=1 PERL_SRC=$TOP/uperl
136     PERL_LIB=$TOP/lib-perl
137     %font "s"
138    
139     %pause
140     Statische Module
141     %pause
142     %font "t5"
143     make CC=$(CC) OPTIMIZE=$(OPTIMIZE) LINKTYPE=static CCCDLFLAGS= static
144    
145     %page
146    
147     Linken
148    
149     %pause
150     %font "t4"
151     goofed: src/main.o src/xsinit.o src/libfiles.o extensions
152     $(CC) $(CFLAGS) -o $@ src/xsinit.o
153     `find lib-perl/auto -name '*.a' -print`
154     src/main.o src/libfiles.o uperl/libuperl.a
155     $(LIBS)
156     %font "s"
157    
158     %pause
159     xsinit.c enthält boot_Modulname Aufrufe, die die bootstrap-Funktionen registrieren:
160    
161     %pause
162     %font "t4"
163     newXS ("daemon::bootstrap", boot_daemon, file);
164     newXS ("re::bootstrap", boot_re, file);
165     newXS ("POSIX::bootstrap", boot_POSIX, file);
166     \# usw..
167    
168    
169     %page
170    
171     "Bootstrapping"
172    
173     %pause
174     %font "t4"
175     char *embed_argv[EMBED_ARGC] = {
176     "goofed", "-e", ....
177     };
178    
179     %pause
180     daemon->bootstrap (0);
181     PerlIO::scalar->bootstrap (0);
182     %pause
183     @INC = sub {
184     open my $fh, '<', \(daemon::libfile ($_[1]))
185     or die "FATAL: loader can't in-memory stream\n";
186     $fh;
187     };
188     %pause
189     require daemon;
190     daemon->init;
191    
192