NightShade Vs. Euphoria++
- Posted by mtsreborn at yahoo.com Feb 08, 2001
- 447 views
Hmmm.. Before I can start coding on U4IA++ again, I should know what syntax to use... Euphoria's, or Gothic NightShade's? If I'd opt for NightShade, the package will be 'Gothic NightShade' and not U4IA++. NightShade being a totally new language closely releated to Euphoria (read: it *is* Euphoria, just with other datatypes). So I'll need *you* to tell me wich one to go for. Remember, I can get a NightShade To C and C To NightShade translator out there even before the Beta-1 release of RDS' E2C. You will have to choose now. To let you pick, below are two graphics programs, one written in Gothic NightShade, and one written in U4IA++. Both come with the benchmark results after being translated to C. ---------------U4IA++ program------------------------- include image.e include graphics.e sequence bmp bmp = read_bitmap("test.bmp") if graphics_mode(get_mode(640,480,16)) = -1 then end if atom t, cnt cnt = 0 t = time() while t+10 > time() do display_image({0,0},bmp[2]) cnt+=1 end while printf(1,"%d blits per second",cnt/5) if wait_key() then end if -------------Gothic NightShade Program---------------- include image.e include graphics.e integer array bmp bmp = read_bitmap("test.bmp") if graphics_mode(get_mode(640,480,16)) = -1 then end if atom t, cnt cnt = 0 t = time() while t+10 > time() do display_image({0,0},bmp[2]) cnt+=1 end while printf(1,"%d blits per second",cnt/5) if wait_key() then end if U4IA++ Version: 218 Blits Per Second NightShade Version: 312 Blits Per Second I gave this example bvecause it illustrates the speed of NightShade datatypes over Euphoria datatypes. The only difference between U4IA++ and NightShade are the datatypes. These are: integer atom object string Ofwich each can be decalerd as follows: integer a a = 10 integer array as as = {10,50,60,{20,30,40},40} atom f f = 3.14 atom array f f = {2.5,3.14,{1.0,2.3}} object o o = "YOU SUCK!" o = {3.14,3.14*2} object array os os = {"YOU SUCK!!!",3.14,2} string s s = "MTS RULES!" string array ss ss = {"MTS RULES!","RDS SUCKS!"} That's it! For the rest, the syntax and library routines are exactly the same as U4IA++. This means that you have OOP support in the form; type myclass() integer age string name procedure doshit() puts(1,sprintf("%s is %d!!",{name,age}) end procedure end type myclass test test.age = 17 test.name = "MTS" test.doshit() The only thing NightShade doesn't handle very effectivly (due to speed issues) is object arrays. Each object is fairly large and complex. Therefore you shouldn't use arrays of objects too much if you'd like to hang onto memory. I, or any lamer with half a brain, can code a Euphoria To Gothic NightShade translator. All that has to be changed is 'sequence' into 'object array'. Wich language do you find the best? Mike The Spike PS. Knowing that Gothic NightShade is the fastest.