• Python/C/Pascal ... How To Choose ?

    From c186282@[email protected] to comp.os.linux.misc on Sat Nov 8 02:01:12 2025
    From Newsgroup: comp.os.linux.misc

    I posted recently on a simple video recording pgm
    that mostly uses ffmpeg to get it done. Re-did
    the other day, it's really good now.

    However, just because, I started a 'C' and Pascal
    version.

    The ffmpeg command line required is long and
    complicated. Some literal stuff, some vars.
    Then I remember that 'C' is a total BASTARD
    when it comes to strings.

    Have done complicated 'C' apps that fool with
    complicated strings - but didn't LIKE it.

    Pascal is much easier with strings ... easy
    concats and such. Some of the number->string
    stuff is a bit weird, but nothing as bad as 'C'.

    SO ...... I'm going to abandon the 'C' version
    and make a Free Pascal basic pgm instead. Don't
    know if it will be simpler/faster right now, but
    due to the requirements WILL be easier than 'C',
    and far fewer chances of weird errors.

    Frankly, at this point, I like Python. Yea, it's
    interpreted, ergo a bit slow, but it has a LOT
    of conveniences that make up for that most
    of the time.

    Note neither 'C' or FP have a straight-up
    equiv for 'sleep()'. This is critical to
    my app. Turbo had something like it ... but
    it was like a legacy lib and not sure to
    be as accurate or versatile as Python sleep().

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Diego Garcia@[email protected] to comp.os.linux.misc on Sat Nov 8 11:31:22 2025
    From Newsgroup: comp.os.linux.misc

    On Sat, 8 Nov 2025 02:01:12 -0500, c186282 wrote:


    The ffmpeg command line required is long and
    complicated. Some literal stuff, some vars.
    Then I remember that 'C' is a total BASTARD
    when it comes to strings.

    Have done complicated 'C' apps that fool with
    complicated strings - but didn't LIKE it.


    That's why there are option parsers like "getopt()"
    or "getopt_long()" from GLIBC.

    Then there are libraries like "popt:"

    <https://github.com/rpm-software-management/popt>

    Digitally speaking, strings are a very unnatural construct
    and that's why C doesn't deal with them in a "nice" fashion.

    But then that's what C libraries are for.

    And that's why incompetent programmers flock to Python.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From ram@[email protected] (Stefan Ram) to comp.os.linux.misc on Sat Nov 8 12:03:43 2025
    From Newsgroup: comp.os.linux.misc

    Diego Garcia <[email protected]> wrote or quoted:
    And that's why incompetent programmers flock to Python.

    If "incompetent programmers" built most of the modern AI, data
    science, and automation pipelines using Python - the same language
    through which most research and real-world models are prototyped,
    trained, and deployed - what does that make everyone else?


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Diego Garcia@[email protected] to comp.os.linux.misc on Sat Nov 8 12:15:58 2025
    From Newsgroup: comp.os.linux.misc

    On 8 Nov 2025 12:03:43 GMT, Stefan Ram wrote:

    Diego Garcia <[email protected]> wrote or quoted:
    And that's why incompetent programmers flock to Python.

    If "incompetent programmers" built most of the modern AI, data
    science, and automation pipelines using Python - the same language
    through which most research and real-world models are prototyped,
    trained, and deployed - what does that make everyone else?


    Python is written in the C language.

    What does that tell you?


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Sat Nov 8 13:28:12 2025
    From Newsgroup: comp.os.linux.misc

    On 2025-11-08 08:01, c186282 wrote:


    Note neither 'C' or FP have a straight-up
    equiv for 'sleep()'. This is critical to
    my app. Turbo had something like it ... but
    it was like a legacy lib and not sure to
    be as accurate or versatile as Python sleep().

    What do you want to do with sleep?

    FreePascal has sleep() and fpSleep().
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Sat Nov 8 13:32:24 2025
    From Newsgroup: comp.os.linux.misc

    On 2025-11-08 13:15, Diego Garcia wrote:
    On 8 Nov 2025 12:03:43 GMT, Stefan Ram wrote:

    Diego Garcia <[email protected]> wrote or quoted:
    And that's why incompetent programmers flock to Python.

    If "incompetent programmers" built most of the modern AI, data
    science, and automation pipelines using Python - the same language
    through which most research and real-world models are prototyped,
    trained, and deployed - what does that make everyone else?


    Python is written in the C language.

    What does that tell you?

    Nothing.
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From ram@[email protected] (Stefan Ram) to comp.os.linux.misc on Sat Nov 8 12:44:40 2025
    From Newsgroup: comp.os.linux.misc

    Diego Garcia <[email protected]> wrote or quoted:
    Python is written in the C language.

    Python is a programming language. Programming languages are not
    written in anything. It is programming language /specifications/
    or /implementations/ that are written in some language.

    The specification of Python is written in English.

    There is one implementation of Python written in C indeed, viz.,
    "CPython". Other implementation are written in Python itself (PyPy,
    partially faster than CPython!), Java (Jython), or C# (IronPython).

    So, you got that totally wrong.

    What does that tell you?


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From The Natural Philosopher@[email protected] to comp.os.linux.misc on Sat Nov 8 12:45:51 2025
    From Newsgroup: comp.os.linux.misc

    On 08/11/2025 12:28, Carlos E.R. wrote:
    On 2025-11-08 08:01, c186282 wrote:


    Note neither 'C' or FP have a straight-up
    equiv for 'sleep()'. This is critical to
    my app. Turbo had something like it ... but
    it was like a legacy lib and not sure to
    be as accurate or versatile as Python sleep().

    What do you want to do with sleep?

    FreePascal has sleep() and fpSleep().

    C has sleep() and usleep().
    --
    Labour - a bunch of rich people convincing poor people to vote for rich
    people by telling poor people that "other" rich people are the reason
    they are poor.

    Peter Thompson

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From The Natural Philosopher@[email protected] to comp.os.linux.misc on Sat Nov 8 12:50:13 2025
    From Newsgroup: comp.os.linux.misc

    On 08/11/2025 12:44, Stefan Ram wrote:
    Diego Garcia <[email protected]> wrote or quoted:
    Python is written in the C language.

    Python is a programming language. Programming languages are not
    written in anything. It is programming language /specifications/
    or /implementations/ that are written in some language.

    The specification of Python is written in English.

    There is one implementation of Python written in C indeed, viz.,
    "CPython". Other implementation are written in Python itself (PyPy,
    partially faster than CPython!), Java (Jython), or C# (IronPython).

    So, you got that totally wrong.

    What does that tell you?


    That you have some axe to grind that I am not even interested in
    discovering the nature of.
    --
    Labour - a bunch of rich people convincing poor people to vote for rich
    people by telling poor people that "other" rich people are the reason
    they are poor.

    Peter Thompson

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Diego Garcia@[email protected] to comp.os.linux.misc on Sat Nov 8 12:57:58 2025
    From Newsgroup: comp.os.linux.misc

    On 8 Nov 2025 12:44:40 GMT, Stefan Ram wrote:


    Python is a programming language. Programming languages are not
    written in anything.


    Ha, ha, ha, ha, ha, ha, ha, ha!

    Download the Python source:

    <https://www.python.org/downloads/source/>

    What do you find inside the tarballs? There are C source
    files all over the place.

    Python is written entirely in the C language.


    So, you got that totally wrong.

    What does that tell you?


    It tells me that you are an ignoramus idiot that desperately
    wants to defend Python because Python defends ignoramus
    idiots.


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Carlos E.R.@[email protected] to comp.os.linux.misc on Sat Nov 8 14:35:19 2025
    From Newsgroup: comp.os.linux.misc

    On 2025-11-08 13:45, The Natural Philosopher wrote:
    On 08/11/2025 12:28, Carlos E.R. wrote:
    On 2025-11-08 08:01, c186282 wrote:


    Note neither 'C' or FP have a straight-up
    equiv for 'sleep()'. This is critical to
    my app. Turbo had something like it ... but
    it was like a legacy lib and not sure to
    be as accurate or versatile as Python sleep().

    What do you want to do with sleep?

    FreePascal has sleep() and fpSleep().

    C has sleep() and usleep().

    Freepascal too, but doc doesn't say what it does.

    https://www.freepascal.org/daily/packages/libc/libc/usleep.html

    usleep

    Declaration

    Source position: unistdh.inc line 64

    function usleep(

    __useconds: __useconds_t

    ):LongInt;


    I also see FpNanoSleep.

    <https://www.freepascal.org/docs-html/rtl/baseunix/fpnanosleep.html>

    (this one documented properly)
    --
    Cheers, Carlos.
    ES🇪🇸, EU🇪🇺;
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From ram@[email protected] (Stefan Ram) to comp.os.linux.misc on Sat Nov 8 13:51:08 2025
    From Newsgroup: comp.os.linux.misc

    Diego Garcia <[email protected]> wrote or quoted:
    It tells me that you are an ignoramus idiot that desperately
    wants to defend Python because Python defends ignoramus
    idiots.

    Yeah, from where you are that totally checks out!


    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From rbowman@[email protected] to comp.os.linux.misc on Sat Nov 8 20:29:34 2025
    From Newsgroup: comp.os.linux.misc

    On Sat, 8 Nov 2025 02:01:12 -0500, c186282 wrote:


    The ffmpeg command line required is long and complicated. Some literal
    stuff, some vars. Then I remember that 'C' is a total BASTARD when it
    comes to strings.

    Only if you don't know the language. sprintf() is your friend if strcat() won't do. Consider that sprintf() returns the number of bytes printed.

    char* ptr = buffer
    ptr += sprintf(ptr, "sone value %d ", x);
    ptr += sprintf(ptr, "another value %d ", y);

    allows you to build whatever you want in buffer. (assuming buffer is valid memory and you're doing some sanity checking.


    Note neither 'C' or FP have a straight-up equiv for 'sleep()'. This is critical to my app. Turbo had something like it ... but it was like a
    legacy lib and not sure to be as accurate or versatile as Python
    sleep().

    man 3 sleep
    man 3 usleep
    man 2 nanosleep

    What do you think CPython is doing?


    --- Synchronet 3.21a-Linux NewsLink 1.2