Programming language: Difference between revisions

From Decimal Wiki
Jump to navigation Jump to search
[checked revision][checked revision]
No edit summary
No edit summary
Line 1: Line 1:
{{#seo:
{{#seo:
                     |title= Язык программирования
                     |title= Programming language
                     |titlemode= append  
                     |titlemode= append  
                     |keywords= Язык программирования
                     |keywords= Programming language
                     |description= Язык программирования
                     |description= Programming language
                     }}
                     }}
<div class="mikio-article-content">
<div class="mikio-article-content">
 
<div class="mikio-tags">
<div class="mikio-tags">




</div>
</div>
<span id="jazyk_programmirovanija"></span>
<span id="jazyk_programmirovanija"></span>
= Язык программирования =
= Programming language =
 
<div class="level1">
<div class="level1">
 
'''Язык программирования''' — это набор формальных правил, по которым пишут программы.
'''The programming language''' is a set of formal rules by which programs are written.
 
 
</div>
</div>
<span id="u_jazyka_programmirovanija_est_dva_aspekta"></span>
<span id="u_jazyka_programmirovanija_est_dva_aspekta"></span>
===== У языка программирования есть два аспекта: =====
===== The programming language has two aspects: =====
 
<div class="level5">
<div class="level5">
 
<ul>
<ul>
<li><div class="li">
<li><div class="li">
 
синтаксис (правила написания кода, правописание, порядок слов);
syntax (rules for writing code, spelling, word order);
 
</div></li>
</div></li>
<li><div class="li">
<li><div class="li">
 
семантика (идея, смысловая нагрузка или назначение).
semantics (idea, semantic load or purpose).
 
</div></li></ul>
</div></li></ul>
 
Обычный язык нужен для общения с людьми, а язык программирования — для общения с компьютером. Как и в любом естественном языке, у компьютерных есть лексика и семантика, но, поскольку они намного проще, чем человеческие, грамматика у них не на первом месте, но синтаксис и словообразование важны. А для для понятия «смысл» программисты используют слово «семантика».
An ordinary language is needed to communicate with people, and a programming language is needed to communicate with a computer. As in any natural language, computer languages have vocabulary and semantics, but since they are much simpler than human ones, grammar is not in the first place, but syntax and word formation are important. And for the concept of "meaning" programmers use the word "semantics".
 
 
</div>
</div>
<span id="otlichie_jazykov_programmirovanija_ot_algoritmov"></span>
<span id="otlichie_jazykov_programmirovanija_ot_algoritmov"></span>
= Отличие языков программирования от алгоритмов =
= The difference between programming languages and algorithms =
 
<div class="level1">
<div class="level1">
 
Программы нужны для того, чтобы машина сделала что-то полезное. Это невозможно, если нет чёткого алгоритма порядка действий и правил выполнения чего-то полезного.
Programs are needed in order for the machine to do something useful. This is impossible if there is no clear algorithm the order of actions and rules for doing something useful.
 
Алгоритм работает как маршрут в навигаторе: ''«Из пункта А едем в пункт Б, поворот через 150 метров»'' . Англичанин понимает его по-английски, китаец — по-китайски, а мы с вами — по-русски. Языки разные, а порядок действий один: '''все должны добраться до нужного места.'''
The algorithm works like a route in the navigator: ""From point A we go to point B, turn in 150 meters"" . An Englishman understands it in English, a Chinese understands it in Chinese, and you and I understand it in Russian. The languages are different, but the procedure is the same: "'everyone has to get to the right place.'''
 
'''Любая программа начинается с алгоритма, но на разных языках это может выглядеть по-разному.'''
'''Any program starts with an algorithm, but it may look different in different languages.'''
 
 
</div>
</div>
<span id="kak_kompjuter_ponimaet_raznye_jazyki_programmirovanija"></span>
<span id="kak_kompjuter_ponimaet_raznye_jazyki_programmirovanija"></span>
= Как компьютер понимает разные языки программирования =
= How a computer understands different programming languages =
 
<div class="level1">
<div class="level1">
 
'''Язык программирования''' — это '''не''' язык компьютера. Машина понимает последовательности нулей и единичек: есть напряжение в цепи единица, нет ноль. Поэтому любую программу сначала надо перевести в набор таких машинных команд.
'''The programming language''' is '''not''' the language of the computer. The machine understands sequences of zeros and ones: there is a voltage in the circuit one, no zero. Therefore, any program must first be translated into a set of such machine commands.
 
Для этого есть два инструмента — '''компилятор''' и '''интерпретатор.''' Первый работает как бюро переводов: вы отдаёте ему весь текст программы, а он превращает его в исполняемый код, набор команд для процессора. Интерпретатор же больше похож на переводчика-синхрониста: сказали фразу синхронист быстро её перевёл, а компьютер выполнил.
There are two tools for this the '''compiler''' and the '''interpreter.''' The first one works like a translation agency: you give him the entire text of the program, and he turns it into executable code, a set of commands for the processor. The interpreter is more like a simultaneous interpreter: they said the phrase the synchronist quickly translated it, and the computer executed it.
 
Внутри компиляторов и интерпретаторов — сложные наборы правил по превращению языка программирования в машинный код, понятный компьютеру. Это тоже программы. Их пишут создатели нового языка на каком-то другом, уже существующем. Например, интерпретатор Python написан на C, а сам C — на ассемблере, практически машинном коде.
Compilers and interpreters contain complex sets of rules for turning a programming language into machine code understandable to a computer. These are also programs. They are written by the creators of a new language in some other, already existing one. For example, the Python interpreter is written in C, and C itself is written in assembler, almost machine code.
 
 
</div>
</div>
<span id="zachem_nuzhny_novye_jazyki_programmirovanija"></span>
<span id="zachem_nuzhny_novye_jazyki_programmirovanija"></span>
= Зачем нужны новые языки программирования? =
= Why do we need new programming languages? =
 
<div class="level1">
<div class="level1">
 
Существует уже несколько тысяч языков программирования, но всё равно продолжают создаваться новые. Обычно это делается для решения каких-то конкретных задач или в случае неудобства использования имеющегося языка.
There are already several thousand programming languages, but new ones are still being created. This is usually done to solve some specific tasks or in case of inconvenience of using an existing language.
 
Языки живут, пока люди пользуются написанными на них программами.
Languages live as long as people use programs written in them.
 
 
</div>
</div>
<span id="jazyki_programmirovanija_v_decimalchain"></span>
<span id="jazyki_programmirovanija_v_decimalchain"></span>
= Языки программирования в DecimalChain =
= Programming languages in DecimalChain =
 
<div class="level1">
<div class="level1">
 
Для корректной совместимости с Cosmos SDK и Tendermint в качестве языка программирования для реализации функционала Decimal, а именно программного обеспечения мастернод (валидаторов), использован язык рограмирования '''Golang.'''
For correct compatibility with the Cosmos SDK and Tendermint, the programming language "'Golang."' is used as a programming language for implementing Decimal functionality, namely the software of masternodes (validators).
 
Для написания бэкенд-модулей мы выбрали '''TypeScript''' , который строго типизирован и удобен в процессе разработки, а также компилируется в JavaScript, исполняется в современных браузерах и совместим с NodeJS. В частности, на TypeScript написаны воркеры (Workers) и индексер (Indexer).
To write backend modules, we chose "TypeScript", which is strictly typed and convenient in the development process, as well as compiled in JavaScript, executed in modern browsers and compatible with NodeJS. In particular, Workers and Indexer are written in TypeScript.
 
Для реализации десктоп-приложений кошельков команда Decimal использовала '''ElectronJS,''' который позволяет на основе JavaScript, HTML и CSS создавать кроссплатформенные десктоп-приложения.
To implement desktop wallet applications, the Decimal team used "ElectronJS," which allows creating cross-platform desktop applications based on JavaScript, HTML and CSS.
 




</div>
</div>
<div style="clear:both">
<div style="clear:both">




</div>
</div>
 
</div>
</div>
  [[Category:Commoninfo]]
  [[Category:Commoninfo]]

Revision as of 08:10, 30 June 2022


Programming language

The programming language is a set of formal rules by which programs are written.

The programming language has two aspects:
  • syntax (rules for writing code, spelling, word order);

  • semantics (idea, semantic load or purpose).

An ordinary language is needed to communicate with people, and a programming language is needed to communicate with a computer. As in any natural language, computer languages have vocabulary and semantics, but since they are much simpler than human ones, grammar is not in the first place, but syntax and word formation are important. And for the concept of "meaning" programmers use the word "semantics".

The difference between programming languages and algorithms

Programs are needed in order for the machine to do something useful. This is impossible if there is no clear algorithm — the order of actions and rules for doing something useful.

The algorithm works like a route in the navigator: ""From point A we go to point B, turn in 150 meters"" . An Englishman understands it in English, a Chinese understands it in Chinese, and you and I understand it in Russian. The languages are different, but the procedure is the same: "'everyone has to get to the right place.

Any program starts with an algorithm, but it may look different in different languages.

How a computer understands different programming languages

The programming language is not the language of the computer. The machine understands sequences of zeros and ones: there is a voltage in the circuit — one, no — zero. Therefore, any program must first be translated into a set of such machine commands.

There are two tools for this — the compiler and the interpreter. The first one works like a translation agency: you give him the entire text of the program, and he turns it into executable code, a set of commands for the processor. The interpreter is more like a simultaneous interpreter: they said the phrase — the synchronist quickly translated it, and the computer executed it.

Compilers and interpreters contain complex sets of rules for turning a programming language into machine code understandable to a computer. These are also programs. They are written by the creators of a new language — in some other, already existing one. For example, the Python interpreter is written in C, and C itself is written in assembler, almost machine code.

Why do we need new programming languages?

There are already several thousand programming languages, but new ones are still being created. This is usually done to solve some specific tasks or in case of inconvenience of using an existing language.

Languages live as long as people use programs written in them.

Programming languages in DecimalChain

For correct compatibility with the Cosmos SDK and Tendermint, the programming language "'Golang."' is used as a programming language for implementing Decimal functionality, namely the software of masternodes (validators).

To write backend modules, we chose "TypeScript", which is strictly typed and convenient in the development process, as well as compiled in JavaScript, executed in modern browsers and compatible with NodeJS. In particular, Workers and Indexer are written in TypeScript.

To implement desktop wallet applications, the Decimal team used "ElectronJS," which allows creating cross-platform desktop applications based on JavaScript, HTML and CSS.