On Thu, Oct 03, 2002 at 12:04:40PM +0900, William Djaja Tjokroaminata wrote:
> Hi batsman, holy python!
> 
> My goodness!  It looks that they are already doing (or finishing) *the*
> right thing to do, while Alan Chen and I were still discussing
> it.  Hopefully Rite will incorporate a similar concept as Pysco.  However,
> I really doubt its goal:
> 
>     "High-level languages are faster than low-level ones!"

It may be hard to achieve, but it is in theory possible.

> no matter how much Pysco may use gazillions of bytes for memory.  For one
> thing, assembly is (in general) always faster than C.

It could theoretically be faster, for each method would be specialized
for the kind of data that does appear during execution. Instead of
having the programmer foresee the types of the data, the real features
of data are observed during execution.
If the compiler were clever enough, we could see for example
	def amethod(list)
	# it turns out list is always an array with only 1 element
	end
if the specializing compiler finds constrains on the data that the
programmer didn't, it can do a much better work optimizing code.

Of course, this isn't easy at all.

> The Psyco web also contains several links; one of them is Pyrex.  In
> Pyrex, we can write
> 
>  def primes(int kmax):
>   cdef int n, k, i
>   cdef int p[1000]
>   result = []
>   if kmax > 1000:
>     kmax = 1000
>   k = 0
>   n = 2
>   while k < kmax:
>     i = 0
>     while i < k and n % p[i] <> 0:
>       i = i + 1
>     if i == k:
>       p[k] = n
>       k = k + 1
>       result.append(n)
>     n = n + 1
>   return result
> 
> which just exists in my dream in Ruby.  Ahhhh.......

Remember the post by Rockit's author, stating that in the future you'd
be able to take the AST and generate C (or whatever) code dynamically...
And in the meantime, there's RubyInline.

-- 
 _           _                             
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
  
The only other people who might benefit from Linux8086 would be owners
of PDP/11's and other roomsized computers from the same era.
	-- Alan Cox