Language Features
Cyclone attempts to avoid some of the common pitfalls of C, while still maintaining its look and performance. To this end, Cyclone places the following limits on programs:
NULLchecks are inserted to prevent segmentation faults- Pointer arithmetic is limited
- Pointers must be initialized before use (this is enforced by definite assignment analysis)
- Dangling pointers are prevented through region analysis and limits on
free - Only "safe" casts and unions are allowed
gotointo scopes is disallowedswitchlabels in different scopes are disallowed- Pointer-returning functions must execute
return setjmpandlongjmpare not supported
To maintain the tool set that C programmers are used to, Cyclone provides the following extensions:
- Never-
NULLpointers do not requireNULLchecks - "Fat" pointers support pointer arithmetic with run-time bounds checking
- Growable regions support a form of safe manual memory management
- Garbage collection for heap-allocated values
- Tagged unions support type-varying arguments
- Injections help automate the use of tagged unions for programmers
- Polymorphism replaces some uses of
void * - varargs are implemented as fat pointers
- Exceptions replace some uses of
setjmpandlongjmp
For a better high-level introduction to Cyclone, the reasoning behind Cyclone and the source of these lists, see this paper.
Cyclone looks, in general, much like C, but it should be viewed as a C-like language.
Read more about this topic: Cyclone (programming Language)
Famous quotes containing the words language and/or features:
“From a hasty glance through the various tests I figure it out that I would be classified in Group B, indicating Low Average Ability, reserved usually for those just learning to speak the English Language and preparing for a career of holding a spike while another man hits it.”
—Robert Benchley (18891945)
“However much we may differ in the choice of the measures which should guide the administration of the government, there can be but little doubt in the minds of those who are really friendly to the republican features of our system that one of its most important securities consists in the separation of the legislative and executive powers at the same time that each is acknowledged to be supreme, in the will of the people constitutionally expressed.”
—Andrew Jackson (17671845)