POV-Ray : Newsgroups : povray.off-topic : Theoretical programming question Server Time
11 Oct 2024 11:12:40 EDT (-0400)
  Theoretical programming question (Message 7 to 16 of 16)  
<<< Previous 6 Messages Goto Initial 10 Messages
From: Darren New
Subject: Re: Theoretical programming question
Date: 30 Oct 2007 22:59:09
Message: <4727fd8d$1@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> Are you saying the only operations to put data *on* the stack are DUP 
>> and PUSH IMMEDIATE?  Seems like it would be difficult to do much, yah.
> 
>   It supports pushing characters (as their ascii values) in a string too,
> but that isn't much of a help in this case.

I take it you mean in the same way you could just code a series of "push 
this integer literal" instruction?

I don't see how you can do it, then.  Imagine a 10,000 state turing 
machine. You wouldn't be able to access state 5000's instruction without 
wiping out at least instructions 5003-10000.

Maybe there's something exceptionally clever you could do, but with 
limited-width registers (i.e., top-of-stack) it would be hard to know what.

Out of curiousity, what kind of language or machine is this?  Or is this 
like some contest/homework style problem?

-- 
   Darren New / San Diego, CA, USA (PST)
     Remember the good old days, when we
     used to complain about cryptography
     being export-restricted?


Post a reply to this message

From: Warp
Subject: Re: Theoretical programming question
Date: 31 Oct 2007 08:19:33
Message: <472880e5@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Out of curiousity, what kind of language or machine is this?

  Befunge.

  I tried to create a mandelbrot generator with it. Failed.

-- 
                                                          - Warp


Post a reply to this message

From: Tom York
Subject: Re: Theoretical programming question
Date: 31 Oct 2007 13:25:00
Message: <web.4728c750d9f26ea37d55e4a40@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Darren New <dne### [at] sanrrcom> wrote:
> > Out of curiousity, what kind of language or machine is this?
>
>   Befunge.
>
>   I tried to create a mandelbrot generator with it. Failed.
>
> --
>                                                           - Warp

What about

http://catseye.tc/projects/befunge93/eg/mandel.bf

linked to from

http://catseye.tc/projects/befunge93/eg/INDEX.html

?

Tom


Post a reply to this message

From: Warp
Subject: Re: Theoretical programming question
Date: 31 Oct 2007 14:59:42
Message: <4728dead@news.povray.org>
Tom York <alp### [at] zubenelgenubi34spcom> wrote:
> What about

> http://catseye.tc/projects/befunge93/eg/mandel.bf

  Not much of a help trying to know how to implement it, as you can see...

-- 
                                                          - Warp


Post a reply to this message

From: Darren New
Subject: Re: Theoretical programming question
Date: 31 Oct 2007 16:50:02
Message: <4728f88a$1@news.povray.org>
Warp wrote:
> Tom York <alp### [at] zubenelgenubi34spcom> wrote:
>> What about
> 
>> http://catseye.tc/projects/befunge93/eg/mandel.bf
> 
>   Not much of a help trying to know how to implement it, as you can see...

OK. I want to see a befunge program that looks like a mandelbrot that 
generates a mandelbrot. :)

-- 
   Darren New / San Diego, CA, USA (PST)
     Remember the good old days, when we
     used to complain about cryptography
     being export-restricted?


Post a reply to this message

From: Kevin Wampler
Subject: Re: Theoretical programming question
Date: 31 Oct 2007 17:51:35
Message: <472906f7$1@news.povray.org>
Since Befunge seems to support random-access storage with the "p" and 
"g" commands, I'd imagine that it should indeed be Turing complete 
(otherwise, completely without any sort of proof, I suspect that it 
would be equivalent to a pushdown automata).

Looking at the program Tom linked, it seems to make pretty heavy use of 
these commands.  I can imagine it was a monstrous pain to write though. 
  Anything in particular that inspired you to give it a shot, or did it 
just seem like an interesting puzzle?

Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> Out of curiousity, what kind of language or machine is this?
> 
>   Befunge.
> 
>   I tried to create a mandelbrot generator with it. Failed.
>


Post a reply to this message

From: Warp
Subject: Re: Theoretical programming question
Date: 31 Oct 2007 19:13:52
Message: <47291a3f@news.povray.org>
Kevin Wampler <wampler+pov### [at] uwashingtonedu> wrote:
> Since Befunge seems to support random-access storage with the "p" and 
> "g" commands

  The problem is that those support only putting and getting a character.
To calculate the mandelbrot set with integers you need to handle pretty
large integral values.

  Ok, maybe it's possible to split a large integer into characters by
doing divisions and modulos (and multiplications and additions when reading),
but it becomes extremely cumbersome, especially with befunge (which, as far
as I can tell, doesn't support the concept of a subroutine, unless theres
a really clever way of emulating them).

  If befunge had just one extra command: "copy the nth value in the stack
to the top of the stack", everything would become much easier.
  Well, I suppose the purpose of this language is not to be easy to use. :P

>   Anything in particular that inspired you to give it a shot, or did it 
> just seem like an interesting puzzle?

  I wanted to try a completely different programming language, for fun.

-- 
                                                          - Warp


Post a reply to this message

From: Darren New
Subject: Re: Theoretical programming question
Date: 31 Oct 2007 19:25:28
Message: <47291cf8$1@news.povray.org>
Warp wrote:
> but it becomes extremely cumbersome,

It's pretty f'ing tedious with a three-color turing machine, too. :-)

-- 
   Darren New / San Diego, CA, USA (PST)
     Remember the good old days, when we
     used to complain about cryptography
     being export-restricted?


Post a reply to this message

From: Warp
Subject: Re: Theoretical programming question
Date: 31 Oct 2007 19:33:40
Message: <47291ee4@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Warp wrote:
> > but it becomes extremely cumbersome,

> It's pretty f'ing tedious with a three-color turing machine, too. :-)

  The Thue programming language actually looks like an interesting concept.
Perhaps I will try to make a mandelbrot generator with it.

  From what I see, you really need to start from the very basics, by
defining things like binary addition and multiplication...

-- 
                                                          - Warp


Post a reply to this message

From: Kevin Wampler
Subject: Re: Theoretical programming question
Date: 2 Nov 2007 02:02:24
Message: <472acb80$1@news.povray.org>
Warp wrote:
>   I wanted to try a completely different programming language, for fun.

I admire your dedication to it, I think Befunge would push my patience 
beyond its limits for anything much beyond "hello world".


Post a reply to this message

<<< Previous 6 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.