Content deleted Content added
m more footnotes |
m →top: HTTP to HTTPS for Cornell University |
||
(18 intermediate revisions by 13 users not shown) | |||
Line 1:
{{Short description|Memory-safe dialect of the C programming language}}
{{use dmy dates|date=August 2024}}
{{more footnotes|date=August 2015}}
{{Infobox programming language
Line 9 ⟶ 10:
| released = {{Start date and age|2002}}
| designer = [[AT&T Labs]]
| developer = [[Cornell University]]
| latest release version = 1.0
| latest release date = {{Start date and age|2006|05|08}}
Line 24 ⟶ 25:
| website = {{URL|http://cyclone.thelanguage.org}}
| wikibooks =
| discontinued = Yes<ref>{{cite web |title=Open Access Cyclone (programming language) Journals · OA.mg |url=https://oa.mg/journals/open-access-cyclone-programming-language-journals |website=oa.mg |access-date=30 October 2022 |archive-date=30 October 2022 |archive-url=https://web.archive.org/web/20221030192542/https://oa.mg/journals/open-access-cyclone-programming-language-journals |url-status=live }}</ref>
}}
The '''Cyclone''' [[programming language]]
Cyclone development was started as a joint project of Trevor Jim from [[AT&T Labs]] Research and [[Greg Morrisett]]'s group at [[Cornell University]] in 2001. Version 1.0 was released on May 8, 2006.<ref>{{cite web |title=Cyclone |url=
==Language features==
Line 35 ⟶ 36:
* [[Pointer arithmetic]] is limited
* Pointers must be initialized before use (this is enforced by [[definite assignment analysis]])
* [[Dangling pointer]]s are prevented through region analysis and limits on
* Only "safe" casts and unions are allowed
* [[Control flow|<code>goto</code>]] into scopes is disallowed
* [[Control flow|<code>switch</code>]] labels in different scopes are disallowed
* Pointer-returning functions must execute <code>return</code>
* [[Setjmp
To maintain the tool set that C programmers are used to, Cyclone provides the following extensions:
Line 55 ⟶ 56:
For a better high-level introduction to Cyclone, the reasoning behind Cyclone and the source of these lists, see [http://www.cs.umd.edu/projects/cyclone/papers/cyclone-safety.pdf this paper].
Cyclone looks, in general, much like
===Pointer types===
Line 74 ⟶ 75:
int strlen(const char *s)
{
int
if (s == NULL)
return 0;
while (s[
}
return
}
</syntaxhighlight>
This function assumes that the string being passed in is terminated by
<syntaxhighlight lang="C">
int strlen(const char ? s)
{
int
if (s == NULL)
return 0;
for (
if (*s == '\0')
return
return n;
}
Line 109:
}
</syntaxhighlight>
<syntaxhighlight lang="C">
char *itoa(int i)
Line 119:
}
</syntaxhighlight>
Cyclone does regional analysis of each segment of code, preventing dangling pointers, such as the one returned from this version of <code>itoa</code>. All of the local variables in a given scope are considered to be part of the same region, separate from the heap or any other local region. Thus, when analyzing <code>itoa</code>, the Cyclone compiler would see that <code>z</code> is a pointer into the local stack, and would report an error.
Line 131:
==External links==
* [http://cyclone.thelanguage.org/ Cyclone
* [https://web.archive.org/web/20111227232825/http://www.eecs.harvard.edu/~greg/cyclone/old_cyclone.html Old web site]
* [http://cyclone.thelanguage.org/wiki/Download Cyclone -
* [http://cyclone.thelanguage.org/wiki/Frequently%20Asked%20Questions Cyclone - FAQ]
* [http://cyclone.thelanguage.org/wiki/Cyclone%20for%20C%20Programmers Cyclone for C programmers]
* [http://cyclone.thelanguage.org/wiki/User%20Manual Cyclone
* [http://www.cs.umd.edu/~mwh/papers/cyclone-cuj.pdf Cyclone: a Type-safe Dialect of C] by Dan Grossman, Michael Hicks, Trevor Jim, and Greg Morrisett - published January 2005
Line 147:
{{DEFAULTSORT:Cyclone (Programming Language)}}
[[Category:C programming language family]]
[[Category:Programming languages created in 2002]]
|