-
Notifications
You must be signed in to change notification settings - Fork 0
/
faq.htm
4053 lines (3861 loc) · 268 KB
/
faq.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<html>
<head>
<meta charset="utf-8" />
<title>
Seed7 FAQ</title>
<meta name="author" content="Thomas Mertes" />
<meta name="copyright" content="Thomas Mertes" />
<meta name="keywords" content="Seed7, SeedSeven, Seed, Seven, 7, programming, language, extensible, extendable" />
<meta name="description" content="Seed7 - The extensible programming language" />
<meta name="page-topic" content="programming language, computer, software, downloads" />
<meta name="audience" content="all" />
<meta name="content-language" content="en" />
<meta name="robots" content="index,follow" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="style3.css" type="text/css" />
</head>
<body style="margin:0 0 0 0;">
<div style="background-image: url('images/header1x.png');" class="top_image">
<img style="overflow:hidden;" src="images/hearts7m.png" height="68" width="50"
/><img style="overflow:hidden;" src="images/header3.png" height="68" width="745" />
</div>
<div style="background-image: url('images/fillpix.png');" class="space_below_top_image">
</div>
<div class="menu">
<a class="head" href="index.htm"><big>Seed7</big></a>
<a class="menu" href="faq.htm">FAQ</a>
<a class="menu" href="manual/index.htm">Manual</a>
<a class="menu" href="scrshots/index.htm">Programs</a>
<a class="menu" href="examples/index.htm">Examples</a>
<a class="menu" href="libraries/index.htm">Libraries</a>
<a class="menu" href="algorith/index.htm">Algorithms</a>
<a class="menu" href="benchmks/index.htm">Benchmarks</a>
<a class="menu" href="subject_index.htm">Index</a>
<a class="menu" href="http://sourceforge.net/project/showfiles.php?group_id=151126">Download</a>
<a class="menu" href="https://github.com/ThomasMertes/seed7">GitHub</a>
<a class="menu" href="build.htm">Build Seed7</a>
<a class="menu" href="links.htm">Links</a>
</div>
<div class="content">
<div style="padding-right:20;">
<p></p><hr /><h1 align="center">
Frequently asked questions
</h1><hr />
<p></p>
<h2>
General
</h2><ul>
<li><a class="link" href="#new_language"><b>
Why a new programming language?
</b></a></li>
<li><a class="link" href="#design_principles"><b>
What are the design principles of Seed7?
</b></a></li>
<li><a class="link" href="#extensible_programming"><b>
What is an extensible programming language?
</b></a></li>
<li><a class="link" href="#portable"><b>
Are Seed7 programs portable?
</b></a></li>
<li><a class="link" href="#license"><b>
Which license does Seed7 use?
</b></a></li>
<li><a class="link" href="#pascal_descendant"><b>
Is Seed7 a descendant of Pascal?
</b></a></li>
<li><a class="link" href="#java_comparison"><b>
How does Seed7 compare to Java?
</b></a></li>
<li><a class="link" href="#application_area"><b>
What kind of programs can be written in Seed7?
</b></a></li>
<li><a class="link" href="#lines_of_code"><b>
How many lines of code are in the Seed7 project?
</b></a></li>
<li><a class="link" href="#os"><b>
On which operating systems does Seed7 run?
</b></a></li>
<li><a class="link" href="#installer"><b>
Is there an installer for Seed7?
</b></a></li>
<li><a class="link" href="#download"><b>
Where can I download Seed7?
</b></a></li>
<li><a class="link" href="#uncompress"><b>
How do I uncompress the *.tgz file from the release?
</b></a></li>
<li><a class="link" href="#compile_interpreter"><b>
How do I compile the Seed7 interpreter?
</b></a></li>
<li><a class="link" href="#errors"><b>
I got errors when compiling Seed7. What should I do?
</b></a></li>
<li><a class="link" href="#verify_interpreter"><b>
How do I verify that the interpreter works correctly?
</b></a></li>
<li><a class="link" href="#install"><b>
How can I install Seed7?
</b></a></li>
<li><a class="link" href="#interpreter"><b>
How can I use the Seed7 interpreter?
</b></a></li>
<li><a class="link" href="#compile"><b>
Is it possible to compile Seed7 programs?
</b></a></li>
<li><a class="link" href="#syntax_highlighting"><b>
Is there support for syntax highlighting?
</b></a></li>
<li><a class="link" href="#debug_with_eclipse"><b>
Can I debug Seed7 programs with Eclipse?
</b></a></li>
<li><a class="link" href="#profile_programs"><b>
Can I profile Seed7 programs?
</b></a></li>
</ul><h2>
Language
</h2><ul>
<li><a class="link" href="#reserved_words"><b>
What are the reserved words of Seed7?
</b></a></li>
<li><a class="link" href="#syntax"><b>
How is the syntax of Seed7 defined?
</b></a></li>
<li><a class="link" href="#statements"><b>
Why does Seed7 not use the C statements like C++ and Java?
</b></a></li>
<li><a class="link" href="#declaration_syntax"><b>
Why is the <tt>type: name</tt> declaration syntax used?
</b></a></li>
<li><a class="link" href="#readability"><b>
What makes code readable?
</b></a></li>
<li><a class="link" href="#everybody_invents_statements"><b>
Isn't the code unreadable if everybody invents new statements?
</b></a></li>
<li><a class="link" href="#lisp_comparison"><b>
Hasn't Lisp already user defined statements and operators?
</b></a></li>
<li><a class="link" href="#static_type_checking"><b>
Why does Seed7 use static type checking?
</b></a></li>
<li><a class="link" href="#development_speed_and_type_checking"><b>
Is the program development slowed down with static type checking?
</b></a></li>
<li><a class="link" href="#runtime_speed_and_type_checking"><b>
Does static type checking speed up programs?
</b></a></li>
<li><a class="link" href="#first_class_types_and_type_checking"><b>
How can static type checking work if types are first-class objects?
</b></a></li>
<li><a class="link" href="#type_inference"><b>
Why does Seed7 not use type inference?
</b></a></li>
<li><a class="link" href="#local_type_declaration"><b>
Why does a local type declaration trigger an error?
</b></a></li>
<li><a class="link" href="#two_dimensional_array"><b>
Why does a two-dimensional array trigger an error?
</b></a></li>
<li><a class="link" href="#automatic_casts"><b>
Are there automatic casts to the right type?
</b></a></li>
<li><a class="link" href="#do_what_i_mean"><b>
Is Seed7 a "do what I mean" language?
</b></a></li>
<li><a class="link" href="#declare_later"><b>
Can I use something and declare it later?
</b></a></li>
<li><a class="link" href="#overloading"><b>
Can functions be overloaded?
</b></a></li>
<li><a class="link" href="#overload_result"><b>
Can I overload two functions which just differ in the result type?
</b></a></li>
<li><a class="link" href="#variable_parameter_list"><b>
Can functions have variable parameter lists?
</b></a></li>
<li><a class="link" href="#initialization_with_is"><b>
Why does the initialization use the keyword 'is' instead of ':=' ?
</b></a></li>
<li><a class="link" href="#initialize_data"><b>
Is there an elegant way to initialize data?
</b></a></li>
<li><a class="link" href="#initialize_variables"><b>
Why is it necessary to initialize all variables?
</b></a></li>
<li><a class="link" href="#byte_small_long"><b>
Are there types like byte, small and long?
</b></a></li>
<li><a class="link" href="#unicode"><b>
Is Unicode supported?
</b></a></li>
<li><a class="link" href="#mutable_strings"><b>
Why are strings in Seed7 mutable?
</b></a></li>
<li><a class="link" href="#indexed_from_one"><b>
Why are strings indexed from one?
</b></a></li>
<li><a class="link" href="#comparisons"><b>
How are comparisons done in Seed7?
</b></a></li>
<li><a class="link" href="#database_access"><b>
Can Seed7 access databases?
</b></a></li>
<li><a class="link" href="#regular_expressions"><b>
Are there regular expressions?
</b></a></li>
<li><a class="link" href="#scanner_functions"><b>
What are scanner functions?
</b></a></li>
<li><a class="link" href="#div_operator"><b>
Why is the div operator used for integer divisions?
</b></a></li>
<li><a class="link" href="#concatenation_operators"><b>
Why are & and <& defined for string concatenation?
</b></a></li>
<li><a class="link" href="#types_of_parameters"><b>
What types of parameters does Seed7 have?
</b></a></li>
<li><a class="link" href="#in_parameter"><b>
What is an 'in' parameter?
</b></a></li>
<li><a class="link" href="#difference_val_and_ref_parameter"><b>
Is there an example where val and ref parameters have different behavior?
</b></a></li>
<li><a class="link" href="#call_by_name"><b>
What is call-by-name?
</b></a></li>
<li><a class="link" href="#functions_declared_with_const"><b>
Why are functions declared with const?
</b></a></li>
<li><a class="link" href="#functions_declared_without_const"><b>
Are there functions declared without const?
</b></a></li>
<li><a class="link" href="#integer_overflow"><b>
What is an integer overflow?
</b></a></li>
<li><a class="link" href="#integer_to_bigInteger_promotion"><b>
Why are integers not promoted to bigInteger when they overflow?
</b></a></li>
<li><a class="link" href="#garbage_collection"><b>
Is there a garbage collection?
</b></a></li>
<li><a class="link" href="#object_oriented"><b>
Is Seed7 object oriented?
</b></a></li>
<li><a class="link" href="#inherited_from_object"><b>
Is everything inherited from object?
</b></a></li>
<li><a class="link" href="#difference_overloading_oo"><b>
What is the difference between overloading and object orientation?
</b></a></li>
<li><a class="link" href="#abstract_data_type"><b>
What is an abstract data type?
</b></a></li>
<li><a class="link" href="#multiple_dispatch"><b>
What is multiple dispatch?
</b></a></li>
<li><a class="link" href="#container_classes"><b>
What container classes do exist?
</b></a></li>
<li><a class="link" href="#primitive_types"><b>
Are there primitive types?
</b></a></li>
<li><a class="link" href="#object_and_primitive_types"><b>
What is the difference between object and primitive types?
</b></a></li>
<li><a class="link" href="#when_use_object_or_primitive_types"><b>
When to use an object type and when a primitive type?
</b></a></li>
<li><a class="link" href="#how_does_the_assignment_work"><b>
How does the assignment work?
</b></a></li>
<li><a class="link" href="#two_forms_of_assignment"><b>
Why are there two forms of assignment?
</b></a></li>
<li><a class="link" href="#constructors"><b>
Where are the constructors?
</b></a></li>
<li><a class="link" href="#static_methods"><b>
Are there static methods / class methods?
</b></a></li>
<li><a class="link" href="#generics"><b>
Are there generics / templates?
</b></a></li>
<li><a class="link" href="#parser_in_library"><b>
Is the parser part of the run-time library?
</b></a></li>
<li><a class="link" href="#access_AST"><b>
Can I access the abstract syntax tree (AST)?
</b></a></li>
<li><a class="link" href="#no_artificial_restrictions"><b>
What restrictions does Seed7 have?
</b></a></li>
<li><a class="link" href="#undefined_behavior"><b>
What does the term undefined behavior mean?
</b></a></li>
<li><a class="link" href="#memory_safety"><b>
What does the term memory safety mean?
</b></a></li>
<li><a class="link" href="#exceptions"><b>
Are there exceptions?
</b></a></li>
<li><a class="link" href="#stack_trace"><b>
What happens if an exception is not caught?
</b></a></li>
<li><a class="link" href="#write_raises_RANGE_ERROR"><b>
Why does a write statement raise RANGE_ERROR?
</b></a></li>
<li><a class="link" href="#no_return_statement"><b>
Is there a return statement?
</b></a></li>
<li><a class="link" href="#break_and_continue"><b>
Why are break and continue not supported?
</b></a></li>
<li><a class="link" href="#define_break_and_continue"><b>
How to define break and continue?
</b></a></li>
</ul><h2>
Implementation
</h2><ul>
<li><a class="link" href="#how_parsed"><b>
How is Seed7 parsed?
</b></a></li>
<li><a class="link" href="#lto"><b>
What is link time optimization?
</b></a></li>
<li><a class="link" href="#compile_to_dll_or_so"><b>
Can Seed7 compile to a dll/so?
</b></a></li>
<li><a class="link" href="#lib_path"><b>
Where does the interpreter look for include libraries?
</b></a></li>
<li><a class="link" href="#predefined_include_libraries"><b>
How is the directory of the predefined include libraries determined?
</b></a></li>
<li><a class="link" href="#make_depend"><b>
What happens during <tt>make depend</tt>?
</b></a></li>
<li><a class="link" href="#cmd_config_value"><b>
How does the Seed7 compiler get information about C compiler and runtime?
</b></a></li>
<li><a class="link" href="#seed7_package"><b>
What should a binary Seed7 package install?
</b></a></li>
<li><a class="link" href="#compile_with_database_connectons"><b>
What is necessary to compile Seed7 with database connections?
</b></a></li>
<li><a class="link" href="#searching_dynamic_libraries_failed"><b>
How to fix the error "Searching dynamic libraries failed"?
</b></a></li>
<li><a class="link" href="#bytecode"><b>
Does the interpreter use bytecode?
</b></a></li>
<li><a class="link" href="#analyze"><b>
How does the analyze phase of the interpreter work?
</b></a></li>
<li><a class="link" href="#compile_call_by_name"><b>
How does the compiler implement call-by-name parameters?
</b></a></li>
<li><a class="link" href="#action"><b>
What does action "XYZ_SOMETHING" mean?
</b></a></li>
<li><a class="link" href="#dollar_signs"><b>
Why are there dollar signs in some places?
</b></a></li>
<li><a class="link" href="#seed7_version_number"><b>
Why does "seed7_05.s7i" contain a version number?
</b></a></li>
<li><a class="link" href="#boot_a_language"><b>
Can I use an "abc.s7i" include file to boot to the abc language?
</b></a></li>
</ul><hr />
<p></p>
<div><br /><a name="new_language"><h3>Why a new programming language?
</h3></a><hr />
<p>
Because Seed7 has several features which are not found in other
programming languages:
</p><ul>
<li>The possibility to declare new statements (syntactical and
semantically) in the same way as functions are declared (There are
also user definable operators with priority and associativity).</li>
<li>Declaration constructs for constant-, variable-, function-,
parameter-, and other declarations are described in Seed7 (The user
can change existing declaration constructs or invent new ones).</li>
<li><a class="link" href="#generics">Templates</a> use no special syntax. They are just functions with
<tt><a class="type" href="manual/types.htm#type">type</a></tt> parameters or a <tt><a class="type" href="manual/types.htm#type">type</a></tt> result.</li>
<li>Seed7 has <a class="link" href="#abstract_data_type">abstract data types</a>. For example the types <tt><a class="type" href="manual/types.htm#array">array</a></tt>, <tt><a class="type" href="manual/types.htm#hash">hash</a></tt>,
<tt><a class="type" href="manual/types.htm#struct">struct</a></tt> and <tt><a class="type" href="manual/types.htm#set">set</a></tt>. They are not hard coded in the compiler but are
abstract data types written in Seed7. User defined abstract data
types are possible as well.</li>
<li>The <a class="link" href="#object_oriented">object orientation</a> of Seed7 allows <a class="link" href="#multiple_dispatch">multiple dispatch</a>. That
means that a function or method is connected to more than one type.</li>
<li>Seed7 is a syntactically and semantically extensible language:
Almost all of the Seed7 language (<a class="link" href="manual/stats.htm">statements</a>, <a class="link" href="examples/operator.htm">operators</a>,
declaration constructs, and more) is defined in Seed7 in an include
file (seed7_05.s7i).</li>
<li>The application program contains an include statement and the s7
interpreter is booted with the language description when it starts.
This way it is possible to define language variants or a totally
different language.</li>
</ul></div>
<div><br /><a name="design_principles"><h3>What are the design principles of Seed7?
</h3></a><hr />
<p>
The design principles are:
</p><dl>
<dt>Can interpret scripts or compile large programs:</dt><dd>
The <a class="link" href="#interpreter">interpreter</a> starts quickly. It can process 400000 lines
per second. This allows a quick edit-test cycle. Seed7 can be
<a class="link" href="#compile">compiled</a> to efficient machine code (via a C compiler as back-end).
You don't need makefiles or other build technology for Seed7
programs.</dd>
<dt>Error prevention:</dt><dd>
Seed7 is <a class="link" href="#static_type_checking">statically typed</a>, <a class="link" href="#memory_safety">memory safe</a>, variables must <a class="link" href="#initialize_variables">always
have a value</a>, there are no pointers and there is no NULL. All
errors, inclusive <a class="link" href="#integer_overflow">integer overflow</a>, trigger an exception.</dd>
<dt>Source code portability:</dt><dd>
Most programming languages claim to be source code portable, but
often you need considerable effort to write portable
code. In Seed7 it is hard to write unportable code. Seed7 programs
can be <a class="link" href="#portable">executed without changes</a>. Even the path delimiter
(/) and database connection strings are standardized. Seed7 has
drivers for graphic, console, etc. to compensate for different
operating systems.</dd>
<dt>Readability:</dt><dd>
Programs are more often read than written. Seed7 uses several
approaches to improve <a class="link" href="#readability">readability</a>.</dd>
<dt>Well defined behavior:</dt><dd>
Seed7 has a well-defined behavior in all situations.
<a class="link" href="#undefined_behavior">Undefined behavior</a> like in C does not exist.</dd>
<dt>Overloading:</dt><dd>
Functions, operators and statements are not only identified
by identifiers but also via the types of their parameters.
This allows <a class="link" href="#overloading">overloading</a> the same identifier for different
purposes.</dd>
<dt>Extensibility:</dt><dd>
Every programmer can <a class="link" href="#extensible_programming">define new statements and operators</a>. This
includes new operator symbols. Even the syntax and semantics
of Seed7 is defined in libraries.</dd>
<dt>Object orientation:</dt><dd>
There are interfaces and implementations of them. Classes are
not used. This allows <a class="link" href="#multiple_dispatch">multiple dispatch</a>.</dd>
<dt>Multiple dispatch:</dt><dd>
A method is not attached to one object (this). Instead, it can
be connected to several objects. This is like the
overloading of functions.</dd>
<dt>Performance:</dt><dd>
Seed7 is designed to allow <a class="link" href="#compile">compilation</a> to efficient machine
code. Several high level <a class="link" href="scrshots/s7c.htm#optimizations">optimizations</a> are also done.</dd>
<dt>No virtual machine:</dt><dd>
Seed7 is based on the executables of the operating system.
This removes another dependency.</dd>
<dt>No artificial restrictions:</dt><dd>
Historic programming languages have a lot of artificial
<a class="link" href="#no_artificial_restrictions">restrictions</a>. In Seed7 there is no limit for length of an
identifier or string, for the number of variables or number
of nesting levels, etc.</dd>
<dt>Independent of databases:</dt><dd>
A <a class="link" href="manual/database.htm">database independent API</a> supports the <a class="link" href="#database_access">access to SQL
databases</a>. The database drivers of Seed7 consist of 30000
lines of C. This way many differences between databases are
abstracted away.</dd>
<dt>Possibility to work without IDE:</dt><dd>
IDEs are great, but some programming languages have been
designed in a way that makes it hard to use them without
IDE. Programming language features should be designed in a way
that makes it possible to work with a plain text editor.</dd>
<dt>Minimal dependency on external tools:</dt><dd>
To <a class="link" href="#compile_interpreter">compile Seed7</a> you just need a C compiler and a make utility.
The Seed7 libraries avoid calling external tools as well.</dd>
<dt>Comprehensive libraries:</dt><dd>
The <a class="link" href="libraries/index.htm">libraries</a> of Seed7 cover many areas.</dd>
<dt>Own implementations of libraries:</dt><dd>
Many languages have no own implementation for essential library
functions. Instead C, C++ or Java libraries are used. In Seed7
most of the libraries are written in Seed7. This reduces the
dependency on external libraries. The source code of external
libraries is sometimes hard to find and in most cases hard to
read.</dd>
<dt>Reliable solutions:</dt><dd>
Simple and reliable solutions are preferred over complex
ones that may fail for assorted reasons.</dd>
</dl></div>
<div><br /><a name="extensible_programming"><h3>What is an extensible programming language?
</h3></a><hr />
<p>
An extensible programming language supports mechanisms to extend the
programming language, compiler/interpreter and runtime environment.
The programmer is allowed to define new language constructs such as
statements, declaration constructs and operators syntactically
and semantically. Most programming languages allow user defined
variables, functions and types, but they also use constructs which
are hard-coded in the compiler/interpreter. An extensible programming
language tries to avoid such hard-coded constructs in normal programs.
</p><p>
Extensible programming was an area of active research in the 1960s,
but in the 1970s the extensibility movement was displaced by the
abstraction movement. Today's software history gives almost no hint
that the extensible languages movement had ever occurred. In the
historical movement an extensible programming language consisted of
a base language providing elementary computing facilities, and a
meta-language capable of modifying the base language. A program then
consisted of meta-language modifications and code in the modified
base language. A popular approach to do language extension was the
use of macro definitions. The constructs of the base language were
hard-coded.
</p><p>
The design and development of Seed7 is based on independent research,
which was done without knowing that the historic extensible
programming language movement existed. Although Seed7 has different
roots it reaches many of the original extensible programming language
goals. Contrary to the historic movement Seed7 does not have a
meta-language. In Seed7 a language extension is formulated in Seed7
itself. Seed7 differentiates between syntactic and semantic extensions.
Syntactic extensions are described in <a class="link" href="manual/syntax.htm">Chapter 9 (Structured syntax
definition)</a> of the manual. The semantic extensions of Seed7 are done
by declaring statements and operators as functions. For the body of
loops and similar needs statically typed <a class="link" href="#call_by_name">call-by-name</a> parameters are
used.
</p></div>
<div><br /><a name="portable"><h3>Are Seed7 programs portable?
</h3></a><hr />
<p>
Yes. Seed7 spares no effort to support source code portability.
No changes are necessary, if programs are moved between different
processors, between 32- and 64-bit systems or between little- and
big-endian machines. Seed7 source code can also be moved between
different operating systems. Several driver libraries assure that
the access to operating system resources such as files, directories,
network, clock, keyboard, console and graphics is done in a portable
way. The <a class="link" href="libraries/index.htm">libraries</a> of Seed7 cover many areas. The goal is: There
should be no need to <a class="link" href="manual/ffi.htm">call foreign C functions</a>, or to <a class="link" href="libraries/shell.htm">execute shell</a>
(respectively cmd.exe) commands.
</p><ul>
<li>Seed7 <a class="link" href="#cmd_config_value">determines the properties</a> of the underlying C compiler and
C runtime library and uses code to compensate the differences.</li>
<li>Different <a class="link" href="#unicode">Unicode</a> encodings (e.g.: UTF-8 or UTF-16) in system
calls (e.g. fopen()/wopen()) are hidden from the programmer.</li>
<li>Portable file functions are provided in the library <a class="lib" href="libraries/osfiles.htm">osfiles.s7i</a>:<ul>
<li>There are functions to <a class="link" href="manual/os.htm#copyFile">copy</a>, <a class="link" href="manual/os.htm#moveFile">move</a> and <a class="link" href="manual/os.htm#removeFile">remove</a> files (and
directory trees).</li>
<li>File properties such as <a class="link" href="manual/os.htm#fileSize">size</a>, <a class="link" href="manual/os.htm#fileType">type</a>, <a class="link" href="manual/os.htm#getATime">time</a> and <a class="link" href="manual/os.htm#getFileMode">mode</a> can be
obtained and changed.</li>
<li><a class="link" href="manual/os.htm#readDir">The contents of a directory</a> can be read as array of strings or
<a class="link" href="libraries/dir.htm">via the file interface</a>.</li>
<li>A <a class="link" href="manual/os.htm#Standard_path_representation">standard path representation</a> removes all problems with
drive letters and different path delimiters.</li></ul></li>
<li>Differences between Unix sockets and winsockets are hidden and
a Seed7 <tt><a class="type" href="manual/file.htm#Sockets">socket</a></tt> is a <tt><a class="type" href="manual/types.htm#file">file</a></tt> (as in Unix). The type <tt><a class="type" href="libraries/poll.htm#pollData">pollData</a></tt> allows
to wait until a socket is ready to read or write data. <a class="link" href="libraries/tls.htm">TLS/SSL</a>
and higher level protocols such as <a class="link" href="libraries/gethttp.htm">HTTP</a>, <a class="link" href="libraries/gethttps.htm">HTTPS</a>, <a class="link" href="libraries/ftp.htm">FTP</a>
and <a class="link" href="libraries/smtp.htm">SMTP</a> are also supported.</li>
<li>The library <a class="lib" href="libraries/keybd.htm">keybd.s7i</a> defines the file <a class="var" href="manual/file.htm#Keyboard_file">KEYBOARD</a>, which supports
reading single key presses. The characters read from <a class="var" href="manual/file.htm#Keyboard_file">KEYBOARD</a> are
not echoed to the console and there is no need to press ENTER.
There is also a portable way to check, if a <a class="link" href="libraries/keybd.htm#inputReady(in_console_keybd_file)">key has been pressed</a>.</li>
<li><a class="link" href="manual/file.htm#Keyboard_file">Reading keys</a> and key combinations such as ctrl-F1 from a <a class="link" href="libraries/console.htm">text
console</a> or a <a class="link" href="libraries/draw.htm">graphic window</a> under different operating systems
always delivers the same character code.</li>
<li>There is an access to the <a class="link" href="libraries/console.htm">text console</a>, which allows <a class="link" href="libraries/console.htm#setPos(in_console_file,in_integer,in_integer)">cursor
positioning</a>.</li>
<li>An operating system independent type for <a class="link" href="manual/types.htm#time">times and dates</a>, based
on the proleptic Gregorian calendar, is provided in the library
<a class="lib" href="libraries/time.htm">time.s7i</a>.</li>
<li>A <a class="link" href="libraries/draw.htm">portable graphics library</a> allows drawing, image operations,
windows manipulation and bitmap <a class="link" href="libraries/font.htm">fonts</a>. Events to redraw a window
and other annoyances are managed in the graphics library.</li>
<li>A <a class="link" href="libraries/sql_base.htm">database library</a> provides a <a class="link" href="manual/database.htm">database independent API</a> to connect
to MySQL, MariaDB, SQLLite, PostgreSQL, Oracle, Firebird, Interbase,
Db2, Informix and SQL Server databases. The ODBC interface can be
used as well.</li>
<li>Weaknesses of operating systems are hidden (E.g.: The windows
function utime() does not work on directories, but Seed7 allows
the modification of directory <a class="link" href="manual/os.htm#setATime">access</a> and <a class="link" href="manual/os.htm#setMTime">modification times</a> also
under windows).</li>
</ul></div>
<div><br /><a name="license"><h3>Which license does Seed7 use?
</h3></a><hr />
<p>
Seed7 is "Free as in Freedom" and not only "Free as in Free Beer".
The s7 interpreter and the example programs (extension .sd7) are under the
GPL (General Public License, seen in the file COPYING).
</p><p>
The Seed7 runtime library is under the LGPL (Lesser General Public License,
seen in the file LGPL). The Seed7 include files (extension .s7i) are a part
of the Seed7 runtime library.
</p><p>
Seed7 allows the interpretation and compilation of programs with any license.
There is no restriction on the license of your Seed7 programs.
</p><p>
For the development of the <a class="link" href="scrshots/s7c.htm">Seed7 compiler</a> it will be necessary to move some
source code from the s7 interpreter (under GPL) to the Seed7 runtime library
(under LGPL). This will only be done to for the Seed7 runtime library and only
as far as necessary to make no restriction on the license of compiled Seed7
programs.
</p><p>
If you send me patches (I would be very pleased), it is assumed that you
accept license changes from GPL to LGPL for parts of code which need to be
in the runtime library to support compilation of Seed7 programs.
</p></div>
<div><br /><a name="pascal_descendant"><h3>Is Seed7 a descendant of Pascal?
</h3></a><hr />
<p>
No, not really. The keywords and statements remind people of Pascal,
but behind the surface there is much difference. Don't judge a book
by its cover. Seed7 is neither limited to Pascal's features, nor is it
implemented like Pascal. Notable differences are:
</p><dl><dd><table border="1" cellspacing="0" cellpadding="5">
<tr><th>Feature </th><th> Standard Pascal </th><th> Seed7</th></tr>
<tr><td>syntax </td><td> hard-coded in the compiler </td><td> defined in a library</td></tr>
<tr><td>statements </td><td> hard-coded in the compiler </td><td> defined in a library</td></tr>
<tr><td>operators </td><td> hard-coded in the compiler </td><td> defined in a library</td></tr>
<tr><td>array </td><td> hard-coded in the compiler </td><td> defined as abstract data type <tt><a class="type" href="libraries/array.htm">array</a></tt></td></tr>
<tr><td>record / struct </td><td> hard-coded in the compiler </td><td> defined as abstract data type</td></tr>
<tr><td>hash table </td><td> not in the standard library </td><td> defined as abstract data type <tt><a class="type" href="libraries/hash.htm">hash</a></tt></td></tr>
<tr><td>compiler target </td><td> machine code or P-code </td><td> C, compiled to machine code afterwards</td></tr>
<tr><td><a class="link" href="#generics">template</a> </td><td> none </td><td> function with type parameters</td></tr>
<tr><td><a class="link" href="#abstract_data_type">abstract data type</a> </td><td> none </td><td> function with type result</td></tr>
<tr><td>object orientation </td><td> none </td><td> interfaces and multiple dispatch</td></tr>
</table></dd></dl><p>
Except for LL(1) parsing, no technology used by classical Pascal
compilers could be used to implement Seed7.
</p></div>
<div><br /><a name="java_comparison"><h3>How does Seed7 compare to Java?
</h3></a><hr />
<p>
Several features of Seed7 are missing in Java:
</p><dl><dd><table border="1" cellspacing="0" cellpadding="5">
<tr><th>Features missing in Java </th><th> Comment</th></tr>
<tr><td>Stand alone functions </td><td> Singletons must be used instead </td></tr>
<tr><td>Call-by-reference parameters </td><td> All parameters are call-by-value </td></tr>
<tr><td><a class="link" href="#call_by_name">Call-by-name</a> parameters </td><td> All parameters are call-by-value </td></tr>
<tr><td><a class="link" href="#overloading">Operator overloading</a> </td><td> In Java it is necessary to write <tt>a.add(b.multiply(c))</tt> instead of <tt>a <a class="op_no_ul" href="libraries/bigint.htm#(in_bigInteger)+(in_bigInteger)">+</a> b <a class="op_no_ul" href="libraries/bigint.htm#(in_bigInteger)*(in_bigInteger)">*</a> c</tt>. </td></tr>
<tr><td>User defined operators </td><td> - </td></tr>
<tr><td>User defined statements </td><td> - </td></tr>
<tr><td>User defined syntax </td><td> - </td></tr>
<tr><td><a class="link" href="#comparisons">One operator to check for equality</a> </td><td> For POD types Java uses <tt><span class="op">==</span></tt> and for strings <tt>name.equals(<span class="stri">""</span>)</tt>.</td></tr>
<tr><td><a class="link" href="#initialize_data">Elegant way to express data structures</a> </td><td> Property files and XML must be used instead </td></tr>
<tr><td><a class="link" href="#initialize_data">User defined functions to initialize data</a> </td><td> - </td></tr>
<tr><td><a class="link" href="#multiple_dispatch">Multiple dispatch</a> </td><td> - </td></tr>
<tr><td>Checking for <a class="link" href="#integer_overflow">integer overflow</a> </td><td> The result is modulo a power of two without any indication that this is wrong. </td></tr>
<tr><td>Escape sequences only as part of <a class="link" href="manual/tokens.htm#String_literals">literals</a> </td><td> Unicode escapes can be everywhere. That can cause unexpected effects </td></tr>
</table></dd></dl><p>
</p></div>
<div><br /><a name="application_area"><h3>What kind of programs can be written in Seed7?
</h3></a><hr />
<p>
Seed7 can be used in various application areas:
</p><ul>
<li>Applications, like an Excel look-alike (Seed7 is a general purpose
language and programs can be <a class="link" href="#compile">compiled</a> to an executable).</li>
<li>Scripts that deal with <a class="link" href="manual/os.htm">files and directories</a> (The Seed7 Homepage
and the Seed7 release are created with Seed7 scripts).</li>
<li>Tools for networking (There is support for <a class="link" href="manual/file.htm#Sockets">sockets</a>, <a class="link" href="libraries/tls.htm">TLS/SSL</a>, <a class="link" href="libraries/listener.htm">listeners</a>,
<a class="link" href="libraries/gethttp.htm">HTTP</a>, <a class="link" href="libraries/gethttps.htm">HTTPS</a>, <a class="link" href="libraries/ftp.htm">FTP</a>, <a class="link" href="libraries/smtp.htm">SMTP</a> and <a class="link" href="libraries/htmldom.htm">HTML parsing</a>). E.g.:<ul>
<li><a class="link" href="scrshots/ftp7.htm">A ftp file transfer program</a></li>
<li><a class="link" href="scrshots/ftpserv.htm">A ftp server</a></li>
<li><a class="link" href="scrshots/comanche.htm">A web server</a></li></ul></li>
<li>Programs that deal with XML (There is support for XML parsing and
the possibility to <a class="link" href="libraries/xmldom.htm">read XML</a> into a DOM data structure).</li>
<li>CGI scripts (A <a class="link" href="libraries/cgi.htm">CGI support library</a> is available and the <a class="link" href="scrshots/comanche.htm">Comanche</a>
web server can be used to test CGI scripts).</li>
<li>Programs that use the browser as user interface:<ul>
<li><a class="link" href="scrshots/db7.htm">A database inspector</a></li>
<li><a class="link" href="scrshots/ide7.htm">A simple editor</a></li></ul></li>
<li>As language to describe <a class="link" href="algorith/index.htm">algorithms</a>.</li>
<li>Command line utilities. E.g.:<ul>
<li><a class="link" href="scrshots/calc7.htm">A calculator that works like a read-eval-print loop (REPL)</a></li>
<li><a class="link" href="scrshots/make7.htm">A make utility capable to process Unix and Windows makefiles</a></li>
<li><a class="link" href="scrshots/tar7.htm">A tar archiving utility</a></li>
<li><a class="link" href="scrshots/savehd7.htm">A program to save a potentially damaged harddisk partition to an image file</a></li></ul></li>
<li>2D games. E.g.:<ul>
<li><a class="link" href="scrshots/panic.htm">Panic</a></li>
<li><a class="link" href="scrshots/mahjong.htm">Mahjong solitaire</a></li>
<li><a class="link" href="scrshots/pairs.htm">Pairs</a></li></ul></li>
<li>Simulations. E.g.:<ul>
<li><a class="link" href="scrshots/wator.htm">Planet Wator Predator-Prey simulation</a></li>
<li><a class="link" href="scrshots/dnafight.htm">Bacteria which fight against each other</a></li></ul></li>
<li>Functions to explore mathematics. E.g.:<ul>
<li><a class="link" href="scrshots/mandelbr.htm">Mandelbrot set</a></li>
<li><a class="link" href="algorith/graphic.htm#bifurk">Bifurcation</a></li>
<li><a class="link" href="algorith/graphic.htm#cellauto">Cellular automaton</a></li></ul></li>
</ul></div>
<div><br /><a name="lines_of_code"><h3>How many lines of code are in the Seed7 project?
</h3></a><hr />
<p>
The Seed7 package contains more than 100000 lines of C and more
than 400000 lines of Seed7. For version 2024-03-22 the number of lines is:
</p><dl><dd><table border="0" cellspacing="0">
<tr><td align="right">182501</td> <td width="20"></td> <td>C source files (*.c)</td></tr>
<tr><td align="right"> 13736</td> <td width="20"></td> <td>C header files (*.h)</td></tr>
<tr><td align="right">256022</td> <td width="20"></td> <td>Seed7 source files (*.sd7)</td></tr>
<tr><td align="right">180303</td> <td width="20"></td> <td>Seed7 library/include files (*.s7i)</td></tr>
</table></dd></dl><p>
C code (*.c and *.h files) can be divided into the following areas:
</p><dl><dd><table border="0" cellspacing="0">
<tr><td align="right"> 0.3%</td> <td width="20"></td> <td>Interpreter main
<tr><td align="right">11.6%</td> <td width="20"></td> <td>Parser
<tr><td align="right"> 2.8%</td> <td width="20"></td> <td>Interpreter core
<tr><td align="right">24.7%</td> <td width="20"></td> <td>Primitive action functions
<tr><td align="right"> 7.4%</td> <td width="20"></td> <td>General helper functions
<tr><td align="right">48.5%</td> <td width="20"></td> <td>Runtime library
<tr><td align="right"> 4.7%</td> <td width="20"></td> <td>Compiler data library
</table></dd></dl><p>
Details about these files can be found in the file <nobr><span class="lib">seed7/src/read_me.txt</span></nobr>.
</p></div>
<div><br /><a name="os"><h3>On which operating systems does Seed7 run?
</h3></a><hr />
<p>
Seed7 runs on the following operating systems:
</p><ul>
<li>Linux is supported with the following compilers:<ul>
<li>gcc (the development is done using gcc under Linux)</li>
<li>clang</li>
<li>icc</li>
<li>tcc</li></ul></li>
<li>Unix (I also used Seed7 under various Unix variants, so it is probably
easy to port Seed7 to a Unix variant)</li>
<li>BSD (there is a <a class="link" href="http://www.freshports.org/lang/seed7">FreeBSD port</a> and an <a class="link" href="http://openports.se/lang/seed7">OpenBSD port</a>)</li>
<li>Windows is supported with the following compilers:<ul>
<li>MinGW GCC (the binary Windows release of Seed7 uses MinGW)</li>
<li>Cygwin GCC (the X11 graphics needs Cygwin/X)</li>
<li>clang</li>
<li>MSVC cl.exe (cl.exe is the stand-alone compiler of MSVC)</li>
<li>tcc</li>
<li>BDS bcc32.exe (bcc32.exe is the stand-alone compiler of the BDS)</li></ul></li>
<li>DOS (uses DJGPP. Sockets, graphics, processes and databases are currently not supported)</li>
<li>macOS is supported with the following compilers:<ul>
<li>gcc</li>
<li>clang</li></ul></li>
</ul><p>
For other operating systems it might be necessary to write driver modules for
screen (=text console), graphics, time or other aspects of Seed7. The package
contains various older driver modules which are not up to date, but can be used
as base to write such driver modules. For more detailed information look at the
files <nobr><span class="lib">seed7/read_me.txt</span></nobr> and <nobr><span class="lib">seed7/src/read_me.txt</span></nobr>.
</p></div>
<div><br /><a name="installer"><h3>Is there an installer for Seed7?
</h3></a><hr />
<p>
A Seed7 installer for Windows can be downloaded from:
</p><dl><dd>
<a class="link" href="https://sourceforge.net/projects/seed7/files/bin">https://sourceforge.net/projects/seed7/files/bin</a>
</dd></dl><p>
This directory contains the latest installer and older ones. Installers have
names with the following pattern:
</p><pre class="indent">
seed7_05_<b>yyyymmdd</b>_win.exe
</pre><p>
Just download the installer with the latest date (<tt>yyyy-mm-dd</tt>). It is not a
problem, if the installer is older than the latest source release of Seed7.
The installer is capable to download the latest source release. After you
have downloaded the installer you can start it (either from the console
(cmd.exe) or from the Windows Explorer).
</p><p>
The installer leads through the installation process with a dialog. It
determines the latest source release of Seed7 and downloads it. If the
latest release cannot be downloaded a manually downloaded source release
can be used instead. The installer can also use a built-in release of
Seed7. This built-in release is the one with the date of the installer.
</p><p>
The installer asks for an installation directory for Seed7. Afterwards it
compiles Seed7 with the makefile <span class="lib">seed7/src/mk_mingc.mak</span>. The installer
uses a built-in make utility and an encapsulated gcc. These tools do not
interfere with another make or gcc, which might be installed on your
computer.
</p><p>
Finally, the installer adds the directory with the Seed7 executables to the
search path (PATH variable). Therefore, it needs administrator rights. The
program to change the path is <tt>setwpath.exe</tt>. The name <tt>setwpath.exe</tt> will show
up, when you are asked to allow administrative rights for the installation.
</p><p>
The installer can be used to update an existing Seed7 installation. The
installer checks the version of an existing installation of Seed7 and
offers the possibility to update. Update means that all files in the Seed7
installation directory are replaced. Therefore, it makes sense to place your
own Seed7 programs and libraries at a different place.
</p></div>
<div><br /><a name="download"><h3>Where can I download Seed7?
</h3></a><hr />
<p>
The latest source code release of Seed7 can be downloaded from:
</p><dl><dd>
<a class="link" href="https://sourceforge.net/projects/seed7/files">https://sourceforge.net/projects/seed7/files</a>
</dd></dl><p>
Just click on the button <tt><span class="box"><b> <a class="link" href="https://sourceforge.net/projects/seed7/files/latest/download">Download Latest Version</a> </b></span></tt>.
</p><p>
Other source code releases can be found in the directory <tt>seed7</tt>.
It is strongly recommended to use the latest version.
An <a class="link" href="#installer">installer for Windows</a> can be found in the directory <tt>bin</tt>.
Other executables are also in the <tt>bin</tt> directory.
</p><p>
Seed7 is now <a class="link" href="https://github.com/ThomasMertes/seed7">available at GitHub</a> as well. You can use the command:
</p><pre class="indent">
git clone https://github.com/ThomasMertes/seed7.git
</pre><p>
to clone the Seed7 repository.
</p><p>
After downloading the Seed7 source code the <a class="link" href="build.htm">interpreter can be compiled</a>.
</p></div>
<div><br /><a name="uncompress"><h3>How do I uncompress the *.tgz file from the release?
</h3></a><hr />
<p>
If you have a gnu <tt>'tar'</tt> program available you can just do
</p><pre class="indent">
$ tar -xvzf seed7_05_yyyymmdd.tgz
</pre><p>
If your <tt>'tar'</tt> command does not accept the <tt>'z'</tt> option
you need to uncompress the file first with <tt>'gunzip'</tt>:
</p><pre class="indent">
$ gunzip seed7_05_yyyymmdd.tgz
$ tar -xvf seed7_05_yyyymmdd.tar
</pre><p>
Sometimes the browser downloads a *.gz file instead of a *.tgz file.
In that case, you could also use <tt>'gunzip'</tt> as shown above. As
an alternative, you can also use <tt>'zcat'</tt>:
</p><pre class="indent">
$ zcat seed7_05_yyyymmdd.gz > seed7.tar
$ tar -xvf seed7.tar
</pre><p>
Under windows you can use the 7-Zip compression/decompression utility
(there is no relationship to Seed7). 7-Zip is open-source software and is
available at: <a class="link" href="http://www.7-zip.org">www.7-zip.org</a>.
</p></div>
<div><br /><a name="compile_interpreter"><h3>How do I compile the Seed7 interpreter?
</h3></a><hr />
<p>
There is a detailed description how to <a class="link" href="build.htm">build Seed7</a> in <nobr><a class="lib" href="build.htm">seed7/src/read_me.txt</a></nobr>.
</p><p>
The way to compile the interpreter depends on the operating system and the
development tools used. You need a stand-alone C compiler and a make utility
to compile the interpreter. A C compiler, which is only usable from an IDE,
is not so useful, since some Seed7 programs (e.g. The Seed7 compiler <tt><a class="prog" href="scrshots/s7c.htm">s7c</a></tt>)
need to call the C compiler as well.
</p><p>
In case a make utility is missing the program <tt><a class="prog" href="scrshots/make7.htm">make7</a></tt> can be used instead.
You can download <a class="link" href="https://sourceforge.net/projects/seed7/files/bin/make7.exe/download">make7.exe</a>, which is a binary version of make7 for Windows.
</p><p>
To compile the interpreter under Linux just go to the <nobr><span class="lib">src</span></nobr> directory and type:
</p><pre class="indent">
make depend
make
</pre><p>
For other cases, several makefiles are prepared for various combinations of
operating system, make utility, C compiler and shell:
</p><dl><dd><table border="1" cellspacing="0" cellpadding="5">
<tr><th>makefile name</th><th>operating system </th><th>make prog </th><th>C compiler </th><th>shell</th></tr>
<tr><td>mk_linux.mak </td><td> Linux/Unix/BSD </td><td> (g)make </td><td> gcc </td><td> sh</td></tr>
<tr><td>mk_clang.mak </td><td> Linux/Unix/BSD </td><td> (g)make </td><td> clang </td><td> sh</td></tr>
<tr><td>mk_icc.mak </td><td> Linux/Unix/BSD </td><td> (g)make </td><td> icc </td><td> sh</td></tr>
<tr><td>mk_tcc_l.mak </td><td> Linux/Unix/BSD </td><td> (g)make </td><td> tcc </td><td> sh</td></tr>
<tr><td>mk_cygw.mak </td><td> Windows (Cygwin)</td><td> (g)make </td><td> gcc </td><td> sh</td></tr>
<tr><td>mk_msys.mak </td><td> Windows (MSYS) </td><td> mingw32-make </td><td> gcc </td><td> sh</td></tr>
<tr><td>mk_mingw.mak </td><td> Windows (MinGW) </td><td> mingw32-make </td><td> gcc </td><td> cmd.exe</td></tr>
<tr><td>mk_nmake.mak </td><td> Windows (MinGW) </td><td> nmake </td><td> gcc </td><td> cmd.exe</td></tr>
<tr><td>mk_msvc.mak </td><td> Windows (MSVC) </td><td> nmake </td><td> cl </td><td> cmd.exe</td></tr>
<tr><td>mk_bcc32.mak </td><td> Windows (bcc32) </td><td> make </td><td> bcc32 </td><td> cmd.exe</td></tr>
<tr><td>mk_bccv5.mak </td><td> Windows (bcc32) </td><td> make </td><td> bcc32 V5.5 </td><td> cmd.exe</td></tr>
<tr><td>mk_clangw.mak</td><td> Windows (clang) </td><td> (g)make </td><td> clang </td><td> cmd.exe</td></tr>
<tr><td>mk_tcc_w.mak </td><td> Windows (tcc) </td><td> (g)make </td><td> tcc </td><td> cmd.exe</td></tr>
<tr><td>mk_djgpp.mak </td><td> DOS </td><td> (g)make </td><td> gcc </td><td> cmd.exe</td></tr>
<tr><td>mk_osx.mak </td><td> macOS </td><td> make </td><td> gcc </td><td> sh</td></tr>
<tr><td>mk_osxcl.mak </td><td> macOS </td><td> make </td><td> clang </td><td> sh</td></tr>
<tr><td>mk_freebsd.mk</td><td> FreeBSD </td><td> make </td><td> clang/gcc </td><td> sh</td></tr>
<tr><td>mk_emccl.mak </td><td> Linux/Unix/BSD </td><td> make </td><td> emcc + gcc </td><td> sh</td></tr>
<tr><td>mk_emccw.mak </td><td> Windows (emcc) </td><td> mingw32-make </td><td> emcc + gcc </td><td> cmd.exe</td></tr>
</table></dd></dl><p>
In the optimal case you just copy one makefile from above to 'makefile' and do
(with the corresponding make program):
</p><pre class="indent">
make depend
make
</pre><p>
When the interpreter is compiled successfully, the executable and the libraries
are placed in the <tt>'bin'</tt> directory. Additionally, a symbolic link to the executable
is placed in the <tt>'prg'</tt> directory (Under Windows symbolic links are not supported,
so a copy of the executable is placed in the <tt>'prg'</tt> directory). The Seed7 compiler
(<tt><a class="prog" href="scrshots/s7c.htm">s7c</a></tt>) is compiled with:
</p><pre class="indent">
make s7c
</pre><p>
The compiler executable is copied to the <tt>'bin'</tt> directory. If you do several
compilation attempts in succession you need to do
</p><pre class="indent">
make clean
</pre><p>
before you start a new attempt.
</p></div>
<div><br /><a name="errors"><h3>I got errors when compiling Seed7. What should I do?
</h3></a><hr />
<p>
In most cases errors indicate that some development package of your
distribution is missing. If your operating system is Linux, BSD or Unix
not all development packages with header files might be installed. In
this case you get some errors after typing 'make depend'. Errors such as
</p><pre class="box">
chkccomp.c:56:20: fatal error: stdlib.h: No such file or directory
s7.c:30:20: fatal error: stdlib.h: No such file or directory
</pre><p>
indicate that the development package of the C library is
missing. I don't know the name of this package in your
distribution (under Ubuntu it has the name libc6-dev), but
you can search for C development libraries and header files.
</p><p>
Errors such as
</p><pre class="box">
con_inf.c:54:18: error: term.h: No such file or directory
kbd_inf.c:53:18: error: term.h: No such file or directory
trm_inf.c:47:18: error: term.h: No such file or directory
</pre><p>
indicate that the curses or ncurses development package is missing.
I don't know the name of this package in your distribution
(under Ubuntu it has the name libncurses5-dev), but you
can search in your package manager for a curses/ncurses
package which mentions that it contains the header files.
To execute programs, you also need to install the non-developer
package of curses/ncurses (in most cases it will already
be installed because it is needed by other packages).
</p><p>
Errors such as
</p><pre class="box">
drw_x11.c:38:19: error: X11/X.h: No such file or directory
drw_x11.c:39:22: error: X11/Xlib.h: No such file or directory
drw_x11.c:40:23: error: X11/Xutil.h: No such file or directory
drw_x11.c:45:24: error: X11/keysym.h: No such file or directory
</pre><p>
indicate that the X11 development package is missing.
Under Ubuntu this package has the name libx11-dev and is
described as: X11 client-side library (development headers)
Note that under X11 'client' means: The program which wants to
draw. A X11 <tt>'server'</tt> is the place where the drawings are displayed.
So, you must search for a X11 client developer package with
headers. If you use X11 in some way (you don't do everything
from the text console) the non-developer package of X11 will
already be installed.
</p><p>
Errors such as
</p><pre class="box">
gcc chkccomp.c -o chkccomp
chkccomp.c:28:10: fatal error: base.h: No such file or directory
compilation terminated.
</pre><p>
or
</p><pre class="box">
del version.h
process_begin: CreateProcess(NULL, del version.h, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: *** [clean] Error 2
</pre><p>
indicate that your makefile contains commands for the cmd.exe
(or command.com) windows console, but your 'make' program uses
a Unix shell (<nobr><span class="lib">/usr/bin/sh</span></nobr>) to execute them. Either use a
makefile which uses Unix shell commands (e.g. mk_msys.mak or
mk_cygw.mak) or take care that the 'make' program uses cmd.exe
(or command.com) to execute the commands.
</p><p>
Errors such as
</p><pre class="box">
s7.c:28:21: error: version.h: No such file or directory
</pre><p>
indicate that you forgot to run 'make depend' before running
'make'. Since such an attempt produces several unneeded files it