Draft:Coalton (programming language): Difference between revisions

Content deleted Content added
Stylewiki (talk | contribs)
reference on creation, additional details
Declining submission: nn - Submission is about a topic not yet shown to meet general notability guidelines (be more specific if possible)
 
(10 intermediate revisions by 5 users not shown)
Line 1:
{{AFC submission|d|nn|u=66.31.113.172|ns=118|decliner=Caleb Stanford|declinets=20250810192510|ts=20250809221822}} <!-- Do not remove this line! -->
{{AfC submission|t||ts=20250716222922|u=Stylewiki|ns=118|demo=}}{{AFC comment|1=In accordance with Wikipedia's [[Wikipedia:Conflict of interest|Conflict of interest policy]], I disclose that I have a conflict of interest regarding the subject of this article. <!--Comment automatically added by the Article Wizard--> [[User:Stylewiki|Stylewiki]] ([[User talk:Stylewiki|talk]]) 22:29, 16 July 2025 (UTC)}}
 
{{AFC comment|1=Looks like a cool project, but I'm not seeing independent evidence of notability. Please ping me if you disagree. [[User:Caleb Stanford|Caleb Stanford]] ([[User talk:Caleb Stanford|talk]]) 19:25, 10 August 2025 (UTC)}}
 
{{AfC submission|t||ts=20250716222922|u=Stylewiki|ns=118|demo=}}{{AFC comment|1=In accordance with Wikipedia's [[Wikipedia:Conflict of interest|Conflict of interest policy]], I disclose that I have a conflict of interest regarding the subject of this article. <!--Comment automatically added by the Article Wizard--> [[User:Stylewiki|Stylewiki]] ([[User talk:Stylewiki|talk]]) 22:29, 16 July 2025 (UTC)}}
 
----
<!-- Important, do not remove anything above this line before article has been created. -->
 
{{Short description|Statically typed dialect of Lisp}}
{{Draft topics|software|computing|technology}}
{{stub}}
{{AfC topic|stem}}
{{Primary sources|date=July 2025}}
 
<!-- Important, do not remove anything above this line before article has been created. -->
 
{{Infobox programming language
| name = Coalton
Line 20 ⟶ 26:
| website = {{URL|https://coalton-lang.github.io}}
| year = {{start date and age|2018}}
| influenced_by = [[Common Lisp (programming language)|Common Lisp]], [[Scheme (programming language)|Scheme]], [[Haskell (programming language)|Haskell]], [[OCaml (programming language)|OCaml]], [[Standard ML (programming language)|Standard ML]], [[Clojure]], [[Rust (programming language)|Rust]]
| designer = Robert Smith
| developer = Robert Smith, Coalton community
Line 31 ⟶ 37:
}}
 
'''Coalton''' is a [[functional programming|functional]], [[static typing|statically typed]], [[General-purpose programming language|general-purpose]] [[programming language]] embedded in [[Common Lisp (programming language)|Common Lisp]]. Its type system is similar to Haskell's, but evaluation is strict like Standard ML or OCaml. [[Metaprogramming]] is supported through traditional Lisp [[Macro (computer science)|macros]]. Coalton focuses on performance through efficient data representation and compiler optimization.<ref>{{cite web | title=Toward safe, flexible, and efficient software in Common Lisp - European Lisp Symposium 2025 | website=[[YouTube]] | date=20 May 2025 | url=https://www.youtube.com/watch?v=of92m4XNgrM }}</ref>.
 
''Coalton'' refers to both the language and its implementation, and remains under active, open-source development as of July 2025<ref>https://github.com/coalton-lang/coalton</ref>.
 
''Coalton'' refers to both the language and its implementation, and remains under active, open-source development as of July 2025<ref>{{cite web | title=Coalton | website=[[GitHub]] | url=https://github.com/coalton-lang/coalton }}</ref>.
 
== History ==
Robert Smith started designing Coalton in 2018<ref>{{cite web | title=Deprecated-coalton-prototype/Thoughts.md at master · stylewarning/Deprecated-coalton-prototype | website=[[GitHub]] | url=https://github.com/stylewarning/deprecated-coalton-prototype/blob/master/thoughts.md }}</ref> to import the benefits of [[ML (programming language)|ML]]-like static typing into the interactive, incremental programming environment of Common Lisp. Coalton was further developed by a team led by Smith and was officially announced in 2021<ref>{{cite web | title=Introducing Coalton: How to Have Our (Typed) Cake and (Safely) Eat It Too, in Common Lisp | date=10 September 2021 | url=https://coalton-lang.github.io/20211010-introducing-coalton/ }}</ref>. Coalton has since been used for quantum computing research, the implementation of the [[Quil (instruction set architecture)|Quil]] compiler<ref>{{cite web | title=Using Coalton to Implement a Quantum Compiler | date=6 September 2022 | url=https://coalton-lang.github.io/20220906-quantum-compiler/ }}</ref>, and defense applications.
 
Coalton is used<ref>{{cite web | title=APS -2023 APS March Meeting - Event - A language-oriented approach to exchange-only silicon dot qubit software | volume=68, 3 | url=https://meetings.aps.org/Meeting/MAR23/Session/F70.8 }}</ref> at [[HRL Laboratories]] for building software for qubits based on exchange-only [[Silicon quantum dot|silicon dots]].
 
== Features ==
 
* Static typing with global type inference and optional type declarations.
* Parametric algebraic data types, pattern matching, and compile-time exhaustiveness checking.
* Multi-parameter type classes with functional dependencies.
* [[Evaluation strategy#Strict evaluation|Strictly evaluated]] with lazy iterators.
* Advanced [[Immutable object|immutable]] data structures including [[hash array mapped tries]] and relaxed radix balanced trees.
* Machine code compilation (on Lisp hosts that support it).
* Compiler optimizations including heuristic [[Inline expansion|inlining]] and user-controlledcontrollable inlining with the <code>inline</code> directive.
* User-controllable function [[monomorphization]] with the <code>monomorphize</code> directive.
* User-controllercontrollable data type representation control with the <code>repr</code> directive.
* Separate development and release modes. Release mode enables greater compiler optimization opportunities at the expense of development interactivity.
* Non-[[Memory allocation|allocating]] <code>Optional</code> data type (cf. Haskell's <code>Maybe</code> or OCaml's <code>Option</code>).
* Exception handling with resumptions.
* Inline Common Lisp code with the <code>lisp</code> operator.
* Metaprogramming via ordinary <code>defmacro</code>.
* Advanced numerical data types including [[dual number|dual numbers]], hyper -dual numbers, [[Computable number|computable real numbers]], and arbitrary[[Arbitrary-precision arithmetic|arbitrary-precision]] floating[[Floating-point arithmetic|floating-point]] numbers.
 
== Examples ==
Line 135 ⟶ 143:
Hello, world!
</syntaxhighlight>
 
== Criticisms ==
 
When Coalton is written as a part of <code>.lisp</code> files, it requires wrapping the Coalton code in <code>coalton</code> or <code>coalton-toplevel</code> macros. This detracts from the incremental development style of Common Lisp.<ref>https://news.ycombinator.com/item?id=35704441</ref>
 
A more serious criticism is that Hindley-Milner type systems are unsound when mutation is allowed<ref>{{cite journal |last1=Wright |first1=Andrew |title=Simple imperative polymorphism |journal=LISP and Symbolic Computation |date=1995 |volume=8 |issue=4 |pages=343–355 |doi=10.1007/BF01018828 |url=https://link.springer.com/article/10.1007/BF01018828 |access-date=10 August 2025}}</ref>, and Coalton allows mutation. Several fixes to the type inference algorithm have been proposed.<ref>{{cite web | title=Certain combinations of polymorphism and mutation can lead to type-unsoundness · Issue #84 · coalton-lang/Coalton | website=[[GitHub]] | url=https://github.com/coalton-lang/coalton/issues/84 }}</ref>
 
== References ==
Line 141 ⟶ 155:
{{Programming languages}}
{{Authority control}}
 
[[Category:High-level programming languages]]
[[Category:Cross-platform free software]]
[[Category:Extensible syntax programming languages]]
[[Category:Functional languages]]
[[Category:Pattern matching programming languages]]
[[Category:Programming languages]]
[[Category:Programming languages created in 2018]]
[[Category:Statically typed programming languages]]
[[Category:ML programming language family]]
[[Category:Lisp programming language family]]