Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Coroutine
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Native support== Coroutines originated as an [[assembly language]] method, but are supported in some [[high-level programming language]]s. {{Div col|colwidth=18em}} * [[Aikido (programming language)|Aikido]] * [[AngelScript]] * [[Ballerina (programming language)|Ballerina]] * [[BCPL]] * [[Pascal (programming language)|Pascal]] (Borland [[Turbo Pascal]] 7.0 with uThreads module) * [[BETA (programming language)|BETA]] * [[BLISS]] * [[C++]] (Since C++20) * [[C Sharp (programming language)|C#]] (Since 2.0) * [[Chapel (programming language)|Chapel]] * [[ChucK]] * [[CLU (programming language)|CLU]] * [[D (programming language)|D]] * [[Dynamic C]] * [[Erlang (programming language)|Erlang]] * [[F Sharp (programming language)|F#]] * [[Factor (programming language)|Factor]] * [[GameMonkey Script]] * [[Godot (game engine)|GDScript]] (Godot's scripting language) * [[Haskell (programming language)|Haskell]]<ref>{{cite web | title = Coroutine: Type-safe coroutines using lightweight session types | url = http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Coroutine | access-date = 2008-12-18 | archive-date = 2013-01-20 | archive-url = https://web.archive.org/web/20130120062237/http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Coroutine | url-status = live }}</ref><ref>{{cite web | title = Co-routines in Haskell | url = https://axman6.com/posts/2016-07-10-Linear-resources-in-haskell.html | access-date = 2019-01-13 | archive-date = 2020-01-09 | archive-url = https://web.archive.org/web/20200109052929/https://axman6.com/posts/2016-07-10-Linear-resources-in-haskell.html | url-status = live }}</ref> * [[High Level Assembly]]<ref>{{cite web | title = The Coroutines Module (coroutines.hhf) | url = http://www.plantation-productions.com/Webster/HighLevelAsm/HLADoc/HLAStdlib/1_HTML/HLAStdlib.htm#50618574_pgfId-998318 | work = HLA Standard Library Manual | access-date = 2013-12-04 | archive-date = 2019-04-27 | archive-url = https://web.archive.org/web/20190427211627/http://plantation-productions.com/Webster/HighLevelAsm/HLADoc/HLAStdlib/1_HTML/HLAStdlib.htm#50618574_pgfId-998318 | url-status = live }}</ref> * [[Icon (programming language)|Icon]] * [[Io (programming language)|Io]] * [[JavaScript]] (since 1.7, standardized in ECMAScript 6)<ref>{{cite web | title = New in JavaScript 1.7 | url = https://developer.mozilla.org/en/docs/New_in_JavaScript_1.7 | access-date = 2018-06-18 | archive-date = 2009-03-08 | archive-url = https://web.archive.org/web/20090308111529/https://developer.mozilla.org/en//docs//New_in_JavaScript_1.7 }}</ref><!-- Does JavaScript belong here? See the link. --> ECMAScript 2017 also includes [[await]] support. * [[Julia (programming language)|Julia]]<ref>{{cite web| title=Julia Manual - Control Flow - Tasks (aka Coroutines)| url=https://docs.julialang.org/en/v1/manual/asynchronous-programming/#man-asynchronous| access-date=2021-02-10| archive-date=2021-01-23| archive-url=https://web.archive.org/web/20210123235831/https://docs.julialang.org/en/v1/manual/asynchronous-programming/#man-asynchronous| url-status=live}}</ref> * [[Kotlin (programming language)|Kotlin]] (since 1.1)<ref>{{cite web| title=What's New in Kotlin 1.1| url=https://kotlinlang.org/docs/reference/whatsnew11.html#coroutines-experimental| access-date=2017-02-27| archive-date=2019-08-11| archive-url=https://web.archive.org/web/20190811233854/https://kotlinlang.org/docs/reference/whatsnew11.html#coroutines-experimental| url-status=live}}</ref> * [[Limbo (programming language)|Limbo]] * [[Lua (programming language)|Lua]]<ref>{{Cite web|url=http://www.lua.org/manual/5.2/manual.html#2.6|title=Lua 5.2 Reference Manual|website=www.lua.org|access-date=2012-06-19|archive-date=2018-01-13|archive-url=https://web.archive.org/web/20180113023237/http://www.lua.org/manual/5.2/manual.html#2.6|url-status=live}}</ref> * [[Lucid (programming language)|Lucid]] * [[ΞΌC++]] * [[Modula-2]] * [[Nemerle]] * [[Perl 5]] (using the [https://metacpan.org/pod/Coro Coro module]) * [[PHP]] (with [https://github.com/facebook/hiphop-php HipHop], native since PHP 5.5) * [[Picolisp]] * [[Prolog]] * [[Python (programming language)|Python]] (since 2.5,<ref>{{Cite web|url=https://stackabuse.com/python-async-await-tutorial/|title=Python async/await Tutorial|date=December 17, 2015|website=Stack Abuse|access-date=October 21, 2019|archive-date=November 29, 2019|archive-url=https://web.archive.org/web/20191129130627/https://stackabuse.com/python-async-await-tutorial/|url-status=live}}</ref> with improved support since 3.3 and with explicit syntax since 3.5<ref>{{Cite web|url=https://docs.python.org/3/reference/compound_stmts.html#async-def|title=8. Compound statements β Python 3.8.0 documentation|website=docs.python.org|access-date=2016-03-11|archive-date=2019-11-27|archive-url=https://web.archive.org/web/20191127123528/https://docs.python.org/3/reference/compound_stmts.html#async-def|url-status=live}}</ref>) * [[Racket (programming language)]] * [[Raku (programming language)|Raku]]<ref>{{cite web|title=Gather and/or Coroutines|url=https://perl6advent.wordpress.com/2012/12/19/gather-andor-coroutines/|date=2012-12-19|access-date=2015-06-08|archive-date=2020-06-13|archive-url=https://web.archive.org/web/20200613175447/https://perl6advent.wordpress.com/2012/12/19/gather-andor-coroutines/|url-status=live}}</ref> * [[Ruby (programming language)|Ruby]] * [[Sather]] * [[Scheme (programming language)|Scheme]] * [[Self (programming language)|Self]] * [[Simula]] 67<ref name="Dahl1972">{{cite book|title=Structured Programming|editor1-first=O.J.|editor1-last=Dahl|editor2-first=C.A.R.|editor2-last=Hoare|publisher=Academic Press|year=1972|isbn=978-0-12-200550-3|location=London, UK|pages=175β220|chapter=Hierarchical Program Structures}}</ref> * [[Smalltalk]] * [[Squirrel (programming language)|Squirrel]] * [[Stackless Python]] * [[SuperCollider]]<ref>McCartney, J. [http://portal.acm.org/citation.cfm?id=1245228 "Rethinking the Computer Music Programming Language: SuperCollider"]. Computer Music Journal, 26(4):61-68. MIT Press, 2002.</ref> * [[Tcl]] (since 8.6) * [[urbiscript]] <!-- Coroutines can be implemented in any language, so please limit this list to languages with native support. Specifically, don't re-add the following entries without consideration: * [[C Sharp (programming language)|C#]] * [[Perl]] * [[Smalltalk]] --> {{div col end}} Since [[continuation]]s can be used to implement coroutines, programming languages that support them can also quite easily support coroutines.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)