1. Eu-Logo, Speed & New Ports
- Posted by Ralf Nieuwenhuijsen <nieuwen at XS4ALL.NL> Jan 27, 1998
- 607 views
- Last edited Jan 28, 1998
Hi, there a couple of things I like to talk about here. +--+ First off, I do think Euphoria could use a logo, something to recognize it with, but PLEASE let it be original. No 'Euphoria NOW!' or any other type of rip. Euphoria isn't a cheap rip-off and its logo shouldn't be that either. +--+ As to speed, the way I look at it, Euphoria doesn't cheat. Basic does, why ? Basic has special string optimized routines, and other tricks. Where Euphoria doesn't have any type of speed-cheat, that harms Euphoria's simplicity. The repeat, and concatenation simply look a lot better, and they are far more logical. They cheat, and they are not very good at it! +--+ And there was a request for the source code of Euphoria, so it could be ported, extended, etc. This has down and upsides, but I think the best thing would be the idea I thrown into this list-serv before. Cut all graphics and none-basic stuff out of the interpreter (saves loading time, memory space), even better, cut out ALL built-in routines. So only the basic parser is still available. But we add one new thingie to the interpreter. The ability to load machine-code libs. There could be a machine-level access lib, and a graphics lib. But people could also have machine code, that needs the quickness of a stack-based interface with your program (to pass arguments). The source code of the basic parser could be released (for NONE-commercial purposes only off course!!), however the libraries are machine specific anyway and not very easy to port. This would also eliminate the ugly way we are now porting in machine code. (completely unsafe, no error checking at all, etc.) And a real perfectionist would even add the ability for a parser script (advanced macro-processing). What I mean by this is, that a way to add syntax's to euphoria would be nice, because there are ways when I can NOT do stuff efficiently, however I know the interpreter is capable to do this, if it would only get into its stack right. Example: I want to get value from the function read_bitmap and send the first element to the screen, the second to the pallet, however if it isn't a sequence I want to display an error message. How can I do this, without storing the sequence into a local variable ? Does Euphoria optimize for this ? Example 2: Try to write a recursive upper_case that is as fast as an if-statement. all_up = text + (( text => 'a' and text <= 'z' ) * ('A' - 'a')) This does an add, two compares, an 'and', a subtraction and a multiply for every element. However I only want to see if it is between 'a' and 'z' and if that is the case then I want to add 'A'-'a' So that would be two compares, and an add. See the difference, especially the multiplication takes time. Why can't we say (good remark of some1 on nl.comp.programmeren in the basic Vs Euphoria discussion) something like this: every text >= 'a' and text <= 'z' do text = text + ('A' - 'a') I mean, the interpreter is capable of handling this ? But the parser will never translate code this way. Please look up the icon language for some very nice efficient and keen (that is, less code more clarity, less tricks) syntax tricks. Together with Euphoria sequence (which is most definitely made for this kind of syntax) this could be a new level in powerful programming. Euphoria can do anything OOP can just as easily and readable (programmable), but Euphoria can not do a those ICON things. (The rest of ICON is very very deeply sad, but there recursion system is brilliant) If any1 would like to hear more about how this recursion system works, ask me. +--+ I now have bored y'all enough.. +--+ Ralf Nieuwenhuijsen nieuwen at xs4all.nl (PS David, still working on a that customizable preprocessor ?)