Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
j4cbo
Nov 1, 2004
huh?
I wrote this. You'll need a decent grasp of x86 assembly to comprehend the horror...

code:
/* void iret(int addr, ...); */
.global iret
iret:
        add $4, %esp 
        iret

Adbot
ADBOT LOVES YOU

j4cbo
Nov 1, 2004
huh?

rjmccall posted:

Note that you do need either memory cells to be unbounded or an unbounded number of cells. Models with bounded memory are never Turing-equivalent.

You need the cells themselves to be unbounded, since there's no way to refer to an unbounded number of cells with a value of bounded range.

For what it's worth, even C isn't Turing complete unless you let "char" be an unbounded value (i.e. any natural or integer, rather than -128 to 127 or some such). This is because the size of any pointer must be a multiple of the size of a single char, and if pointers are of finite dimension, then you can only reach a bounded number of memory addresses.

Functional languages, like SML, OCaml, Haskell, and Lisp/Scheme, are generally Turing-complete without any extra weirdness. Their implementations usually aren't, of course.

j4cbo
Nov 1, 2004
huh?

Avenging Dentist posted:

The first part of this does not imply the second part.

The sizeof operator result "is an integer" according to the spec, so it can't be infinity. Or is that not what you meant?

j4cbo
Nov 1, 2004
huh?

Avenging Dentist posted:

"Integer" in the ISO standard is understood to refer to the integral types in the language, which make no explicit mandate that the values be finite. It's being pedantic, but so are you. (It would be stupid, for instance, for sizeof to return an integer larger than can be represented by the available integral types, so just "is an element of Z" isn't what the standard is referring to. Besides that, the grammar rules for integer constants clearly allow constants of infinite length.)

Incidentally, a conforming implementation of ISO C can have unbounded char values if it wants. The standard says nothing whatsoever about the size of a byte, and in fact goes out of its way to provide for systems where a byte is not 8 bits.

Infinite and unbounded (arbitrarily large) aren't the same thing. And yes, of course I'm being pedantic. :)

That latter bit was my point - it's fine by the spec for char to be unbounded, and in fact is required for the language to be "actually" Turing-complete.

j4cbo
Nov 1, 2004
huh?
λf. (λx. f (x x)) (λx. f (x x))

Adbot
ADBOT LOVES YOU

j4cbo
Nov 1, 2004
huh?

Vanadium posted:

no this is not "who knows what the value of i is going to be afterwards", this is literally undefined behaviour

you do not have to argue why it is because it just says in the standard not to do that poo poo

oh poo poo guys demons just flew out of my nose what do i do

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply