1

Topic: Languages for calculations

Now like growth of productivity of processors stopped, the future behind multisequencing - many kernels means, it is a lot of processors in one computer. Whether exist , allowing conveniently  algorithm? I represent it so: in such  there should be two types of cycles - normal and parallel. In normal cycles there is any counter which increases each iteration, and in parallel the system should launch at once many flows, each of which processes the section of storage and has on an input the number - analog of the counter. In these parallel cycles some tasks cannot be implemented - for example, factorial calculation. But as a whole, when it will be necessary to process at one go the big array, they will normally work.

2

Re: Languages for calculations

Hello, Khimik, you wrote: K> in such  there should be two types of cycles - normal and parallel even in conservative  already is stream and parallelStream

3

Re: Languages for calculations

Hello, Khimik, you wrote: K> In these parallel cycles some tasks cannot be implemented - for example, factorial calculation. But as a whole, when it will be necessary to process at one go the big array, they will normally work. For "parallel cycles" separate languages are not necessary, enough libraries. For example Intel TBB, Microsoft PPL, and since a C ++ 17 - generally in STL. There just those parallel cycles, even a title corresponding - parallel_for.

4

Re: Languages for calculations

Hello, Khimik, you wrote: K> I represent it so: in such  there should be two types of cycles - normal and parallel. In normal cycles there is any counter which increases each iteration, and in parallel the system should launch at once many flows, each of which processes the section of storage and has on an input the number - analog of the counter. For a C ++ still is OpenMP - there generally  the most ordinary cycles, by means of adding #pragma. But nevertheless it is better than library of type TBB.

5

Re: Languages for calculations

Hello, Evgeny. Panasyuk, you wrote: EP> Hello, Khimik, you wrote: K>> I represent it so: in such  there should be two types of cycles - normal and parallel. In normal cycles there is any counter which increases each iteration, and in parallel the system should launch at once many flows, each of which processes the section of storage and has on an input the number - analog of the counter. EP> for a C ++ still is OpenMP - there generally  the most ordinary cycles, by means of adding #pragma. But nevertheless it is better than library of type TBB. And what will be, if in it  a normal cycle to try to count a factorial?

6

Re: Languages for calculations

Hello, Khimik, you wrote: EP>> For a C ++ still is OpenMP - there generally  the most ordinary cycles, by means of adding #pragma. But nevertheless it is better than library of type TBB. K> and what will be, if in it  a normal cycle to try to count a factorial? Some flows will be launched and the parallel reduction will be produced - the problem is not present, as multiplication operation is associative: template <typename T> T factorial (T N) {T result = 1; #pragma omp parallel for reduction (*:result) for (T i = 1; i <= N; ++ i) result * = i; return result;} But, again , I instead of OpenMP prefer libraries of type TBB, or a C ++ 17 STL. In the presence of lambdas, an ubiquitous output of types, etc. tricks with  are not necessary.

7

Re: Languages for calculations

Hello, Khimik, you wrote: K> Now like growth of productivity of processors stopped, the future behind multisequencing - many kernels means, it is a lot of processors in one computer. Whether exist , allowing conveniently  algorithm? Languages of 4th generation for example sql. Where the compiler itself synthesizes and  algorithm. K> I represent it so: in such  there should be two types of cycles - normal and parallel. In normal cycles there is any counter which increases each iteration, and in parallel the system should launch at once many flows, each of which processes the section of storage and has on an input the number - analog of the counter. In these parallel cycles some tasks cannot be implemented - for example, factorial calculation. But as a whole, when it will be necessary to process at one go the big array, they will normally work. In such languages of cycles it is not necessary. Simply other primitives - samplings, convolutions, etc.

8

Re: Languages for calculations

Hello, Khimik, you wrote: K> I represent it so: in such  there should be two types of cycles - normal and parallel. It is such children's, amateurish sight. It prevailed in 90. Then thought that if to make the extension of imperative languages all  will be accelerated in so much time, how many at you is processors. In a reality, it is self-deception.  calculations at level of cycles hardly less than it is useless. In the real world there are tasks which well  and those that  is bad. The majority of calculations has an accurate sequence. It would be necessary to calculate at first to calculate And, etc. Parallelit is possible "in big". A simple example. Here there is at us a project which we develop. In it of 100500 files.  analysis one  is almost useless (very difficult and I pound) a little. But  analysis of separate files it is possible simply enough. In my opinion from programming languages of following worship it is necessary to demand not automatic multisequencing, and support of warranties of a correctness of manual multisequencing. Well cannot it is effective  calculations the automatic machine (program). And the person - can. Means it is necessary for it to help. I consider that support of locality of the data and increase of efficiency of change and "copying" of the local data will be following step to mankind development. We are returned to the same files. Here  we a file in a separate flow. Now it is necessary to make so that I could process data retrieveds (and them much) is parallel with the remaining data (from other files) and thus not to have problems with locks and not to copy all data. For this purpose it is necessary that the programmer operated with certain areas of storage which it is possible change only from one control flow. And to give to the programmer a cheap method of transmission "the frozen it is blind information" from one flow in another. Differently it is necessary to make so that flows had no general data, and date transmission from one flow in another was transparent and cheap. I have a mass of thoughts about it. But it demands development of a modern language of programming. And new  for it. The correct thoughts are in Raste. But there all is too difficult that it could enter into a mainstream. It is necessary to teach to manipulate languages heaps. To teach to transfer these heaps between "the virtual processes" (in style the Erlang). For this purpose it is necessary to create programming modern languages.

9

Re: Languages for calculations

Hello, Evgeny. Panasyuk, you wrote: EP> some flows Will be launched and the parallel reduction will be produced - the problem is not present, as multiplication operation is associative: EP> EP> template <typename T> EP> T factorial (T N) EP> {EP> T result = 1; EP> #pragma omp parallel for reduction (*:result) EP> for (T i = 1; i <= N; ++ i) EP> result * = i; EP> return result; EP>} EP> EP> But, again , I instead of OpenMP prefer libraries of type TBB, or a C ++ 17 STL. In the presence of lambdas, an ubiquitous output of types, etc. tricks with  are not necessary.  for , but I do not understand as this code works. It was a question that factorial calculation just is impossible . Or in this code it  partially, type of digit with 2 to 5 are multiplied in one process, with 6 on 9 in other, then two results the factorial of nine is multiplied and turns out?

10

Re: Languages for calculations

Hello, kov_serg, you wrote: _> Languages of 4th generation for example sql. Where the compiler itself synthesizes and  algorithm. On SQL Doom you will not write...

11

Re: Languages for calculations

Hello, Khimik, you wrote: EP>> some flows Will be launched and the parallel reduction will be produced - the problem is not present, as multiplication operation is associative: EP>> EP>> #pragma omp parallel for reduction (*:result) EP>> for (T i = 1; i <= N; ++ i) EP>> result * = i; EP>> K> Sorri for , but I do not understand as this code works. It was a question that factorial calculation just is impossible . Or in this code it  partially, type of digit with 2 to 5 are multiplied in one process, with 6 on 9 in other, then two results the factorial of nine is multiplied and turns out? Yes, so. The parallel reduction is one of basis operations for parallel algorithms, and as for multi-core, for multi-node (a-lja MPI_Reduce), and for GPGPU. That is it is necessary to calculate: a * b * c * d where a, b, c, d - the arbitrary data, and * - the arbitrary associative binary operation. For the associativity account we have possibility to place a bracket as it is required to us (that as a matter of fact reduces dependences between the data): (a * b) * (c * d) And accordingly to calculate operations in brackets parallely. Actually it approaches and for operations with a floating point, in spite of the fact that they not associative. The main thing understand that the result can to depend on the order of calculations, and is frequent these distinctions are admissible (in a case floating point).

12

Re: Languages for calculations

Hello, VladD2, you wrote: VD> In a reality, it is self-deception. VD> Parallelit of calculation at level of cycles hardly less than is useless. Cycles happen not only on a low level, but also on high. You further also give an example: VD> Parallelit is possible "in big". A simple example. In from there is at us a project which we develop. In it of 100500 files.  analysis one  is almost useless (very difficult and I pound) a little. But  analysis of separate files it is possible simply enough. Here is how time parallel analysis of separate files, it also is a cycle on files at high level - parallel transform/map, and can also parallel reduce after, depending on the task.

13

Re: Languages for calculations

Hello, Evgeny. Panasyuk, you wrote: EP> Cycles happen not only on a low level, but also on high. You further also give an example: VD>> Parallelit is possible "in big". A simple example. In from there is at us a project which we develop. In it of 100500 files.  analysis one  is almost useless (very difficult and I pound) a little. But  analysis of separate files it is possible simply enough. EP> here is how time parallel analysis of separate files, it also is a cycle on files at high level - parallel transform/map, and can also parallel reduce after, depending on the task. It any more cycles. It already program structure.  cycles hardly less than it is completely useless.  it is possible only for essence really capable to be processed independently. For today, solve that it is possible  can only the person. On this from language it is required to allow to the person to define as as . And for increase of efficiency and safety to give it mechanisms of control of date transmission between parallel to processes (or other units of parallel performance). Roughly speaking languages providing cheap  processes are necessary. And cheap date transmission in between. Are for this purpose necessary: 1. A warranty of an invariance given different "processes". 2. Cheapness of date transmission (an object graph frost in one process and its transmissions to another). 3. Monitoring aids of sequence of calculations. That the person could behold as calculations  and are returned reversely to synchronous.

14

Re: Languages for calculations

15

Re: Languages for calculations

Hello, VladD2, you wrote: EP>> Cycles happen not only on a low level, but also on high. You further also give an example: VD>>> Parallelit is possible "in big". A simple example. In from there is at us a project which we develop. In it of 100500 files.  analysis one  is almost useless (very difficult and I pound) a little. But  analysis of separate files it is possible simply enough. EP>> here is how time parallel analysis of separate files, it also is a cycle on files at high level - parallel transform/map, and can also parallel reduce after, depending on the task. VD> it any more cycles. It already program structure. And this STRUCTURE how expresses? Whether cycles casually? VD> Paralelene of cycles hardly less than is completely useless. If you not all cycles cycles name, and only those which not  it is visible yes. And if without terminological balancing act - that quite has, from here and is visible in parallel libraries (that multi-thread that multi-process that multi-node) primitives of "parallel cycles" type parallel map/transform, reduce, and sometimes and alloyed mapreduce. VD> And for increase of efficiency and safety to give it mechanisms of control of date transmission between parallel to processes (or other units of parallel performance). It only for a subset of those tasks in which date transmission between parallel processes is required. Many tasks express through mapreduce where in processes there is no interaction with others. The same tasks in which there is a constant interaction between processes normally concern not to parallel computing, and to concurrent.

16

Re: Languages for calculations

Hello, Evgeny. Panasyuk, you wrote: EP> And this STRUCTURE how expresses? Whether cycles casually? No. But it not the main thing. The main thing that the primary goal not , and to make so that  calculations did not hinder each other (were isolated). And in that how to unite results of calculations. EP> if you not all cycles cycles name, and only those which not  it is visible yes. And if without terminological balancing act - that quite has, from here and is visible in parallel libraries (that multi-thread that multi-process that multi-node) primitives of "parallel cycles" type parallel map/transform, reduce, and sometimes and alloyed mapreduce. These libraries are in the same way useless. They no more than crutches not solving a problem, but only only  their facilitating. In respect of language means and libraries it is possible to select such  as Rx and ReactiveUI. These are more useful crutches. And there there are no cycles. But even these advanced crutches do not solve a problem of competitive change of the data. For the decision of this problem it is necessary to do modern languages and new  to them. EP> It only for a subset of those tasks in which date transmission between parallel processes is required. Many tasks express through mapreduce where in processes there is no interaction with others. These are 100 % of tasks. All tasks demand operation dataful. Map-redju - no more than algorithm for certain tasks. It any does not give warranties. And for safe and productive programming warranties and control are necessary. EP> the same tasks in which there is a constant interaction between processes normally concern not to parallel computing, and to concurrent. Yes you can though to hell bald that want to carry. It changes nothing. The main problem of parallel calculations in that that it is necessary to supervise change of the data. If it was not so problems would solve banal functions.

17

Re: Languages for calculations

Hello, VladD2, you wrote: EP>> If you not all cycles cycles name, and only those which not  it is visible yes. And if without terminological balancing act - that quite has, from here and is visible in parallel libraries (that multi-thread that multi-process that multi-node) primitives of "parallel cycles" type parallel map/transform, reduce, and sometimes and alloyed mapreduce. VD> These libraries are in the same way useless. They no more than crutches not solving a problem, but only only  their facilitating. Are useful, solve quite real engineering and scientific tasks, and it is successful. These libraries also load all computing clusters. Once again, speech about parallel computing, scientific computings and engineering calculations. You broadcast more about concurrency is other subject. VD> in respect of language means and libraries it is possible to select such  as Rx and ReactiveUI. These are more useful crutches. And there there are no cycles. VD> But even these advanced crutches do not solve a problem of competitive change of the data. In-in, about that and speech is all concurrency, and to a subject has only mediated relation EP>> It only for a subset of those tasks in which date transmission between parallel processes is required. Many tasks express through mapreduce where in processes there is no interaction with others. VD> it is 100 % of tasks. All tasks demand operation dataful. Yes, dataful, but not all with the divided data.

18

Re: Languages for calculations

Hello, Kodt, you wrote: High-level - because the price for interstream communication should not exceed advantage of multisequencing. That is, matrixes 10*10 to multiply on several kernels - the sense is not present, and here matrixes 10000*10000 - already are. It is necessary to multiply matrixes on GPU. They are for this purpose intended. And generally, such things should do libraries. Should not write everyone the variant of multiplication of matrixes. In general, the example from a finger is exhausted. Speech almost always goes to realities about challenging tasks with a heap of branchings and the difficult data. And here in these conditions multisequencing of a cycle gives nothing. All essentially is more difficult.

19

Re: Languages for calculations

Hello, Khimik, you wrote: K> Now like growth of productivity of processors stopped, the future behind multisequencing - many kernels means, it is a lot of processors in one computer. Whether exist , allowing conveniently  algorithm? There are at least two different classes of tasks. About a vectorization (parallel cycles) and appropriate libraries already some times mentioned, parallel collections are practically everywhere. The second type of tasks mentioned VladD2. These are more high-level (and more dynamic) tasks. At it parsing and data handling. In a web there can be a loading of configs and then additional resources from several services with different dependences (to go on a config to one service, then under its link in another, etc.) . For this task too there are decisions. It Futures/Promises (still deferred from the same series). Are called differently in different languages. Convenience depends from specific API in specific language. In languages with support of monads generally all is fine. Monadnoe/applikativnoe API with function at the left (in haskell-style fn:> v1:> v2:>> v3 and similar) too it is normal. And here if developers mastered only the functor (aka map) there it is sick. An example - javascript. Without normal wrappers (one function Async.apply (fn, arg1, arg2....)) something nontrivial on native Promise to do very inconveniently (the wrapper becomes easily, but why not in the standard that???) . Here literally yesterday did: def deleteRecursive (path: Path): Future [Unit] = deleteNode (path) recoverWith {/* Already deleted. */case NoNodeException => Future.successfull (()) case NotEmptyException => val op = for {children <- getChildren (path) childOperations = children.map (child => deleteRecursive (path + child)) _ <- Future.sequence (childOperations) _ <- deleteNode (path)} yield () op recoverWith {case NoNodeException => Future.successfull (())}} Future.sequence  black magic on conversion Seq [Future [Unit]] in Future [Seq [Unit]]. As a matter of fact it is similar deleteChildren from here. While the original waits the answer from the server, I sends a pile of commands and then on the sly rakes result. Actually there not "multithreading", and "asynchrony" (one flow of a data interchange), but in usage API of this fact simply it is not visible.

20

Re: Languages for calculations

Hello, VladD2, you wrote: VD> We are returned to the same files. Here  we a file in a separate flow. Now it is necessary to make so that I could process data retrieveds (and them much) is parallel with the remaining data (from other files) and thus not to have problems with locks and not to copy all data. Sounds as the typical task for futures + immutable data structures. And  parts (like a parcer  and other strictly algorithmic closed steps) about Futures anything will not know a file, it will be in the exterior (coordinating) code. VD> for this purpose it is necessary that the programmer operated with certain areas of storage which it is possible change only from one control flow. Local variables VD> And to give to the programmer a cheap method of transmission "the frozen it is blind information" from one flow in another. Immutable types. VD> Differently it is necessary to make so that flows had no general data, and date transmission from one flow in another was transparent and cheap. Had no general impure data. I do not see any problems in the invariable data divided by many flows. Transmission  the data - simple and transparent. Purity API (immutable in, immutable out) is reached  the code. In methods - let changeable structures use, it is not a pity. VD> It is necessary to teach to manipulate languages heaps. To teach to transfer these heaps between "the virtual processes" (in style the Erlang). And programmers too to it to learn? And how many there it is planned to benefit in comparison with futures+immutable structures? I for the sake of two-three times in a productivity difference will learn hardly a modern language and I booze manually on area to label. For immutable the board is, but rather small (hardly less optimal structures, superfluous lookup instead of cycles). If secures, I will look more likely at a cluster on compilation. Because in pure functions and acyclic columns to carry out separate operations on a cluster it is possible easily and simply. Almost exchanges nothing. Was Future, calculated in a flow. Will be Future, obtaining the data from a network. It is possible still everyones shared fs + caches to look, etc. But it hardly soon it is required.

21

Re: Languages for calculations

Hello, Khimik, you wrote: K> Hello, kov_serg, you wrote: _>> Languages of 4th generation for example sql. Where the compiler itself synthesizes and  algorithm. K> on SQL Doom you will not write... "As you know soap about fairy godmothers". On js wrote.