Re: Well I did it! (variable_id, etc..)
- Posted by Andy Serpa <ac at onehorseshy.com> Nov 25, 2004
- 674 views
Greg Haberek wrote: > > > That's nice, but we can't have them as an exe that runs at Eu's speed, and > > we can't have the source unless we bought what? How much slower is your > > interpreter now? > > I'll put out the source once I get all the features in that I'd like. > As far as speed, well, it definitly needs to be run with the C > backend. > > sorting test - 10,000 random integers 0 - 999 > > exw.exe - 0.020 seconds > euw.exe - 11.376 seconds > > That's 568% slower! > > It's my hope that since I've implemented these features, RDS may be > more likely to use them, since I put in all the grunt work of thinking > and all. Heck, the whole equals thing for sequences was a matter of > changing one line. One line!!! Check this out: > > execute.e: line 1139 in procedure opEQUALS_IFW() > if val[a] = val[b] then > > change to: > if equal( val[a], val[b] ) then > > That's it!!! I had to rack my brain figuring out the inner workings of > the interpreter to put in the rest, but now its easy as pie. Rob's > coding style isn't that bad once you get the hang of it. > Someone needs to separate the PD front-end from the back-end so that the front-end can just spit out an unshrouded .il byte-code file, and then the PD back-end can read in this file and run it. I will get to this eventually if no one else does first. Then we just have to create a new back-end that runs faster than the PD back-end, or hope Rob "sees the light" and simply sells us the real back-end (for a profit!). I think I will try writing a new backend in Ocaml, which shouldn't be too hard for the core of the language because Ocaml already does everything Euphoria does (in a syntactically different way) and has garbage collection etc. (It also has some support for threads and other stuff people have been looking for if you want to jump ship completely.) It can run interpreted, or as bytecode, or as native code, just a Eu can. When compiled, it is much faster than translated Eu (it approaches the speed of C for pure Ocaml, of course it wouldn't run as fast as an Eu .il interpreter), so it might be possible to make a halfway decent performing backend. I'll probably just make a mini-backend implementing the core at first to see how it performs...