Re: Python (was Re: I did not inhale)

Liste des GroupesRevenir à cl misc 
Sujet : Re: Python (was Re: I did not inhale)
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.misc
Date : 22. Aug 2024, 18:36:04
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240822102243.459@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-08-22, Bart <bc@freeuk.com> wrote:
On 22/08/2024 16:28, Kaz Kylheku wrote:
On 2024-08-22, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
On 2024-08-22 13:00, David Brown wrote:
>
Then there are those that - wisely or unwisely - program in C for
Windows, without POSIX.
>
Yes, that is true. There is no reason to use POSIX under Windows,
whatsoever.
 
David also wrote this, in the same comment:
 
It takes but one single counter-example to invalidate general claims
like this.
 
It applies to your reply as well.
 
There are excellent, excellent reasons to use POSIX under Windows.
 
Such as, oh, having an entire POSIX appliation ported to Windows
almost without lifting a finger.
 
For the TXR project I use a POSIX layer called Cygnal (see signature
below). It gives a decent Windows port which preserves most of the
functionality. All the POSIX stuff in the TXR Lisp standard library just
works. The interactive listener ("REPL") with history and editing just
works, right in your cmd.exe console.
 
>
You can use the same argument to justify using X11 under Windows.

I could use a similar argument, but it would lack nuance.

Using X11 under Windows requires a server component, which is
somewhat clunky for a stand-alone application to carry.

X11 windows will not integrate nicely into the Windows desktop as
native windows with native widgets and behaviors.

Most POSIX stuff does translate nicely to the Windows environment, largely
because Windows was aped after Unix.

(It's also not clear how well your product manages to use POSIX under
pure Windows, or whether you have to drag this other thing called 'CygWin'.

It relies on a DLL, which is a modified/forked version of the Cygwin
DLL, named cygwin1.dll. This just sits in the same directory as the main
executable.

If you wrote a program with Microsoft Visual C, and dynamically linked
it to its run-time, you'd have the same thing: your executable and a
redistributable run-time.

The cygwin1.dll provides C stuff: malloc, printf, sin, cos, ...
Plus POSIX stuff: glob, ftw, fork, dup2, stat, tcgetattr, ...

Can you write a normal Windows app and just call into a DLL called
posix.dll or is there an extra layer or two involved?)

You can use Win32 calls (into kernel32.dll, user32.dll, ...) along side
all that stuff from cygwin1.dll, just like you can use Win32 calls in a
program linked to MSVC redistributable run-time.

Here is an example TXR Lisp program that I use for turning a laptop
monitor off. It's saved as "monitor-off.tl", where the .tl suffix
has the correct association that I can launch it by double clicking on
it.

The (usleep ...) call is implemented using POSIX functions.

(typedef HWND (cptr HWND))
(typedef UINT uint)
(typedef LPARAM long)
(typedef WPARAM ulong)

(defsymacro SC_MONITORPOWER #xF170)

(defsymacro WM_SYSCOMMAND #x0112)

(defsymacro MONITOR_OFF 2)

(defvarl HWND_BROADCAST (cptr-int -1 'HWND))

(with-dyn-lib "user32.dll"
  (deffi PostMessage "PostMessageW"
         int (HWND UINT WPARAM LPARAM)))

(usleep 2000000)

(PostMessage HWND_BROADCAST WM_SYSCOMMAND SC_MONITORPOWER MONITOR_OFF)

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Date Sujet#  Auteur
15 Aug 24 * Re: I did not inhale256Kalevi Kolttonen
16 Aug 24 `* Re: Python (was Re: I did not inhale)255Lawrence D'Oliveiro
16 Aug 24  +* Re: Python (was Re: I did not inhale)250Kaz Kylheku
16 Aug 24  i`* Re: Python (was Re: I did not inhale)249Kalevi Kolttonen
16 Aug 24  i +* Re: Python (was Re: I did not inhale)2John Ames
17 Aug 24  i i`- Re: Python (was Re: I did not inhale)1D
17 Aug 24  i +* Re: Python (was Re: I did not inhale)64Muttley
17 Aug 24  i i+* Re: Python (was Re: I did not inhale)61Dmitry A. Kazakov
17 Aug 24  i ii+* Re: Python (was Re: I did not inhale)58Lawrence D'Oliveiro
18 Aug 24  i iii`* Re: Python (was Re: I did not inhale)57Dmitry A. Kazakov
18 Aug 24  i iii +* Re: Python (was Re: I did not inhale)14Muttley
18 Aug 24  i iii i`* Re: Python (was Re: I did not inhale)13Dmitry A. Kazakov
18 Aug 24  i iii i `* Re: Python (was Re: I did not inhale)12Muttley
18 Aug 24  i iii i  +* Re: Python (was Re: I did not inhale)10Dmitry A. Kazakov
18 Aug 24  i iii i  i+* Re: Python (was Re: I did not inhale)2Kaz Kylheku
18 Aug 24  i iii i  ii`- Re: Python (was Re: I did not inhale)1Dmitry A. Kazakov
19 Aug 24  i iii i  i+- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
19 Aug 24  i iii i  i+- Re: Python (was Re: I did not inhale)1Muttley
25 Aug 24  i iii i  i`* Re: Python (was Re: I did not inhale)5Sebastian
25 Aug 24  i iii i  i `* Re: Python (was Re: I did not inhale)4Dmitry A. Kazakov
25 Aug 24  i iii i  i  +* Re: Python (was Re: I did not inhale)2vallor
25 Aug 24  i iii i  i  i`- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
25 Aug 24  i iii i  i  `- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
18 Aug 24  i iii i  `- Re: Python (was Re: I did not inhale)1Richard Kettlewell
18 Aug 24  i iii +* Re: Python (was Re: I did not inhale)2Kenny McCormack
18 Aug 24  i iii i`- Re: Python (was Re: I did not inhale)1Muttley
18 Aug 24  i iii +* Re: Python (was Re: I did not inhale)5Kaz Kylheku
18 Aug 24  i iii i`* Re: Python (was Re: I did not inhale)4Dmitry A. Kazakov
19 Aug 24  i iii i `* Re: Python (was Re: I did not inhale)3Kaz Kylheku
19 Aug 24  i iii i  `* Re: Python (was Re: I did not inhale)2Dmitry A. Kazakov
19 Aug 24  i iii i   `- Re: Python (was Re: I did not inhale)1Kaz Kylheku
19 Aug 24  i iii `* Re: Python (was Re: I did not inhale)35Lawrence D'Oliveiro
19 Aug 24  i iii  `* Re: Python (was Re: I did not inhale)34Dmitry A. Kazakov
19 Aug 24  i iii   +* Re: Python (was Re: I did not inhale)23David Brown
19 Aug 24  i iii   i+* Re: Python (was Re: I did not inhale)21Dmitry A. Kazakov
19 Aug 24  i iii   ii+* Re: Python (was Re: I did not inhale)4Muttley
19 Aug 24  i iii   iii`* Re: Python (was Re: I did not inhale)3Dmitry A. Kazakov
19 Aug 24  i iii   iii +- Re: Python (was Re: I did not inhale)1Muttley
30 Sep 24  i iii   iii `- Re: Python (was Re: I did not inhale)1Bozo User
19 Aug 24  i iii   ii+* Re: Python (was Re: I did not inhale)12David Brown
20 Aug 24  i iii   iii`* Re: Python (was Re: I did not inhale)11Dmitry A. Kazakov
20 Aug 24  i iii   iii +* Re: Python (was Re: I did not inhale)3Lawrence D'Oliveiro
20 Aug 24  i iii   iii i`* Re: Python (was Re: I did not inhale)2Dmitry A. Kazakov
21 Aug 24  i iii   iii i `- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
20 Aug 24  i iii   iii `* Re: Python (was Re: I did not inhale)7David Brown
20 Aug 24  i iii   iii  `* Re: Python (was Re: I did not inhale)6Dmitry A. Kazakov
20 Aug 24  i iii   iii   +* Re: Python (was Re: I did not inhale)2David Brown
20 Aug 24  i iii   iii   i`- Re: Python (was Re: I did not inhale)1Dmitry A. Kazakov
21 Aug 24  i iii   iii   `* Re: Python (was Re: I did not inhale)3Lawrence D'Oliveiro
21 Aug 24  i iii   iii    `* Re: Python (was Re: I did not inhale)2Dmitry A. Kazakov
22 Aug 24  i iii   iii     `- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
19 Aug 24  i iii   ii`* Re: Python (was Re: I did not inhale)4Keith Thompson
19 Aug 24  i iii   ii `* Re: Python (was Re: I did not inhale)3John Ames
20 Aug 24  i iii   ii  +- Re: Python (was Re: I did not inhale)1Muttley
20 Aug 24  i iii   ii  `- Re: Python (was Re: I did not inhale)1Stefan Ram
19 Aug 24  i iii   i`- Re: Python (was Re: I did not inhale)1Bart
19 Aug 24  i iii   +* Re: Python (was Re: I did not inhale)8Lawrence D'Oliveiro
19 Aug 24  i iii   i`* Re: Python (was Re: I did not inhale)7Dmitry A. Kazakov
19 Aug 24  i iii   i +* Re: Python (was Re: I did not inhale)2Keith Thompson
19 Aug 24  i iii   i i`- Re: Python (was Re: I did not inhale)1Dmitry A. Kazakov
20 Aug 24  i iii   i `* Re: Python (was Re: I did not inhale)4Lawrence D'Oliveiro
20 Aug 24  i iii   i  `* Re: Python (was Re: I did not inhale)3Dmitry A. Kazakov
20 Aug 24  i iii   i   +- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
20 Aug 24  i iii   i   `- Re: Python (was Re: I did not inhale)1D
21 Aug 24  i iii   `* Re: Python (was Re: I did not inhale)2vallor
21 Aug 24  i iii    `- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
18 Aug 24  i ii+- Re: Python (was Re: I did not inhale)1Muttley
18 Aug 24  i ii`- Re: Python (was Re: I did not inhale)1Eric Pozharski
18 Aug 24  i i`* Re: Python (was Re: I did not inhale)2David Brown
18 Aug 24  i i `- Re: Python (was Re: I did not inhale)1Muttley
18 Aug 24  i `* Re: Python (was Re: I did not inhale)182David Brown
18 Aug 24  i  +* C function prototype was Python (was Re: I did not inhale)2James Harris
18 Aug 24  i  i`- Re: C function prototype was Python (was Re: I did not inhale)1David Brown
18 Aug 24  i  +* Re: Python (was Re: I did not inhale)2Keith Thompson
19 Aug 24  i  i`- Re: Python (was Re: I did not inhale)1David Brown
20 Aug 24  i  `* Re: Python (was Re: I did not inhale)177Kalevi Kolttonen
20 Aug 24  i   +* Re: Python (was Re: I did not inhale)3Muttley
20 Aug 24  i   i+- Re: Python (was Re: I did not inhale)1Lew Pitcher
20 Aug 24  i   i`- Re: Python (was Re: I did not inhale)1Kalevi Kolttonen
20 Aug 24  i   +* Re: Python (was Re: I did not inhale)170David Brown
20 Aug 24  i   i`* Re: Python (was Re: I did not inhale)169Kalevi Kolttonen
21 Aug 24  i   i +* Re: Python (was Re: I did not inhale)161David Brown
21 Aug 24  i   i i+* Re: Python (was Re: I did not inhale)142Muttley
21 Aug 24  i   i ii`* Re: Python (was Re: I did not inhale)141David Brown
21 Aug 24  i   i ii `* Re: Python (was Re: I did not inhale)140Muttley
21 Aug 24  i   i ii  `* Re: Python (was Re: I did not inhale)139David Brown
21 Aug 24  i   i ii   `* Re: Python (was Re: I did not inhale)138Muttley
21 Aug 24  i   i ii    `* Re: Python (was Re: I did not inhale)137David Brown
22 Aug 24  i   i ii     `* Re: Python (was Re: I did not inhale)136Muttley
22 Aug 24  i   i ii      +* Re: Python (was Re: I did not inhale)6D
22 Aug 24  i   i ii      i+* Re: Python (was Re: I did not inhale)4Muttley
22 Aug 24  i   i ii      ii`* Re: Python (was Re: I did not inhale)3D
22 Aug 24  i   i ii      ii `* Re: Python (was Re: I did not inhale)2Lew Pitcher
22 Aug 24  i   i ii      ii  `- Re: Python (was Re: I did not inhale)1Muttley
22 Aug 24  i   i ii      i`- Re: Python (was Re: I did not inhale)1David Brown
22 Aug 24  i   i ii      `* Re: Python (was Re: I did not inhale)129David Brown
22 Aug 24  i   i ii       +* Re: Python (was Re: I did not inhale)120Muttley
26 Aug 24  i   i ii       i`* Re: Python (was Re: I did not inhale)119John Ames
26 Aug 24  i   i ii       i +- Re: Python (was Re: I did not inhale)1Muttley
26 Aug 24  i   i ii       i `* Re: Python (was Re: I did not inhale)117Lawrence D'Oliveiro
26 Aug 24  i   i ii       i  +* Re: Python (was Re: I did not inhale)113John Ames
26 Aug 24  i   i ii       i  +* Re: Python (was Re: I did not inhale)2Bart
27 Aug 24  i   i ii       i  `- Re: Python (was Re: I did not inhale)1Kaz Kylheku
22 Aug 24  i   i ii       `* Re: Python (was Re: I did not inhale)8Lawrence D'Oliveiro
21 Aug 24  i   i i`* Re: Python (was Re: I did not inhale)18Lawrence D'Oliveiro
21 Aug 24  i   i `* Re: Python (was Re: I did not inhale)7Muttley
21 Aug 24  i   `* Re: Python (was Re: I did not inhale)3Lawrence D'Oliveiro
16 Aug 24  `* Re: Python (was Re: I did not inhale)4Kalevi Kolttonen

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal