Re:Streem – a new programming language from Matz
by marvy on Thursday December 11, 2014 @04:16PM
(#8737104)
I think I don't believe you. Look at the car and house example above. Is that arcane?
[ Parent
| on HN ]
Re:Streem – a new programming language from Matz
by mackwic on Thursday December 11, 2014 @06:11PM
(#8737601)
Well, sorry but sed _is_ cryptic.
Let me quote an exemple for you (squeezing blank lines):
>leaves a blank line at the beginning and end if there are some already.
#!/usr/bin/sed -f
# on empty lines, join with next
# Note there is a star in the regexp
:x
/^\n*$/ {
N
bx
}
# now, squeeze all '\n', this can be also done by:
# s/^\(\n\)*/\1/
s/\n*/\
/
As soon as you begin to use sed registers, the code becomes arcanic.
Re:Streem – a new programming language from Matz
by balakk on Friday December 12, 2014 @12:10AM
(#8738664)
> arcanic
Arcane. Some would call it archaic too :)
Re:Streem – a new programming language from Matz
by mijoharas on Friday December 12, 2014 @09:26AM
(#8740118)
> I think that stream-oriented languages are doomed to have an arcanic syntax.
> Streams are a non-trivial construction, after all.
...
> Well, sorry but sed _is_ cryptic. Let me quote an exemple for you (squeezing blank lines):
I agree with you that sed is cryptic, but I don't think that that necessarily means that stream processing languages are doomed to have an archaic syntax. I'd also agree with marvy in saying that the car and house example is very clear as to it's intent:
STDIN | /\w+/{|word|
/house/ {
# when word is house
}
/car/ {
# when word is car
}
{
# default case
}
}
I'd say that's very straightforward and not arcane at all. Just because sed is arcane (it could be argued) doesn't make it a precondition for any stream languageEDITS: formatting.