Jump to content

Talk:Nondeterministic programming

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Rektide (talk | contribs) at 02:31, 5 October 2010 (go lang). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Please move this article to Nondeterministic programming (note the lower-case in the second word.) -- 192.250.34.161 15:53, 22 June 2007 (UTC)[reply]

The title of the article doesn't make it obvious that this is talking about a nondeterministic programming paradigm. Is this different than behavior that is non-deterministic? If so, the article should make some mention and contrast the two. E.g. a multi-threaded or multi-process program that shares state, but doesn't do anything to synchronize reads/writes. —Preceding unsigned comment added by 131.107.0.77 (talk) 23:41, 16 December 2009 (UTC)[reply]

As an example, I'd cite "Select" in Go language. Permit me to quote extensively from the language spec[1]:
A "select" statement chooses which of a set of possible communications will proceed. It looks similar to a "switch" statement but with the cases all referring to communication operations.
For all the send and receive expressions in the "select" statement, the channel expressions are evaluated in top-to-bottom order, along with any expressions that appear on the right hand side of send expressions. A channel may be nil, which is equivalent to that case not being present in the select statement except, if a send, its expression is still evaluated. If any of the resulting operations can proceed, one of those is chosen and the corresponding communication and statements are evaluated. [snip]
If multiple cases can proceed, a pseudo-random fair choice is made to decide which single communication will execute.
Here the Go language explicitly specifies a non-determinism in program flow, requiring the runtime to make a psuedo-random fair choice pick of which communication to proceed with: mandated, specified nondeterminism.
--Rektide (talk) 02:31, 5 October 2010 (UTC)[reply]