Improvements to DALIS

After working on some improvements to my DALIS programming language, I decided to celebrate by actually taking the time to understand the algorithm that draws the mandelbrot set better. After some reading on wikipedia, I was able to refactor it somewhat. So, this is my current implementation:

LOOP d=0, h=0, e=1.1
   LOOP b=-2
      LOOP n=0, h=127, r=0
         r = r*r-n*n+b
         n = 2*d*n+e
      REPEAT d=r, h=h-1 IF ((r*r)+(n*n) < 4) AND (h > 32)
      WRITE (h)
   REPEAT b=b+0.04 IF b < 1
   WRITE RETURN
REPEAT e=e-0.1 IF e > -1.2

I think it's much better. As you can see, it's now possible for several variables to be assigned on the same line and there is a RETURN keyword to write line breaks easily. Drawing the mandelbrot set in ten lines of code is pretty good, surely?

At the moment I'm working on a means of getting user input, which is going well, and in the background I'm thinking of ways to build simple webservices with DALIS... At this rate I'll have to start writing a book entitled "The DALIS programming language" :-)

Comments are closed