Live data from Hacker News

Lisp implementation in sed

github.com

21–30 of 64 posts

Re: Lisp implementation in sed

#21

Earlier quoted context omitted.

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.

woah woah woah. we don't just throw around "waste of time" like that :)

I was wrong, obviously.

Re: Lisp implementation in sed

#22
post #17
post #15

Now you have three problems.

Oh come on. They took an unreadable language and implemented a slightly less unreadable language in it. That's at least two problems and one solution. To what, I don't know.

Having a Lisp will make it a little easier to write the Javascript interpreter. Baby steps.

Re: Lisp implementation in sed

#23
post #20

Earlier quoted context omitted.

did I misinterpret or did you just call lisp "[nearly] unreadable"? all languages are unreadable for the uninitiated.

You didn't misinterpret.

i am not particularly gifted at computer science and especially not programming languages. by necessity, the only languages i know are JavaScript and lisp. so I am always surprised to hear lisp is "unreadable" as opposed to "unfamiliar".

Re: Lisp implementation in sed

#24
post #17

Earlier quoted context omitted.

Oh come on. They took an unreadable language and implemented a slightly less unreadable language in it. That's at least two problems and one solution. To what, I don't know.

Having a Lisp will make it a little easier to write the Javascript interpreter. Baby steps.

brace yourself for sed flappy bird

Re: Lisp implementation in sed

#25
post #8

Earlier quoted context omitted.

Indeed. There are few wide-spread programming languages around any more that lack such things as, say, any form of arithmetic whatsoever.

sed has regular expressions. I think you could do some binary arithmetic fairly easily with regular expressions and find and replace...

Yep, that's pretty much how you have to do it. (If all you need is increment/decrement, though, you can actually do it pretty concisely with decimal-digit strings. Skipping the binary-to-decimal conversion greatly simplifies displaying numerical values.)

Re: Lisp implementation in sed

#26
post #7

Earlier quoted context omitted.

If this was (the only available) programming, I'd quit. Kudos, I think, to the author. His pain tolerance exceeds mine by a vast amount.

> If this was (the only available) programming, I'd quit. We started with nothing, remember? Just the bare metal. If this were the only available programming, I'd write an interpreter for a better language. Never imagine that your current suite of tools is all there is.

It will be a challenge to make an interpreter for a better language faster than dead slow.

I would bet on a compiler for a better language instead. That way, only one person would have to wait ages and ages. I doubt the result would be fast, but it wouldn't be insanely, insanely, insanely slow, either.

Re: Lisp implementation in sed

#27
post #17

Earlier quoted context omitted.

Oh come on. They took an unreadable language and implemented a slightly less unreadable language in it. That's at least two problems and one solution. To what, I don't know.

did I misinterpret or did you just call lisp "[nearly] unreadable"? all languages are unreadable for the uninitiated.

One theory that people often bring up vis-a-vis readability of lisp is that people seem to have a harder time parsing symbols than words (so all the parens makes it harder to look through a file).

Compared to python or coffeescript, it feels like there's a lot less noise

Re: Lisp implementation in sed

#28
post #20

Earlier quoted context omitted.

You didn't misinterpret.

i am not particularly gifted at computer science and especially not programming languages. by necessity, the only languages i know are JavaScript and lisp. so I am always surprised to hear lisp is "unreadable" as opposed to "unfamiliar".

I think that Lisp got a reputation for being unreadable because some Lisp programmers have the tendency to get too far into macros to extend the language, resulting in a language that other developers have not seen before.

Re: Lisp implementation in sed

#29

Earlier quoted context omitted.

sed has regular expressions. I think you could do some binary arithmetic fairly easily with regular expressions and find and replace...

Yep, that's pretty much how you have to do it. (If all you need is increment/decrement, though, you can actually do it pretty concisely with decimal-digit strings. Skipping the binary-to-decimal conversion greatly simplifies displaying numerical values.)

The GNU sed manual has examples like that at the end. It always seemed odd to show examples of things that are so awkward and inefficient. If they meant for sed to do those things, presumably they would have made commands for them.

Re: Lisp implementation in sed

#30
post #20

Earlier quoted context omitted.

You didn't misinterpret.

i am not particularly gifted at computer science and especially not programming languages. by necessity, the only languages i know are JavaScript and lisp. so I am always surprised to hear lisp is "unreadable" as opposed to "unfamiliar".

Basic Lisp is pretty readable. But, ironically, if you dump enough reader macros into your code it becomes very unreadable very quickly.

Most Lisp code I've seen is heavy on the reader macros.

Post reply on HN