POV-Ray : Newsgroups : povray.general : compiled functios Server Time
6 Aug 2024 17:01:44 EDT (-0400)
  compiled functios (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From:
Subject: compiled functios
Date: 6 Feb 2002 07:20:05
Message: <g9726u02voq27v8umjek99f3h0i480rbdt@4ax.com>
I wonder - is there any other non-exotic language which compile functions
"on-line" and allow execute this compiled function just in next line of script ?
Are "our" 3.5 functions{} some novelty in languages?

ABX


Post a reply to this message

From: Warp
Subject: Re: compiled functios
Date: 6 Feb 2002 08:27:48
Message: <3c612f54@news.povray.org>

: I wonder - is there any other non-exotic language which compile functions
: "on-line" and allow execute this compiled function just in next line of script ?
: Are "our" 3.5 functions{} some novelty in languages?

  Nope, it's nothing new. Many scripting languages use this technique for
speed. The most notorious one is Perl, which runs its scripts by first
byte-compiling them on the fly to memory and then interpreting this bytecode.
This is why Perl is so fast (as an interpreted scripting language).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From:
Subject: Re: compiled functios
Date: 6 Feb 2002 08:52:58
Message: <r1c26ug57jcp5tlbe81m1rld45c2slmh45@4ax.com>
On 6 Feb 2002 08:27:48 -0500, Warp <war### [at] tagpovrayorg> wrote:
>   Nope, it's nothing new. Many scripting languages use this technique for
> speed. The most notorious one is Perl, which runs its scripts by first
> byte-compiling them on the fly to memory and then interpreting this bytecode.
> This is why Perl is so fast (as an interpreted scripting language).

I don't know Perl but what I understad from your answer Perl compiles whole
script. What I asked is: is there any other language which compile one
parametrized expresion to use in next expression within the same interpreted
script?

ABX


Post a reply to this message

From: Warp
Subject: Re: compiled functios
Date: 6 Feb 2002 09:11:51
Message: <3c6139a6@news.povray.org>

: What I asked is: is there any other language which compile one
: parametrized expresion to use in next expression within the same interpreted
: script?

  Uh? What's the difference?
  That's basically what Perl does.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Ron Parker
Subject: Re: compiled functios
Date: 6 Feb 2002 09:27:35
Message: <slrna62fap.5ps.ron.parker@fwi.com>
On 6 Feb 2002 09:11:51 -0500, Warp wrote:

>: What I asked is: is there any other language which compile one
>: parametrized expresion to use in next expression within the same interpreted
>: script?
> 
>   Uh? What's the difference?
>   That's basically what Perl does.

Nope, Perl compiles the whole script, then runs it.  He's asking whether there
are any other languages that are hybrid between byte-compiled and interpreted.

-- 
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: compiled functios
Date: 6 Feb 2002 10:20:16
Message: <3c6149b0@news.povray.org>
Ron Parker wrote:

>>   Uh? What's the difference?
>>   That's basically what Perl does.
> 
> Nope, Perl compiles the whole script, then runs it.  He's asking whether
> there are any other languages that are hybrid between byte-compiled and
> interpreted.

  Yes, I think Clipper used such pseudointerpreted things...  I used it for 
years, but I don't remember anything right now. Memory is so nice... :)

-- 
Jaime Vives Piqueres

La Persistencia de la Ignorancia
http://www.ignorancia.org


Post a reply to this message

From:
Subject: Re: compiled functios
Date: 6 Feb 2002 10:48:00
Message: <e0j26u4vfbjptnbrid9r60q7aob4l093n7@4ax.com>
On 6 Feb 2002 09:27:35 -0500, Ron Parker <ron### [at] povrayorg> wrote:
> Nope, Perl compiles the whole script, then runs it.  He's asking whether there
> are any other languages that are hybrid between byte-compiled and interpreted.

Yes, that's it.

Let's imagine such example:
I can start infinite loop with 3.5 which all the time checks for existence of
two specified files. First contains vertices of poly, second - list of points.
When files appear then my loop starts macro, read first file and makes function
to test if given point is inside this polygon. Then it starts loop along second
file and checks all points with speed of compiled program. Somehow it outputs
result, unlocks variables, clear files and continue infinite loop.

Of course it's only imagination - in reality it could be wasting of CPU for this
infinite loop. What I wanted to show - all was done with only one script but
with speed of compiled program without anything like "eval" or included
temporary files.

ABX


Post a reply to this message

From: Warp
Subject: Re: compiled functios
Date: 6 Feb 2002 15:57:55
Message: <3c6198d1@news.povray.org>
Ron Parker <ron### [at] povrayorg> wrote:
: Nope, Perl compiles the whole script, then runs it.  He's asking whether there
: are any other languages that are hybrid between byte-compiled and interpreted.

  Ok. There might not be many popular languages which do this kind of thing
(although I wouldn't be surprised if there were less-known languages which
do something like this).

  In fact, I have myself done a library which can be used for this kind of
thing: http://iki.fi/warp/FunctionParser/

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Deaken
Subject: Re: compiled functios
Date: 6 Feb 2002 23:09:42
Message: <3C61FE5A.5A995018@sw-tech.com>
Ron Parker wrote:
> 
> He's asking whether there
> are any other languages that are hybrid between byte-compiled and interpreted.

Forth, but I don't think it's hybridized in the way that you want.

Deaken


Post a reply to this message

From:
Subject: Re: compiled functios
Date: 8 Feb 2002 15:41:05
Message: <3c64364c.268368740@news.povray.org>

<abx### [at] babilonorg> wrote:
>I wonder - is there any other non-exotic language which compile functions
>"on-line" and allow execute this compiled function just in next line of script ?
>Are "our" 3.5 functions{} some novelty in languages?

The first graphics software I saw using compiled functions was
FractInt (in the formula interpreter), and that was at least 5 years
ago.

/Erkki


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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