At one time, we distinguished between “scripting” languages and “programming” languages. To begin with, the “scripting” languages were
somehow more limited in functionality than full-fledged “programming” languages. Or they were slower, because they were interpreted.
Then languages like Perl and Java came along: both were compiled to a bytecode, a sort of pseudo-machine-language, which was interpreted by software, not CPU hardware. Were they “scripting” or “programming” languages? Some might have classed Perl as a “scripting” language to begin with, but given it is must as powerful as Java, then why
shouldn’t Java also be considered a “scripting” rather than “programming” language? And before these two, there was UCSD Pascal, which was probably the pioneer of this compile-to-bytecode idea.
So that terminology for distinguishing between classes of programming languages became largely obsolete.
But there is one distinction that I think is still relevant, and that
is the one between shell/command languages and programming languages.
In a shell language, everything you type is assumed to be a literal
string, unless you use special substitution sequences. E.g. in a POSIX
shell:
ls -l thingy
“give me information about the file/directory named ‘thingy’”, vs.
ls -l $thingy
“give me information about the files/directories whose names are in
the value of the variable ‘thingy’”.
Whereas in a programming language, everything is assumed to be a
language construct, and every unadorned name is assumed to reference
some value/object, so you need quote marks to demarcate literal
strings, e.g. in Python:
os.listdir(thingy)
“return a list of the contents of the directory whose name is in the variable ‘thingy’”, vs.
os.listdir("thingy")
“return a list of the contents of the directory named ‘thingy’”.
This difference in design has to do with their typical usage: most of
the use of a shell/command language is in typing a single command at a
time, for immediate execution. Whereas a programming language is
typically used to construct sequences consisting of multiple lines of
code before they are executed.
This difference is also why attempts to use programming languages as
though they were shell/command languages, entering and executing a
single line of code at a time, tend to end up being more trouble than
they are worth.
Conversely, using shell/command languages as programming languages, by collecting multiple lines of code into shell scripts, does work, but
only up to a point. The concept of variable substitution via string substitution tends to lead to trouble when trying to do more advanced
data manipulations.
So, in short, while there is some overlap in their applicable usage
areas, they are still very much oriented to different application
scenarios.
At one time, we distinguished between “scripting” languages and >“programming” languages. To begin with, the “scripting” languages were >somehow more limited in functionality than full-fledged “programming” >languages. Or they were slower, because they were interpreted.
Then languages like Perl and Java came along: both were compiled to a >bytecode, a sort of pseudo-machine-language, which was interpreted by >software, not CPU hardware. Were they “scripting” or “programming” >languages? Some might have classed Perl as a “scripting” language to
At one time, we distinguished between “scripting” languages and “programming” languages. [...] But there is one distinction that I
think is still relevant, and that is the one between shell/command
languages and programming languages.
On Fri, 29 Mar 2024 01:14:18 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
At one time, we distinguished between “scripting” languages and
“programming” languages. To begin with, the “scripting” languages were
somehow more limited in functionality than full-fledged “programming”
languages. Or they were slower, because they were interpreted.
Then languages like Perl and Java came along: both were compiled to a
bytecode, a sort of pseudo-machine-language, which was interpreted by
software, not CPU hardware. Were they “scripting” or “programming” >> languages? Some might have classed Perl as a “scripting” language to
My rule of thimb is that a scripting language is one whereby the source code can be run immediately by the interpreter, eg perl, python, regardless of what happens internally. A full fledged programming language is one that requires a compile/debug/link step first with the compiler and runtime (if required) being seperate. eg Java, C
My rule of thimb is that a scripting language is one whereby the source code can be run immediately by the interpreter, eg perl, python, regardless of what happens internally. A full fledged programming language is one that requires a compile/debug/link step first with the compiler and runtime (if required) being seperate. eg Java, C
Muttley@dastardlyhq.com writes:
My rule of thimb is that a scripting language is one whereby the source code >> can be run immediately by the interpreter, eg perl, python, regardless of
what happens internally. A full fledged programming language is one that
requires a compile/debug/link step first with the compiler and runtime (if >> required) being seperate. eg Java, C
C can be a scripting language by that rule:
At one time, we distinguished between “scripting” languages and “programming” languages. To begin with, the “scripting” languages were
somehow more limited in functionality than full-fledged “programming” languages. Or they were slower, because they were interpreted.
Then languages like Perl and Java came along: both were compiled to a bytecode, a sort of pseudo-machine-language, which was interpreted by software, not CPU hardware. Were they “scripting” or “programming” languages? Some might have classed Perl as a “scripting” language to begin with, but given it is must as powerful as Java, then why
shouldn’t Java also be considered a “scripting” rather than “programming” language? And before these two, there was UCSD Pascal, which was probably the pioneer of this compile-to-bytecode idea.
So that terminology for distinguishing between classes of programming languages became largely obsolete.
But there is one distinction that I think is still relevant, and that
is the one between shell/command languages and programming languages.
In a shell language, everything you type is assumed to be a literal
string, unless you use special substitution sequences. E.g. in a POSIX
shell:
ls -l thingy
“give me information about the file/directory named ‘thingy’”, vs.
ls -l $thingy
“give me information about the files/directories whose names are in
the value of the variable ‘thingy’”.
Whereas in a programming language, everything is assumed to be a
language construct, and every unadorned name is assumed to reference
some value/object, so you need quote marks to demarcate literal
strings, e.g. in Python:
os.listdir(thingy)
“return a list of the contents of the directory whose name is in the variable ‘thingy’”, vs.
os.listdir("thingy")
“return a list of the contents of the directory named ‘thingy’”.
This difference in design has to do with their typical usage: most of
the use of a shell/command language is in typing a single command at a
time, for immediate execution. Whereas a programming language is
typically used to construct sequences consisting of multiple lines of
code before they are executed.
This difference is also why attempts to use programming languages as
though they were shell/command languages, entering and executing a
single line of code at a time, tend to end up being more trouble than
they are worth.
Conversely, using shell/command languages as programming languages, by collecting multiple lines of code into shell scripts, does work, but
only up to a point. The concept of variable substitution via string substitution tends to lead to trouble when trying to do more advanced
data manipulations.
So, in short, while there is some overlap in their applicable usage
areas, they are still very much oriented to different application
scenarios.
My rule of thimb is that a scripting language is one whereby the
source code can be run immediately by the interpreter, eg perl,
python, regardless of what happens internally. A full fledged
programming language is one that requires a compile/debug/link step
first with the compiler and runtime (if required) being seperate. eg
Java, C
On Fri, 29 Mar 2024 09:55:33 -0000 (UTC)
Muttley@dastardlyhq.com wrote:
My rule of thimb is that a scripting language is one whereby the
source code can be run immediately by the interpreter, eg perl,
python, regardless of what happens internally. A full fledged
programming language is one that requires a compile/debug/link step
first with the compiler and runtime (if required) being seperate. eg
Java, C
By *that* logic, even Lisp and Forth don't count as "full-fledged
programming languages" o_O Johanne's definition of a "scripting
On Fri, 29 Mar 2024 08:44:54 -0700
John Ames <commodorejohn@gmail.com> wrote:
By *that* logic, even Lisp and Forth don't count as "full-fledged >programming languages" o_O Johanne's definition of a "scripting
As a counter point, good luck writing a device driver in lisp. Forth
maybe, no idea.
On Fri, 29 Mar 2024 11:40:03 +0000
Richard Kettlewell <invalid@invalid.invalid> wrote:
Muttley@dastardlyhq.com writes:
My rule of thimb is that a scripting language is one whereby the source code
can be run immediately by the interpreter, eg perl, python, regardless of >>> what happens internally. A full fledged programming language is one that >>> requires a compile/debug/link step first with the compiler and runtime (if >>> required) being seperate. eg Java, C
C can be a scripting language by that rule:
No definition is perfect in this case, its all shades of grey.
On Fri, 29 Mar 2024 09:55:33 -0000 (UTC)
Muttley@dastardlyhq.com wrote:
My rule of thimb is that a scripting language is one whereby the
source code can be run immediately by the interpreter, eg perl,
python, regardless of what happens internally. A full fledged
programming language is one that requires a compile/debug/link step
first with the compiler and runtime (if required) being seperate. eg
Java, C
By *that* logic, even Lisp and Forth don't count as "full-fledged
programming languages" o_O Johanne's definition of a "scripting
language" as a DSL designed for directing the actions of the operating
system makes much more sense, IMHO.
On Fri, 29 Mar 2024 08:44:54 -0700
John Ames <commodorejohn@gmail.com> wrote:
On Fri, 29 Mar 2024 09:55:33 -0000 (UTC)
Muttley@dastardlyhq.com wrote:
My rule of thimb is that a scripting language is one whereby the
source code can be run immediately by the interpreter, eg perl,
python, regardless of what happens internally. A full fledged
programming language is one that requires a compile/debug/link step
first with the compiler and runtime (if required) being seperate. eg
Java, C
By *that* logic, even Lisp and Forth don't count as "full-fledged >>programming languages" o_O Johanne's definition of a "scripting
As a counter point, good luck writing a device driver in lisp.
On 2024-03-29, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
On Fri, 29 Mar 2024 11:40:03 +0000
Richard Kettlewell <invalid@invalid.invalid> wrote: >>>Muttley@dastardlyhq.com writes:
My rule of thimb is that a scripting language is one whereby the source >code
can be run immediately by the interpreter, eg perl, python, regardless of >>>> what happens internally. A full fledged programming language is one that >>>> requires a compile/debug/link step first with the compiler and runtime (if
required) being seperate. eg Java, C
C can be a scripting language by that rule:
No definition is perfect in this case, its all shades of grey.
Yes, a definition can be close to perfet here:
Scripting is an activity, a use case, not a language.
On 2024-03-29, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
On Fri, 29 Mar 2024 08:44:54 -0700
John Ames <commodorejohn@gmail.com> wrote:
On Fri, 29 Mar 2024 09:55:33 -0000 (UTC)
Muttley@dastardlyhq.com wrote:
My rule of thimb is that a scripting language is one whereby the
source code can be run immediately by the interpreter, eg perl,
python, regardless of what happens internally. A full fledged
programming language is one that requires a compile/debug/link step
first with the compiler and runtime (if required) being seperate. eg
Java, C
By *that* logic, even Lisp and Forth don't count as "full-fledged >>>programming languages" o_O Johanne's definition of a "scripting
As a counter point, good luck writing a device driver in lisp.
The Lisp machines had operating systems and device drivers written in
Lisp, interrupt-driven and all. Where do you perceive the difficulty?
On Fri, 29 Mar 2024 17:09:56 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
On 2024-03-29, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
On Fri, 29 Mar 2024 11:40:03 +0000
Richard Kettlewell <invalid@invalid.invalid> wrote: >>>>Muttley@dastardlyhq.com writes:
My rule of thimb is that a scripting language is one whereby the source >>code
can be run immediately by the interpreter, eg perl, python, regardless of >>>>> what happens internally. A full fledged programming language is one that >>>>> requires a compile/debug/link step first with the compiler and runtime (if
required) being seperate. eg Java, C
C can be a scripting language by that rule:
No definition is perfect in this case, its all shades of grey.
Yes, a definition can be close to perfet here:
Define perfect. Yours isn't.
Scripting is an activity, a use case, not a language.
So if I write a program to for example process some files in a directory by your argument its a script whether I write it in shell, python, C++ or assembler.
On Fri, 29 Mar 2024 17:13:47 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
On 2024-03-29, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
On Fri, 29 Mar 2024 08:44:54 -0700
John Ames <commodorejohn@gmail.com> wrote:
On Fri, 29 Mar 2024 09:55:33 -0000 (UTC)
Muttley@dastardlyhq.com wrote:
My rule of thimb is that a scripting language is one whereby the
source code can be run immediately by the interpreter, eg perl,
python, regardless of what happens internally. A full fledged
programming language is one that requires a compile/debug/link step
first with the compiler and runtime (if required) being seperate. eg >>>>> Java, C
By *that* logic, even Lisp and Forth don't count as "full-fledged >>>>programming languages" o_O Johanne's definition of a "scripting
As a counter point, good luck writing a device driver in lisp.
The Lisp machines had operating systems and device drivers written in
Lisp, interrupt-driven and all. Where do you perceive the difficulty?
Were the mucky bits actually written in Lisp or was Lisp simply calling some routines written in assembler?
As a counter point, good luck writing a device driver in lisp.
The terminology will continue to be used, but the distinction does not matter, except from a speed of processing difference.
A scripting language is a programming language made for a hypothetical >machine, not too different from a programming language made for a real >machine, one made of hardware.
TCL is a language that might be considered half-way between your
categories here.
Program text is initially text.[*] During parsing (either in
an interpreted or in a compiled language) you split the text
in tokens.
Consider looking at a shell language like a domain-specific programming language. A shell is a programming language made specifically for
running programs. ... (Of course, the idea evolves and you want to
glue programs, do variable substitution et cetera.)
A scripting language is a programming language made for a hypothetical machine, not too different from a programming language made for a real machine, one made of hardware.
You seem to find trouble with using a programming language in a REPL.
On Fri, 29 Mar 2024 10:37:22 +0100, Janis Papanagnou wrote:
Program text is initially text.[*] During parsing (either in
an interpreted or in a compiled language) you split the text
in tokens.
And then, how do you interpret the tokens?
In a shell language, everything you type is assumed to be a
literal string, unless you use special substitution sequences.
In a shell language, you have
the assumption that “everything is literal text until indicated otherwise”;
in a programming language, you have the assumption that
“everything is a program construct until indicated otherwise”.
The distinctions between script and programming languages made sense when they were first introduced. [...]
On 29.03.2024 21:59, Lawrence D'Oliveiro wrote:
On Fri, 29 Mar 2024 10:37:22 +0100, Janis Papanagnou wrote:
Program text is initially text.[*] During parsing (either in
an interpreted or in a compiled language) you split the text
in tokens.
And then, how do you interpret the tokens?
In an interpreter the tokens are interpreted, in a compiler
they are subject to the parsing. [...]
What I was saying is that there's initially literal program text
that is transformed to tokens in the lexical analysis, and then
further processed.
in a programming language, you have the assumption that
“everything is a program construct until indicated otherwise”.
So what is 'for i in a ; do ... ; done' then in your world?
On 29.03.2024 21:59, Lawrence D'Oliveiro wrote:
On Fri, 29 Mar 2024 10:37:22 +0100, Janis Papanagnou wrote:
Program text is initially text.[*] During parsing (either in
an interpreted or in a compiled language) you split the text
in tokens.
And then, how do you interpret the tokens?
In an interpreter the tokens are interpreted, in a compiler
they are subject to the parsing. (But you know that I'm sure.)
So what is 'for i in a ; do ... ; done' then in your world?
This is one of many basic shell constructs that I use in shell
programming (not "shell scripting") regularly.
On 30.03.2024 00:14, Janis Papanagnou wrote:
On 29.03.2024 21:59, Lawrence D'Oliveiro wrote:
On Fri, 29 Mar 2024 10:37:22 +0100, Janis Papanagnou wrote:
Program text is initially text.[*] During parsing (either in
an interpreted or in a compiled language) you split the text
in tokens.
And then, how do you interpret the tokens?
In an interpreter the tokens are interpreted, in a compiler
they are subject to the parsing. [...]
Just noticed that this may be misleading. Of course the shell
does also a syntax analysis step and report syntax errors. So
don't get me wrong here.
Just noticed that this may be misleading. Of course the shell
does also a syntax analysis step and report syntax errors. So
don't get me wrong here.
I did indeed get you wrong here (see my other followup).
On Sat, 30 Mar 2024 00:14:42 +0100, Janis Papanagnou wrote:
What I was saying is that there's initially literal program text
that is transformed to tokens in the lexical analysis, and then
further processed.
In a shell language, that is “further processed” as literal text, except for any instances of substitution markers.
in a programming language, you have the assumption that
“everything is a program construct until indicated otherwise”.
So what is 'for i in a ; do ... ; done' then in your world?
“for” is just the name of a command, like any other. In POSIX, this one happens to be built into the shell; it might not in other shells.
Johanne Fairchild <jfairchild@tudado.org> wrote or quoted:
A scripting language is a programming language made for a hypothetical >>machine, not too different from a programming language made for a real >>machine, one made of hardware.
C is clearly a programming language, yet its specification
says, "The semantic descriptions in this document describe
the behavior of an abstract machine". And you cannot buy
this abstract C machine as a piece of hardware anywhere!
On Fri, 29 Mar 2024 08:09:46 -0300, Johanne Fairchild wrote:
Consider looking at a shell language like a domain-specific programming
language. A shell is a programming language made specifically for
running programs. ... (Of course, the idea evolves and you want to
glue programs, do variable substitution et cetera.)
That’s the thing. The design for a “language made specifically for running
programs” always seems to start with the assumption that what the user types is to be passed as literal text, unless special markers are present
to indicate that they want to “glue programs, do variable substitution et cetera”. Notice your use of the term “variable substitution”, which is characteristic of a shell language: in a programming language, you don’t call it “substitution”, you call it “evaluation”.
You seem to find trouble with using a programming language in a REPL.
I find REPLs annoying and inconvenient. If I want to do “scratchpad” programming, I do it in a Jupyter notebook.
On Sat, 30 Mar 2024 00:14:42 +0100, Janis Papanagnou wrote:
So what is 'for i in a ; do ... ; done' then in your world?
“for” is just the name of a command, like any other. In POSIX, this one happens to be built into the shell; it might not in other shells.
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
So what is 'for i in a ; do ... ; done' then in your world?
This is one of many basic shell constructs that I use in shell
programming (not "shell scripting") regularly.
I use it both in shell scripting/programming and interactively.
And the entire construct needs to be processed before the shell can
begin to execute it. Misspelling "done" prevents the whole thing from running.
I can see a point where people use for interactive use other shells
than for programming; like tcsh (interactively) and bash (programming), because of the powerful features tcsh supports. Since the increase of interactive features supported by the shells that are typically used
for programming I prefer to have the same shell with same syntax and
features for both, and to be able to pass code from one application
context to the other.
Consider your Lisp writing, which violates the culture of Lisp writing.
Of course you should keep your independence, but maybe there are good
reasons why the culture is as it is---not all culture is fashion.
"for" is not just a command. It's a keyword, part of the shell language syntax.
On Fri, 29 Mar 2024 17:08:35 -0700, Keith Thompson wrote:
"for" is not just a command. It's a keyword, part of the shell language
syntax.
Remember, that’s only true of POSIX shells.
Besides the naming, keep in mind that there's a semantical differences between a "command", a "built-in command", and "shell construct". An
example where you can observe operational differences is:
'/bin/test' and '/bin/['
'test' and '['
'[['
where (for example) the latter does not need quoting.
On Fri, 29 Mar 2024 17:08:35 -0700, Keith Thompson wrote:
"for" is not just a command. It's a keyword, part of the shell language
syntax.
Remember, that’s only true of POSIX shells
"David W. Hodgins" <dwhodgins@nomail.afraid.org> writes:
[...]
The terminology will continue to be used, but the distinction does not
matter, except from a speed of processing difference.
Just to share that I, personally, don't use the distinction. For
instance, I say that
"the answer is %.2f\n"
is a program that builds a string given its usual context. I say that
awk '1; { print "" }'
is a program to double-space a file. I haven't said ``script'' in
years.
Johanne Fairchild <jfairchild@tudado.org> wrote or quoted:Of course. :) But we both know what that means. It's abstract because
A scripting language is a programming language made for a hypothetical >>>machine, not too different from a programming language made for a real >>>machine, one made of hardware.C is clearly a programming language, yet its specification
says, "The semantic descriptions in this document describe
the behavior of an abstract machine". And you cannot buy
this abstract C machine as a piece of hardware anywhere!
there are so many real machines for which this abstract one is an
abstraction of. And the real ones are the target of the language.
On 2024-03-29, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote: >>>Scripting is an activity, a use case, not a language.
So if I write a program to for example process some files in a directory by >> your argument its a script whether I write it in shell, python, C++ or
assembler.
I also wrote: "Scripting refers to executing commands which are so high
level that they are entire applications or functional blocks within an >application."
You're just being deliberately obtuse, not to mention snippy with the >scissors.
On 2024-03-29, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
Were the mucky bits actually written in Lisp or was Lisp simply calling some >> routines written in assembler?
Sorry, could you demarcate where exactly the goalposts are? Which mucky
bits?
In kernels written in C, there are mucky bits in assembler, like
entry and exit into an trap/interrupt handler. You usually can't save
But look at Pascal, Java, or Python. They are usually compiled
into an intermediate code (called "p-code" in the case of
Pascal) which is then interpreted (the interpreter is called
"JVM" in the case of Java). Yet, we think of Pascal and Java
as programming languages and of Python as a scripting language.
But this is actually an implementation detail: Java also can
be compiled into machine code.
[...]
I'm not being obtuse. There is no hard dividing line between scripts and programs - as I said, its shades of grey.
At one time, we distinguished between “scripting” languages and “programming” languages. To begin with, the “scripting” languages were[...]
somehow more limited in functionality than full-fledged “programming” languages. Or they were slower, because they were interpreted.
But look at Pascal, Java, or Python. They are usually compiled
into an intermediate code (called "p-code" in the case of
Pascal) which is then interpreted
On Fri, 29 Mar 2024 17:25:18 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
On 2024-03-29, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote: >>>>Scripting is an activity, a use case, not a language.
So if I write a program to for example process some files in a directory by
your argument its a script whether I write it in shell, python, C++ or
assembler.
I also wrote: "Scripting refers to executing commands which are so high >>level that they are entire applications or functional blocks within an >>application."
So if I write:
int main()
{
system("ls | wc -l");
return 0;
}
Thats a script?
No? What if I use popen() or execve() then? Where do you
draw the line?
You're just being deliberately obtuse, not to mention snippy with the >>scissors.
I'm not being obtuse. There is no hard dividing line between scripts and
programs - as I said, its shades of grey.
On Fri, 29 Mar 2024 08:44:54 -0700
John Ames <commodorejohn@gmail.com> wrote:
On Fri, 29 Mar 2024 09:55:33 -0000 (UTC)
Muttley@dastardlyhq.com wrote:
My rule of thimb is that a scripting language is one whereby the
source code can be run immediately by the interpreter, eg perl,
python, regardless of what happens internally. A full fledged
programming language is one that requires a compile/debug/link step
first with the compiler and runtime (if required) being seperate. eg
Java, C
By *that* logic, even Lisp and Forth don't count as "full-fledged
programming languages" o_O Johanne's definition of a "scripting
As a counter point, good luck writing a device driver in lisp. Forth maybe, no idea.
On Fri, 29 Mar 2024 17:58:41 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
On 2024-03-29, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
Were the mucky bits actually written in Lisp or was Lisp simply calling some
routines written in assembler?
Sorry, could you demarcate where exactly the goalposts are? Which mucky >>bits?
Oh I dunno, the parts that walk a kernel memory structure for example.
Johanne Fairchild <jfairchild@tudado.org> wrote or quoted: >>ram@zedat.fu-berlin.de (Stefan Ram) writes:
Johanne Fairchild <jfairchild@tudado.org> wrote or quoted:Of course. :) But we both know what that means. It's abstract because >>there are so many real machines for which this abstract one is an >>abstraction of. And the real ones are the target of the language.
A scripting language is a programming language made for a hypothetical >>>>machine, not too different from a programming language made for a real >>>>machine, one made of hardware.C is clearly a programming language, yet its specification
says, "The semantic descriptions in this document describe
the behavior of an abstract machine". And you cannot buy
this abstract C machine as a piece of hardware anywhere!
If you want to see it this way ...
But look at Pascal, Java, or Python. They are usually compiled
into an intermediate code (called "p-code" in the case of
Pascal) which is then interpreted (the interpreter is called
"JVM" in the case of Java). Yet, we think of Pascal and Java
as programming languages and of Python as a scripting language.
On Fri, 29 Mar 2024 17:25:18 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
On 2024-03-29, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote: >>>>Scripting is an activity, a use case, not a language.
So if I write a program to for example process some files in a directory by
your argument its a script whether I write it in shell, python, C++ or
assembler.
I also wrote: "Scripting refers to executing commands which are so high >>level that they are entire applications or functional blocks within an >>application."
So if I write:
int main()
{
system("ls | wc -l");
return 0;
}
Thats a script? No? What if I use popen() or execve() then? Where do you
draw the line?
It didn't really take off very well, but certainly people have written device drivers in Forth.
On 2024-03-29 02:14, Lawrence D'Oliveiro wrote:
At one time, we distinguished between “scripting” languages and[...]
“programming” languages. To begin with, the “scripting” languages were
somehow more limited in functionality than full-fledged “programming”
languages. Or they were slower, because they were interpreted.
The key difference is that a program in a scripting language need not
to be complete or known in order to be executed.
The limitations and ugliness of scripting languages is determined by
this requirement, but also easiness of use.
VAX Pascal (1980) was compiled directly to VAX machine code, as was
the Pascal compiler I wrote in the graduate compiler class.
UCSD Pascal used p-code, and IIRC Borland picked up
on that.
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
On 2024-03-29 02:14, Lawrence D'Oliveiro wrote:
At one time, we distinguished between “scripting” languages and[...]
“programming” languages. To begin with, the “scripting” languages were
somehow more limited in functionality than full-fledged “programming” >>> languages. Or they were slower, because they were interpreted.
The key difference is that a program in a scripting language need not
to be complete or known in order to be executed.
The limitations and ugliness of scripting languages is determined by
this requirement, but also easiness of use.
Perl, Python, and Lua are all considered scripting languages, and for
all of them a syntax error at the end of a script will prevent any of it
from being executed. The distinction is that they're not optimized for interactive use, as shell languages are (though they all can be used interactively).
So what is 'for i in a ; do ... ; done' then in your world?
On 2024-03-30, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
I also wrote: "Scripting refers to executing commands which are so high >>>level that they are entire applications or functional blocks within an >>>application."
So if I write:
int main()
{
system("ls | wc -l");
return 0;
}
Thats a script?
The "ls | wc -l" part is a script, passed off for execution to a
language that mainly supports scripting.
Note the non-scripting features here like "int main",
which doesn't /do/ anything, and typically the need to compile
and link this in order to run it.
No? What if I use popen() or execve() then? Where do you
draw the line?
If you use popen and execve, you're using more systems programming
functional blocks that are not scripting commands.
I'm not being obtuse. There is no hard dividing line between scripts and
Right now you're doubling down on obtusity, by my estimate.
(defun get-network-interface-list ()
(open-shared-library "iphlpapi.dll")
(let ((blk-size 65536) ;; crude!
(get-adapters-info (foreign-symbol-address "GetAdaptersInfo")))
(if get-adapters-info
(%stack-block ((blk blk-size))
(rlet ((len-inout #>ULONG blk-size))
(if (zerop (ff-call get-adapters-info :address blk
:address len-inout
#>DWORD))
(loop for ptr = blk then (pref ptr #>IP_ADAPTER_INFO.Next)
until (%null-ptr-p ptr)
collecting
(let ((alen (pref ptr #>IP_ADAPTER_INFO.AddressLength))
(addr (pref ptr #>IP_ADAPTER_INFO.Address))
(aname (pref ptr #>IP_ADAPTER_INFO.AdapterName))
(descr (pref ptr #>IP_ADAPTER_INFO.Description))
(iplist (pref ptr #>IP_ADAPTER_INFO.IpAddressList))
(type (pref ptr #>IP_ADAPTER_INFO.Type)))
(list type
(loop for i below alen
collecting (%get-unsigned-byte addr i)
into mac-bytes
finally
(return (mac-bytes-to-string mac-bytes)))
(get-ip-address-list iplist)
(%get-cstring aname)
(%get-cstring descr))))))))))
On Sat, 30 Mar 2024 18:46:50 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
(defun get-network-interface-list ()
(open-shared-library "iphlpapi.dll")
(let ((blk-size 65536) ;; crude!
(get-adapters-info (foreign-symbol-address "GetAdaptersInfo")))
(if get-adapters-info
(%stack-block ((blk blk-size))
(rlet ((len-inout #>ULONG blk-size))
(if (zerop (ff-call get-adapters-info :address blk
:address len-inout
#>DWORD))
(loop for ptr = blk then (pref ptr #>IP_ADAPTER_INFO.Next)
until (%null-ptr-p ptr)
collecting
(let ((alen (pref ptr #>IP_ADAPTER_INFO.AddressLength)) >> (addr (pref ptr #>IP_ADAPTER_INFO.Address))
(aname (pref ptr #>IP_ADAPTER_INFO.AdapterName)) >> (descr (pref ptr #>IP_ADAPTER_INFO.Description)) >> (iplist (pref ptr #>IP_ADAPTER_INFO.IpAddressList))
(type (pref ptr #>IP_ADAPTER_INFO.Type)))
(list type
(loop for i below alen
collecting (%get-unsigned-byte addr i)
into mac-bytes
finally
(return (mac-bytes-to-string mac-bytes)))
(get-ip-address-list iplist)
(%get-cstring aname)
(%get-cstring descr))))))))))
Ugh. No wonder the language fell out of fashion. Looks like some kind of hacked up Basic.
A scripting language is a programming language made for a hypothetical >machine, not too different from a programming language made for a real >machine, one made of hardware.
Muttley@dastardlyhq.com writes:
On Sat, 30 Mar 2024 18:46:50 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
(defun get-network-interface-list ()
(open-shared-library "iphlpapi.dll")
(let ((blk-size 65536) ;; crude!
(get-adapters-info (foreign-symbol-address "GetAdaptersInfo")))
(if get-adapters-info
(%stack-block ((blk blk-size))
(rlet ((len-inout #>ULONG blk-size))
(if (zerop (ff-call get-adapters-info :address blk
:address len-inout
#>DWORD))
(loop for ptr = blk then (pref ptr #>IP_ADAPTER_INFO.Next)
until (%null-ptr-p ptr)
collecting
(let ((alen (pref ptr #>IP_ADAPTER_INFO.AddressLength))
(addr (pref ptr #>IP_ADAPTER_INFO.Address))
(aname (pref ptr #>IP_ADAPTER_INFO.AdapterName)) >>> (descr (pref ptr #>IP_ADAPTER_INFO.Description)) >>> (iplist (pref ptr >#>IP_ADAPTER_INFO.IpAddressList))
(type (pref ptr #>IP_ADAPTER_INFO.Type)))
(list type
(loop for i below alen
collecting (%get-unsigned-byte addr i) >>> into mac-bytes
finally
(return (mac-bytes-to-string >mac-bytes)))
(get-ip-address-list iplist)
(%get-cstring aname)
(%get-cstring descr))))))))))
Ugh. No wonder the language fell out of fashion. Looks like some kind of
hacked up Basic.
Fashion and intelligence have never been very good friends.
On Fri, 29 Mar 2024 17:13:47 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
On 2024-03-29, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
On Fri, 29 Mar 2024 08:44:54 -0700
John Ames <commodorejohn@gmail.com> wrote:
On Fri, 29 Mar 2024 09:55:33 -0000 (UTC)
Muttley@dastardlyhq.com wrote:
My rule of thimb is that a scripting language is one whereby the
source code can be run immediately by the interpreter, eg perl,
python, regardless of what happens internally. A full fledged
programming language is one that requires a compile/debug/link step
first with the compiler and runtime (if required) being seperate. eg >>>>> Java, C
By *that* logic, even Lisp and Forth don't count as "full-fledged >>>>programming languages" o_O Johanne's definition of a "scripting
As a counter point, good luck writing a device driver in lisp.
The Lisp machines had operating systems and device drivers written in
Lisp, interrupt-driven and all. Where do you perceive the difficulty?
Were the mucky bits actually written in Lisp or was Lisp simply calling some routines written in assembler? In the same sense that Python doesn't actually "do" AI, its way too slow, the AI but is done in libraries written in C++ that
Python simply calls.
In a non-scripting programming language, the types often are
based on hardware, like "16 bit integer", and typing is often
handled in a static and rather strict way. Higher types, like
strings whose size can change at run time, are often missing.
Scripting languages handle the memory for you. In a scripting
language, you cannot call "malloc" to obtain the obligation to
free this piece of memory exactly once in the future. They are
garbage collected.
On Mon, 01 Apr 2024 06:49:48 -0300
Johanne Fairchild <jfairchild@tudado.org> wrote:
Muttley@dastardlyhq.com writes:
On Sat, 30 Mar 2024 18:46:50 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
(defun get-network-interface-list ()
(open-shared-library "iphlpapi.dll")
(let ((blk-size 65536) ;; crude!
(get-adapters-info (foreign-symbol-address "GetAdaptersInfo"))) >>>> (if get-adapters-info
(%stack-block ((blk blk-size))
(rlet ((len-inout #>ULONG blk-size))
(if (zerop (ff-call get-adapters-info :address blk
:address len-inout
#>DWORD))
(loop for ptr = blk then (pref ptr #>IP_ADAPTER_INFO.Next) >>>> until (%null-ptr-p ptr)
collecting
(let ((alen (pref ptr #>IP_ADAPTER_INFO.AddressLength))
(addr (pref ptr #>IP_ADAPTER_INFO.Address)) >>>> (aname (pref ptr #>IP_ADAPTER_INFO.AdapterName))
(descr (pref ptr #>IP_ADAPTER_INFO.Description))
(iplist (pref ptr >>#>IP_ADAPTER_INFO.IpAddressList))
(type (pref ptr #>IP_ADAPTER_INFO.Type)))
(list type
(loop for i below alen
collecting (%get-unsigned-byte addr i) >>>> into mac-bytes
finally
(return (mac-bytes-to-string >>mac-bytes)))
(get-ip-address-list iplist)
(%get-cstring aname)
(%get-cstring descr))))))))))
Ugh. No wonder the language fell out of fashion. Looks like some kind of >>> hacked up Basic.
Fashion and intelligence have never been very good friends.
Readability of the flow of control matters. God knows whats going on with
all those nested statements.
On 1 Apr 2024 14:16:33 GMT
ram@zedat.fu-berlin.de (Stefan Ram) wrote:
Scripting languages handle the memory for you. In a scripting
language, you cannot call "malloc" to obtain the obligation to
free this piece of memory exactly once in the future. They are
garbage collected.
And while this is pretty true of scripting languages, it doesn't make
for a good point-of-contrast with "non-scripting" languages; *piles* of
them include support for automatic memory management, and some (outside
of the C family) don't even include facilities for doing it "by hand."
Why is it important that there be a distinction between "scripting"
and "non-scripting" languages at all?
And while this is pretty true of scripting languages, it doesn't make
for a good point-of-contrast with "non-scripting" languages; *piles*
of them include support for automatic memory management, and some
(outside of the C family) don't even include facilities for doing it
"by hand."
And, in fact, C actually does one specific bit of automatic memory
management itself - the stack, which may or may not even *be* a true
hardware stack (depending on the architecture,) and which is handled in
an entirely transparent fashion* by compiler-generated entry/exit code >generated by the compiler for each function.
This stack "management" is "limited" in C:
|Stack overflow even can occur without function calls. For
|example, the program int main(void) { int a[10000000]; }
Ugh. No wonder the language fell out of fashion. Looks like some kind of hacked up Basic.
Scripting languages handle the memory for you.
On 1 Apr 2024 21:13:42 GMT
ram@zedat.fu-berlin.de (Stefan Ram) wrote:
This stack "management" is "limited" in C:
True enough, although as noted that's an implementation issue as much
as it is a limitation of the language spec. (I'm not sure how you could >handle that in a way that's both robust and reasonably C-ish...)
|Stack overflow even can occur without function calls. For
|example, the program int main(void) { int a[10000000]; }
John Ames <commodorejohn@gmail.com> wrote or quoted:
And, in fact, C actually does one specific bit of automatic memory >>management itself - the stack, which may or may not even *be* a true >>hardware stack (depending on the architecture,) and which is handled in
an entirely transparent fashion* by compiler-generated entry/exit code >>generated by the compiler for each function.
This stack "management" is "limited" in C:
|Unfortunately, the notion of stack overflow is not mentioned
|by the standard or the standard’s rationale at all. This is
|very troublesome, as for most actual implementations stack
|overflow is a real problem.
...
|in a real C implementation, a call like f(10000000) will not
|return 10000000, but instead will crash with a message like
|"segmentation fault". Furthermore, stack overflow does not
|necessarily have to result in a crash with a nice error
|message, but might also overwrite non-stack parts of the
|memory (possibly putting the address of virus code there).
|Stack overflow even can occur without function calls. For
|example, the program int main(void) { int a[10000000]; }
...
"Subtleties of the ANSI/ISO C standard" (2012); Robbert
Krebbers, Freek Wiedijk; Radboud University Nijmegen.
... the stack, which may or may not even *be* a true
hardware stack (depending on the architecture,) ...
Why is it important that there be a distinction between "scripting" and "non-scripting" languages at all?
Readability of the flow of control matters. God knows whats going on with
all those nested statements.
reading that indentation.
On Mon, 01 Apr 2024 21:26:19 -0300, Johanne Fairchild wrote:
reading that indentation.
If indentation is good, more indentation should be better.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Mon, 01 Apr 2024 21:26:19 -0300, Johanne Fairchild wrote:
reading that indentation.
If indentation is good, more indentation should be better.
No.
You don't seem to much of a Lisp writer. Lisp writers have no problem >reading that indentation.
( SETQ DIFF
( LAMBDA( X )
( COND
( ( ATOMP X )
( COND
( ( = X 'X )
1 )
( T
0 )))
( T
( COND
( ( =( CAR X )'SUM )
( LIST 'SUM( DIFF( CADR X ))( DIFF( CADDR X )))))))))
def diff( x ):
return 1 if x == 'x' else 0 if type( x )is str
else[ 'sum', diff( x[ 1 ]), diff( x[ 2 ])]
if x[ 0 ]== 'sum' else None
Why is it important that there be a distinction between "scripting"
and "non-scripting" languages at all?
On Mon, 01 Apr 2024 21:26:19 -0300, Johanne Fairchild wrote:
reading that indentation.
If indentation is good, more indentation should be better.
John Ames <commodorejohn@gmail.com> writes:
On 1 Apr 2024 21:13:42 GMT
ram@zedat.fu-berlin.de (Stefan Ram) wrote:
This stack "management" is "limited" in C:
True enough, although as noted that's an implementation issue as much
as it is a limitation of the language spec. (I'm not sure how you could >>handle that in a way that's both robust and reasonably C-ish...)
Modern (64-bit) linux systems leave large buffer zones (unmapped addresses) on either side of the stack; a stack overflow or underflow will
immediately fault if the RLIMIT_STACK value is exceeded.
It still protects writing to memory outside that buffer, right?
[snip]
On Tue, 2 Apr 2024 15:30:09 -0000 (UTC)
candycanearter07 <candycanearter07@candycanearter07.nomail.afraid>
wrote:
It still protects writing to memory outside that buffer, right?
[snip]
"Protecting memory" doesn't mean "no page fault," though, just that it
won't scribble all over some other process's memory.
But I am curious
how universally various freenix distributions these days just let the >application segfault vs. using that as a cue to allocate additional
stack space; a quick test with WSL (Debian somethingorother) runs that
test without complaint, but I don't have a genuine *nix box to hand to
try it with.
Johanne Fairchild <jfairchild@tudado.org> wrote or quoted:
You don't seem to much of a Lisp writer. Lisp writers have no problem >>reading that indentation.
Well, there is the expression "write-only code", which shows
that a good Lisp writer may not necessarily be a good reader.
This is an example of LISP code:
( SETQ DIFF
( LAMBDA( X )
( COND
( ( ATOMP X )
( COND
( ( = X 'X )
1 )
( T
0 )))
( T
( COND
( ( =( CAR X )'SUM )
( LIST 'SUM( DIFF( CADR X ))( DIFF( CADDR X )))))))))
. For someone who has not learned LISP, this is difficult to read,
/not/ because of the indentation, but because the words used have no
meaning for him. Without the indentation it would be harder to read.
ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted:
( SETQ DIFF
( LAMBDA( X )
( COND
( ( ATOMP X )
( COND
( ( = X 'X )
1 )
( T
0 )))
( T
( COND
( ( =( CAR X )'SUM )
( LIST 'SUM( DIFF( CADR X ))( DIFF( CADDR X )))))))))
In Python:
def diff( x ):
return 1 if x == 'x' else 0 if type( x )is str
else[ 'sum', diff( x[ 1 ]), diff( x[ 2 ])]
if x[ 0 ]== 'sum' else None
On Mon, 01 Apr 2024 21:26:19 -0300, Johanne Fairchild wrote:
reading that indentation.
If indentation is good, more indentation should be better.
John Ames <commodorejohn@gmail.com> writes:
On Tue, 2 Apr 2024 15:30:09 -0000 (UTC)
candycanearter07 <candycanearter07@candycanearter07.nomail.afraid>
wrote:
It still protects writing to memory outside that buffer, right?
[snip]
"Protecting memory" doesn't mean "no page fault," though, just that it >>won't scribble all over some other process's memory.
The regions each side of the stack are marked not-present. This supports automatic stack expansion, within the resource limit for the stack on
one side, and will produce a SIGSEGV or SIGBUS on the other end.
But I am curious
how universally various freenix distributions these days just let the >>application segfault vs. using that as a cue to allocate additional
stack space; a quick test with WSL (Debian somethingorother) runs that
test without complaint, but I don't have a genuine *nix box to hand to
try it with.
All linux will allocate space, up to the stack resource limit.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Mon, 01 Apr 2024 21:26:19 -0300, Johanne Fairchild wrote:
reading that indentation.
If indentation is good, more indentation should be better.
Too much of a good thing is a bad thing.
In article <87plv762zt.fsf@tudado.org>,
Johanne Fairchild <jfairchild@tudado.org> wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Mon, 01 Apr 2024 21:26:19 -0300, Johanne Fairchild wrote:
reading that indentation.
If indentation is good, more indentation should be better.
Too much of a good thing is a bad thing.
By definition. Because the definition of "too much" implies having crossed >into the zone of being a bad thing.
I would like to argue that there are things that there is no such thing as >too much of, but I can't think of any examples off hand.
gazelle@shell.xmission.com (Kenny McCormack) writes:
In article <87plv762zt.fsf@tudado.org>,
Johanne Fairchild <jfairchild@tudado.org> wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Mon, 01 Apr 2024 21:26:19 -0300, Johanne Fairchild wrote:
reading that indentation.
If indentation is good, more indentation should be better.
Too much of a good thing is a bad thing.
By definition. Because the definition of "too much" implies having crossed >> into the zone of being a bad thing.
I would like to argue that there are things that there is no such thing as >> too much of, but I can't think of any examples off hand.
Money?
gazelle@shell.xmission.com (Kenny McCormack) writes:...
I would like to argue that there are things that there is no such thing as >> too much of, but I can't think of any examples off hand.
Money?
ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted:
def diff( x ):
return 1 if x == 'x' else 0 if type( x )is str else[ 'sum', diff( x[
1 ]), diff( x[ 2 ])]
if x[ 0 ]== 'sum' else None
Oops! That was one long line starting with "return";
it was wrapped by the newsreader, but is not correct Python anymore
when wrapped this way.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Mon, 01 Apr 2024 21:26:19 -0300, Johanne Fairchild wrote:
reading that indentation.
If indentation is good, more indentation should be better.
Too much of a good thing is a bad thing.
By that same logic, if water is good, more water should be better. Tell
that to someone who is drowning.
... she was following a recommendation that she drink 8 glasses of water
a day "for her health".
On 2 Apr 2024 08:26:14 GMT, Stefan Ram wrote:
ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted:
def diff( x ):
return 1 if x == 'x' else 0 if type( x )is str else[ 'sum', diff( x[ >>> 1 ]), diff( x[ 2 ])]
if x[ 0 ]== 'sum' else None
Oops! That was one long line starting with "return";
it was wrapped by the newsreader, but is not correct Python anymore
when wrapped this way.
It’s bloody horrible Python even when wrapped correctly. I think Python’s version of the conditional expression is a complete abortion.
How about this, to at least get things the same way round as in the more usual C-style conditional expression:
def diff(x) :
return \
[
lambda :
[
lambda :
[
lambda : None,
lambda : ['sum', diff(x[1]), diff(x[2])],
][x[0] == 'sum'](),
lambda : 0,
][isinstance(x, str)](),
lambda : 1,
][x == 'x']()
#end diff
How about just writing Python code the way pretty much everyone else
writes Python code?
On Tue, 02 Apr 2024 15:20:06 -0300, Johanne Fairchild wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Mon, 01 Apr 2024 21:26:19 -0300, Johanne Fairchild wrote:
reading that indentation.
If indentation is good, more indentation should be better.
Too much of a good thing is a bad thing.
Should that principle be carried to excess, though?
John Ames <commodorejohn@gmail.com> writes:
On 1 Apr 2024 21:13:42 GMT
ram@zedat.fu-berlin.de (Stefan Ram) wrote:
This stack "management" is "limited" in C:
True enough, although as noted that's an implementation issue as much
as it is a limitation of the language spec. (I'm not sure how you could >>handle that in a way that's both robust and reasonably C-ish...)
Modern (64-bit) linux systems leave large buffer zones (unmapped addresses) on either side of the stack; a stack overflow or underflow will
immediately fault if the RLIMIT_STACK value is exceeded.
On 03/04/2024 02:23, Lawrence D'Oliveiro wrote:It's a real "Doc, it hurts when I do this!" situation.
It’s bloody horrible Python even when wrapped correctly. I think Python’s version of the conditional expression is a completeThat's probably the reason almost no one uses it. That post is the
abortion.
first time I have ever seen conditional expressions outside of a
brief mention in a tutorial on Python conditionals showing how to
write normal conditionals in the language. I think Python stole this
one from Perl.
On 03/04/2024 02:23, Lawrence D'Oliveiro wrote:
On 2 Apr 2024 08:26:14 GMT, Stefan Ram wrote:
ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted:It’s bloody horrible Python even when wrapped correctly. I think
def diff( x ):
return 1 if x == 'x' else 0 if type( x )is str else[ 'sum', diff( x[ >>>> 1 ]), diff( x[ 2 ])]
if x[ 0 ]== 'sum' else None
Oops! That was one long line starting with "return";
it was wrapped by the newsreader, but is not correct Python anymore
when wrapped this way.
Python’s version of the conditional expression is a complete
abortion.
That's probably the reason almost no one uses it. That post is the
first time I have ever seen conditional expressions outside of a brief mention in a tutorial on Python conditionals showing how to write
normal conditionals in the language. I think Python stole this one
from Perl.
David Brown <david.brown@hesbynett.no> writes:
On 03/04/2024 02:23, Lawrence D'Oliveiro wrote:
It’s bloody horrible Python even when wrapped correctly. I think
Python’s version of the conditional expression is a complete
abortion.
That's probably the reason almost no one uses it. That post is the
first time I have ever seen conditional expressions outside of a brief
mention in a tutorial on Python conditionals showing how to write
normal conditionals in the language. I think Python stole this one
from Perl.
No, Perl's conditional expressions use the same syntax as C's.
As for whether Python's conditional expression syntax, it's not clear
that (cond ? expr1 : expr2) is better or worse than (expr1 if cond else expr2) (unless you happen to be familiar with one of them).
David Brown <david.brown@hesbynett.no> writes:
On 03/04/2024 02:23, Lawrence D'Oliveiro wrote:
On 2 Apr 2024 08:26:14 GMT, Stefan Ram wrote:
ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted:It’s bloody horrible Python even when wrapped correctly. I think
def diff( x ):
return 1 if x == 'x' else 0 if type( x )is str else[ 'sum', diff( x[ >>>>> 1 ]), diff( x[ 2 ])]
if x[ 0 ]== 'sum' else None
Oops! That was one long line starting with "return";
it was wrapped by the newsreader, but is not correct Python anymore >>>> when wrapped this way.
Python’s version of the conditional expression is a complete
abortion.
That's probably the reason almost no one uses it. That post is the
first time I have ever seen conditional expressions outside of a brief
mention in a tutorial on Python conditionals showing how to write
normal conditionals in the language. I think Python stole this one
from Perl.
No, Perl's conditional expressions use the same syntax as C's.
As for whether Python's conditional expression syntax, it's not clear
that (cond ? expr1 : expr2) is better or worse than (expr1 if cond else expr2) (unless you happen to be familiar with one of them).
scott@slp53.sl.home (Scott Lurndal) writes:
John Ames <commodorejohn@gmail.com> writes:
On 1 Apr 2024 21:13:42 GMT
ram@zedat.fu-berlin.de (Stefan Ram) wrote:
This stack "management" is "limited" in C:
True enough, although as noted that's an implementation issue as much
as it is a limitation of the language spec. (I'm not sure how you could >>>handle that in a way that's both robust and reasonably C-ish...)
Modern (64-bit) linux systems leave large buffer zones (unmapped addresses) >> on either side of the stack; a stack overflow or underflow will
immediately fault if the RLIMIT_STACK value is exceeded.
...unless it’s exceeded by enough to reach some other mapped address.
https://blog.qualys.com/vulnerabilities-threat-research/2017/06/19/the-stack-clash
On 03/04/2024 18:00, Keith Thompson wrote:[...]
David Brown <david.brown@hesbynett.no> writes:
That's probably the reason almost no one uses it. That post is theNo, Perl's conditional expressions use the same syntax as C's.
first time I have ever seen conditional expressions outside of a brief
mention in a tutorial on Python conditionals showing how to write
normal conditionals in the language. I think Python stole this one
from Perl.
I am not very familiar with Perl, and don't know what are expressions
or statements. Perhaps I have been imagining things. I had the idea
that in Perl you could write "<do_this> if <condition>" as an
alternative to the more common imperative language ordering "if
<condition> then <do_this>".
As for whether Python's conditional expression syntax, it's not
clear
that (cond ? expr1 : expr2) is better or worse than (expr1 if cond else
expr2) (unless you happen to be familiar with one of them).
I think expr1 and expr2 belong naturally together, as you are
selecting one or the other. If you are using a short-circuit
evaluation, you would express it in words as "evaluate cond, and based
on that, evaluate either expr1 and expr2". Having "expr1" first is a
bit like a recipe that says "add the sugar to the egg whites, having
first beaten the egg whites". It is an ordering that does not suit
well in an imperative language (I know Python is multi-paradigm, but
it is basically imperative).
But I agree that familiarity could be a big factor in my subjective
opinion here.
David Brown <david.brown@hesbynett.no> writes:
On 03/04/2024 18:00, Keith Thompson wrote:[...]
David Brown <david.brown@hesbynett.no> writes:
That's probably the reason almost no one uses it. That post is theNo, Perl's conditional expressions use the same syntax as C's.
first time I have ever seen conditional expressions outside of a brief >>>> mention in a tutorial on Python conditionals showing how to write
normal conditionals in the language. I think Python stole this one
from Perl.
I am not very familiar with Perl, and don't know what are expressions
or statements. Perhaps I have been imagining things. I had the idea
that in Perl you could write "<do_this> if <condition>" as an
alternative to the more common imperative language ordering "if
<condition> then <do_this>".
Yes, but it's not the same thing. Perl has postfix conditionals, so you
can write:
statement if condition;
but that's a statement, not an expression, and there's no form
equivalent to if/else. It's a specific case of "statement modifiers",
where the keyword can be any of if, unless, while, until, for, foreach,
or when. (The latter is for an experimental "switch" feature, disabled
by default in recent releases.)
https://perldoc.perl.org/perlsyn#Statement-Modifiers
As for whether Python's conditional expression syntax, it's not
clear
that (cond ? expr1 : expr2) is better or worse than (expr1 if cond else
expr2) (unless you happen to be familiar with one of them).
I think expr1 and expr2 belong naturally together, as you are
selecting one or the other. If you are using a short-circuit
evaluation, you would express it in words as "evaluate cond, and based
on that, evaluate either expr1 and expr2". Having "expr1" first is a
bit like a recipe that says "add the sugar to the egg whites, having
first beaten the egg whites". It is an ordering that does not suit
well in an imperative language (I know Python is multi-paradigm, but
it is basically imperative).
But I agree that familiarity could be a big factor in my subjective
opinion here.
I don't have a strong opinion one way or the other, beyond a willingness
to accept the syntax and other rules of whatever language I'm using.
But I suggest that Python's "expr1 if condition else expr2" is intended
to emphasize expr1 over expr2, treating the condition being true as the "normal" case. That's not necessarily a bad thing.
On 03/04/2024 19:19, Keith Thompson wrote:
David Brown <david.brown@hesbynett.no> writes:
On 03/04/2024 18:00, Keith Thompson wrote:[...]
David Brown <david.brown@hesbynett.no> writes:
Yes, but it's not the same thing. Perl has postfix conditionals, soThat's probably the reason almost no one uses it. That post is theNo, Perl's conditional expressions use the same syntax as C's.
first time I have ever seen conditional expressions outside of a brief >>>>> mention in a tutorial on Python conditionals showing how to write
normal conditionals in the language. I think Python stole this one
from Perl.
I am not very familiar with Perl, and don't know what are expressions
or statements. Perhaps I have been imagining things. I had the idea
that in Perl you could write "<do_this> if <condition>" as an
alternative to the more common imperative language ordering "if
<condition> then <do_this>".
you
can write:
statement if condition;
but that's a statement, not an expression, and there's no form
equivalent to if/else. It's a specific case of "statement modifiers",
where the keyword can be any of if, unless, while, until, for, foreach,
or when. (The latter is for an experimental "switch" feature, disabled
by default in recent releases.)
OK. That's a lot more than I knew.
However, I don't see a relevant distinction between a statement and an expression as particularly significant here, at least in terms of code clarity.
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
David Brown <david.brown@hesbynett.no> writes:
On 03/04/2024 02:23, Lawrence D'Oliveiro wrote:
It’s bloody horrible Python even when wrapped correctly. I think
Python’s version of the conditional expression is a complete
abortion.
That's probably the reason almost no one uses it. That post is the
first time I have ever seen conditional expressions outside of a brief
mention in a tutorial on Python conditionals showing how to write
normal conditionals in the language. I think Python stole this one
from Perl.
No, Perl's conditional expressions use the same syntax as C's.
As for whether Python's conditional expression syntax, it's not clear
that (cond ? expr1 : expr2) is better or worse than (expr1 if cond else
expr2) (unless you happen to be familiar with one of them).
I’ve been familiar with both for years and I think the Python version is >awful; in particular the ordering is a bizarre choice. The PEP where
they worked out the design acknowledges this but then they went ahead
and did it anyway...
I’ve been familiar with both for years and I think the Python version is >awful; in particular the ordering is a bizarre choice.
And let me tell you, when you start getting into that kind of nested
stuff with not parentheses in view, even the "?:" notation can start
looking pretty darn mysterious to some folks.
On 4 Apr 2024 11:20:48 GMT, Stefan Ram wrote:
And let me tell you, when you start getting into that kind of nested
stuff with not parentheses in view, even the "?:" notation can start
looking pretty darn mysterious to some folks.
This is where indentation helps. E.g.
a =
b ?
c ? d : e
: f ?
g ? h : i
: j;
On Thu, 4 Apr 2024 23:29:21 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On 4 Apr 2024 11:20:48 GMT, Stefan Ram wrote:
And let me tell you, when you start getting into that kind of nested
stuff with not parentheses in view, even the "?:" notation can start
looking pretty darn mysterious to some folks.
This is where indentation helps. E.g.
a =
b ?
c ? d : e
: f ?
g ? h : i
: j;
Just use brackets. Saves a lot of pain.
On Thu, 4 Apr 2024 23:29:21 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On 4 Apr 2024 11:20:48 GMT, Stefan Ram wrote:
And let me tell you, when you start getting into that kind of nested
stuff with not parentheses in view, even the "?:" notation can start
looking pretty darn mysterious to some folks.
This is where indentation helps. E.g.
a =
b ?
c ? d : e
: f ?
g ? h : i
: j;
Just use brackets. Saves a lot of pain.
Or just use if blocks if it's too complex.
On 4 Apr 2024 11:20:48 GMT, Stefan Ram wrote:
And let me tell you, when you start getting into that kind of nested
stuff with not parentheses in view, even the "?:" notation can start
looking pretty darn mysterious to some folks.
This is where indentation helps. E.g.
a =
b ?
c ? d : e
: f ?
g ? h : i
: j;
On 05.04.2024 01:29, Lawrence D'Oliveiro wrote:
This is where indentation helps. E.g.Indentation generally helps.
a =
b ?
c ? d : e
: f ?
g ? h : i
: j;
The parenthesis are not used for grouping, but are the alternative
form for IF/THEN/ELSE/FI
On 05.04.2024 01:29, Lawrence D'Oliveiro wrote:
On 4 Apr 2024 11:20:48 GMT, Stefan Ram wrote:
And let me tell you, when you start getting into that kind of nested
stuff with not parentheses in view, even the "?:" notation can start
looking pretty darn mysterious to some folks.
This is where indentation helps. E.g.
a =
b ?
c ? d : e
: f ?
g ? h : i
: j;
Indentation generally helps. In above code (in my book) it's not
that clear [from the indentation], e.g. where the last ':' 'else'
belongs to. So I'd have lined the colons up with the respective
'?'. (YMMV.)
Not all languages differentiate (per syntax) a conditional command
from a conditional expression. Here are the two forms supported by
Algol for both, statements and expressions (here the examples are
both depicted for expressions only)
a :=
( b | ( c | d | e )
| ( f | ( g | h | i )
| j ) );
The parenthesis are not used for grouping, but are the alternative
form for IF/THEN/ELSE/FI
a := IF b
THEN
IF c THEN d ELSE e FI
ELSE
IF f THEN
IF g THEN h ELSE i FI
ELSE j FI
FI
Pick your choice depending on the case (or taste).
Here are the two forms supported by Algol ...
On Thu, 4 Apr 2024 23:29:21 -0000 (UTC) Lawrence D'Oliveiro
<ldo@nz.invalid> wrote:
This is where indentation helps. E.g.
a =
b ?
c ? d : e
: f ?
g ? h : i
: j;
Just use brackets. Saves a lot of pain.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Fri, 5 Apr 2024 09:17:37 -0000 (UTC), Muttley wrote:
...
>> a =
>> b ?
>> c ? d : e
>> : f ?
>> g ? h : i
>> : j;
>
> Just use brackets. Saves a lot of pain.
a=(b?(c?d:e):(f?(g?h:i):j));
A normal programmer would write something like:
a = b ? (c ? d : e) :
f ? (g ? h : i) :
j;
I.e., she would allow herself to use spaces and newlines, and just
enough parentheses to make the structure clear.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Fri, 5 Apr 2024 09:17:37 -0000 (UTC), Muttley wrote:
...
>> a =
>> b ?
>> c ? d : e
>> : f ?
>> g ? h : i
>> : j;
>
> Just use brackets. Saves a lot of pain.
a=(b?(c?d:e):(f?(g?h:i):j));
A normal programmer would write something like:
a = b ? (c ? d : e) :
f ? (g ? h : i) :
j;
I.e., she would allow herself to use spaces and newlines, and just
enough parentheses to make the structure clear.
On Fri, 5 Apr 2024 12:40:02 -0000 (UTC)
candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> wrote:
Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote at 09:17 this Friday >>(GMT):
On Thu, 4 Apr 2024 23:29:21 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On 4 Apr 2024 11:20:48 GMT, Stefan Ram wrote:
And let me tell you, when you start getting into that kind of nested >>>>> stuff with not parentheses in view, even the "?:" notation can start >>>>> looking pretty darn mysterious to some folks.
This is where indentation helps. E.g.
a =
b ?
c ? d : e
: f ?
g ? h : i
: j;
Just use brackets. Saves a lot of pain.
Or just use if blocks if it's too complex.
Indeed. It might not look as "l33t", but with modern compilers it'll end
up as the same assembler anyway.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Fri, 5 Apr 2024 09:17:37 -0000 (UTC), Muttley wrote:
...
>> a =
>> b ?
>> c ? d : e
>> : f ?
>> g ? h : i
>> : j;
>
> Just use brackets. Saves a lot of pain.
a=(b?(c?d:e):(f?(g?h:i):j));
A normal programmer would write something like:
a = b ? (c ? d : e) :
f ? (g ? h : i) :
j;
I.e., she would allow herself to use spaces and newlines, and just
enough parentheses to make the structure clear.
- Alan
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote or quoted:
On 05.04.2024 01:29, Lawrence D'Oliveiro wrote:
This is where indentation helps. E.g.Indentation generally helps.
a =
b ?
c ? d : e
: f ?
g ? h : i
: j;
Let me give it a try to find how I would indent that!
b?
c? d: e:
f?
g? h: i:
j;
The parenthesis are not used for grouping, but are the alternative
form for IF/THEN/ELSE/FI
It's funny how the discussion oscillates between
"too many parentheses" (LISP code) and "not enough parentheses"
("let me add some parens to improve readability").
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Fri, 5 Apr 2024 09:17:37 -0000 (UTC), Muttley wrote:
...
>> a =
>> b ?
>> c ? d : e
>> : f ?
>> g ? h : i
>> : j;
>
> Just use brackets. Saves a lot of pain.
a=(b?(c?d:e):(f?(g?h:i):j));
A normal programmer would write something like:
a = b ? (c ? d : e) :
f ? (g ? h : i) :
j;
I.e., she would allow herself to use spaces and newlines, and just
On 2024-04-05, Alan Bawden <alan@csail.mit.edu> wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Fri, 5 Apr 2024 09:17:37 -0000 (UTC), Muttley wrote:
...
>> a =
>> b ?
>> c ? d : e
>> : f ?
>> g ? h : i
>> : j;
>
> Just use brackets. Saves a lot of pain.
a=(b?(c?d:e):(f?(g?h:i):j));
A normal programmer would write something like:
a = b ? (c ? d : e) :
f ? (g ? h : i) :
j;
I.e., she would allow herself to use spaces and newlines, and just
enough parentheses to make the structure clear.
It looks good, undeniably.
However, I cannot tell at a glance whether or not the nice appearance
isn't telling me some kind of lie. That's an inherent problem with
the ternary operator.
I have to remember that = has lower precedence than ?:. But, ==
has higher precedence. So this careless edit makes it wrong,
even though it still looks just as nice:
a == b ? (c ? d : e) :
f ? (g ? h : i) :
j;
A lot of people think the layout of code should make the programmer's >intentions clear, and make it easy to see what the code does. That's
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote or quoted:
[ Algol syntax variants, keywords vs. parenthesis ("meek form" ?) ]
The parenthesis are not used for grouping, but are the alternative
form for IF/THEN/ELSE/FI
It's funny how the discussion oscillates between
"too many parentheses" (LISP code) and "not enough parentheses"
("let me add some parens to improve readability").
On Fri, 5 Apr 2024 18:30:12 +0200, Janis Papanagnou wrote:
Here are the two forms supported by Algol ...
Just a note, that’s Algol 68. In my time, “Algol” used unqualified was understood to refer to Algol 60.
I named it always explicitly as "Algol 60" and "Algol 68".
But at some instance of time I read somewhere that "Algol"
would "now" refer to Algol 68, so I changed my habit.
But since [LD'O's] post shows that this may not (not yet?) be
common usage I'll be more specific in future. - Thanks for
the hint!
On 06/04/2024 17:57, Janis Papanagnou wrote:
I named it always explicitly as "Algol 60" and "Algol 68".
But at some instance of time I read somewhere that "Algol"
would "now" refer to Algol 68, so I changed my habit.
Quite right. Algol 60 died, for all practical purposes,
half a century ago. Algol 68 may be a niche interest, but it is
still a nice language, and its [dwindling] band of adherents and practitioners still use it and prefer it to C and other more
recent languages.
But since [LD'O's] post shows that this may not (not yet?) be
common usage I'll be more specific in future. - Thanks for
the hint!
For how long? Does anyone still think that an unadorned
"Unix" must refer to 6th Edition [or earlier], "C" to K&R, "Fortran"
to Fortran IV, and so on? Clearly, there /are/ occasions when it is necessary to specify which version of a language/OS/computer/... is
being referred to, and there is often a change-over period of a few
years when an older version is still sufficiently current. But fifty
years is surely long enough to get used to the newer version!
On 06/04/2024 17:57, Janis Papanagnou wrote:
I named it always explicitly as "Algol 60" and "Algol 68".
But at some instance of time I read somewhere that "Algol"
would "now" refer to Algol 68, so I changed my habit.
Quite right. Algol 60 died, for all practical purposes,
half a century ago. Algol 68 may be a niche interest, but it is
still a nice language, and its [dwindling] band of adherents and practitioners still use it and prefer it to C and other more
recent languages.
I named it always explicitly as "Algol 60" and "Algol 68". But at some instance of time I read somewhere that "Algol" would "now" refer to
Algol 68, so I changed my habit.
Sure, Algol 60 is way beyond a museum piece by now. But remember, that was the one that spawned a great number of offshoots, namely the “Algol-like”
language family--or really, superfamily. That included Pascal and its own offshoots.
Algol 68 was a bit less influential in terms of language features
(I think
C “int”, “char”, “struct” and “union”, and the “long” and “short”
qualifiers came from there, and csh “if ... fi” as well), [...]
Algol 68 was a bit less influential in terms of language features [...]
See how many you can spot:
* “Elaboration” for the process of executing a program (including possibly
transforming from source form to an executable form)
* “Transput” instead of “input/output”
* “Heap” for an area in which memory may be dynamically allocated and
freed in no particular order
* “Overloading” for multiple context-dependent definitions of an operator * “Name” instead of “pointer” or “address”
* “Mode” instead of “data type”
* “Coercion” for a type conversion
* “Cast” for an explicit type conversion
* “Void” for a construct yielding no value
* “Dereferencing” for following a pointer
* “Slice” for a subarray of an array
* “Pragmat” for compiler directive (I think “pragma” is more common
nowadays.)
Lisp overloads them as block markers which simply makes the code more confusing, not less.
On 07.04.2024 00:57, Lawrence D'Oliveiro wrote:
* “Name” instead of “pointer” or “address”
Well, we had function parameters called "by name" before.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
At one time, we distinguished between “scripting” languages and
“programming” languages. [...] But there is one distinction that I
think is still relevant, and that is the one between shell/command
languages and programming languages.
[...]
Consider looking at a shell language like a domain-specific programming language. A shell is a programming language made specifically for
running programs. When you write a shell line, you're specifying the arguments of execve(2). In other words, a shell is a programming
language made to prepare the memory to be consumed by the system in a specific way---execve(2).
The downside is the loss of performance because of disk access for
trivial things like 'nfiles=$(ls | wc -l)'.
I suspect disk access times where
one of the reasons for the development of perl in the early 90s.
Sure, Algol 60 is way beyond a museum piece by now. But remember, that was the one that spawned a great number of offshoots, namely the “Algol-like”
language family--or really, superfamily. That included Pascal and its own offshoots.
Algol 68 was a bit less influential in terms of language features (I think
C “int”, “char”, “struct” and “union”, and the “long” and “short”
qualifiers came from there, and csh “if ... fi” as well), but it did seem
to introduce a bunch of new terminology, some of which caught on, others
did not. See how many you can spot:
* “Elaboration” for the process of executing a program (including possibly
transforming from source form to an executable form)
On Sun, 07 Apr 2024 00:01:43 +0000, Javier wrote:
The downside is the loss of performance because of disk access for
trivial things like 'nfiles=$(ls | wc -l)'.
Well, you could save one process creation by writing
“nfiles=$(echo * | wc -l)” instead. But that would still not be strictly correct.
But, WRT Algol 60 vs. Algol 68, these are quite different languages;
I wouldn't call the latter a new version.
Algol 60, OTOH, also had an own history and continued use after 1968;
to my knowledge it had been used in numerical mathematics [...].
But Algol 60, Simula, and also Algol 68 are all meaningless today, I
(sadly) dare to say.
On 06.04.2024 20:32, Andy Walker wrote:
But Algol 60, Simula, and also Algol 68 are all meaningless today, I
(sadly) dare to say. Maybe more than of "niche interest"? Can't tell.
I can see no argument for saying that [“Algol”], by default, refers to A60.
On 06/04/2024 22:54, Janis Papanagnou wrote:
But, WRT Algol 60 vs. Algol 68, these are quite different languages;
I wouldn't call the latter a new version.
I agree; OTOH, WG2.1 accepted A68 as the "new" Algol. The
instant question here was what an unadorned "Algol" means, and while
I can see an argument for saying that it shouldn't happen, I can see
no argument for saying that it, by default, refers to A60.
On Sat, 6 Apr 2024 08:58:45 -0000 (UTC), Muttley wrote:
Lisp overloads them as block markers which simply makes the code more
confusing, not less.
That’s because there is no fundamental difference between “blocks” and >whatever else it is you think those Lisp parentheses are used for.
If acknowledging the existence of female developers makes you
uncomfortable, you're just going to have to learn to deal with that
yourself. I'm not going to adjust my language to cater to your
insecurities.
I agree; OTOH, WG2.1 accepted A68 as the "new" Algol. The
instant question here was what an unadorned "Algol" means, and while
I can see an argument for saying that it shouldn't happen, I can see
no argument for saying that it, by default, refers to A60.
But Algol 60, Simula, and also Algol 68 are all meaningless today, I
(sadly) dare to say.
You're probably right. But A68G is still a nice language. It
creaks in places, and it's not suitable for everything [what is?]. But
it serves all my programming needs. It has the advantage, in practice,
over C that all the common programming blunders -- use of uninitialised variables, array accesses out of bounds, numerical overflow, dereferencing null pointers, memory leaks and consequences thereof, the things that
cause most of the security holes -- are picked up either by the compiler
or at run-time before they can do any damage. I expect there are modern languages that also do that, but at my age it's not worth learning a new language when the old one works perfectly well.
On Sun, 07 Apr 2024 06:04:16 -0400
Alan Bawden <alan@csail.mit.edu> wrote:
If acknowledging the existence of female developers makes you
uncomfortable, you're just going to have to learn to deal with that
yourself. I'm not going to adjust my language to cater to your
insecurities.
If my insecurities you mean acknowledging reality then fine. The thing about people like you is (and I don't believe the 50% thing, sorry) is that you would never use a male pronoun if talking about nurses or pre school teachers who are heavily biased towards women.
Even in the 21st century, articles like <https://seattlewebsitedevelopers.medium.com/algol-the-language-that-influenced-the-future-cfec9a3e2a4c>
can say
Generally called ALGOL 60, ALGOL had three major updates ...
On 08/04/2024 09:47, Muttley@dastardlyhq.com wrote:
On Sun, 07 Apr 2024 06:04:16 -0400
Alan Bawden <alan@csail.mit.edu> wrote:
If acknowledging the existence of female developers makes you
uncomfortable, you're just going to have to learn to deal with that
yourself. I'm not going to adjust my language to cater to your
insecurities.
If my insecurities you mean acknowledging reality then fine. The thing about >> people like you is (and I don't believe the 50% thing, sorry) is that you
would never use a male pronoun if talking about nurses or pre school teachers
who are heavily biased towards women.
What makes you so sure about that? Are you assuming that because /you/
are sexist, everyone else is?
It certainly encourages the writing of small modular tools. The
downside is the loss of performance because of disk access for trivial
things like 'nfiles=$(ls | wc -l)'. I suspect disk access times where
one of the reasons for the development of perl in the early 90s.
It’s like, I don’t know ... you’re trying to save space. Why?It's a matter of balance. Needlessly crunching things to fit onto a
It’s like programming inside an apartment block, instead of having a bungalow with a yard of your own.
On Sun, 07 Apr 2024 00:01:43 +0000
Javier <invalid@invalid.invalid> wrote:
the loss of performance because of disk access for trivial
things like 'nfiles=$(ls | wc -l)'. I suspect disk access times where
one of the reasons for the development of perl in the early 90s.
You really want either built-ins for a lot of basic commands, or a good scheme for caching commonly-used executables. AmigaDOS (a TriPOS
derivative) made it pretty trivial to set up a RAM disk and add that to
the search path, which made a big difference in performance since
almost nothing was built-in. Wouldn't be hard to do in *nix-land,
either, but it's an open question whether you'd gain anything over
modern generalized disk caching.
On Mon, 8 Apr 2024 14:35:48 +0200
David Brown <david.brown@hesbynett.no> wrote:
On 08/04/2024 09:47, Muttley@dastardlyhq.com wrote:
On Sun, 07 Apr 2024 06:04:16 -0400
Alan Bawden <alan@csail.mit.edu> wrote:
If acknowledging the existence of female developers makes you
uncomfortable, you're just going to have to learn to deal with that
yourself. I'm not going to adjust my language to cater to your
insecurities.
If my insecurities you mean acknowledging reality then fine. The thing about
people like you is (and I don't believe the 50% thing, sorry) is that you >>> would never use a male pronoun if talking about nurses or pre school teachers
who are heavily biased towards women.
What makes you so sure about that? Are you assuming that because /you/ >>are sexist, everyone else is?
An immediate fallacious ad hominem no doubt in order to prop up whatever straw men follow.
... compulsively indenting and
splitting across lines can get out of hand, too. It seems to me that a
lot of people in this age of "cinematic" aspect ratios and super-sized displays in personal computing forget that eye-travel isn't free, and spreading information across maximal space can make it *harder* to keep
track of context.
Hmm, wonder why hardly anyone outside academia used the language even back in
the day, never mind now....
Also, I suspect HD caching and the increase in HD speed was one of the reasons for the fall in popularity of Perl for writing small system automation tasks that could be done with just shell. But there were
another reasons, like the disapearance of diversity in the Unix OS
ecosystem.
Perl made easy to write portable scripts that could run on propietary
Unixen that came with slight incompatibilities in the command line tools (IRIX/Solaris/HP-UX/AIX, etc.)
There it is again: “maximal space”. The “space” is there to be used. Code may be one-dimensional, but you have a two-dimensional screen toLike I said: eye-travel. If the same amount of information is spread
display it, why not make use of that, if it makes a complex structure clearer?
for \This, for example. Most of your example is quite reasonable, but what
entry \
in \
get_each_record \
There it is again: “maximal space”. The “space” is there to be used. Code may be one-dimensional, but you have a two-dimensional screen to
display it, why not make use of that, if it makes a complex structure clearer?
Another example:
def fill_in_depreciations(tax_year) :
"(re)inserts depreciation entries for the specified tax year," \
" based on currently-entered assets."
sql.cursor.execute \
(
"delete from payments where kind = %s and tax_year = %s",
["D", tax_year]
)
for \
entry \
in \
get_each_record \
On 2024-04-08, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
On Mon, 8 Apr 2024 14:35:48 +0200
David Brown <david.brown@hesbynett.no> wrote:
On 08/04/2024 09:47, Muttley@dastardlyhq.com wrote:
What makes you so sure about that? Are you assuming that because /you/ >>>are sexist, everyone else is?
An immediate fallacious ad hominem no doubt in order to prop up whatever
straw men follow.
You wrote, "people like you ... would never use a male pronoun if
talking about nurses", written by you, is already ad hominem;
it's a direct accusation of hypocrisy, rather than focusing on the
argument content.
If you can't handle the ad-hominem ball returned to your court,
don't serve it!
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
There it is again: “maximal space”. The “space” is there to be used. >> Code may be one-dimensional, but you have a two-dimensional screen to
display it, why not make use of that, if it makes a complex structure
clearer?
Like I said: eye-travel. If the same amount of information is spread
out over a larger space, there comes a point where it's actually *more*
work to read, and it eventually becomes harder for the brain to keep
track of the relevant context as a result; the "flow" is broken.
On Mon, 8 Apr 2024 19:32:21 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
On 2024-04-08, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
On Mon, 8 Apr 2024 14:35:48 +0200
David Brown <david.brown@hesbynett.no> wrote:
On 08/04/2024 09:47, Muttley@dastardlyhq.com wrote:
What makes you so sure about that? Are you assuming that because /you/ >>>>are sexist, everyone else is?
An immediate fallacious ad hominem no doubt in order to prop up whatever >>> straw men follow.
You wrote, "people like you ... would never use a male pronoun if
talking about nurses", written by you, is already ad hominem;
it's a direct accusation of hypocrisy, rather than focusing on the
argument content.
Mine was correct in general, yours shows you don't understand the difference between sexism and realism.
On Mon, 8 Apr 2024 19:32:21 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
If you can't handle the ad-hominem ball returned to your court,
don't serve it!
In tennis spectators don't generally jump onto the court and return the ball.
John Ames <commodorejohn@gmail.com> writes:
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
There it is again: “maximal space”. The “space” is there to be used.
Code may be one-dimensional, but you have a two-dimensional screen to
display it, why not make use of that, if it makes a complex structure
clearer?
Like I said: eye-travel. If the same amount of information is spread
out over a larger space, there comes a point where it's actually *more*
work to read, and it eventually becomes harder for the brain to keep
track of the relevant context as a result; the "flow" is broken.
Also, the more it’s spread out, the less of it you can get on one
screen, and the resulting need for paging makes the medium-scale
structure a lot less clear.
John Ames <commodorejohn@gmail.com> writes:
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
There it is again: “maximal space”. The “space” is there to be used.
Code may be one-dimensional, but you have a two-dimensional screen to
display it, why not make use of that, if it makes a complex structure
clearer?
Like I said: eye-travel. If the same amount of information is spread
out over a larger space, there comes a point where it's actually *more*
work to read, and it eventually becomes harder for the brain to keep
track of the relevant context as a result; the "flow" is broken.
Also, the more it’s spread out, the less of it you can get on one
screen, and the resulting need for paging makes the medium-scale
structure a lot less clear.
Comments to say when your loop or functions end is another big red flag
that the layout is bad.
On Tue, 9 Apr 2024 10:11:09 +0200, David Brown wrote:
Comments to say when your loop or functions end is another big red flag
that the layout is bad.
Without #end comments: how easy is it to tell which lines belong to
the inner function, and which to the outer?
On Mon, 8 Apr 2024 19:32:21 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
On 2024-04-08, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
On Mon, 8 Apr 2024 14:35:48 +0200
David Brown <david.brown@hesbynett.no> wrote:
On 08/04/2024 09:47, Muttley@dastardlyhq.com wrote:
What makes you so sure about that? Are you assuming that because /you/ >>>>are sexist, everyone else is?
An immediate fallacious ad hominem no doubt in order to prop up whatever >>> straw men follow.
You wrote, "people like you ... would never use a male pronoun if
talking about nurses", written by you, is already ad hominem;
it's a direct accusation of hypocrisy, rather than focusing on the
argument content.
Mine was correct in general
Muttley@dastardlyhq.com writes:
On Mon, 8 Apr 2024 19:32:21 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
On 2024-04-08, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
On Mon, 8 Apr 2024 14:35:48 +0200
David Brown <david.brown@hesbynett.no> wrote:
On 08/04/2024 09:47, Muttley@dastardlyhq.com wrote:
What makes you so sure about that? Are you assuming that because /you/ >>>>>are sexist, everyone else is?
An immediate fallacious ad hominem no doubt in order to prop up whatever >>>> straw men follow.
You wrote, "people like you ... would never use a male pronoun if
talking about nurses", written by you, is already ad hominem;
it's a direct accusation of hypocrisy, rather than focusing on the >>>argument content.
Mine was correct in general
Only in your worldview.
FWIW, at the local A&E, the split is about 50-50.
On Tue, 09 Apr 2024 15:01:46 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
Muttley@dastardlyhq.com writes:
On Mon, 8 Apr 2024 19:32:21 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
On 2024-04-08, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote: >>>>> On Mon, 8 Apr 2024 14:35:48 +0200
David Brown <david.brown@hesbynett.no> wrote:
On 08/04/2024 09:47, Muttley@dastardlyhq.com wrote:
What makes you so sure about that? Are you assuming that because /you/ >>>>>>are sexist, everyone else is?
An immediate fallacious ad hominem no doubt in order to prop up whatever >>>>> straw men follow.
You wrote, "people like you ... would never use a male pronoun if >>>>talking about nurses", written by you, is already ad hominem;
it's a direct accusation of hypocrisy, rather than focusing on the >>>>argument content.
Mine was correct in general
Only in your worldview.
FWIW, at the local A&E, the split is about 50-50.
What local A&E? Here in the UK the vast majority of nurses are female whereas >with doctors its a more even mix.
Mine was correct in general
Only in your worldview.
FWIW, at the local A&E, the split is about 50-50.
What local A&E? Here in the UK the vast majority of nurses are female
whereas with doctors its a more even mix.
On Tue, 9 Apr 2024 15:09:01 -0000 (UTC)
Muttley@dastardlyhq.com wrote:
Mine was correct in general
Only in your worldview.
FWIW, at the local A&E, the split is about 50-50.
What local A&E? Here in the UK the vast majority of nurses are female
whereas with doctors its a more even mix.
"I was actually correct in a broadly objective sense, if you discount >attestations to the contrary because I don't feel they match my
specific experience" is a *special* breed of argument :|
On 09.04.2024 09:47, Richard Kettlewell wrote:
John Ames <commodorejohn@gmail.com> writes:
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
There it is again: “maximal space”. The “space” is there to be used.
Code may be one-dimensional, but you have a two-dimensional screen to
display it, why not make use of that, if it makes a complex structure
clearer?
Like I said: eye-travel. If the same amount of information is spread
out over a larger space, there comes a point where it's actually *more*
work to read, and it eventually becomes harder for the brain to keep
track of the relevant context as a result; the "flow" is broken.
Also, the more it’s spread out, the less of it you can get on one
screen, and the resulting need for paging makes the medium-scale
structure a lot less clear.
Add structuring code (e.g. using functions) to manage complexity
and make it possible to keep entities in appropriate sizes.
You could try doing what almost every other Python programmer does - use smaller functions and drop the silly line continuations.
On Tue, 9 Apr 2024 15:22:25 +0200, David Brown wrote:
You could try doing what almost every other Python programmer does - use
smaller functions and drop the silly line continuations.
Fine. Try that with the example I gave.
ITYM "he" would allow HIMself.
On 07.04.2024 23:05, Lawrence D'Oliveiro wrote:
Even in the 21st century, articles likeAn extremely badly written article in *all* aspects (form, content,
<https:// [... snipped, to avoid giving it more publicity -- ANW]
facts, quality, etc.).
Muttley@dastardlyhq.com writes:
[...]
ITYM "he" would allow HIMself.
I am looking forward with great eagerness to this subthread dying out,
and I encourage everyone to help make that happen.
On 08/04/2024 13:53, Janis Papanagnou wrote:
On 07.04.2024 23:05, Lawrence D'Oliveiro wrote:
Even in the 21st century, articles likeAn extremely badly written article in *all* aspects (form, content,
<https:// [... snipped, to avoid giving it more publicity -- ANW]
facts, quality, etc.).
Agreed. I think it is a prime candidate for the worst serious supposedly-scientific web page I've ever seen.
If it was written by a
12yo with access to ChatGPT, that would not surprise me.
It has two
indirect redeeming features:
-- It pointed me at "https://opensource.com/article/20/6/algol68",
which /is/ worth reading.
-- Its list of the A60 committee members prompted me to check, and I
found, somewhat to my surprise, that one of them, Mike Woodger,
who I worked with briefly nearly 50 years ago, is still alive, aged
101. Having recently seen a couple of new scientific papers by F. G.
Smith, the former Astronomer Royal, aged 100, perhaps we are entering
a new era of golden oldies? Richard Guy made it to 103, and was still
working past his century. I know of a fair number of nonagenarians,
not least Tom Lehrer [96 yesterday], but [mostly] not whether they are
still active.
[ Friedrich L. Bauer ] - He died 9 years ago at age of 91.
Two weeks ago would have been his centenary!
Janis
I don't worry about that anymore. My bash scripts run blazing fast
in my laptop with an SSD.
I guess it was an issue at the time Perl
appeared (1987), although TBH I didn't experience it myself, since at
that time I wasn't a Unix user.
Also, I suspect HD caching and the increase in HD speed was one of the reasons for the fall in popularity of Perl for writing small system automation tasks that could be done with just shell. But there were
another reasons, like the disapearance of diversity in the Unix OS ecosystem. Perl made easy to write portable scripts that could run on propietary Unixen that came with slight incompatibilities in the command line tools (IRIX/Solaris/HP-UX/AIX, etc.)
Perhaps somebody here who uses (or used to use) Perl for system
automation tasks can tell us more about their personal reasons
for prefering (or used to prefer) Perl over shell.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Sun, 07 Apr 2024 00:01:43 +0000, Javier wrote:
The downside is the loss of performance because of disk access for
trivial things like 'nfiles=$(ls | wc -l)'.
Well, you could save one process creation by writing
“nfiles=$(echo * | wc -l)” instead. But that would still not be strictly
correct.
If that saves a process, it's because echo is builtin.
But it will set
$nfiles to 1 (unless you happen to have files with newlines in their
names). Both skip hidden files, which may or may not be what you want.
[...]
Python:
There should be one - and preferably only one - obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 916 |
Nodes: | 10 (1 / 9) |
Uptime: | 04:16:28 |
Calls: | 12,174 |
Calls today: | 4 |
Files: | 186,522 |
Messages: | 2,234,901 |