Cyclone (programming language): Difference between revisions

Content deleted Content added
added reference to first Cyclone paper
Bender the Bot (talk | contribs)
m top: HTTP to HTTPS for Cornell University
 
(8 intermediate revisions by 6 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 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]] was intended to be a safe dialect of the [[C (programming language)|C language]].<ref>{{Cite bookjournal |titlelast1=ProceedingsJim of|first1=Trevor the|last2=Morrisett general|first2=J. track,Greg 2002|last3=Grossman USENIX|first3=Dan annual|last4=Hicks technical|first4=Michael conferenceW. |last5=Cheney |first5=James |last6=Wang |first6=Yanling |date=2002-06-10 |title=Cyclone: JuneA Safe Dialect of C |url=https://dl.acm.org/doi/10.5555/647057.713871 -|journal=Proceedings 15,of 2002,the Monterey,General California,Track USAof the Annual Conference on USENIX Annual Technical Conference |dateseries=2002ATEC '02 |___location=USA |publisher=USENIX Association |pages=275–288 |isbn=978-1-880446-00-3 |editor-last=USENIX Association |___location=Berkeley, Calif}}</ref>. It avoids [[buffer overflow]]s and other vulnerabilities that are possible in C programs by design, without losing the power and convenience of C as a tool for [[system programming]]. It is no longer supported by its original developers, with the reference tooling not supporting [[64-bit computing|64-bit platforms]]. The [[Rust (programming language)|Rust]] language is mentioned by the original developers for having integrated many of the same ideas Cyclone had.<ref>{{cite web |title=Cyclone |url=http://cyclone.thelanguage.org/ |website=cyclone.thelanguage.org |access-date=11 December 2023 |archive-date=21 May 2006 |archive-url=https://web.archive.org/web/20060521202022/http://cyclone.thelanguage.org/ |url-status=live }}</ref>
 
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=httphttps://www.cs.cornell.edu/Projects/cyclone/ |website=[[Cornell University]] |access-date=30 October 2022 |archive-date=15 October 2022 |archive-url=https://web.archive.org/web/20221015034248/https://www.cs.cornell.edu/Projects/cyclone/ |url-status=live }}</ref>
 
==Language features==
Line 83 ⟶ 84:
}
</syntaxhighlight>
This function assumes that the string being passed in is terminated by {{code|NULL}} (<code>'\0'</code>). However, what would happen if {{code|style=white-space:nowrap|2=c|1=char buf[6] = {'h','e','l','l','o','!'};}} were passed to this string? This is perfectly legal in C, yet would cause <code>strlen</code> to iterate through memory not necessarily associated with the string <code>s</code>. There are functions, such as <code>strnlen</code> which can be used to avoid such problems, but these functions are not standard with every implementation of [[ANSI C]]. The Cyclone version of <code>strlen</code> is not so different from the C version:
<syntaxhighlight lang="C">
int strlen(const char ? s)