for -- else: what was the motivation?

Chris Angelico rosuav at gmail.com
Tue Oct 18 21:10:52 EDT 2022


On Wed, 19 Oct 2022 at 12:01, Peter J. Holzer <hjp-python at hjp.at> wrote:
>
> On 2022-10-17 09:25:00 +0200, Karsten Hilbert wrote:
> > > which had special combinations for all the BASIC keywords). And if you
> > > go this way, why not go a step further and dissociate the program from
> > > its linear text representation? Add footnotes, different views,
> > > hyperlinks, format mathematical expressions like formulas, etc.
> >
> > http://literateprogramming.com/
>
> Right. That's one of the inspirations for my comment.
>
> But literate programming is of course still very much rooted in the
> "linear text representation" paradigm. You have one definite source
> which is a linear text.
>
> In a world of IDEs, databases and hypertext that's probably not the best
> we can do. As Raymond Hettinger would say, "there must be a better way".
>
> It would be very different from mainstream programming languages,
> however. And ideally you would want it to integrate with a lot of other
> infrastructure. So that alone might make it a non-starter, even if it
> was really good (which realistically early iterations wouldn't be).
>

There are special-purpose languages like Scratch which are not simple
text in that form. My Twitch channel bot has a command executor whose
language, if you call it that, is basically JSON - and the way to edit
those commands is very Scratch-inspired. These are not general-purpose
programming languages, but for what they do, they can be very useful.
It's a great way to put together incredibly high level primitives that
tie in well with the system they're in. (Imagine programming a model
train set, with primitives like "change the points here to go
straight" and "advance train #32 to the next red signal".)

I'm not sure how you'd make that useful for general-purpose
programming, but there's definitely a LOT of value in non-textual
languages for certain situations.

ChrisA


More information about the Python-list mailing list