Re: [Readable-discuss] LISP as a BASH alternative?
> The "sweet-run" program processes the rest of the file through "unsweeten" > and runs it. Here's an example of using it, in this case to use scsh: +1! -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss
Re: [Readable-discuss] LISP as a BASH alternative?
Your wish is my command. If you want to use sweet-expressions to write scripts, I have a new toy in the git repository, "sweet-run". I'd like to know if it's worth keeping. The "sweet-run" program processes the rest of the file through "unsweeten" and runs it. Here's an example of using it, in this case to use scsh: === #!./sweet-run ;#!scsh -s ;!# run cat("README") === Here's another example, to invoke guile: === #!./sweet-run ;#!guile ;!# ; This is a demonstration of sweet-run. display "This calculates 5:\n" display {2 + 3} display "\n" define factorial(n) if {n <= 1} 1 {n * factorial{n - 1}} ; f{...} => f({...}) display "Now let's calculate factorial(22):\n" display factorial(22) dwheeler@DWHEELER2-LT ~/readable-code $ cat sweet-run-demo2 #!./sweet-run ;#!scsh -s ;!# === Thoughts? Is it a keeper? --- David A. Wheeler -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss
Re: [Readable-discuss] LISP as a BASH alternative?
> > That said, we have a Scheme implementation; it's likely to be > not-so-difficult to transliterate that into Common Lisp. Would you be > interested? > Yes, I would be. I've tried my hand at writing an alternative reader in the past, but it's been several months since I've worked on it. One of the things I've wondered is how to replace the default Common Lisp reader with my own. I've also written hash-table pseudocode for bracket notation; it's a lot nicer than Common Lisp's default hash-table syntax! (I haven't gotten to the position, yet, where I would feel comfortable writing a "bracketaccess" macro.) On Fri, Jul 27, 2012 at 5:49 AM, David A. Wheeler wrote: > Okay, I have sweet-expressions working as a shell scripting language. I > did this by modifying "unsweeten" so that a leading ";#" and ";!" are > generated without the semicolon. > > To try it out, just install scsh (Scheme Shell). Here's a simple > "demo.sscm" file: > > = > ;#!scsh -s > ;!# > > run cat("README") > = > > Process this with: > ./unsweeten < demo.sscm > demo > chmod a+x demo > (This begs to be set in a makefile) > > Run doing: > ./demo > > It's not Common Lisp, but it is certainly a Lisp. > > --- David A. Wheeler > -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss
Re: [Readable-discuss] LISP as a BASH alternative?
Okay, I have sweet-expressions working as a shell scripting language. I did this by modifying "unsweeten" so that a leading ";#" and ";!" are generated without the semicolon. To try it out, just install scsh (Scheme Shell). Here's a simple "demo.sscm" file: = ;#!scsh -s ;!# run cat("README") = Process this with: ./unsweeten < demo.sscm > demo chmod a+x demo (This begs to be set in a makefile) Run doing: ./demo It's not Common Lisp, but it is certainly a Lisp. --- David A. Wheeler -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss
Re: [Readable-discuss] LISP as a BASH alternative?
Alpheus Madsen: > This is actually a major reason I'm interested in Sweet-Expressions, myself. I'd like to use some form of Common Lisp as a shell, and it would be kindof awkward to have to use parentheses for everything. If you want to write *scripts* using a Lisp-like language, scsh might be useful to you (http://www.scsh.net/). It's a Scheme for also easily invoking programs, doing redirections, etc. E.G., it has a "process form". Scsh isn't really for interactive use, so it might not be what you're looking for, but maybe it is. It'd allow quick experimentation, anyway!! It still uses traditional s-expression notation, of course, but... I think it'd be trivial to combine scsh and our current "unsweeten" program for writing scripts. Just write in sweet-expressions, use unsweeten, and send to scsh. The only "problem" is that you really need to have "#!..." on the first line, which is a block comment sequence that ends with !#. Guile has that too, same semantics even. It sounds like it'd be a good idea to support #!...!# comments somehow, as that'd solve the problem (though I'm not sure how to "return" block comments). Or we could interpret some comments specially to do the same thing, e.g., comments beginning with ";#!" and ";#!" could be output without the leading ";". Then you could write shell scripts in a Lisp-like language, using some existing tools. --- David A. Wheeler -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss
Re: [Readable-discuss] LISP as a BASH alternative?
Alpheus Madsen: > This is actually a major reason I'm interested in Sweet-Expressions, myself. > I'd like to use some form of Common Lisp as a shell, and it would be kindof > awkward to have to use parentheses for everything. Awesome! Sounds like another use case. I've implemented curly-infix in Common Lisp (it's an easy readtable mod), but we haven't implemented neoteric or sweet expressions in Common Lisp. Yet. That said, we have a Scheme implementation; it's likely to be not-so-difficult to transliterate that into Common Lisp. Would you be interested? Indeed, I'd be open to simplifying the Scheme implementation to make it easier to transliterate, help wanted if you're thinking about that too. I want the Scheme implementation to be "obviously right", not "so complicated I can't find the bugs". I think many people won't be willing to replace their reader until they think it's trustworthy. Speaking of which, I've restored some neoteric tests (there were defects in the tests, not the implementation, but I wanted to track that down). You can always add another test, but we have enough test cases that you can gain some confidence in the reader just from that. Having a significant test case makes it easier to refactor the code. --- David A. Wheeler -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss
Re: [Readable-discuss] LISP as a BASH alternative?
This is actually a major reason I'm interested in Sweet-Expressions, myself. I'd like to use some form of Common Lisp as a shell, and it would be kindof awkward to have to use parentheses for everything. On Tue, Jul 24, 2012 at 7:11 PM, David A. Wheeler wrote: > Ben Booth: > > Hi, > >This is my first post to this mailing list. It's great to see that there > >is renewed activity on this project. > > I think so too. Welcome aboard! > > >I've been thinking about what a indentation-sensitive lisp-like language > >might look like for the last several years, although my attempts at > >writing a parser haven't produced any usable results yet. > > I know of a parser that you could try out :-). > > If you haven't yet, give our tutorial a whirl, which explains how to > download and try it out: > http://sourceforge.net/p/readable/wiki/Tutorial/ > > > What i find most interesting about readable S-expressions is the > > possibility of using a lisp-like language's REPL as an alternative to > > BASH and other shell-scripting languages. > > That's definitely a possibility. I don't plan to purse this right now, > but if anyone wants to give it a whirl, it should be an easy project to > implement. > > > ... Anyway, thanks for all the effort! This is a very useful and > interesting > > project that i will be following closely. > > Excellent! If you have ideas/suggestions, please post. Code or > documentation or website help would be appreciated, too. > > I have a TODO list here: > http://sourceforge.net/p/readable/wiki/TODO/ > If you or anyone else sees something you'd be willing to do, please let us > know! > > --- David A. Wheeler > > > -- > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > ___ > Readable-discuss mailing list > Readable-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/readable-discuss > -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss
Re: [Readable-discuss] LISP as a BASH alternative?
Ben Booth: > Hi, >This is my first post to this mailing list. It's great to see that there >is renewed activity on this project. I think so too. Welcome aboard! >I've been thinking about what a indentation-sensitive lisp-like language >might look like for the last several years, although my attempts at >writing a parser haven't produced any usable results yet. I know of a parser that you could try out :-). If you haven't yet, give our tutorial a whirl, which explains how to download and try it out: http://sourceforge.net/p/readable/wiki/Tutorial/ > What i find most interesting about readable S-expressions is the > possibility of using a lisp-like language's REPL as an alternative to > BASH and other shell-scripting languages. That's definitely a possibility. I don't plan to purse this right now, but if anyone wants to give it a whirl, it should be an easy project to implement. > ... Anyway, thanks for all the effort! This is a very useful and interesting > project that i will be following closely. Excellent! If you have ideas/suggestions, please post. Code or documentation or website help would be appreciated, too. I have a TODO list here: http://sourceforge.net/p/readable/wiki/TODO/ If you or anyone else sees something you'd be willing to do, please let us know! --- David A. Wheeler -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss
Re: [Readable-discuss] LISP as a BASH alternative?
Hi Ben! I realized this as well earlier this year: http://arclanguage.org/item?id=16098 Kartik http://github.com/akkartik/wart#readme -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss