DALIS on the command line

by david 22. November 2011 20:39

I originally wrote DALIS as a cloud based programming language, but since I had abstracted out all the IO, it has been really easy to make a command line version as well.  So I have thrown together a few simple scripts to play around with. Consider this, for example:

IF ISASSIGNED("arg1") AND ISASSIGNED("arg2")
   min = NUMBER(arg1)
   max = NUMBER(arg2)
   gap = (max-min) / 10
   WRITE "deg F deg C"+RETURN
   LOOP f=min
      c=(5/9)*(f-32)
      WRITE TEXT(f,1)+" "+TEXT(c,1)+RETURN
   REPEAT f=f+gap IF f<(max+1)
OTHERWISE
   WRITE "You must pass two arguments, min and max."+RETURN
END

As you can see, DALIS programs can now accept parameters (the web based version allows you to pass the parameters in the query string of the url). In this example you specify a minimum and maximum temperature in degrees farenheight and the program makes a simple table converting them to celcius.  Here is a screenshot:

DALIS on the command line

You never know, this might even make for a useful little scripting language.

About the author

David

I'm a C# developer having worked with .Net since it was in beta.  Before that I mainly worked in C and C++.  I have been developing commercial software for more than 20 years.  I also mess around with microprocesors, but that's just for fun.  I live near Cambridge, England and at the moment I'm contracted to one of the departments at Cambridge University.

Tag cloud