News for hackers. Stuff that matters.
Re:Lisp implementation in sed by nate_martin on Friday June 27, 2014 @07:13PM (#7956710)
Would someone mind giving a quick explanation of how this works? I have only used sed to replace text in files and directories. How do people write interpreters and game loops with this unix utility?
Re:Lisp implementation in sed by mtdewcmu on Friday June 27, 2014 @07:27PM (#7956750)
With difficulty.

I started playing with the idea of making a programming language out of sed at one point, but then I decided that, even if I succeeded, it would be a waste of time.

I didn't take into account Hacker News.

Re:Lisp implementation in sed by catshirt on Friday June 27, 2014 @07:47PM (#7956816)
woah woah woah. we don't just throw around "waste of time" like that :)
Re:Lisp implementation in sed by mtdewcmu on Friday June 27, 2014 @08:02PM (#7956872)
I was wrong, obviously.
Re:Lisp implementation in sed by nix1 on Saturday June 28, 2014 @02:43AM (#7957635)
Becoming famous by wasting time is something to consider...
Re:Lisp implementation in sed by rmorell on Friday June 27, 2014 @09:29PM (#7957126)
sed is provably Turing complete: http://www.catonmat.net/blog/proof-that-sed-is-turing-comple... which means that it's effectively able to simulate any other Turing-complete language (provided enough processing power and memory).
Re:Lisp implementation in sed by bnegreve on Saturday June 28, 2014 @04:27AM (#7957766)
> sed is provably Turing complete

This submission is in itself, an elegant proof that sed is Turing complete.

Re:Lisp implementation in sed by jes5199 on Friday June 27, 2014 @07:44PM (#7956808)
the sed language allows conditional jumps to labels. That makes it powerful enough to write programs in.

If you had to just write programs by running a series of sed substitution expressions to a file over and over, and not use conditionals... it might still be possible to program in. Much harder to think about, though.