<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki1463/index.php?action=history&amp;feed=atom&amp;title=Cyclone_%28programming_language%29</id>
	<title>Cyclone (programming language) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki1463/index.php?action=history&amp;feed=atom&amp;title=Cyclone_%28programming_language%29"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki1463/index.php?title=Cyclone_(programming_language)&amp;action=history"/>
	<updated>2026-12-01T16:30:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki1463/index.php?title=Cyclone_(programming_language)&amp;diff=4675&amp;oldid=prev</id>
		<title>imported&gt;AnomieBOT: Dating maintenance tags: {{Fact}}</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki1463/index.php?title=Cyclone_(programming_language)&amp;diff=4675&amp;oldid=prev"/>
		<updated>2026-04-06T13:58:58Z</updated>

		<summary type="html">&lt;p&gt;Dating maintenance tags: {{Fact}}&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Memory-safe dialect of the C programming language}}&lt;br /&gt;
{{use dmy dates|date=August 2024}}&lt;br /&gt;
{{more footnotes|date=August 2015}}&lt;br /&gt;
{{Infobox programming language&lt;br /&gt;
 | name                   = Cyclone&lt;br /&gt;
 | logo                   =&lt;br /&gt;
 | logo caption           =&lt;br /&gt;
 | file ext               =&lt;br /&gt;
 | paradigm               =&lt;br /&gt;
 | released               = {{Start date and age|2002}}&lt;br /&gt;
 | designer               = [[AT&amp;amp;T Labs]]&lt;br /&gt;
 | developer              = [[Cornell University]]&lt;br /&gt;
 | latest release version = 1.0&lt;br /&gt;
 | latest release date    = {{Start date and age|2006|05|08}}&lt;br /&gt;
 | latest preview version =&lt;br /&gt;
 | latest preview date    = &amp;lt;!-- {{start date and age|YYYY|MM|DD}} --&amp;gt;&lt;br /&gt;
 | typing                 =&lt;br /&gt;
 | implementations        =&lt;br /&gt;
 | dialects               =&lt;br /&gt;
 | influenced by          = [[C (programming language)|C]], [[C++]]&amp;lt;ref&amp;gt;{{Cite web|title=Cyclone for C programmers|url= https://cyclone.thelanguage.org/wiki/Cyclone%20for%20C%20Programmers/#Additions|access-date=12 October 2025|website=cyclone.thelanguage.org}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
 | influenced             = [[Rust (programming language)|Rust]], [[Project Verona]]&lt;br /&gt;
 | programming language   =&lt;br /&gt;
 | operating system       =&lt;br /&gt;
 | license                =&lt;br /&gt;
 | website                = {{URL|http://cyclone.thelanguage.org}}&lt;br /&gt;
 | wikibooks              =&lt;br /&gt;
 | discontinued           = Yes&amp;lt;ref&amp;gt;{{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 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Cyclone&amp;#039;&amp;#039;&amp;#039; [[programming language]] was intended to be a safe dialect of the [[C (programming language)|C language]].&amp;lt;ref&amp;gt;{{Cite journal |last1=Jim |first1=Trevor |last2=Morrisett |first2=J. Greg |last3=Grossman |first3=Dan |last4=Hicks |first4=Michael W. |last5=Cheney |first5=James |last6=Wang |first6=Yanling |date=2002-06-10 |title=Cyclone: A Safe Dialect of C |url=https://dl.acm.org/doi/10.5555/647057.713871 |journal=Proceedings of the General Track of the Annual Conference on USENIX Annual Technical Conference |series=ATEC &amp;#039;02 |location=USA |publisher=USENIX Association |pages=275–288 |isbn=978-1-880446-00-3}}&amp;lt;/ref&amp;gt; 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.&amp;lt;ref&amp;gt;{{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 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cyclone development was started as a joint project of Trevor Jim from [[AT&amp;amp;T Labs]] Research and [[Greg Morrisett]]&amp;#039;s group at [[Cornell University]] in 2001. Version 1.0 was released on May 8, 2006.&amp;lt;ref&amp;gt;{{cite web |title=Cyclone |url=https://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 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Language features==&lt;br /&gt;
Cyclone attempts to avoid some of the common pitfalls of [[C (programming language)|C]], while still maintaining its look and performance.{{fact|date=April 2026}} To this end, Cyclone places the following limits on programs:&lt;br /&gt;
* &amp;lt;code&amp;gt;[[Null pointer|NULL]]&amp;lt;/code&amp;gt; checks are inserted to prevent [[segmentation fault]]s&lt;br /&gt;
* [[Pointer arithmetic]] is limited&lt;br /&gt;
* Pointers must be initialized before use (this is enforced by [[definite assignment analysis]])&lt;br /&gt;
* [[Dangling pointer]]s are prevented through region analysis and limits on &amp;lt;code&amp;gt;[[free()]]&amp;lt;/code&amp;gt;&lt;br /&gt;
* Only &amp;quot;safe&amp;quot; casts and unions are allowed&lt;br /&gt;
* [[Control flow|&amp;lt;code&amp;gt;goto&amp;lt;/code&amp;gt;]] into scopes is disallowed&lt;br /&gt;
* [[Control flow|&amp;lt;code&amp;gt;switch&amp;lt;/code&amp;gt;]] labels in different scopes are disallowed&lt;br /&gt;
* Pointer-returning functions must execute &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;&lt;br /&gt;
* [[Setjmp.h|&amp;lt;code&amp;gt;setjmp&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;longjmp&amp;lt;/code&amp;gt;]] are not supported&lt;br /&gt;
&lt;br /&gt;
To maintain the tool set that C programmers are used to, Cyclone provides the following extensions:&lt;br /&gt;
* Never-&amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; pointers do not require &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; checks&lt;br /&gt;
* &amp;quot;Fat&amp;quot; pointers support pointer arithmetic with run-time [[bounds checking]]&lt;br /&gt;
* Growable regions support a form of safe manual memory management&lt;br /&gt;
* [[Garbage collection (computer science)|Garbage collection]] for heap-allocated values&lt;br /&gt;
* [[Smart pointer]]s, such as unique pointers&lt;br /&gt;
* [[Region-based memory management]]&lt;br /&gt;
* [[Tagged union]]s support type-varying arguments&lt;br /&gt;
* Injections help automate the use of tagged unions for programmers&lt;br /&gt;
* [[Polymorphism (computer science)|Polymorphism]] replaces some uses of [[void pointer|&amp;lt;code&amp;gt;void*&amp;lt;/code&amp;gt;]]&lt;br /&gt;
* [[Variadic function|Variadic arguments]] are implemented as fat pointers&lt;br /&gt;
* [[Exception handling|Exceptions]] replace some uses of &amp;lt;code&amp;gt;setjmp&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;longjmp&amp;lt;/code&amp;gt;&lt;br /&gt;
* [[Namespace]]s&lt;br /&gt;
* [[Type inference]]&lt;br /&gt;
* [[Pattern matching]]&lt;br /&gt;
* [[Template (C++)|Templates]], parameterized types&lt;br /&gt;
&lt;br /&gt;
Cyclone looks, in general, much like C, but it should be viewed as a C-like language.&lt;br /&gt;
&lt;br /&gt;
===Pointer types===&lt;br /&gt;
Cyclone implements three kinds of [[pointer (computer science)|pointer]]:&lt;br /&gt;
* &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; (the normal type)&lt;br /&gt;
* &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (the never-&amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; pointer), and&lt;br /&gt;
* &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; (the only type with [[pointer arithmetic]] allowed, [[fat pointer|&amp;quot;fat&amp;quot; pointer]]s).&lt;br /&gt;
The purpose of introducing these new pointer types is to avoid common problems when using pointers. Take for instance a function, called &amp;lt;code&amp;gt;foo&amp;lt;/code&amp;gt; that takes a pointer to an int:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
int foo(int* p);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Although the person who wrote the function &amp;lt;code&amp;gt;foo&amp;lt;/code&amp;gt; could have inserted &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; checks, let us assume that for performance reasons they did not. Calling &amp;lt;code&amp;gt;foo(NULL);&amp;lt;/code&amp;gt; will result in [[undefined behavior]] (typically, although not necessarily, a &amp;lt;code&amp;gt;[[SIGSEGV]]&amp;lt;/code&amp;gt; [[Unix signal|signal]] being sent to the application). To avoid such problems, Cyclone introduces the &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; pointer type, which can never be &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt;. Thus, the &amp;quot;safe&amp;quot; version of &amp;lt;code&amp;gt;foo&amp;lt;/code&amp;gt; would be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
int foo(int@ p);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This tells the Cyclone compiler that the argument to &amp;lt;code&amp;gt;foo&amp;lt;/code&amp;gt; should never be &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt;, avoiding the aforementioned undefined behavior. The simple change of &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; saves the programmer from having to write &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; checks and the operating system from having to trap &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; pointer dereferences.  This extra limit, however, can be a rather large stumbling block for most C programmers, who are used to being able to manipulate their pointers directly with arithmetic. Although this is desirable, it can lead to [[buffer overflow]]s and other &amp;quot;off-by-one&amp;quot;-style mistakes. To avoid this, the &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; pointer type is delimited by a known bound, the size of the array. Although this adds overhead due to the extra information stored about the pointer, it improves safety and security. Take for instance a simple (and naïve) &amp;lt;code&amp;gt;strlen&amp;lt;/code&amp;gt; function, written in C:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
int strlen(const char* s) {&lt;br /&gt;
    int i = 0;&lt;br /&gt;
    if (!s) {&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
    while (s[i] != &amp;#039;\0&amp;#039;) {&lt;br /&gt;
        i++;&lt;br /&gt;
    }&lt;br /&gt;
    return i;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This function assumes that the string being passed in is terminated by &amp;lt;code&amp;gt;&amp;#039;\0&amp;#039;&amp;lt;/code&amp;gt;. If this code was passed the unterminated string {{code|style=white-space:nowrap|2=c|1=char buf[6] = {&amp;#039;h&amp;#039;,&amp;#039;e&amp;#039;,&amp;#039;l&amp;#039;,&amp;#039;l&amp;#039;,&amp;#039;o&amp;#039;,&amp;#039;!&amp;#039;};}}, &amp;lt;code&amp;gt;strlen&amp;lt;/code&amp;gt; would iterate beyond the end of the string, into memory not associated with the string. Non [[ANSI C]] functions such as such as &amp;lt;code&amp;gt;strnlen&amp;lt;/code&amp;gt; seek to address such problems.&lt;br /&gt;
&lt;br /&gt;
The Cyclone&amp;#039;s &amp;lt;code&amp;gt;strlen&amp;lt;/code&amp;gt; is similar to the C version:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
int strlen(const char? s) {&lt;br /&gt;
    int n = s.size;&lt;br /&gt;
    if (!s) {&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
    for (int i = 0; i &amp;lt; n; i++, s++) {&lt;br /&gt;
        if (*s == &amp;#039;\0&amp;#039;) {&lt;br /&gt;
            return i;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return n;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Here, &amp;lt;code&amp;gt;strlen&amp;lt;/code&amp;gt; bounds itself by the length of the array passed to it. Each of the kinds of pointer type can be safely cast to each of the others, and arrays and strings are automatically cast to &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; by the compiler. (Casting from &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; invokes a [[bounds checking|bounds check]], and casting from &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; invokes both a &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; check and a bounds check. Casting from &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; results in no checks whatsoever; the resulting &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; pointer has a size of 1.)&lt;br /&gt;
&lt;br /&gt;
===Dangling pointers and region analysis===&lt;br /&gt;
Consider the following code, in C:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
char* itoa(int i) {&lt;br /&gt;
    char buf[20];&lt;br /&gt;
    sprintf(buf, &amp;quot;%d&amp;quot;, i);&lt;br /&gt;
    return buf;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The function &amp;lt;code&amp;gt;itoa&amp;lt;/code&amp;gt; allocates an array of chars &amp;lt;code&amp;gt;buf&amp;lt;/code&amp;gt; on the stack and returns a pointer to the start of &amp;lt;code&amp;gt;buf&amp;lt;/code&amp;gt;. However, the memory used on the stack for &amp;lt;code&amp;gt;buf&amp;lt;/code&amp;gt; is deallocated when the function returns, so the returned value cannot be used safely outside of the function. While [[GNU Compiler Collection]] and other compilers will warn about such code, the following will typically compile without warnings:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
char* itoa(int i) {&lt;br /&gt;
    char buf[20];&lt;br /&gt;
    sprintf(buf, &amp;quot;%d&amp;quot;, i);&lt;br /&gt;
    char* z = buf;&lt;br /&gt;
    return z;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
GNU Compiler Collection can produce warnings for such code as a side-effect of option {{code|-O2}} or {{code|-O3}}, but there are no guarantees that all such errors will be detected.&lt;br /&gt;
Cyclone does regional analysis of each segment of code, preventing dangling pointers, such as the one returned from this version of &amp;lt;code&amp;gt;itoa&amp;lt;/code&amp;gt;. 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 &amp;lt;code&amp;gt;itoa&amp;lt;/code&amp;gt;, the Cyclone compiler would see that &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; is a pointer into the local stack, and would report an error.&lt;br /&gt;
&lt;br /&gt;
===Fat pointers===&lt;br /&gt;
A [[fat pointer]] is used for allowing pointer arithmetic. Fat pointers must be declared with &amp;lt;code&amp;gt;@fat&amp;lt;/code&amp;gt;. For example, &amp;lt;code&amp;gt;argv&amp;lt;/code&amp;gt; is often declared as type &amp;lt;code&amp;gt;char**&amp;lt;/code&amp;gt; (a pointer to a pointer to a character), or alternatively thought of as &amp;lt;code&amp;gt;char*[]&amp;lt;/code&amp;gt; (pointer to an array of characters). In Cyclone, this is instead expressed as &amp;lt;code&amp;gt;char*@fat*@fat&amp;lt;/code&amp;gt; (a fat pointer to a fat pointer to characters).&lt;br /&gt;
&lt;br /&gt;
Cyclone instead allows &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to represent &amp;lt;code&amp;gt;*@fat&amp;lt;/code&amp;gt;. Thus, the two declarations are equivalent:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int main(int argc, char?? argv);&lt;br /&gt;
// equivalent to the more verbose declaration&lt;br /&gt;
int main(int argc, char*@fat*@fat argv);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parameterized types===&lt;br /&gt;
Similar to [[Templates (C++)|templates in C++]], Cyclone has a form of [[generic programming]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct LinkedList&amp;lt;`a&amp;gt; {&lt;br /&gt;
    `a head;&lt;br /&gt;
    struct LinkedList&amp;lt;`a&amp;gt;* next;&lt;br /&gt;
} LinkedList&amp;lt;`a&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
// ...&lt;br /&gt;
LinkedList&amp;lt;int&amp;gt;* ll = new LinkedList{1, new LinkedList{2, null}};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;abstract&amp;quot; type can be used, that encapsulates the implementation type but ensures the definition does not leak to the client.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
abstract struct Queue&amp;lt;`a&amp;gt; {&lt;br /&gt;
    LinkedList&amp;lt;`a&amp;gt; front;&lt;br /&gt;
    LinkedList&amp;lt;`a&amp;gt; rear;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
extern struct Queue&amp;lt;`a&amp;gt;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Namespaces ===&lt;br /&gt;
[[Namespace]]s exist in Cyclone, similar to C++. Namespaces are used to avoid name clashes in code, and follow the &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; notation as in C++. Namespaces can be nested.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
namespace foo {&lt;br /&gt;
    int x;&lt;br /&gt;
    int f() {&lt;br /&gt;
        return x;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
namespace bar {&lt;br /&gt;
    using foo {&lt;br /&gt;
        int g() {&lt;br /&gt;
            return f();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    int h() {&lt;br /&gt;
        return foo::f();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pattern matching ===&lt;br /&gt;
Pattern-matching can be accomplished in Cyclone like so:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int g(int a, int b) {&lt;br /&gt;
    switch ($(a, b - 1)) {&lt;br /&gt;
        case $(0, y) &amp;amp;&amp;amp; y &amp;gt; 1:&lt;br /&gt;
            return 1;&lt;br /&gt;
        case $(3, y) &amp;amp;&amp;amp; f(x + y) == 7:&lt;br /&gt;
            return 2;&lt;br /&gt;
        case $(4, 72):&lt;br /&gt;
            return 3;&lt;br /&gt;
        default:&lt;br /&gt;
            return 4;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;let&amp;lt;/code&amp;gt; declaration is used to match a pattern and expression.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct Pair {&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
} Pair;&lt;br /&gt;
&lt;br /&gt;
void f(Pair p) {&lt;br /&gt;
    let Pair(first, second) = p;&lt;br /&gt;
    // equivalent to:&lt;br /&gt;
    // int first = p.x;&lt;br /&gt;
    // int second = p.y;&lt;br /&gt;
    // ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Type inference ===&lt;br /&gt;
In Cyclone, rather than using &amp;lt;code&amp;gt;auto&amp;lt;/code&amp;gt; like [[C (programming language)|C]] and [[C++]] or &amp;lt;code&amp;gt;var&amp;lt;/code&amp;gt; in [[Java (programming language)|Java]] and [[C Sharp (programming language)|C#]], Cyclone instead uses &amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt; (an underscore) to denote a type-inferred variable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
_ x = (SomeType*)malloc(sizeof(SomeType));&lt;br /&gt;
// instead of:&lt;br /&gt;
SomeType x = (SomeType*)malloc(sizeof(SomeType));&lt;br /&gt;
&lt;br /&gt;
_ myNumber = 100; // inferred to int&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Exceptions ===&lt;br /&gt;
Cyclone features [[Exception handling (programming)|exceptions]]. An uncaught exception will halt the program. Like Java, Cyclone features a [[null pointer exception]], called &amp;lt;code&amp;gt;Null_Exception&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
typedef FILE File;&lt;br /&gt;
&lt;br /&gt;
File* f = fopen(&amp;quot;/etc/passwd&amp;quot;, &amp;quot;r&amp;quot;);&lt;br /&gt;
try {&lt;br /&gt;
    int code = getc((File* @notnull)f);&lt;br /&gt;
} catch {&lt;br /&gt;
    case &amp;amp;Null_Exception:&lt;br /&gt;
        printf(&amp;quot;Error: can&amp;#039;t open /etc/passwd\n&amp;quot;);&lt;br /&gt;
        return 1;&lt;br /&gt;
    case &amp;amp;Invalid_argument(s):&lt;br /&gt;
        printf(&amp;quot;Error: invalid argument: %s\n&amp;quot;, s);&lt;br /&gt;
        return 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One can also manually throw exceptions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
throw new Null_Exception(&amp;quot;This is a null exception&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[C (programming language)|C]]&lt;br /&gt;
* [[ML (programming language)|ML]]&lt;br /&gt;
* [[Rust (programming language)|Rust]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [http://cyclone.thelanguage.org/ Cyclone homepage]&lt;br /&gt;
* [https://web.archive.org/web/20111227232825/http://www.eecs.harvard.edu/~greg/cyclone/old_cyclone.html Old web site]&lt;br /&gt;
* [http://cyclone.thelanguage.org/wiki/Download Cyclone - source code repositories]&lt;br /&gt;
* [http://cyclone.thelanguage.org/wiki/Frequently%20Asked%20Questions Cyclone - FAQ]&lt;br /&gt;
* [http://cyclone.thelanguage.org/wiki/Cyclone%20for%20C%20Programmers Cyclone for C programmers]&lt;br /&gt;
* [http://cyclone.thelanguage.org/wiki/User%20Manual Cyclone user manual]&lt;br /&gt;
* [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&lt;br /&gt;
&lt;br /&gt;
Presentations:&lt;br /&gt;
* [https://web.archive.org/web/20110607170455/http://www.cs.kent.ac.uk/people/staff/rej/morrisett-4.2.03.ppt Cyclone:  A Type-Safe Dialect of C]&lt;br /&gt;
* [http://www.cs.washington.edu/homes/djg/slides/grossman_cyclone_jpl_05.ppt Cyclone: A Memory-Safe C-Level Programming Language]&lt;br /&gt;
&lt;br /&gt;
{{CProLang}}&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Cyclone (Programming Language)}}&lt;br /&gt;
[[Category:C programming language family]]&lt;br /&gt;
[[Category:Programming languages created in 2002]]&lt;/div&gt;</summary>
		<author><name>imported&gt;AnomieBOT</name></author>
	</entry>
</feed>