Is there a programming language where you don't have to define actors yourself - every function is just ran as a separate actor (which can mean a separate thread if there are free cores available) by default?
For example it means that if I write something as simple as
v = fA(x) + fB(y)
then fA and fB could be calculated simultaneously before the sum of their results was assigned to v.
General-purpose programming languages are more commonly used by programmers. According to a study, C, Python, and Java were the most commonly used programming languages in 2021 respectively.
Functional Programming. Object Oriented Programming. This programming paradigm emphasizes on the use of functions where each function performs a specific task. This programming paradigm is based on object oriented concept. Classes are used where instance of objects are created.
Ballerina language is an open-source, cloud-native programming language designed to ease the burden of integration development associated with enterprise applications. Ballerina simplifies how a program talks over the network, usually to an application program interface (API).
I don't think there is anything this extreme, since the context switching and comunication overhead would be too big.
The closest I can think of to what you are asking is data-parallel programing, where the program is mostly written in the same style as a sequential version but parts of it are ran in parallel where possible.
Examples are loop vectorization in Fortran and "par" magic in Haskell.
Haskell's par
combinator lets you evaluate expressions concurrently (which can mean in separate threads if there are free cores available). All you have to do is:
x `par` y
Which will evaluate x
and y
concurrently, and return the value of y
. Note that x
and y
can be programs of arbitrary complexity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With