From pchung@watercove.com Fri Mar 9 23:12:27 2001 From: pchung@watercove.com (Peter Chung) Date: Fri, 9 Mar 2001 18:12:27 -0500 Subject: [Compiler-sig] command line interface parser Message-ID: <5BFDB1D553A1D411A48200508BB0F6EC02B3CA@k2.watercove.com> Hi, I am new to this mailing list, so please excuse my ignorance. I learn about Python from a colleague. He says I could use it to build a flexible CLI parser in a grammar I specified easily with Python and have 'C' code generated for it for Solaris. Has anyone done a CLI with Python ? If so, is there a reference implementation available ? Thanks in advance, Peter From loewis@informatik.hu-berlin.de Sat Mar 10 11:25:53 2001 From: loewis@informatik.hu-berlin.de (Martin von Loewis) Date: Sat, 10 Mar 2001 12:25:53 +0100 (MET) Subject: [Compiler-sig] command line interface parser In-Reply-To: <5BFDB1D553A1D411A48200508BB0F6EC02B3CA@k2.watercove.com> (message from Peter Chung on Fri, 9 Mar 2001 18:12:27 -0500) References: <5BFDB1D553A1D411A48200508BB0F6EC02B3CA@k2.watercove.com> Message-ID: <200103101125.MAA27321@pandora.informatik.hu-berlin.de> > I am new to this mailing list, so please excuse my ignorance. I learn about > Python from a colleague. He says I could use it to build a flexible CLI > parser in a grammar I specified easily with Python and have 'C' code > generated for it for Solaris. > > Has anyone done a CLI with Python ? If so, is there a reference > implementation available ? Not sure what kind of "command line interface" you are asking for. Do you want to process a program's argument list (sys.argv), or do you want to offer an interactive mode for your application? Depending on the complexity of your language, different approaches might be appropriate. If the language can be described in terms of regular expressions, it is probably easiest to use the re module for the processing. If the language is slightly more complicated, you could try a few of the Python parser generators (they all generate Python). I personally found Yapps to be useful for a not-so-small language; John Aycock presented a "little languages framework" some years ago. As for generating C: well, probably not what you've expected. You can certainly embed Python into your application; that is quite easy to do. You can also "freeze" the Python modules you use, which involves generating C code. However, that C code is only large arrays representing bytecode; you'd still need to link the Python interpreter into your application. For providing interactive interfaces, it might be even easier to decide that the command line language *is* Python. You then only need to add a few predefined functions that are useful in your application area (or interface with your software), and you got your CLI. Look Ma, no compiler. Regards, Martin From jeremy@alum.mit.edu Mon Mar 12 23:44:14 2001 From: jeremy@alum.mit.edu (Jeremy Hylton) Date: Mon, 12 Mar 2001 18:44:14 -0500 (EST) Subject: [Compiler-sig] Re: [Python-Dev] Revive the types sig? In-Reply-To: <200103122341.SAA23054@cj20424-a.reston1.va.home.com> References: <15020.9404.557943.164934@w221.z064000254.bwi-md.dsl.cnc.net> <200103120711.AAA09711@localhost.localdomain> <15021.22659.616556.298360@anthem.wooz.org> <200103122341.SAA23054@cj20424-a.reston1.va.home.com> Message-ID: <15021.24398.737816.108344@w221.z064000254.bwi-md.dsl.cnc.net> >>>>> "GvR" == Guido van Rossum writes: >> syntaxes with minimal overhead. If I understand their work >> correctly, they have their own compiler which is built on >> Jeremy's tools, and which accepts a modified Python grammar, >> generating different but compatible bytecode sequences. E.g., >> their syntax has a "template" keyword approximately equivalent to >> "def" and they do something different with bare strings left on >> the stack. GvR> I'm not sure this is viable. I believe Jeremy's compiler GvR> package actually doesn't have its own parser -- it uses the GvR> parser module (which invokes Python's standard parse) and then GvR> transmogrifies the parse tree into something more usable, but GvR> it doesn't change the syntax! Quixote can get away with this GvR> because their only change is giving a different meaning to GvR> stand-alone string literals. But for type annotations this GvR> doesn't give enough freedom, I expect. Right! It would be nice to kill two birds with one stone though. We could generate an alternate parser for Python and have it generate the same AST, decorated with type information. Even if the type experiment doesn't work out, the alternate parser might be useful. Jeremy From paulp@ActiveState.com Tue Mar 13 02:00:46 2001 From: paulp@ActiveState.com (Paul Prescod) Date: Mon, 12 Mar 2001 18:00:46 -0800 Subject: [Compiler-sig] Re: [Python-Dev] Revive the types sig? References: <15020.9404.557943.164934@w221.z064000254.bwi-md.dsl.cnc.net> <200103120711.AAA09711@localhost.localdomain> <15021.22659.616556.298360@anthem.wooz.org> <200103122341.SAA23054@cj20424-a.reston1.va.home.com> <15021.24398.737816.108344@w221.z064000254.bwi-md.dsl.cnc.net> Message-ID: <3AAD7F4E.6B0A460F@ActiveState.com> Jeremy Hylton wrote: > >... > > Right! It would be nice to kill two birds with one stone though. We > could generate an alternate parser for Python and have it generate the > same AST, decorated with type information. Even if the type > experiment doesn't work out, the alternate parser might be useful. I would love to see this for a variety of reasons. I have bandwidth to generate types-sig patches for a compiler but not to write the compiler from scratch, though. :( Anyone else interested? -- Python: Programming the way Guido indented it. - (originated with Skip Montanaro?) From biotechinfo2003@yahoo.com Mon Mar 26 15:33:03 2001 From: biotechinfo2003@yahoo.com (biotechinfo2003@yahoo.com) Date: Mon, 26 Mar 2001 15:33:03 Subject: [Compiler-sig] FREE Biotech Stock Info! 651 Message-ID: <555.101640.416210@excite.com> Do you want to capitalize on the Biotech Revolution

Do you want to capitalize on the Biotech Revolution? Would you like to add groundbreaking biotech, pharmaceutical and medical device companies to your portfolio mix? Does hearing about exciting IPO and private placement offerings from life sciences companies interest you?

The exclusive Ruddy-Carlisle Biotech Infoline service keeps you abreast of investment opportunities in the life sciences space. Just sign up for it once and get important information instantly delivered to study at your leisure. Our service is 100% FREE! Sign up!

Ruddy-Carlisle Biotech Infoline:

  • Instantly delivers key life sciences investment information directly to you!
  • Learn about biotech, pharmaceutical & medical device investment opportunities before others!
  • Includes IPO & private placement information!
  • 100% FREE!

For the entire last decade there were only three profitable biotech companies. At the end of this year, ten are projected. At the end of 2003, over forty are projected! The genomic promise is about to be delivered and investors know it. The Ruddy-Carlisle Biotech Infoline provides you with critical, decision-making, information that aids the chance of investment success in this lucrative space. Sign up!

Please Note- Your information will only be shared with companies that are in the life sciences space and pass our rigorous inspection. Only the best opportunities will come to you. Ruddy-Carlisle respects your privacy. Sign up!

 

 

List Removal Instructions
- Simply click here: remove to be instantly and permanently removed from our list. Send the blank email to the address specified. Please do not try to reply to this message.