Relationships beetween Complied/Interpreted/Scripting and other programming language classifications? - programming-languages

I got lost in the classifications of programming languages. What is the relationships between "Compiled/Interpreted/Scripting" and "OOP/Procedural/Functional", and possibly many "terms" for classifying languages?
I do not even know how to ask this properly. Looked for programming language hierarchy but every diagram is always missing some terms above.

There is not really a relationship between them, as they are different classification systems.
OOP/Procedural/Functional describe the syntax and grammar of a programming language.
It describes what a language looks like to the software programmer.
Compiled/Interpreted/Scripting describes how the language is processed, and what is necessary for a program to run.
Compiled languages are transformed into machine code before execution, interpreted and scripting languages are transformed into machine code during execution.
Examples of languages and their classification in either system:
Java is a OOP Compiled language.
Kotlin is a functional compiled language.
Python is a procedural interpreted language.
Javascript is a functional scripting language

Related

Is there an abstract language that "compiles" to natural languages?

Is there an abstract language that "compiles" to natural languages?
For example
(verb-love :subject person-1sg :object person-2sg)
would compile to "I love you" in English but to "Je t'aime" in French.
With the possibility to add mood, tense, etc.
(verb-love :subject person-1sg :object person-2g :tense future)
I used S-expressions the example but the syntax doesn't matter.
It does not have to be Turing-complete since a scripting language could generate such code.
This is a general question without a clear application. Some may say that depends on the application. Compiling abstract representations into text may not be natural language but it is close enough for some applications.
One of the solutions is Grammatical Framework (GF) https://www.grammaticalframework.org/lib/doc/synopsis/index.html. You can write abstractions and various linearisations in different languages. A good starting point is GF's Resource Grammar Library (RGL) which has a small set of vocabulary and standard sentence structure for a very wide range of languages in the world.
There is a tiny version here on the web demo:
http://cloud.grammaticalframework.org/minibar/minibar.html

Differences between low-and high-level languages using the Von Neumann model

I'm confused by this textbook problem:
Assembler is a low-level language, but Java and Python are high-level languages.
Explain the difference with an example using the Von Neumann model. Choose either Java or Python.
I know the differences between low-level and high-level languages, but I'm having a really hard time figuring out a way to explain the differences using the Neumann model. I don't really see what the model has to do with low-or high-level languages? Any ideas?
Low-level languages take their fundamentals from the Von Neumann machine, so they are at a level very close to the machine. They are classified into machine language and assembly language. Also, the instructions are different on each computer, so they are difficult to program and are costly.
High-level languages are based on Abstract MAchines. Whenever a high-level language is being used, an interpretation or translation process will be necessary, which helps to convert the programming language to machine language so that it can be executed.

What defines a programming language?

Recently I've starting a project I'm calling 'JIL' or JIL Interfacing Language, and it's to be a programming language of sorts. Now, I doubt it will ever be super-useful or versatile, but the aim of it is to be a step up from block programming, but a step down from complex languages like java, C, or C++. JIL stands for JIL Interfacing Language because it is both interpreted and parsed in java, and all of its keywords/methods will be interpreted and then executed in java. My question is would JIL count as a 'true' programming language, or is it a 'false' or 'secondary' programming language that is nothing more than a java application.
using wiki's definition as a rule of the thumb:
A programming language is a formal constructed language designed to
communicate instructions to a machine
yours is formal because it can be parsed. if it also instructs machine what to do then congratulations - your first programming language :)

Newer programming language than Prolog for logic programming

Is there any newer language than Prolog specialized for logical programming?
Mercury is nice and modern, and resembles prolog.
Mercury is a new logic/functional programming language, which combines the clarity and expressiveness of declarative programming with advanced static analysis and error detection features. Its highly optimized execution algorithm delivers efficiency far in excess of existing logic programming systems, and close to conventional programming systems. Mercury addresses the problems of large-scale program development, allowing modularity, separate compilation, and numerous optimization/time trade-offs.
There is a quite promising functional logic programming language called Curry. In spite of its newness it should be easy to get used to Curry if you already know Haskell and Prolog as it was directly influenced by these two languages.
Curry combines in a seamless way
features from functional programming
(nested expressions, higher-order
functions, lazy evaluation), logic
programming (logical variables,
partial data structures, built-in
search), and concurrent programming
(concurrent evaluation of expressions
with synchronization on logical
variables).
Don't forget that Prolog is the host for many newer extensions which can be considered languages in their own right. In particular constraint languages like CLP(R), CLP(Q), CLP(FD). More general extensions like CHR, but also many typed approaches.
These languages usually ship as a library in an existing Prolog system. What you get in that setting is often a significantly more mature and stable implementation than from-scratch system can offer. After all, many Prolog systems are almost 30 years old.
Logtalk is an object-oriented logic programming language that extends and leverages the Prolog language with a feature set suitable for programming in the large, focusing in code encapsulation and reuse mechanisms. It's highly portable supporting as a backend compiler most actively maintained Prolog implementations. Other noteworthy features include support for both prototypes and classes, protocols (interfaces), coinduction, component-based programming, event-driven programming, and high-level multi-threading programming. The current distribution include a large set of programming examples, programming tools, libraries, and text editors and syntax highlighters support for programming and publishing source code.
Oz/Mozart is a Multi-paradigm programming language that supports Logic programming as one of it's features. I've never used it so I can't say if it's good. It certainly seems interesting though.
Disclaimer: I work on the Mercury project and would choose Mercury in a choice between Oz/Mozart and Mercury.
None of the other answers has mentioned Picat:
Picat is a simple, and yet powerful, logic-based multi-paradigm programming language aimed for general-purpose applications. Picat is a rule-based language, in which predicates, functions, and actors are defined with pattern-matching rules. Picat incorporates many declarative language features for better productivity of software development, including explicit non-determinism, explicit unification, functions, list comprehensions, constraints, and tabling. Picat also provides imperative language constructs, such as assignments and loops, for programming everyday things. The Picat implementation, which is based on a well-designed virtual machine and incorporates a memory manager that garbage-collects and expands the stacks and data areas when needed, is efficient and scalable. Picat can be used for not only symbolic computations, which is a traditional application domain of declarative languages, but also for scripting and modeling tasks.
Picat looks somewhat similar to Prolog but Picat is a multi-paradigm language:
import util.
input_data(Tri) =>
Lines = read_file_lines("triangle.txt"),
Tri = new_array(Lines.length),
I = 1,
foreach(Line in Lines)
Tri[I] = Line.split().map(to_integer).to_array(),
I := I+1
end.

what is a programming language?

Wikipedia says:
A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer. Programming languages can be used to create programs that specify the behavior of a machine, to express algorithms precisely, or as a mode of human communication.
But is this true? It occurred to me in the shower this morning that a programming language might just be a set of conventions, something that both a human and an appropriately arranged compiler can interpret. If that's the case, then isn't it this definition of a programming language misleading? If that isn't the case, then what's the difference between a compiler and the language it compiles?
Thanks!
z.
A programming language is exactly that set of conventions, but I don't see why that makes the Wikipedia entry misleading, really. If it makes you feel better, you might edit it to read something like:
A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer. Programming languages can be used to define programs that specify the behavior of a machine, to express algorithms precisely, or as a mode of human communication.
I understand what you are saying, and you are right. Describing a programming language as a "machine-readable artificial language designed to express computations that can be performed by a machine" is unnecessarily specific. Programming languages can be more broadly generalized as established descriptions of tasks (or "a set of conventions") that allow one entity to control the behavior of another. What we traditionally identify as programming languages are just a layer of abstraction between machine code and programmers, and are specifically designed for electronic computers.
Programming languages are not limited to traditional computers (see the K'NEX Computer), and aren't even necessarily limited to computational devices at all. For example, when I am pleased with my dog's behavior, he gets a treat. When I am displeased, he gets nothing. Over time the dog learns the treat/no treat programming and I can use the treats to control his behavior (to an extent).
I don't see what is different between what you are asking...
It occurred to me in the shower this morning that a programming language might just be a set of conventions, something that both a human and an appropriately arranged compiler can interpret.
... and the Wikipedia definition.
The key is that a programming language is just "a machine-readable artificial language".
A compiler does indeed act as an effective specification of a language in terms of a reduction to machine code - however, as it's generally difficult to understand a language by reading the compiler's source, one generally considers a programming language in terms of an abstract processing model that the compiler implements. This abstract model is what one means when one refers to the programming language.
That said, there are indeed many languages (Hi there, PHP!) in which the compiler is the only specification of the language in existence. These languages tend to change unpredictably at times as compiler bugs are fixed or introduced.
Programming languages are an abstraction layer that helps insulate the programmer from having to talk in electrical signals to the computer. The creators of the language have done all the hard work in creating a structure (language) or standard (grammar, conjugation, etc.) that then can be interpreted by a compiler in terms that the computer understands.
All programming languages are really nothing more than domain specific languages for machine code or manipulating the registers and memory of a processing entity.
This is probably the true explanation of what a programming language really is:
Step 1: Think of a language and its grammar, which is a set of rules for making syntactically valid statements using the language. For example, a language called GRID has tiles {0,1} as its alphabet and grammar rules that make sure every GRID statement has equal length and height.
Step 2 (definition of program): GRID, so far, is useless. I'd dare to think of any valid statement of GRID as just data. We need to add something else to GRID: a successor function. So GRID={Grammar, alphabet, successor function}. To make this clear, lets use the rules of "The Game of Life" as successor function.
Step 3: The Game of Life is actually Turing Complete, so GRID={Grammar, alphabet, successor function = GOL} can perform any computation that is computable.
A programming language is nothing but a language with a successor function. The environment that evaluates a valid statement of the language(program) does nothing but follow those successor functions. Variables, for example, are things whose successor functions = (STAY THE SAME)
Computers are just very fast environments ;)
Wikipedia's definition might have been taken out of context. For one thing, only programs written in machine code are machine-readable. Otherwise, you need a compiler to convert C++, Java or even assembly code to machine code so the computer can carry out your instructions. Unless you include comments that are only readable to humans, or unless you are strictly discussing a topic within the realm of your program, programming is insufficient for human communication.

Resources