What does it mean when one language is a parallel superset of another?

岁酱吖の 提交于 2019-12-23 07:15:18

问题


I'm reading a journal article about Real-Time Concurrent C, and it mentions in the abstract (so any of you can see the context through that link as well) that "Concurrent C, is a parallel superset of C (and of C++)".

Now I know what a superset is, but what do they mean by a "parallel superset" when referring to programming languages?


回答1:


They're claiming two things, not one thing that is "modified". It's like saying "a quick red car"; the car is quick and red, it's not having a fast color.

  • It's parallel, because it supports parallel programming
  • It's a super-set, because every valid C or C++ program is also a valid Concurrent C program.

That's a bit weird too, since not every valid C program is a valid C++ program.




回答2:


That's two separate concepts.

"Superset" means it extends the language, without removing or changing any existing language features. So any valid C program is (in theory) a valid Concurrent C program.

"Parallel" means that the extensions support parallel execution - programs can do more than one thing at the same time.




回答3:


This article is old. It was written in some previous millennium. It predates the first C++ standard and the first release of the realtime extension to POSIX.

While C++ existed conceptually back then, there was no way to say what C++ was. There was no C++ standard, de facto or official, in 1991. Nowadays, there is a C++ standard.

C++ has not officially supported parallelism until very recently. POSIX extends C rather than C++, and strictly speaking, it is not a superset; it conflicts with the C standard in key areas. The same applies to Microsoft extensions to C/C++.

In my opinion, the first parallel supersets of ISO/IEC 9899 and ISO/IEC 14882, are C11 and C++11, and strictly speaking, even those are not supersets. They extend C/C++ in some areas, but restrict it in others (e.g., restrict, which wasn't a keyword in the original C standard).



来源:https://stackoverflow.com/questions/30378080/what-does-it-mean-when-one-language-is-a-parallel-superset-of-another

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!