Talk:Strict programming language: Difference between revisions

Content deleted Content added
SineBot (talk | contribs)
m Signing comment by 77.101.47.254 - "Common Lisp: "
syntaxhighlight & fix lint
 
(13 intermediate revisions by 9 users not shown)
Line 1:
{{WikiProject banner shell|class=Start|
{{WikiProject Computing|importance=Low}}
{{WikiProject Computer science|importance=Mid}}
{{WikiProject Software|importance=Low}}
}}
{{Wikipedia Unreferenced articles improved|date=21 November 2014}}
 
== Disadvantages ==
 
One of the disadvantages listed is "language must be pure". Ilisted is dcts, semannon-strict ticdisadvantage advantages keeps you "honest" reason why there evenI ondon't see this as a disadvantage, but just a consequence. In fact, I see it as a mdisadvsmajor anyadvantage! All strict purely functional languages todaygave (and why things like monadic IO was invented - they hadin to becausethe thecircumspacesiren usagecall reasoningy couldn't haveof side edeffects, non-strict intosemantics akeeps lessyou "evangelicastrict purely lhonest" form stances those coantage is the one uld be seen as disadvantages).and isThe onlof side effeexithat is probably the inreason whatwhy .there Ieven thinkexists theany wholepurely sectionfunctional shouldlanguages betoday refactoredfunctional(and thewhy silanguagesthings gavelike effectsymonadic !IO Allwas invented laziness- ensuredthey abouthad (i.e.to ratherbecause thanthey talkingcouldn't abouthave "disadvantages", talk about "consequences", and perhapsside effects without them, andtrulyand anlaziness undisputajorensured stthatthat!).in to ren call
The only disadvantage that is truly an undisputed disadvantage is the one about space usage reasoning. I think the whole section should be refactored into a less "evangelical" form (i.e. rather than talking about "disadvantages", talk about "consequences", and perhaps in what circumstances those could be seen as disadvantages).
 
== Common Lisp ==
Line 31 ⟶ 39:
 
::Consider the following example in typed lambda calculus, which takes a boolean and two functional thunks and returns another thunk:
<syntaxhighlight lang="text">
<code>
&lambda; b : (unit -> a) -> (unit -> a) -> a. &lambda; tr : unit -> a. &lambda; fa : unit -> a. &lambda; u : unit. b tr fa
</syntaxhighlight>
</code>
 
::In this case, b could be a suspended [[Church encoding]] of "true" or "false":
<syntaxhighlight lang="text">
<code>
true := &lambda; tr : unit -> a. &lambda; fa : unit -> a. tr ()
false := &lambda; tr : unit -> a. &lambda; fa : unit -> a. fa ()
</syntaxhighlight>
</code>
 
::So all you really need are functions and unit; non-strictness is just a matter of convenience if you don't want to deal with explicitly invoking your thunks. I won't claim it's not convenient, because it is; but it's not really a matter of expressiveness. --[[User:Donhalcon|bmills]] 19:26, 19 February 2006 (UTC)
Line 60 ⟶ 68:
 
True, in C, user-defined functions per se are strict, but the built-in operators <code>[[logical conjunction|&&]]</code>, <code>[[logical disjunction|||]]</code>, and <code>[[?:|?...:]]</code> all [[Short-circuit evaluation|short-circuit]], as does <code>[[Conditional (programming)|if...else]]</code>. Also true, a C++ that overloads these operators [http://stackoverflow.com/questions/5133114/overloading-logical-operators-considered-bad-practice loses the short-circuiting behavior]. But a [[C preprocessor]] macro can build a function that includes this short-circuiting behavior. Scheme also has <code>define-syntax</code> to build a function that short-circuits. --[[User:Damian Yerrick|Damian Yerrick]] ([[User talk:Damian Yerrick|talk]] | [[Special:Contributions/Damian Yerrick|stalk]]) 15:29, 7 May 2012 (UTC)
 
== Regarding Chess's game tree ==
 
Isn't it incorrect to call the game tree of chess finite, when at any point, the players can just keep going back and forth with a single piece? Wouldn't it be more correct to use a cyclic [[Directed graph]] for a finite representation?
 
== Difficult to understand ==
''A strict programming language is a programming language which employs a strict programming paradigm, allowing only strict functions''
What does that means? It's like a recursive definition <!-- Template:Unsigned IP --><small class="autosigned">—&nbsp;Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/186.120.227.55|186.120.227.55]] ([[User talk:186.120.227.55#top|talk]]) 22:09, 17 October 2017 (UTC)</small> <!--Autosigned by SineBot-->
 
:If I'm not mistaken you mean it is a circular definition. Yes there doesn't seem to be a strict definition of what strict means here[[User:Ethanpet113|Ethanpet113]] ([[User talk:Ethanpet113|talk]]) 06:50, 18 November 2018 (UTC)
 
== No Context ==
 
There isn't enough context for this article to be useful, what is it that makes a programming paradigm strict. Is it only necessary that arguments to the function must be evaluated before call, or are there other requirements?[[User:Ethanpet113|Ethanpet113]] ([[User talk:Ethanpet113|talk]]) 06:55, 18 November 2018 (UTC)