Basic Pascal Tutorial/History/bg

From Free Pascal wiki
Revision as of 09:11, 20 April 2021 by Alpinistbg (talk | contribs) (Created page with "{{Pascal_History}} {{TYNavigator|Basic_Pascal_Introduction/bg|Compilers/bg}} История (оригинален автор: Tao Yue, състояние: променено)...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

български (bg) Deutsch (de) English (en) español (es) français (fr) italiano (it) 日本語 (ja) 한국어 (ko) русский (ru) 中文(中国大陆)‎ (zh_CN)

 ◄   ▲   ► 

История (оригинален автор: Tao Yue, състояние: променено)

Произход

Паскал произлиза от ALGOL - език за програмиране предназначен за научни изчисления. На среща в град Цюрих, Международен комитет проектира ALGOL като платформено независим език. Това позволило да се включат в езика допълнителни възможности, но от друга страна затруднило създаването на компилатор за него. Това било по времето, когато на компютрите липсвали много от хардуерните възможности, които сега приемаме за даденост.

Тъй като на много платформи липсвал компилатор за ALGOL, а на самия ALGOL му липсвали указатели и много от основните типове данни, езикът ALGOL никога не бил широко приет. Учените и инженерите предпочитали FORTRAN - друг език за програмиране достъпен на много повече платформи. ALGOL почти изчезнал и останал само като език за описание на алгоритми.

Вирт създава Паскал

Няколко компютърни учени работили върху разширяването на ALGOL през 60-те години. Един от тях бил Dr. Niklaus Wirth от Швейцарския федерален технологичен институт (ETH-Цюрих), член на първоначалната група, създала ALGOL. През 1971 г. той публикува своята спецификация на силно структуриран език, който наподобява в много отношения ALGOL. Той го нарича Паскал на името на френския философ и математик от 17-ти век построил работещ механичен цифров компютър.

Паскал е много силно ориентиран към данните и дава възможност на програмиста да описва свои типове. С тази свобода идват и строгите проверки, които пречат на смесването на различни типове данни. Паскал е създаден като език за обучение и е широко приет като такъв. Той е "свободно течащ" за разлика от FORTRAN и може да се чете подобно на естествения език, което улеснява разбирането на написания на него код.

UCSD Паскал

Едно от нещата, които убили ALGOL, било трудността да се създаде компилатор за него. Д-р Wirth избегнал това, като накарал компилатора си на Паскал да компилира до междинен, независим от платформата обектен код. След това друга програма превръщала този междинен обектен код в изпълним код за конкретната машина.

Проф. Кен Боулс от Калифорнийския университет в Сан Диего (UCSD) се възползвал от тази възможност, за да адаптира компилатора на Паскал към Apple II, най-популярния микрокомпютър тогава. UCSD P-системата станала стандарт и се използвала широко в университетите. Това било резултат от ниската цена на Apple II в сравнение с т.н. мейнфреймове, които по това време били необходими за работа с други езици като FORTRAN. Въздействието на UCSD P-системата върху компютърната индустрия може да се види в рекламите на IBM за нейния революционен персонален компютър, който поддържал три операционни системи: CP / M-86 на Digital Research, P-системата на Softech UCSD и PC-DOS на Microsoft.

Pascal Becomes Standard

By the early 1980's, Pascal had already become widely accepted at universities. Two events conspired to make it even more popular.

First, the Educational Testing Service, the company which writes and administers the principal college entrance exam in the United States, decided to add a Computer Science exam to its Advanced Placement exams for high school students. For this exam, it chose the Pascal language. Because of this, secondary-school students as well as college students began to learn Pascal. Pascal remained the official language of the AP exams until 1999, when it was replaced by C++, which was quickly replaced by Java.

Second, a small company named Borland International released the Turbo Pascal compiler for the IBM Personal Computer. The compiler was designed by Anders Hejlsberg, who would later head the group at Microsoft that developed C# and (re)introduced Managed Code back to the world of computing.

Turbo Pascal was truly revolutionary. It did take some shortcuts and made some modifications to standard Pascal, but these were minor and helped it achieve its greatest advantage: speed. Turbo Pascal compiled at a dizzying rate: several thousand lines a minute. At the time, the available compilers for the PC platform were slow and bloated. When Turbo Pascal came out, it was a breath of fresh air. Soon, Turbo Pascal became the de facto standard for programming on the PC. When PC Magazine published source code for utility programs, it was usually in either assembly or Turbo Pascal.

At the same time, Apple came out with its Macintosh series of computers. As Pascal was the preeminent structured programming language of the day, Apple chose Pascal as the standard programming language for the Mac. When programmers received the API and example code for Mac programming, it was all in Pascal.

Extensions

From version 1.0 to 7.0 of Turbo Pascal, Borland continued to expand the language. One of the criticisms of the original version of Pascal was its lack of separate compilation for modules. Dr. Wirth even created a new programming language, Modula-2, to address that problem. Borland added modules to Pascal with its units feature.

By version 7.0, many advanced features had been added. One of these was DPMI (DOS Protected Mode Interface), a way to run DOS programs in protected mode, gaining extra speed and breaking free of the 640K barrier for accessing memory under DOS. Turbo Vision, a text-based windowing system, allowed programmers to create great-looking interfaces in practically no time at all. Pascal even became object-oriented, as version 5.5 adopted the Apple Object Pascal extensions. When Windows 3.0 came out, Borland created Turbo Pascal for Windows, bringing the speed and ease of Pascal to the graphical user interface. It seemed that Pascal's future was secure.

The World Changes

However, this was not to be. In the 1970s, Dennis Ritchie and Brian Kernighan of AT&T Bell Laboratories created the C Programming Language. Ritchie then collaborated with Ken Thompson to design the UNIX operating system. At the time, AT&T had a government-sanctioned monopoly on telephone service in the United States. In return for the monopoly, its telephone business was regulated and it was prohibited from entering the computer business. AT&T, seeing no market for a research operating system, gave UNIX away to universities for free, complete with source code. Thus, a whole generation of computer science students learned C in their university courses on languages and operating systems. Slowly but surely, C began to filter into the computer programming world.

Pascal took a heavy hit in the 90s when several large companies focused on other programming languages. Microsoft for example focused on Visual Basic and C, and Apple migrated its APIs from Pascal to C and later to Objective C. Despite the lack of support from operating system producers, Pascal still retained a large following through Delphi and Free Pascal.

So what are the advantages of learning Pascal?

Despite having lost its previous position of dominance, Pascal is still quite useful, one of its advantages being that it has a very clear syntax which uses common words, such as begin/end, to express concepts, making its code easier to read and maintain.

Another reason: speed and size. Pascal compilers are lightning-fast and Delphi and Free Pascal are no exceptions. While C programmers might wait for hours, Pascal programmers have to wait only 1 minute for a program of a similar size. Besides that the Pascal IDEs are still leaders in terms of productivity in the world through the Delphi IDE and the Lazarus IDE.

Also, Pascal remains preferred at many universities. In addition, Pascal was well-suited for teaching programming, and remains so. There is less overhead and fewer ways for a student to get a program into trouble. For teaching simple procedural programming, Pascal remains a good choice. Pascal has hung on longer in education outside the United States, and remains an official language of the International Informatics Olympiad. A basic programming background is useful in many technical occupations and Pascal is easier to learn than C/C++.

Today Pascal retains a niche in the market through Delphi, Free Pascal and Lazarus. Many small-scale freeware, shareware, open-source and commercial programs are written in Pascal/Delphi. So enjoy learning it. It's a great introduction to computer programming. It's not dangerous like C, confusing like C++, or slow like Java.

 ◄   ▲   ►