8 thoughts on “Stan is Turing complete

        • A lot of people took exception to me calling Stan “imperative” at the PPAML meeting. To me, imperative is a language with assignment, loops, conditionals, arrays, and without object-oriented or functional properties. Other than pure functional or pure logic programming languages, I don’t know of any languages that don’t have imperative components. So it’s more about what they don’t have — functional programming or object oriented or other components.

          So FORTRAN’s imperative, but C has functional properties by allowing function pointer, and a hybrid language like R or Python has imperative, functional, and object-oriented properties.

          To me this is all semantics, and we just have to define what we mean.

          When I say Stan’s Turing complete, I mean that the language for defining functions (or values if you want to do it all without functions) in Stan is Turing complete in the sense of being able to compute any computable function.

        • I’m sure if I grab the stan manual and start looking I’ll find it, but given the broad audience here, maybe it’s worth mentioning here, exactly where is it that you define functions in Stan? Since we have different blocks, such as data, parameters, model, generated quantities, etc. How does scoping work in stan? Or at least, which portion of the manual should we look in to get the details :-)

        • In the latest manual (for v2.7.0) see chapters 17 and 26 for defining custom functions, and chapter 27 for scoping. Also see chapter 28 if you’re interested in a detailed description of the modeling language syntax

Leave a Reply

Your email address will not be published. Required fields are marked *