dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]Re: BF.Net has entered CVS & a BrainF*** webservice


From: Gopal V
Subject: [DotGNU]Re: BF.Net has entered CVS & a BrainF*** webservice
Date: Sun, 18 May 2003 23:33:01 +0530
User-agent: Mutt/1.2.5i

If memory serves me right, Simon D Howard wrote:
> I knew someone was bound to prove me wrong eventually :)  As this is part 
> of cscc, does this mean it can output JVM code as well?

Nope, I probably will hackup the JVM o/p code as well for a lark ...
And perhaps , just perhaps, the Parrot codegen as well ...

> BTW, if you are generating the same code as my compiler, you should 
> probably beware of buffer overruns:
> 
> http://www.attrition.org/security/advisory/gobbles/GOBBLES-15.txt

ArrayIndexOutOfBoundsException ...

> Maybe you could create some kind of helper array class that automatically 
> expands itself to make overruns impossible?

Well I could put that code for all ILNode_NextOrPrev stuff ... 
with a 

jsr realloc_prev_code;

Or something and write it as a subroutine than as a function , thus
preserving the beautiful single function nature of compiled code.

Use of an arraylist is recommended , but not accepted as BF.NET does
not accept any old class where it wants an array (... naah , I'm just
being irrational like anybody who works with BF for too long ;-)

> The plan was to teach myself Reflection.Emit 
> and then write an implementation of it for dotgnu, but it never happened 
> :(

:( Indeed ...

A quick look at the TODO's listed showed me that there are not too many
TODO's in pnet's Reflection.Emit ...

But You might want a look at my code , it shows how to use TreeCC effectively
to produce wonderful code .... look at the ILNode_BFOpt combining all the
merge optimisations into a single node type... Or at the recursive optimise
calls into the loops ..

Hmmm... I probably should give compiler warnings when I encounter

[+] and [] as infinite loop ... 

and reduce 

[-] to ldloc.0 ldloc.1 ldc.i4.0 stelem.i4

after the initial optimize phase ... try -O1 with cscc for a bf.net
file ;-)

But all that's left as an exercise for the reader ;-)

Gopal
-- 
The difference between insanity and genius is measured by success


reply via email to

[Prev in Thread] Current Thread [Next in Thread]