* Ada & Scripting @ 2003-05-10 12:07 kat-Zygfryd 2003-05-10 13:34 ` Preben Randhol ` (2 more replies) 0 siblings, 3 replies; 23+ messages in thread From: kat-Zygfryd @ 2003-05-10 12:07 UTC (permalink / raw) Have anyone written a binding, or is in the middle of writing a binding of some nice scripting language like Lua or Io? (I know there exist Python and Tcl bindings but those are rather slow) Zygfryd ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-10 12:07 Ada & Scripting kat-Zygfryd @ 2003-05-10 13:34 ` Preben Randhol 2003-05-10 19:10 ` Bobby D. Bryant 2003-05-13 16:33 ` Martin Krischik 2 siblings, 0 replies; 23+ messages in thread From: Preben Randhol @ 2003-05-10 13:34 UTC (permalink / raw) kat-Zygfryd wrote: > Have anyone written a binding, or is in the middle of > writing a binding of some nice scripting language > like Lua or Io? (I know there exist Python and Tcl > bindings but those are rather slow) BUSH http://www.pegasoft.ca/bush.html -- Preben Randhol http://www.pvv.org/~randhol/ ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-10 12:07 Ada & Scripting kat-Zygfryd 2003-05-10 13:34 ` Preben Randhol @ 2003-05-10 19:10 ` Bobby D. Bryant 2003-05-10 20:28 ` kat-Zygfryd 2003-05-13 16:33 ` Martin Krischik 2 siblings, 1 reply; 23+ messages in thread From: Bobby D. Bryant @ 2003-05-10 19:10 UTC (permalink / raw) On Sat, 10 May 2003 14:07:28 +0200, kat-Zygfryd wrote: > Have anyone written a binding, or is in the middle of writing a binding > of some nice scripting language like Lua or Io? (I know there exist > Python and Tcl bindings but those are rather slow) If you do Scheme I have bindings for the GUILE interpreter at http://www.cs.utexas.edu/users/bdbryant/guile-for-ada/index.html -- Bobby Bryant Austin, Texas ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-10 19:10 ` Bobby D. Bryant @ 2003-05-10 20:28 ` kat-Zygfryd 2003-05-11 1:39 ` John R. Strohm 2003-05-12 8:46 ` Preben Randhol 0 siblings, 2 replies; 23+ messages in thread From: kat-Zygfryd @ 2003-05-10 20:28 UTC (permalink / raw) "Bobby D. Bryant" <bdbryant@mail.utexas.edu> wrote in message news:pan.2003.05.10.19.10.12.207574@mail.utexas.edu... > On Sat, 10 May 2003 14:07:28 +0200, kat-Zygfryd wrote: > > If you do Scheme I have bindings for the GUILE interpreter at > http://www.cs.utexas.edu/users/bdbryant/guile-for-ada/index.html > -- > Bobby Bryant > Austin, Texas Thanks, but I wanted something user-friendly and if I remember properly Scheme is a descendant of Lisp, which is not user-friendly. Zygfryd ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-10 20:28 ` kat-Zygfryd @ 2003-05-11 1:39 ` John R. Strohm 2003-05-11 10:12 ` kat-Zygfryd 2003-05-12 8:46 ` Preben Randhol 1 sibling, 1 reply; 23+ messages in thread From: John R. Strohm @ 2003-05-11 1:39 UTC (permalink / raw) "kat-Zygfryd" <6667@wp.pl> wrote in message news:b9jne5$m73$1@news.onet.pl... > "Bobby D. Bryant" <bdbryant@mail.utexas.edu> wrote in message > news:pan.2003.05.10.19.10.12.207574@mail.utexas.edu... > > On Sat, 10 May 2003 14:07:28 +0200, kat-Zygfryd wrote: > > > > If you do Scheme I have bindings for the GUILE interpreter at > > http://www.cs.utexas.edu/users/bdbryant/guile-for-ada/index.html > > -- > > Bobby Bryant > > Austin, Texas > > Thanks, but I wanted something user-friendly > and if I remember properly Scheme is a descendant > of Lisp, which is not user-friendly. Oh, really? SECRETARIES were doing Xerox document processor extension programming in LISP. No one told them it was a "scripting language" or that what they were doing was "programming", so they were just doing it, to steal the Nike slogan. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-11 1:39 ` John R. Strohm @ 2003-05-11 10:12 ` kat-Zygfryd 2003-05-11 10:55 ` John R. Strohm 0 siblings, 1 reply; 23+ messages in thread From: kat-Zygfryd @ 2003-05-11 10:12 UTC (permalink / raw) "John R. Strohm" <strohm@airmail.net> wrote in message news:b9kam8$feh@library1.airnews.net... > > Oh, really? SECRETARIES were doing Xerox document processor extension > programming in LISP. No one told them it was a "scripting language" or that > what they were doing was "programming", so they were just doing it, to steal > the Nike slogan. > Well, I'm not a secretary :P and neither are my worldbuilders. Zygfryd ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-11 10:12 ` kat-Zygfryd @ 2003-05-11 10:55 ` John R. Strohm 2003-05-11 11:23 ` kat-Zygfryd 0 siblings, 1 reply; 23+ messages in thread From: John R. Strohm @ 2003-05-11 10:55 UTC (permalink / raw) "kat-Zygfryd" <6667@wp.pl> wrote in message news:b9l7n6$68k$1@news.onet.pl... > "John R. Strohm" <strohm@airmail.net> wrote in message > news:b9kam8$feh@library1.airnews.net... > > > > Oh, really? SECRETARIES were doing Xerox document processor extension > > programming in LISP. No one told them it was a "scripting language" or > that > > what they were doing was "programming", so they were just doing it, to > steal > > the Nike slogan. > > > > Well, I'm not a secretary :P and neither are my worldbuilders. The implication was that, if a TOTAL non-programmer, who has been strongly conditioned to believe that she/he could not program a computer to save her/his life, could successfully program in LISP to accomplish day-to-day tasks, with no prior formal training in programming *OR* LISP, it CAN'T be all that user-unfriendly. <sarcasm>Now, I'm sure you have an accurate appraisal of your own abilities, and I have no doubt you are correct when you say that learning to do casual programming in LISP is far beyond your current and potential capabilities.</sarcasm> But maybe you underestimate your worldbuilders? I will point out that one of the standard programming assignments in MIT course 6.001 (the freshman EE programming class, required of *ALL* incoming EECS freshmen) is doing, essentially, OBJECT-ORIENTED small-scale Adventure game worldbuilding, in LISP (Scheme dialect, to be precise). If incoming freshment, with typically NO prior experience programming in LISP can do it, maybe your worldbuilders can, too? ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-11 10:55 ` John R. Strohm @ 2003-05-11 11:23 ` kat-Zygfryd 2003-05-13 4:45 ` Bobby D. Bryant 0 siblings, 1 reply; 23+ messages in thread From: kat-Zygfryd @ 2003-05-11 11:23 UTC (permalink / raw) "John R. Strohm" <strohm@airmail.net> wrote in message news:b9lb6p$ihp@library1.airnews.net... > The implication was that, if a TOTAL non-programmer, who has been strongly > conditioned to believe that she/he could not program a computer to save > her/his life, could successfully program in LISP to accomplish day-to-day > tasks, with no prior formal training in programming *OR* LISP, it CAN'T be > all that user-unfriendly. I see that I also needed to include a sarcasm tag in my previous post. > <sarcasm>Now, I'm sure you have an accurate appraisal of your own abilities, > and I have no doubt you are correct when you say that learning to do casual > programming in LISP is far beyond your current and potential > capabilities.</sarcasm> Learning LISP is far beyond my desire and amount of time for the project. > But maybe you underestimate your worldbuilders? > I will point out that one of the standard programming assignments in MIT > course 6.001 (the freshman EE programming class, required of *ALL* incoming > EECS freshmen) is doing, essentially, OBJECT-ORIENTED small-scale Adventure > game worldbuilding, in LISP (Scheme dialect, to be precise). If incoming > freshment, with typically NO prior experience programming in LISP can do it, > maybe your worldbuilders can, too? Well, I study on PUT not MIT. If you like LISP so much then program in it, I find it ugly and unfriendly. Of course you can make it a scripting lang. in a MUD, you can even make assembler or direct virtual machine code, but what for? I want the language to be comfortable and fast to develop in. If you wish to discuss our personal preferences then contact me via mail. Zygfryd ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-11 11:23 ` kat-Zygfryd @ 2003-05-13 4:45 ` Bobby D. Bryant 2003-05-13 16:32 ` Wesley Groleau 2003-05-20 22:19 ` Randy Brukardt 0 siblings, 2 replies; 23+ messages in thread From: Bobby D. Bryant @ 2003-05-13 4:45 UTC (permalink / raw) On Sun, 11 May 2003 13:23:43 +0200, kat-Zygfryd wrote: > Learning LISP is far beyond my desire and amount of time for the > project. I don't want you to use anything you don't want, but this looks like a good place to insert a basic observation on that: When I taught the freshman-level Foundations of Computer Science course here I spent *one* lecture on Scheme syntax, and started in on recursion and induction in the second lecture. Clearly there's a lot more to being proficient at a language than learning its syntax, but just as clearly there aren't very many languages that I could have done that with. Anyway, hope you find something you like. I hope to look into Lua myself someday... when time allows. -- Bobby Bryant Austin, Texas ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-13 4:45 ` Bobby D. Bryant @ 2003-05-13 16:32 ` Wesley Groleau 2003-05-20 22:19 ` Randy Brukardt 1 sibling, 0 replies; 23+ messages in thread From: Wesley Groleau @ 2003-05-13 16:32 UTC (permalink / raw) > On Sun, 11 May 2003 13:23:43 +0200, kat-Zygfryd wrote: > >>Learning LISP is far beyond my desire and amount of time for the >>project. I missed the beginning of this thread, but I gather that a scripting language is needed but LISP is not wanted. I'm not sure why csh, ksh, bash, or even perl are not wanted, but if the subject line indicates the O.P. likes Ada, perhaps BUsiness-oriented SHell (BUSH) would be considered? ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-13 4:45 ` Bobby D. Bryant 2003-05-13 16:32 ` Wesley Groleau @ 2003-05-20 22:19 ` Randy Brukardt 2003-05-21 11:43 ` Georg Bauhaus 1 sibling, 1 reply; 23+ messages in thread From: Randy Brukardt @ 2003-05-20 22:19 UTC (permalink / raw) Bobby D. Bryant wrote in message ... >I don't want you to use anything you don't want, but this looks like a >good place to insert a basic observation on that: When I taught the >freshman-level Foundations of Computer Science course here I spent *one* >lecture on Scheme syntax, and started in on recursion and induction in the >second lecture. Gee, those must be terribly slow freshmen. :-) Considering that the syntax of LISP is essentially: expr ::= identifier | number | ( {expr} ) Getting it do to something is a bit more interesting; but that's semantics, not syntax. They didn't call it LISP (Lots of Irritating Silly Parenthesis) for nothing. :-) :-) Randy. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-20 22:19 ` Randy Brukardt @ 2003-05-21 11:43 ` Georg Bauhaus 0 siblings, 0 replies; 23+ messages in thread From: Georg Bauhaus @ 2003-05-21 11:43 UTC (permalink / raw) Randy Brukardt <randy@rrsoftware.com> wrote: : Bobby D. Bryant wrote in message ... :>I don't want you to use anything you don't want, but this looks like a :>good place to insert a basic observation on that: When I taught the :>freshman-level Foundations of Computer Science course here I spent : *one* :>lecture on Scheme syntax, and started in on recursion and induction in : the :>second lecture. : : : Gee, those must be terribly slow freshmen. :-) : Considering that the syntax of LISP is essentially: : expr ::= identifier | number | ( {expr} ) : Getting it do to something is a bit more interesting; but that's : semantics, not syntax. Lispers often say that :-). But is isn't true. Both from the perspective of an average young student, who will likely perceive "defun" as part of Lisp syntax, I think, and also from the Scheme perspective, which has standardized expression ::= variable | literal | procedure call | lambda expression | conditional | assignment | derived expression | macro use | macro block with lots of syntax rules preceding and following. (The parentheses are in the list rule) http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-10.html In PLT Scheme/DrScheme, there are language subsets. e.g. corresponding to beginners' level, where you don't have LET. Georg ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-10 20:28 ` kat-Zygfryd 2003-05-11 1:39 ` John R. Strohm @ 2003-05-12 8:46 ` Preben Randhol 2003-05-12 12:09 ` Frank Piron 1 sibling, 1 reply; 23+ messages in thread From: Preben Randhol @ 2003-05-12 8:46 UTC (permalink / raw) kat-Zygfryd wrote: > Thanks, but I wanted something user-friendly > and if I remember properly Scheme is a descendant > of Lisp, which is not user-friendly. User-friendly or newbie-friendly ? :-) Very hard to tell if something is user-friendly or not without defining the user. I for example find Microsoft Windows very user-unfriendly in many respects, while other maintain it is user-friendly. Probably we are both right. -- Preben Randhol http://www.pvv.org/~randhol/ ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-12 8:46 ` Preben Randhol @ 2003-05-12 12:09 ` Frank Piron 2003-05-12 14:31 ` Preben Randhol 2003-05-13 4:47 ` Bobby D. Bryant 0 siblings, 2 replies; 23+ messages in thread From: Frank Piron @ 2003-05-12 12:09 UTC (permalink / raw) Preben Randhol schrieb: > > kat-Zygfryd wrote: > > Thanks, but I wanted something user-friendly > > and if I remember properly Scheme is a descendant > > of Lisp, which is not user-friendly. > > User-friendly or newbie-friendly ? :-) Very hard to tell if something is > user-friendly or not without defining the user. This little debate here seems to be one of the (emacs/vim vs. user-friendly editors ), (linux vs. windows), (command-line vs. GUI) category. Lets create a newsgroup named: "very.common.disagreements" ( vcd ) or does anything similar already exist? greetings, Frank Piron ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-12 12:09 ` Frank Piron @ 2003-05-12 14:31 ` Preben Randhol 2003-05-13 4:47 ` Bobby D. Bryant 1 sibling, 0 replies; 23+ messages in thread From: Preben Randhol @ 2003-05-12 14:31 UTC (permalink / raw) Frank Piron wrote: > Preben Randhol schrieb: >> >> kat-Zygfryd wrote: >> > Thanks, but I wanted something user-friendly >> > and if I remember properly Scheme is a descendant >> > of Lisp, which is not user-friendly. >> >> User-friendly or newbie-friendly ? :-) Very hard to tell if something is >> user-friendly or not without defining the user. > > This little debate here seems to be one of the > > (emacs/vim vs. user-friendly editors ), > (linux vs. windows), > (command-line vs. GUI) > > category. Lets create a newsgroup named: > "very.common.disagreements" ( vcd ) > or does anything similar already exist? Hehe. No need one can allways cross post :-) I'm not interested in any debate over the user-friendlyness of scripting languages, but that the OP define the user so it is easier for us to see what may be more friendly. -- Preben Randhol http://www.pvv.org/~randhol/ ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-12 12:09 ` Frank Piron 2003-05-12 14:31 ` Preben Randhol @ 2003-05-13 4:47 ` Bobby D. Bryant 1 sibling, 0 replies; 23+ messages in thread From: Bobby D. Bryant @ 2003-05-13 4:47 UTC (permalink / raw) On Mon, 12 May 2003 13:09:29 +0100, Frank Piron wrote: > Preben Randhol schrieb: >> >> kat-Zygfryd wrote: >> > Thanks, but I wanted something user-friendly >> > and if I remember properly Scheme is a descendant >> > of Lisp, which is not user-friendly. >> >> User-friendly or newbie-friendly ? :-) Very hard to tell if something is >> user-friendly or not without defining the user. > > This little debate here seems to be one of the > > (emacs/vim vs. user-friendly editors ), > (linux vs. windows), > (command-line vs. GUI) No need to write your reply in Scheme! > category. Lets create a newsgroup named: > "very.common.disagreements" ( vcd ) > or does anything similar already exist? -- Bobby Bryant Austin, Texas ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-10 12:07 Ada & Scripting kat-Zygfryd 2003-05-10 13:34 ` Preben Randhol 2003-05-10 19:10 ` Bobby D. Bryant @ 2003-05-13 16:33 ` Martin Krischik 2003-05-14 15:22 ` Preben Randhol 2 siblings, 1 reply; 23+ messages in thread From: Martin Krischik @ 2003-05-13 16:33 UTC (permalink / raw) kat-Zygfryd wrote: > Have anyone written a binding, or is in the middle of > writing a binding of some nice scripting language > like Lua or Io? (I know there exist Python and Tcl > bindings but those are rather slow) Actualy, I have started to write a Library so I can do my scripting in Ada itself. Sound strange? Well I am used to a compiler so the compiling part does not matter to me while on the plus side Ada is a nice language to work with. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-13 16:33 ` Martin Krischik @ 2003-05-14 15:22 ` Preben Randhol 2003-05-14 17:05 ` Martin Krischik 0 siblings, 1 reply; 23+ messages in thread From: Preben Randhol @ 2003-05-14 15:22 UTC (permalink / raw) Martin Krischik wrote: > > Actualy, I have started to write a Library so I can do my scripting in Ada > itself. > > Sound strange? Well I am used to a compiler so the compiling part does not > matter to me while on the plus side Ada is a nice language to work with. Sounds interesting, but it would be very nice if there was some manual. Perhaps there is, but I didn't find it at the sourceforge page. -- Preben Randhol http://www.pvv.org/~randhol/ ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-14 15:22 ` Preben Randhol @ 2003-05-14 17:05 ` Martin Krischik 2003-05-14 18:51 ` sk 0 siblings, 1 reply; 23+ messages in thread From: Martin Krischik @ 2003-05-14 17:05 UTC (permalink / raw) Preben Randhol wrote: > Martin Krischik wrote: >> >> Actualy, I have started to write a Library so I can do my scripting in >> Ada itself. >> >> Sound strange? Well I am used to a compiler so the compiling part does >> not matter to me while on the plus side Ada is a nice language to work >> with. > Sounds interesting, but it would be very nice if there was some manual. That's why I have added the demo program - even thru they are so specialized that they are only usefull for me. Currently I am in the process of cleaning them up generalizing the commandline parser so more work is done in the library and less work is needed for the scripts. Also the most important part is not finished: Execution of external programs. While I can execute programms (only with the CVS version) I want to be able to write the standart input and read the standart output of them. It is tricky since C function 'pipe' can only do one of the two. The part which works well are the text file filter. They convert, fix, change source files for me every day. They where the reason for starting the project: I found sed just to cryptic. > Perhaps there is, but I didn't find it at the sourceforge page. Try http://adacl.sourceforge.net/html/index.htm for a start. The sarIPFFiles.adb is a nice but complex example. Back to the manual part: Yes they would be nice - if I had a bit more time. Anybody want to help? With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-14 17:05 ` Martin Krischik @ 2003-05-14 18:51 ` sk 2003-05-15 16:47 ` Martin Krischik 0 siblings, 1 reply; 23+ messages in thread From: sk @ 2003-05-14 18:51 UTC (permalink / raw) To: comp.lang.ada krischik@users.sourceforge.net: > It is tricky since C function 'pipe' can only do one of the two. The method is to use two pipes, one hooked to stdin, one to stdout and if you are so inclined, a third pipe for stderr. 1) This is quite doable in Ada with roll-your-own bindings. 2) If you use GNAT, look at the package GNAT.Expect Also you might look at AdaPower for the 'popen' bindings. -- ------------------------------------------------- -- Merge vertically for real address -- -- s n p @ t . o -- k i e k c c m ------------------------------------------------- ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-14 18:51 ` sk @ 2003-05-15 16:47 ` Martin Krischik 2003-05-16 20:57 ` sk 0 siblings, 1 reply; 23+ messages in thread From: Martin Krischik @ 2003-05-15 16:47 UTC (permalink / raw) sk wrote: > krischik@users.sourceforge.net: > > It is tricky since C function 'pipe' can only do one of the two. my mistake, it should read 'popen'. > The method is to use two pipes, one hooked to stdin, one to stdout > and if you are so inclined, a third pipe for stderr. I have some C sources for 'popen' which show how this is supposed to work. Now I "only" have to map the function to Ada. > 1) This is quite doable in Ada with roll-your-own bindings. I hope so. > 2) If you use GNAT, look at the package GNAT.Expect Yes, quite interesting source. But I will need some time to fully understand that source. > Also you might look at AdaPower for the 'popen' bindings. I saw them. As I said 'popen' ony returns one of the pipes - so I have to program my own version of 'popen'. Thanks for the help. Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-15 16:47 ` Martin Krischik @ 2003-05-16 20:57 ` sk 2003-05-17 7:36 ` Martin Krischik 0 siblings, 1 reply; 23+ messages in thread From: sk @ 2003-05-16 20:57 UTC (permalink / raw) To: comp.lang.ada Hi, > I have some C sources for 'popen' which show how this is > supposed to work. Now I "only" have to map the function to Ada. ... > I saw them. As I said 'popen' ony returns one of the > pipes - so I have to program my own version of 'popen'. ... and as I said, the method is 2 PIPES (not 'popen') The routine (algorithm) goes, roughly, like so ... <algorithm> Create a PIPE for stdin Create a PIPE for stdout Create a PIPE for stderr FORK if child process DUP the stdin, stdout and stderr pipes Close the write end of the stdin pipe Close the read end of the stdout pipe Close the read end of the stderr pipe EXECUTE the program you choose to talk to through pipes. else -- parent process Close the read end of the stdin pipe Close the write end of the stdout pipe Close the write end of the stderr pipe Read from the stdout or stderr pipes. Write to stdin pipe. end if; </algorithm> Use the "select" or "poll" system calls in the parent process to determine if the pipes are open, open but blocked or closed. There is no difficulty in implementing this algorithm in Ada, but it is a very "C" way to do it. A more Ada solution is to use Ada tasks or protected objects, but there is still a 'fork' and 'exec' call involved since this is the way a Linux system (and Windows I think) implements the "pipe" concept. So, I tend to stick to the parent/child fork and exec method retaining the "C" way to do things. -- ------------------------------------------------- -- Merge vertically for real address -- -- s n p @ t . o -- k i e k c c m ------------------------------------------------- ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Ada & Scripting 2003-05-16 20:57 ` sk @ 2003-05-17 7:36 ` Martin Krischik 0 siblings, 0 replies; 23+ messages in thread From: Martin Krischik @ 2003-05-17 7:36 UTC (permalink / raw) sk wrote: > Hi, > > I have some C sources for 'popen' which show how this is > > supposed to work. Now I "only" have to map the function to Ada. > > I saw them. As I said 'popen' ony returns one of the > > pipes - so I have to program my own version of 'popen'. > > ... and as I said, the method is 2 PIPES (not 'popen') I understand that much > The routine (algorithm) goes, roughly, like so ... > > <algorithm> > [...] > > </algorithm> Which is precicly what popen does - only popen then drops one of the pipes and returns only the other one. Personaly I think that was very wastefull of the original designer of popen. > Use the "select" or "poll" system calls in the parent > process to determine if the pipes are open, open but > blocked or closed. > > There is no difficulty in implementing this algorithm > in Ada, but it is a very "C" way to do it. A more Ada > solution is to use Ada tasks or protected objects, but > there is still a 'fork' and 'exec' call involved since > this is the way a Linux system (and Windows I think) > implements the "pipe" concept. So, I tend to stick > to the parent/child fork and exec method retaining the > "C" way to do things. I wonder if I should base my implentation use GNAT.Expect instead. GNAT.Expect does all of the above and I don't like to reinvent the weel just for the fun of it. Only I was planing for line IO and not pattern matching. Well, I'll look into it. Thank you for your help. It enables me to make an informed desicion - which ist probably the most important part in programming. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com ^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2003-05-21 11:43 UTC | newest] Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2003-05-10 12:07 Ada & Scripting kat-Zygfryd 2003-05-10 13:34 ` Preben Randhol 2003-05-10 19:10 ` Bobby D. Bryant 2003-05-10 20:28 ` kat-Zygfryd 2003-05-11 1:39 ` John R. Strohm 2003-05-11 10:12 ` kat-Zygfryd 2003-05-11 10:55 ` John R. Strohm 2003-05-11 11:23 ` kat-Zygfryd 2003-05-13 4:45 ` Bobby D. Bryant 2003-05-13 16:32 ` Wesley Groleau 2003-05-20 22:19 ` Randy Brukardt 2003-05-21 11:43 ` Georg Bauhaus 2003-05-12 8:46 ` Preben Randhol 2003-05-12 12:09 ` Frank Piron 2003-05-12 14:31 ` Preben Randhol 2003-05-13 4:47 ` Bobby D. Bryant 2003-05-13 16:33 ` Martin Krischik 2003-05-14 15:22 ` Preben Randhol 2003-05-14 17:05 ` Martin Krischik 2003-05-14 18:51 ` sk 2003-05-15 16:47 ` Martin Krischik 2003-05-16 20:57 ` sk 2003-05-17 7:36 ` Martin Krischik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox