This article needs additional citations for
verification. (March 2023) |
Programming languages are typically created by designing a form of representation of a computer program, and writing an implementation for the developed concept, [1] usually an interpreter or compiler. Interpreters are designed to read programs, usually in some variation of a text format, and perform actions based on what it reads, whereas compilers convert code to lower level. [2]
In programming language design, there are a wide variety of factors to consider. Some factors may be mutually exclusive (e.g. security versus speed). It may be necessary to consider whether a programming language will perform better interpreted, or compiled, if a language should be dynamically or statically typed, if inheritance will be in, and the general syntax of the language. [3] Many factors involved with the design of a language can be decided on by the goals behind the language. It's important to consider the target audience of a language, its unique features and its purpose. [4] It is good practice to look at what existing languages lack, or make difficult, to make sure a language serves a purpose. [4]
Various experts have suggested useful design principles:
An interpreter is a program that reads another program, typically as text, [4] as seen in languages like Python. [2] Interpreters read code, and produce the result directly. [8] Interpreters typically read code line by line, and parse it to convert and execute the code as operations and actions. [9]
Compilers are programs that read programs, also usually as some form of text, and converts the code into lower level machine code or operations. [4] Compiled formats generated by compilers store the lower level actions as a file. [2] Compiled languages converted to machine code, tend to be a lot faster, as lower level operations are easier to run, and outcomes can be predicted and compiled ahead of time. [9]
Processes of making a programming language may differ from developer to developer; however, here is a general process of how one might create a programming language, which includes common concepts:
Getting started presents the chicken-and-egg problem familiar from compiler construction: one needs a compiler to bootstrap a compiler, and bootstrapping compiler generators is no exception.
This article needs additional citations for
verification. (March 2023) |
Programming languages are typically created by designing a form of representation of a computer program, and writing an implementation for the developed concept, [1] usually an interpreter or compiler. Interpreters are designed to read programs, usually in some variation of a text format, and perform actions based on what it reads, whereas compilers convert code to lower level. [2]
In programming language design, there are a wide variety of factors to consider. Some factors may be mutually exclusive (e.g. security versus speed). It may be necessary to consider whether a programming language will perform better interpreted, or compiled, if a language should be dynamically or statically typed, if inheritance will be in, and the general syntax of the language. [3] Many factors involved with the design of a language can be decided on by the goals behind the language. It's important to consider the target audience of a language, its unique features and its purpose. [4] It is good practice to look at what existing languages lack, or make difficult, to make sure a language serves a purpose. [4]
Various experts have suggested useful design principles:
An interpreter is a program that reads another program, typically as text, [4] as seen in languages like Python. [2] Interpreters read code, and produce the result directly. [8] Interpreters typically read code line by line, and parse it to convert and execute the code as operations and actions. [9]
Compilers are programs that read programs, also usually as some form of text, and converts the code into lower level machine code or operations. [4] Compiled formats generated by compilers store the lower level actions as a file. [2] Compiled languages converted to machine code, tend to be a lot faster, as lower level operations are easier to run, and outcomes can be predicted and compiled ahead of time. [9]
Processes of making a programming language may differ from developer to developer; however, here is a general process of how one might create a programming language, which includes common concepts:
Getting started presents the chicken-and-egg problem familiar from compiler construction: one needs a compiler to bootstrap a compiler, and bootstrapping compiler generators is no exception.