Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Deliver yesterday, code today, think tomorrow.


devel / comp.lang.python / Re: for convenience

SubjectAuthor
o Re: for convenienceAvi Gross

1
Re: for convenience

<mailman.361.1648166373.2329.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17594&group=comp.lang.python#17594

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: avigr...@verizon.net (Avi Gross)
Newsgroups: comp.lang.python
Subject: Re: for convenience
Date: Thu, 24 Mar 2022 23:59:27 +0000 (UTC)
Lines: 174
Message-ID: <mailman.361.1648166373.2329.python-list@python.org>
References: <433F5B45-E0FC-4DE7-8EA8-CF576B4A542C@paulstgeorge.com>
<487077501.1160671.1648142050989@mail.yahoo.com>
<CAPTjJmrD_rpYUCHhp+JznfGyNAhFTh5xCXTJMpyUTU9B9HW-fA@mail.gmail.com>
<1821154538.57709.1648166367897@mail.yahoo.com>
Reply-To: Avi Gross <avigross@verizon.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de T3ZNy/f+ZQdSq9CdqWLUvgdmJ7xIUgeSG8arEB/lvVTQ==
Return-Path: <avigross@verizon.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=verizon.net header.i=@verizon.net header.b=nZA8YFv4;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'looks': 0.02; 'argument':
0.04; '2022': 0.05; 'despite': 0.05; 'fairly': 0.05; 'is.': 0.05;
'else.': 0.07; 'mar': 0.07; 'matching': 0.07; 'modules': 0.07;
'string': 0.07; 'underlying': 0.07; 'view,': 0.07; 'angelico':
0.09; 'broad': 0.09; 'construct': 0.09; 'example.': 0.09;
'expression': 0.09; 'identical': 0.09; 'language,': 0.09; 'numpy':
0.09; 'operators': 0.09; 'pandas': 0.09; 'parse': 0.09; 'scipy':
0.09; 'tons': 0.09; 'tricks': 0.09; 'url:mailman': 0.15;
'supported': 0.15; 'anything,': 0.16; 'avi': 0.16; 'bits': 0.16;
'c++': 0.16; 'calculations': 0.16; 'chrisa': 0.16; 'command-line':
0.16; 'compiled': 0.16; 'constructs.': 0.16; 'equally': 0.16;
'evaluated.': 0.16; 'expectation': 0.16; 'expected.': 0.16;
'expressions': 0.16; 'functions,': 0.16; 'gross': 0.16; 'humans':
0.16; 'impossible': 0.16; 'jumps': 0.16; 'languages.': 0.16;
'matrices,': 0.16; 'mentioned,': 0.16; 'migrating': 0.16; 'naive':
0.16; 'packages,': 0.16; 'perl,': 0.16; 'remember,': 0.16;
'reminds': 0.16; 'sees': 0.16; 'source-code': 0.16; 'specify':
0.16; 'subset': 0.16; 'tries': 0.16; 'wrote:': 0.16; 'python':
0.16; "can't": 0.17; 'uses': 0.19; 'figure': 0.19; 'thu,': 0.19;
'to:addr:python-list': 0.20; 'language': 0.21; 'languages': 0.22;
'fri,': 0.22; 'maybe': 0.22; 'code': 0.23; 'run': 0.23; 'to:name
:python-list@python.org': 0.24; 'anything': 0.25; 'skip:- 10':
0.25; 'url-ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24':
0.25; 'python,': 0.25; 'stuff': 0.25; 'url:listinfo': 0.25;
'programming': 0.25; 'url-ip:188.166/16': 0.25; 'seems': 0.26;
'tried': 0.26; 'perform': 0.26; 'programming,': 0.26; 'creating':
0.27; "isn't": 0.27; 'bit': 0.27; 'done': 0.28; 'chris': 0.28;
'expect': 0.28; 'sense': 0.28; 'example,': 0.28; 'suggest': 0.28;
'environment': 0.29; 'asked': 0.29; 'it,': 0.29; 'seem': 0.31;
'within': 0.69; 'games': 0.70; 'pieces': 0.70; 'rules': 0.70;
'too.': 0.70; 'interesting': 0.71; 'relationship': 0.71; 'risk':
0.71; 'analyze': 0.75; 'choice': 0.76; 'formatting': 0.76;
'languages,': 0.76; 'vary': 0.76; 'sent:': 0.78; 'header:Reply-
To:1': 0.79; 'paul': 0.81; 'reasons': 0.84; 'up,': 0.84; '(like':
0.84; 'benefit.': 0.84; 'choices': 0.84; 'debate': 0.84; 'dozen':
0.84; 'exceptions': 0.84; 'grammar,': 0.84; 'grew': 0.84;
'handled': 0.84; 'honestly': 0.84; 'inherit': 0.84; 'literally':
0.84; 'luck': 0.84; 'narrow': 0.84; 'operated': 0.84; "people's":
0.84; 'pipes': 0.84; 'sentences': 0.84; 'strings': 0.84; 'behind':
0.88; '"why': 0.91; 'badly': 0.91; 'convenience': 0.91;
'deliberately': 0.91; 'differently': 0.91; 'grammar': 0.91;
'mistakes': 0.91; 'plays': 0.91; 'replacing': 0.91; 'turned': 0.95
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.net; s=a2048;
t=1648166370; bh=B45OIsYr8wzh7VlI3Hf3aK/sZu9Q/r+yDAkk05RKPSc=;
h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject:Reply-To;
b=nZA8YFv4mATYUXmM36jYIXpTvEIak7FqsEEeela+4BduaICwJEaTIgGWBbuNrxSBwobbAg16LiVALwOkxAO03BuhS7yZKw9WDYkgxB9+RuvYZzxQSgStiYXatK+7sdyc/advbrUFdYH2PNnBlX4tgxVsj4YNeLRafrTkglHGv1EbuHkEKh/Q4ulbgcxV8JlXobdglrgUfjp+Hx2pGMQ0ER/qB/lhfgg7o59jc3GFijBgSn2FdNb31owzlud++zbXb0alhfDaR29QXwP08lAAPrjGlNo4P8ssaD6W1tz7HEcM8TZ7zGS31ERduwmg4VAyTmr9ruYsLRHI8DGuzikI7g==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1648166370; bh=zYB227QtcphjwDsmOzDaU4avfpCWdIsvADeHMkPlQzS=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MkOUXq5QUGKYAAxMpO82H6mOwFq.SANRvtGCgbNFjyn1z91XK4v8Q9YE
_ZHvHMHBX3ikzFezWD27Fe08V5nmrnD9w4buGC0oLm.sqZwOlW.7I5vikdprUFjgrzyq41TmpMXm
MWkT_ahvktXIyGQR0x7QxwoRNOjg7OBNOF8DU5XKdDjduWLxKI7UACKGdA21hPalhbg5rbEFhqOM
_Hk6PSR0wLiCJzIv7r1dZmCHuUWUq89Z.Jq6FCl.ZxnhR26Z0_Qto9OGa3yc9LcDX3qCAhJBW8OH
KcPOC4tQ3PHhWJpkeqt9198lUnYL6yXmmRFnH9vCCIJQVABzHt3wg1hD66XgvIA9GgC24GSMfjrR
nc1yUW8sIFr_hwYVJxVXS9r88GApSifAnd5QaTflBqhYBo8dDL_wPqZihzvdS1v9wPEE3AGUvwF2
c4AvBd6RKrA8EKgLosArzTSdoYw01cUsD85ujD7jJBYRtqzO_8i1EfaWdheR4U.BssTEKdxdyig5
SGhI-
X-Sonic-MF: <avigross@verizon.net>
In-Reply-To: <CAPTjJmrD_rpYUCHhp+JznfGyNAhFTh5xCXTJMpyUTU9B9HW-fA@mail.gmail.com>
X-Mailer: WebService/1.1.19987 aolwebmail
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <1821154538.57709.1648166367897@mail.yahoo.com>
X-Mailman-Original-References: <433F5B45-E0FC-4DE7-8EA8-CF576B4A542C@paulstgeorge.com>
<487077501.1160671.1648142050989@mail.yahoo.com>
<CAPTjJmrD_rpYUCHhp+JznfGyNAhFTh5xCXTJMpyUTU9B9HW-fA@mail.gmail.com>
 by: Avi Gross - Thu, 24 Mar 2022 23:59 UTC

Chris:
> To a very large degree, the rules are and must be the same regardless
> of the library/module.

I may not have been clear. I am aware of all kinds of mini-languages such
as various forms of regular expressions where some string contains a fairly
complex program using existing symbols like [~* and so on with no real
relationship to the language being employed. You can often write code
using an identical regular expression and use it with functions in Python,
Perl, R, C++ and lots of other languages. Similarly, the printf() family has a guiding
string that uses symbols like % and : and others as a sort of mini language
that is often independent of the language it is being used in. Yes, some
languages contain functions that only support a subset of functionality
or a superset. For example, some allow you to specify an argument
that you want Perl-style matching enhancements.

So, no, I do not think what I was talking about is necessarily completely
the same as what the main language uses. And another example is how
you can sometimes change the underlying language at run time by all
kinds of techniques such as replacing built-in functions, and in languages
like R, creating all kinds of new functionality as in the pipes I mentioned
including brand new top-level operators or back in Python, tricks like
making a new class inherit from a standard class that then over-rides and
augments or even plays games with multiple inheritance.

I will agree that fundamentally the overall infrastructure seems the same.

But in my view, some changes step out of the original language.

As I have also mentioned, there are ways to get a program to perform
calculations in a shared way with two or more languages with data
moving back and forth as needed. Definitely that example, which I
sometimes use in my programming, literally jumps out of the initial
language.

-----Original Message-----
From: Chris Angelico <rosuav@gmail.com>
To: python-list@python.org <python-list@python.org>
Sent: Thu, Mar 24, 2022 1:37 pm
Subject: Re: for convenience

On Fri, 25 Mar 2022 at 04:15, Avi Gross via Python-list
<python-list@python.org> wrote:
> Python made lots of choices early on and then tried to graft on ever more
> features, sometimes well and sometimes not optimally. The same is true
> for so many other languages. A carefully designed new language built now
> might analyze and make changes.

This is technically true, but it's important to keep in mind that it's
very difficult to understand the reasons behind all the choices in a
language, so if you were to craft your own language now, you would run
the risk of throwing away *good* decisions too.

> I would even argue that a new language might deliberately include a
> pre-processor that works more like Paul first assumed, perhaps as
> something that could be turned on and off so it only operated on designated
> sections or only when some command-line switch asked for it. Some might
> use that, especially if migrating code from a language that had used similar
> constructs. But preprocessors work best in compiled code where it is reasonable
> to make multiple passes across a changing text but not so much in an
> interpreted environment that tries to read and parse things once or in small
> defined chunks dynamically evaluated.

No, I would say that a preprocessor of that sort isn't necessary to a
Python-like language. If you really want one, it's honestly not that
hard to do; remember, "preprocessor" means that it processes the
source code before the main language sees it, so you can do that even
with Python as it currently is.

But I suggest that a naive preprocessor like C's wouldn't be of much
benefit. Much more interesting is the possibility of designing a
language with a proper grammar, which you then compile to Python code
and execute.

(Part of the reason that a naive preprocessor wouldn't work well is
that it would play very badly with dynamic lookups. Good luck making
those work with a source-code transformation.)

> But Languages, human as well as computer, can differ widely and yet seem
> natural enough to most humans who grew up with them. One of my first human
> languages is not big on "gender" and many sentences are exactly the same no
> matter if it was being done by a male or female or anything else. So when I later
> learned German with tons of grammar that included three genders, that was annoying.
> Later I learned English and it seemed more civilized to me but in some ways not.
> Is there really a right way to say put verbs first versus last  or place adjectives
> before versus after what they modify? Well every darn language I learn has
> differences in these ways including exceptions and special cases galore. And
> even the choice of genders for words like "ship" or "road" vary widely across
> languages. You either memorize or give up, or more likely, make lots of small
> mistakes that mark you as a non-native speaker.

Yes, and despite what some people try to claim, they're not just all
the same thing with different symbols :) Languages ARE different,
different in real ways that make them good at different things.

> Languages like Python are actually a bit more of a challenge. Like many modern
> languages that have been overhauled to support multiple programming methods/styles
> (like object-oriented and functional programming) and that have been extended with
> endless add-ons with names like modules and packages, it seems anything you learn
> may turn out to be "wrong" in the sense that others write code completely differently
> than you first expected. You may learn base Python and think you use lists for all
> kinds of things and maybe even lists of lists to emulate matrices, for example.
>
> Then one day someone shows you a program done almost completely using modules
> like numpy and pandas and scipy and so on with bits and pieces of what looks like
> python to glue it together. Some add-ons define entirely new mini-languages whose
> rules only make sense within narrow areas and do not generalize.

To a very large degree, the rules are and must be the same regardless
of the library/module.

> It is very common
> to have half a dozen ways to do anything, like formatting stuff to print even within the
> base language.

That's because formatting things into strings is such an incredibly
broad subject that it's best handled in multiple ways :) You could
equally say that there are half a dozen ways to do arithmetic, which
there are (or even more, in fact).

> This reminds me too much of a recent debate here on whether the word "ELSE" means one
> thing versus another in a new context and I think we had to agree to disagree. Clearly
> some of us are primed to see it one way and some the other and neither of them is right
> but also there is NOW a right way to view the construct within Python because it is what it
> is so get over it!

I think "if/else" and "try/else" are close enough that nobody should
have any concerns about it, and that "for/else" is only confusing
because people have an expectation that isn't supported by *any
language I have ever used*. If people said "hey, I don't know what
for/else should do", that would be fine, but since people say "why
doesn't for/else do what I expect it to", it's very hard to explain,
since it's nearly impossible to figure out people's preconceptions,
since they can't even be explained by other languages' semantics.

ChrisA

--
https://mail.python.org/mailman/listinfo/python-list

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor