թանաքեան
փետրուար 17, 2023
If the implementer doesn’t take steps to avoid it, as simple a statement as n := n + 1 could require an allocation, a method lookup, or both. Good implementations avoid most of the cost, and languages in this family have been used successfully for systems programming. But their general disposition towards heap allocation rather than stack allocation remains, and they have not become popular with systems programmers.
In the 1960s, the trend in the Algol family was toward features for control flow and data structuring. In the 1970s, the trend was toward information-hiding features like interfaces, opaque types, and generics. More recently, the trend in the Algol family has been to adopt a careful selection of techniques from the Lisp and BCPL families. This trend is demonstrated by Modula-3, Oberon, and Cedar, to name three languages that have floated portable implementations in the last few years.
Modula-3, Oberon, and Cedar all provide garbage collection, previously viewed as a luxury available only in the closed runtime systems of the Lisp family. But the world is starting to understand that garbage collection is the only way to achieve an adequate level of safety, and that modern garbage collectors can work in open runtime environments.
At the same time, these three languages allow a small set of unsafe, machine-dependent operations of the sort usually associated with the BCPL family. In Oberon and Modula-3, unsafe operations are allowed only in modules explicitly labeled unsafe. The combination of garbage collection with the explicit isolation of unsafe features produces a language suitable for programming entire systems from the highest-level applications down to the lowest-level device drivers.
In the early days of the Ada project, a general in the Ada Program Office opined that “obviously the Department of Defense is not interested in an artificially simplified language such as Pascal”. Modula-3 represents the opposite point of view. We used every artifice that we could find or invent to make the language simple.
C. A. R. Hoare has suggested that as a rule of thumb a language is too complicated if it can’t be described precisely and readably in fifty pages. The Modula-3 committee elevated this to a design principle: we gave ourselves a “complexity budget” of fifty pages, and chose the most useful features that we could accommodate within this budget. In the end, we were over budget by six lines plus the syntax equations. This policy is a bit arbitrary, but there are so many good ideas in programming language design that some kind of arbitrary budget seems necessary to keep a language from getting too complicated.
Buffer overruns are not ruled out by design: gets, sscanf etc.
Interface inconsistencies: gets vs fgets, fgets vs fscanf (note the position of the file stream parameter)
Bad interfaces like that of getchar() whose return code can be a character or an error code
Particularly bad buffering system which
ignores the block structure of underlying file systems, and
does not support bidirectional buffering
No provisions exist such that independent libraries can cooperate with each other in
signal handling,
setting up alarms, and
tracking childs.
Please note that I do not want to bash Ritchie, Kernighan etc. The libc is history and should be taken as such… It is time to abandon C and the libc and it does not help to place other systems on top of this historic relic.
բարեբախտաբար ոչ ոք չի հետաքրքրւում ու iso կոմիտէն լաւ ա աշխատել standards faq
Ադայի ստեղծողներն հպարտանում էին, որ աւելացրել են ՕԿԾ
լեզուի մէջ ընդամէնը 6 բառ աւելացնելով։
Վիրտը թափել ա բառեր եւ հասկացութիւններ modula-2֊ից ստանալով աւելի ճկուն եւ հզօր լեզու՝ Oberon֊ը։
աղբիւր - արդե՞օք կարող ենք սկսել ծրագրաւորել report֊ը կարդալուց յետոյ։ - եթէ գիտենք ծրագրաւորումն ինչ ա։
sources:
ծրագրաւորման լեզուներ եւ տրանսլեացիայի մեթոդներ Ս․ Սուերդլով։
less is more, why oberon beats mainstream in complex applications
վերեւի սլայդերին վերաբերող թուղթ ֆ․ տկաչեօվ։
program ObjectPascalExample;
type
THelloWorld = object
procedure Put;
end;
var
HelloWorld: THelloWorld;
procedure THelloWorld.Put;
begin
ShowMessage('Hello, World!');
end;
begin
New(HelloWorld);
HelloWorld.Put;
Dispose(HelloWorld);
end.
program ObjectPascalExample;
type
THelloWorld = object
procedure Put;
end;
procedure THelloWorld.Put;
begin
WriteLn('Hello, World!');
end;
var
HelloWorld: THelloWorld; { allocated on the stack and can be used without explicit allocation. }
begin
HelloWorld.Put;
end.
program ObjectPascalExample;
type
PHelloWorld = ^THelloWorld;
THelloWorld = object
procedure Put;
end;
procedure THelloWorld.Put;
begin
WriteLn('Hello, World!');
end;
var
HelloWorld: PHelloWorld; { this is a typed pointer to a THelloWorld }
begin
New(HelloWorld);
HelloWorld^.Put;
Dispose(HelloWorld);
end.
program ObjectPascalExample;
type
THelloWorld = class
procedure Put;
end;
procedure THelloWorld.Put;
begin
Writeln('Hello, World!');
end;
var
HelloWorld: THelloWorld; { this is an implicit pointer }
begin
HelloWorld := THelloWorld.Create; { constructor returns a pointer to an object of type THelloWorld }
HelloWorld.Put;
HelloWorld.Free; { this line deallocates the THelloWorld object pointed to by HelloWorld }
end.
#մոդուլներ
թաղանթապատումը սովորում են օկծ սովորելիս
մինչդեռ այն գոյութիւն է ունեցել մինչ այդ
լռելեայն՝ մոդուլի միջի ֆունկցիաներն ու տուեալները փակ են
անհրաժեշտ ա լինում դարձնել դրսից տեսանելի միայն ինտերֆէյսը
ի տարբերութիւն՝ c֊ում պահանջւում է անել հակառակը՝ անցնել բոլոր ֆունկցիաներով եւ փակել
Another often cited criticism of C++, the missing initialization order, also solved by Oberon’s modules. In contrast of cpp’s include mechanism, the import relationship forbids cycles. Thus, the imported modules can always be initialized before their clients.
ամենակարեւոր հատկութիւններից ա՝ SYSTEM բառով մոդուլ նշելը
դա ստիպում է առանձնացնել վտանգաւոր կոդը, եւ լոկալիզացնել այն։
բոլոր մոդուլները որ չեն պարունակում SYSTEM բառը՝ տեղափոխելի են։
Modules vs. Java packages
Java has the notion of a package. Classes belonging to the same package may acc ess non-public members of each other. The same can be said of Modula-2 or Oberon Modules. Within a module boundary, no restriction exists, while only explicitly exported types, variables and procedures can be accessed from outside a module.
But there is a fundamental difference between the Modules and Java packages. Th e Module is also the basic compilation unit. Thus when you collect things into a module, you know, that they are protected from outside interferences. Java choo se to elect the class as basic compilation unit. Thus everybody may add classes to a package, and you loose the protection against outsiders.
# books
# software tools in pascal
sverdlov
src
# comparison
closures properties & events
no glibc
c++ became so complicated that embarcadero gave up developing own c++ compiler they apply patches to clang’s compiler cppcast link
photoshop ելատեքստ
freetype #
flstudio # crossplatform: amiga blog
post on amiga & lazarus
total commander tuxcmd # lazarus is community choice on sourceforge in 2019 lazarus - community choice
ցանկ — պարունակում ա fpc & lazarus
https://wiki.freepascal.org/Lazarus_Application_Gallery https://wiki.freepascal.org/FPC_Applications/Projects_Gallery https://wiki.freepascal.org/Projects_using_Lazarus https://delphi.fandom.com/wiki/Good_Quality_Applications_Built_With_Delphi http://www.edm2.com/index.php/Category:Software_written_in_Pascal
https://wiki.lazarus.freepascal.org/Lazarus_videos
http://www.copperwood.com/pub/FreePascalFromSquareOne.pdf
http://code.sd/startprog/
http://code.sd/startprog/StartProgUsingPascal.pdf
https://castle-engine.io/modern_pascal
https://castle-engine.io/modern_pascal_introduction.pdf
էստեղ մի մասը բաց ա՝ https://www.blaisepascalmagazine.eu/product/learn-program-using-lazarus-electronic-pdf/
https://www.win.tue.nl/~wstomv/edu/delphi/
https://www.learndelphi.org/wp-content/uploads/2020/03/DelphiProgrammingForBeginners_ENG-CreativeCommons-LearnDelphi.org_.pdf
https://wiki.freepascal.org/Lazarus_Tutorial
https://wiki.freepascal.org/Lazarus_Resources
https://wiki.freepascal.org/Overview_of_Free_Pascal_and_Lazarus
https://wiki.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines
ու տէնց