POV-Ray : Newsgroups : povray.off-topic : Mini-languages Server Time
4 Sep 2024 01:22:22 EDT (-0400)
  Mini-languages (Message 41 to 50 of 108)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Invisible
Subject: Re: Mini-languages
Date: 11 Nov 2010 04:27:22
Message: <4cdbb6fa$1@news.povray.org>
On 10/11/2010 05:55 PM, scott wrote:
>>> (\+|-)[0-9]+(\.[0-9]+)?(E(\+|-)?[0-9]{1,3})?
>>
>> do
>> option (char '+' <|> char '-')
>> many1 digit
>> option (char '.')
>> many1 digit
>> option (do char 'E'; option (char '+' <|> char '-'); many1 digit)
>
> Hmm, now which one is more readable?

Exactly.


Post a reply to this message

From: Invisible
Subject: Re: Mini-languages
Date: 11 Nov 2010 04:30:15
Message: <4cdbb7a7$1@news.povray.org>
>> Yes, I've used SSH myself. It's quite neat that I can have an old 386
>> laptop sitting in a cupboard somewhere and operate it basically as if
>> I was sitting in front of it. On the other hand, would it be so hard
>> to do so with a less primitive interface?
>
> it's strange that I guy used to programming languages feels awkward
> about a text interface.

No, it feels awkward when you sit at a text terminal that's using ANSI 
escape codes to generate colours and block graphics characters to "draw" 
a "graphical" user interface. I mean, why not just have a /real/ 
graphical user interface?

> Notepad in all its glorious graphical user
> interface is much more featureless and rudimentar than vi on an old Unix
> terminal.

Sure. But that's because Notepad sucks beyond belief. ;-)

I'm not arguing that the CLI is useless. I'm arguing that ASCII-art 
"graphical" UIs are silly.


Post a reply to this message

From: Invisible
Subject: Re: Mini-languages
Date: 11 Nov 2010 04:54:02
Message: <4cdbbd3a$1@news.povray.org>
On 10/11/2010 10:07 PM, Darren New wrote:
> Invisible wrote:
>> I've always thought that manpages and the ugliest, lamest, most
>> archaic thing ever, so I don't see that that's much of an advantage.
>
> Oh, wait. Aren't you the one that goes on about LaTeX and Postscript?
> :-) I'm not sure what you have against a text-based program for
> generating typeset output.

TeX, PostScript, HTML, it's all good.

I'm just saying that the finished product looks awful.

The reason I put up with TeX, in spite of its innumerable and obvious 
limitations, is that it produces very, very nice output. troff doesn't 
seem to compare to that.

> Plus, they didn't produce stuff on screen. This is hardcopy land.
> Screens were advanced stuff. :-)

Apparently that's also why all Unix commands fail to offer even the most 
basic feedback as to what's happening, unless something actually goes 
wrong. It's to save paper.

So really, Unix invented environmentalism, 60 years ahead of the rest of 
Western civilisation. :-P


Post a reply to this message

From: nemesis
Subject: Re: Mini-languages
Date: 11 Nov 2010 09:57:35
Message: <4cdc045f@news.povray.org>
Invisible escreveu:
> I'm not arguing that the CLI is useless. I'm arguing that ASCII-art 
> "graphical" UIs are silly.

and I agree here.  However, ssh, bash or vi don't even attempt such 
sillyness, so I wonder what's your point with ssh as example of that...

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: nemesis
Subject: Re: Mini-languages
Date: 11 Nov 2010 10:07:56
Message: <4cdc06cc$1@news.povray.org>
Invisible escreveu:
>> do you really believe spelling out "option (char '+' <|> char '-')" is
>> any worth as opposed to "(\+|-)"?
> 
> Um, *yes*. Why, do you think it doesn't have worth?

it's far more verbose and, thus, hurts readability?

come on! do you even need those quotes around the symbols?

>>> xs <- many1 digit
>>> if length xs > 3 then fail else return ()
>>
>> no, sorry. Truly overkill against "\d{3}".

BTW, my mistake.  Should be "\d{0,3}"

> So define a combinator for it:
> 
>   manyN 0 _ = return []
>   manyN n p = do x <- p; xs <- manyN (n-1) p; return (x:xs)
> 
> And now, forever more, you can merely write
> 
>   manyN 3 digit
> 
> Problem solved.

then try this in your little language:

// A phone number with or without hyphens:
[2-9]\d{2}-?\d{3}-?\d{4}

It looks pretty much like a template for a phone number.  I'm sure yours 
will look like a little backwards forth script and will be much harder 
to figure out.

I also wonder if it's the postfix nature of regexes that bothers you...

-- 
a game sig: http://tinyurl.com/d3rxz9


Post a reply to this message

From: Warp
Subject: Re: Mini-languages
Date: 11 Nov 2010 10:19:05
Message: <4cdc0969@news.povray.org>
nemesis <nam### [at] gmailcom> wrote:
> do you really believe spelling out "option (char '+' <|> char '-')" is 
> any worth as opposed to "(\+|-)"?

  Btw, "(\+|-)" is unnecessarily complex. Just use "[+-]". That's exactly
what the [] syntax is for.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: Mini-languages
Date: 11 Nov 2010 10:28:15
Message: <4cdc0b8e@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> No, it feels awkward when you sit at a text terminal that's using ANSI 
> escape codes to generate colours and block graphics characters to "draw" 
> a "graphical" user interface. I mean, why not just have a /real/ 
> graphical user interface?

  Do you understand the concept of bandwidth? And that it can be quite
limited?

  The VT protocol was designed back when you were lucky if you could
transfer than a few kilobytes per second, so they had to maximize what
you could do while at the same time minimizing the need to transfer data.

  Today this might be more obsolete than it was 20 years ago, but there
are still benefits to that. The standard is quite well-established and
has been around forever, so almost every system in existence supports it.
Also, being text-based (and low-bandwidth) you can create or port terminal
emulators to almost any system with a screen and a keyboard, even very
exotic ones. For instance, it's pretty common for unix-savvy people to
have a terminal emulator on their cellphones so that they can contact
their computer or whatever remotely. A remote GUI would simply not do.

> I'm not arguing that the CLI is useless. I'm arguing that ASCII-art 
> "graphical" UIs are silly.

  Sometimes you have to resort to them to organize what is displayed.

-- 
                                                          - Warp


Post a reply to this message

From: Invisible
Subject: Re: Mini-languages
Date: 11 Nov 2010 10:31:36
Message: <4cdc0c58$1@news.povray.org>
>> Um, *yes*. Why, do you think it doesn't have worth?
>
> it's far more verbose and, thus, hurts readability?

Far more verbose, and as a consequence it's almost self-explanatory what 
it does. (Unlike a collection of symbols that have no widely-accepted 
meaning outside of regex languages...)

> come on! do you even need those quotes around the symbols?

Yes. Because this is a real programming language, you could replace the 
character name with a variable, for example. In this way you can make 
the pattern parameterised.

> then try this in your little language:
>
> // A phone number with or without hyphens:
> [2-9]\d{2}-?\d{3}-?\d{4}
>
> It looks pretty much like a template for a phone number. I'm sure yours
> will look like a little backwards forth script and will be much harder
> to figure out.

I actually can't figure out what that does, so I can't implement it.

> I also wonder if it's the postfix nature of regexes that bothers you...

No, mostly it comes down to these:
1. Commands have cryptic names like "*" or "+".
2. Literal characters aren't quoted, so it's hard to tell what's literal 
and what's a command.
(And 3. since spaces are literal characters, you can't even use spacing 
to make the structure of the expression clearer.)


Post a reply to this message

From: Invisible
Subject: Re: Mini-languages
Date: 11 Nov 2010 10:38:24
Message: <4cdc0df0$1@news.povray.org>
>    Today this might be more obsolete than it was 20 years ago, but there
> are still benefits to that. The standard is quite well-established and
> has been around forever, so almost every system in existence supports it.

It sounds a bit like Unix itself: It's not actually a very good idea, 
but everything in Creation supports it, and so it will remain around 
forever.

Actually, I found a rather interesting description of the history of 
Unix the other day. I'll have to see if I can find it again. As you read 
it, you discover that many design decisions that look stupid are in fact 
merely obsolete. They served a purpose 60 years ago, it's just that they 
aren't the best choice any more.

> Also, being text-based (and low-bandwidth) you can create or port terminal
> emulators to almost any system with a screen and a keyboard, even very
> exotic ones. For instance, it's pretty common for unix-savvy people to
> have a terminal emulator on their cellphones so that they can contact
> their computer or whatever remotely. A remote GUI would simply not do.

These days, the fashion seems to be for everything from print servers to 
network hubs to be controlled by HTML over HTTP. Which is equally 
stupid, but looks more pretty...


Post a reply to this message

From: Warp
Subject: Re: Mini-languages
Date: 11 Nov 2010 10:52:28
Message: <4cdc113c@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> Actually, I found a rather interesting description of the history of 
> Unix the other day. I'll have to see if I can find it again. As you read 
> it, you discover that many design decisions that look stupid are in fact 
> merely obsolete. They served a purpose 60 years ago, it's just that they 
> aren't the best choice any more.

  That would be quite strange, given that Unix was originally developed
41 years ago.

> > Also, being text-based (and low-bandwidth) you can create or port terminal
> > emulators to almost any system with a screen and a keyboard, even very
> > exotic ones. For instance, it's pretty common for unix-savvy people to
> > have a terminal emulator on their cellphones so that they can contact
> > their computer or whatever remotely. A remote GUI would simply not do.

> These days, the fashion seems to be for everything from print servers to 
> network hubs to be controlled by HTML over HTTP. Which is equally 
> stupid, but looks more pretty...

  Well, it has the advantage that it's still relatively low-bandwidth and
usable with any web browser in any system, and you can do things with the
mouse.

  Of course the downside is that you need something that can run a web
browser.

-- 
                                                          - Warp


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.