1. Rob, Gurus, Question for You...
- Posted by cklester <cklester at yahoo.com> Feb 03, 2005
- 500 views
Got this email from somebody browsing the FAQ: "I'm bioinformatics programmer and prefer Python or to a lesser extent Perl because I have to deliver fast. But I'm a bit disappointed by the speed of those, especially Python. Now I'm planning to program a lot of this in Euphoria (and maybe event start a bioEuphoria project similar to bioPython or bioPerl). What I want to do is integrating fast Euphoria code into Python code. I know I can translate Euphoria to C and do it that via C-compiler. But is there another way?" -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
2. Re: Rob, Gurus, Question for You...
- Posted by Patrick Barnes <mrtrick at gmail.com> Feb 03, 2005
- 488 views
- Last edited Feb 04, 2005
On Thu, 03 Feb 2005 10:13:16 -0800, cklester <guest at rapideuphoria.com> wrote: > > Got this email from somebody browsing the FAQ: > > "I'm bioinformatics programmer and prefer Python or to a lesser extent > Perl because I have to deliver fast. But I'm a bit disappointed by the > speed of those, especially Python. Now I'm planning to program a lot of > this in Euphoria (and maybe event start a bioEuphoria project similar > to bioPython or bioPerl). > > What I want to do is integrating fast Euphoria code into Python code. > I know I can translate Euphoria to C and do it that via C-compiler. But > is there another way?" I'm stumped. Unless, you create a shared-memory lib with a Euphoria and a Python version, and pass things back-and-forth with that. Sounds like a bit of work though... -- MrTrick
3. Re: Rob, Gurus, Question for You...
- Posted by cklester <cklester at yahoo.com> Feb 03, 2005
- 489 views
- Last edited Feb 04, 2005
Patrick Barnes wrote: > On Thu, 03 Feb 2005 10:13:16 -0800, cklester <guest at rapideuphoria.com> > wrote: > > > > "I'm bioinformatics programmer and prefer Python or to a lesser extent > > Perl because I have to deliver fast. But I'm a bit disappointed by the > > speed of those, especially Python. Now I'm planning to program a lot of > > this in Euphoria (and maybe event start a bioEuphoria project similar > > to bioPython or bioPerl). > > > > What I want to do is integrating fast Euphoria code into Python code. > > I know I can translate Euphoria to C and do it that via C-compiler. But > > is there another way?" > > I'm stumped. Unless, you create a shared-memory lib with a Euphoria > and a Python version, and pass things back-and-forth with that. Sounds > like a bit of work though... I wonder if creating a dll with Euphoria code would work...? -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
4. Re: Rob, Gurus, Question for You...
- Posted by Robert Craig <rds at RapidEuphoria.com> Feb 03, 2005
- 491 views
- Last edited Feb 04, 2005
cklester wrote: > I wonder if creating a dll with Euphoria code would work...? You can call Windows .dll's and (Linux/FreeBSD) shared libraries written in Euphoria, from other languages. The only problem is that you are limited to passing integers (31-bit) as arguments, assuming you need to pass any arguments. An advantage is that the Euphoria code should be even faster (than interpreted Euphoria) once it's translated/compiled into a .dll. Also, I'm sure Python and Perl have the equivalent of the Euphoria system() or system_exec() for running programs written in other languages. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
5. Re: Rob, Gurus, Question for You...
- Posted by Georg Wrede <georg at iki.fi> Feb 03, 2005
- 479 views
- Last edited Feb 04, 2005
Robert Craig wrote: > > cklester wrote: > > I wonder if creating a dll with Euphoria code would work...? > > You can call Windows .dll's and (Linux/FreeBSD) shared libraries > written in Euphoria, from other languages. The only problem is > that you are limited to passing integers (31-bit) as arguments, Can you explain the reason behind this? If this really can't be avoided, then one could use structs to pass other kinds of data? But the addresses may not fit in 31 bits? -- Another Euphoric, since Nov. 18, 2004 --
6. Re: Rob, Gurus, Question for You...
- Posted by Robert Craig <rds at RapidEuphoria.com> Feb 04, 2005
- 482 views
Georg Wrede wrote: > > Robert Craig wrote: > > > > cklester wrote: > > > I wonder if creating a dll with Euphoria code would work...? > > > > You can call Windows .dll's and (Linux/FreeBSD) shared libraries > > written in Euphoria, from other languages. The only problem is > > that you are limited to passing integers (31-bit) as arguments, > > Can you explain the reason behind this? > > If this really can't be avoided, then one could use structs to > pass other kinds of data? But the addresses may not fit in 31 > bits? The only bit patterns that Euphoria and the rest of the world agree on, are the integers from minus one billion (roughly), to plus one billion. Other values cannot be passed directly from another language to a Euphoria-coded .dll (or shared library) as arguments. (A Euphoria program can pass *any* Euphoria values, atoms or complex sequences, to a Euphoria .dll) Of course, if you manage to pass a pointer to a block of memory, you can store any values you want in that block, and have your Euphoria program peek() the values according to any pre-arranged format that you've decided on. But when you pass that initial pointer from another language, make sure it only needs 31 bits, or else pass it as say two 16-bit values to be combined by the .dll routine into a proper 32-bit (atom) pointer that Euphoria can use for peek/poke. (If you know the pointer must be aligned on say a 4-byte boundary, you could pass it shifted down 2 bits, and solve the problem that way. C's malloc() always returns aligned pointers.) This was discussed many months ago as I recall. You might dig up some more ideas on this by searching. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
7. Re: Rob, Gurus, Question for You...
- Posted by jacques deschĂȘnes <desja at globetrotter.net> Feb 04, 2005
- 485 views
There is numerous ways to do that. One is to run the euphoria program from the python as a child process and share the environment, so information can be exchanged using environment variable. Simple an good for small data volume. another way is using DDE (Dynamic data exchange). To name other methods: shared files, pipes, mailslot, ... regards, Jacques D.
8. Re: Rob, Gurus, Question for You...
- Posted by Alexander Toresson <alexander.toresson at gmail.com> Feb 04, 2005
- 485 views
Robert Craig wrote: > > Georg Wrede wrote: > > > > Robert Craig wrote: > > > > > > cklester wrote: > > > > I wonder if creating a dll with Euphoria code would work...? > > > > > > You can call Windows .dll's and (Linux/FreeBSD) shared libraries > > > written in Euphoria, from other languages. The only problem is > > > that you are limited to passing integers (31-bit) as arguments, > > > > Can you explain the reason behind this? > > > > If this really can't be avoided, then one could use structs to > > pass other kinds of data? But the addresses may not fit in 31 > > bits? > > The only bit patterns that Euphoria and the rest of the world > agree on, are the integers from minus one billion (roughly), > to plus one billion. Other values cannot be passed directly from > another language to a Euphoria-coded .dll (or shared library) > as arguments. Why is that? I've seen many dll's that do accept pointers, and thus can accept full 32-bit integers. Why cannot euphoria dll's accept those values? Regards, Alexander Toresson Assembly. Push 'till you pop.
9. Re: Rob, Gurus, Question for You...
- Posted by Matt Lewis <matthewwalkerlewis at yahoo.com> Feb 04, 2005
- 495 views
Robert Craig wrote: > > cklester wrote: > > I wonder if creating a dll with Euphoria code would work...? > > You can call Windows .dll's and (Linux/FreeBSD) shared libraries > written in Euphoria, from other languages. The only problem is > that you are limited to passing integers (31-bit) as arguments, > assuming you need to pass any arguments. I figured out a way around this. I'll dig up the code and post it later. Matt Lewis
10. Re: Rob, Gurus, Question for You...
- Posted by "Juergen Luethje" <j.lue at gmx.de> Feb 04, 2005
- 490 views
Matt Lewis wrote: > Robert Craig wrote: >> >> cklester wrote: >>> I wonder if creating a dll with Euphoria code would work...? >> >> You can call Windows .dll's and (Linux/FreeBSD) shared libraries >> written in Euphoria, from other languages. The only problem is >> that you are limited to passing integers (31-bit) as arguments, >> assuming you need to pass any arguments. > > I figured out a way around this. I'll dig up the code and post it later. You are making me curious ... Improved abilities to communicate with the rest of the "programming world" would IMHO be important for Euphoria! Regards, Juergen -- Have you read a good program lately?