Expression-oriented programming language

Programming paradigms

* Action
* Agent-oriented
* Array-oriented
* Automata-based
* Concurrent computing
* Relativistic programming
* Data-driven
* Declarative (contrast: Imperative)
* Functional
* Functional logic
* Purely functional
* Logic
* Abductive logic
* Answer set
* Concurrent logic
* Functional logic
* Inductive logic
* Constraint
* Constraint logic
* Concurrent constraint logic
* Dataflow
* Flow-based
* Reactive
* Ontology
* Differentiable
* Dynamic/scripting
* Event-driven
* Function-level (contrast: Value-level)
* Point-free style
* Concatenative
* Generic
* Imperative (contrast: Declarative)
* Procedural
* Object-oriented
* Polymorphic
* Intentional
* Language-oriented
* Domain-specific
* Literate
* Natural-language programming
* Metaprogramming
* Automatic
* Inductive programming
* Reflective
* Attribute-oriented
* Macro
* Template
* Non-structured (contrast: Structured)
* Array
* Nondeterministic
* Parallel computing
* Process-oriented
* Probabilistic
* Quantum
* Set-theoretic
* Stack-based
* Structured (contrast: Non-structured)
* Block-structured
* Structured concurrency
* Object-oriented
* Actor-based
* Class-based
* Concurrent
* Prototype-based
* By separation of concerns:
* Aspect-oriented
* Role-oriented
* Subject-oriented
* Recursive
* Symbolic
* Value-level (contrast: Function-level)

* v
* t
* e

An expression-oriented programming language is a programming language in which every (or nearly every) construction is an expression and thus yields a value.[1] The typical exceptions are macro definitions, preprocessor commands, and declarations, which expression-oriented languages often treat as statements.

Lisp[2] and ALGOL 68 are expression-oriented languages. Pascal is not an expression-oriented language.

All functional programming languages are expression-oriented.[3]

## Contents

* 1 Criticism and prevention
* 2 Examples
* 3 See also
* 4 References

## Criticism and prevention

This article or section possibly contains synthesis of material which does not verifiably mention or relate to the main topic. (July 2022) (Learn how and when to remove this template message)

|

Critics, including language designers,[4][failed verification] blame expression-orientation for an entire class of programming mistakes wherein a programmer accidentally codes an assignment expression, which replaces a variable with an expression rather than testing it for equality with that expression.

The designers of Ada and Java prevent this type of mistake by restricting control expressions to those that evaluate strictly to the boolean data type.[5][6]

The designers of Python implemented assignment as a statement rather than an expression, thus prohibiting assignment from nesting inside any other statement or expression.[7] (Until version 3.8 added 'assignment expressions', with a different syntax.[8])

In some expression-oriented languages, expressions that merely cause side effects return void types.

## Examples

* ALGOL 68
* BLISS
* Icon
* Lisp[2]
* ML
* Perl
* Rebol
* Ruby
* Elixir
* Erlang
* Haskell
* Rust[9]
* Scala
* Kotlin
* OCaml[10]

## See also

* Command–query separation
* Functional programming

## References

1. ↑ "Glossary - The Rust Programming Language". https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/first-edition/glossary.html#expression-oriented-language.
2. ↑ 2.0 2.1 Syme, Don (2020-06-14). "The early history of F#" (in en). Proceedings of the ACM on Programming Languages 4 (HOPL): 1–58. doi:10.1145/3386325. ISSN 2475-1421.
3. ↑ "Expression Oriented Programming" (in en). 2018-02-08. https://medium.com/knoldus/expression-oriented-programming-d88f621fd3a4.
4. ↑ Java Code Conventions "10.4 Variable Assignments"
5. ↑ The Java Language Specification, Java SE 8 Edition "14.9 The if Statement"
6. ↑ Introducing Ada
7. ↑ The Python Language Reference "6.2. Assignment statements"
8. ↑ "PEP 572: Assignment Expressions"
9. ↑ "Functions - The Rust Programming Language". https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/first-edition/functions.html#expressions-vs-statements.
10. ↑ "COS 326: Functional Programming". https://www.cs.princeton.edu/~dpw/courses/cos326-12/notes/type-check.php.

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Expression-oriented programming language. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Expression-oriented_programming_language&oldid=3382496"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template