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:
NULL
checks 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
goto
into scopes is disallowedswitch
labels in different scopes are disallowed- Pointer-returning functions must execute
return
setjmp
andlongjmp
are not supported
To maintain the tool set that C programmers are used to, Cyclone provides the following extensions:
- Never-
NULL
pointers do not requireNULL
checks - "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
setjmp
andlongjmp
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:
“Just as language has no longer anything in common with the thing it names, so the movements of most of the people who live in cities have lost their connexion with the earth; they hang, as it were, in the air, hover in all directions, and find no place where they can settle.”
—Rainer Maria Rilke (18751926)
“These, then, will be some of the features of democracy ... it will be, in all likelihood, an agreeable, lawless, particolored commonwealth, dealing with all alike on a footing of equality, whether they be really equal or not.”
—Plato (c. 427347 B.C.)