• Re: transpiling to low level C

    From Tim Rentsch@tr.17687@z991.linuxsc.com to comp.lang.c on Tue Jan 7 21:38:38 2025
    From Newsgroup: comp.lang.c

    Ben Bacarisse <ben@bsb.me.uk> writes:

    Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

    A statement of fact is a statement concerning an objective question,
    such as "Is every even number greater than 4 the sum of two prime
    numbers?". A statement of fact can be right or wrong or true or
    false, even if it isn't known at the present time which of those is
    the case. The statement "Four colors suffice to color any planar
    map such that adjacent regions do not have the same color" is a
    statement of fact, both now and 60 years ago before the statement
    had been proven. Both P==NP and P!=NP are statements of fact, even
    though one of them must certainly be false; the key property is
    that they are objective statements, subject to falsification. If I
    say "The Earth is flat", that is a statement of fact, even though
    the statement is false.

    I think you go too far. The word "fact" is not neutral as far as its
    truth is concerned, and writing "a statement of fact" does not
    significantly change that. Most dictionaries define a fact as something
    that is true (or at least supported by currently available evidence).
    One online essay[1] concludes that

    "A statement of fact is one that has objective content and is
    well-supported by the available evidence."

    [1] https://philosophersmag.com/the-fact-opinion-distinction/

    I will concede that the phrase "statement of fact" can be used in
    the sense you describe.

    I believe it is also true that "statement of fact" is used in the
    sense I describe, and that sense appears among the alternatives in
    various well-regarded dictionaries.

    In any case, my point was not to have a debate about the meaning of
    a phrase, but to clarify the intended meaning of my earlier remarks.
    I was making a statement about an objective question, one subject to independent verification or falsification. I was not offering a
    comment that was merely expressing a personal point of view.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Tim Rentsch@tr.17687@z991.linuxsc.com to comp.lang.c on Mon Jan 13 08:10:31 2025
    From Newsgroup: comp.lang.c

    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:

    On 21.12.2024 22:51, Tim Rentsch wrote:

    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:

    On 21.12.2024 02:28, Tim Rentsch wrote:

    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:

    On 16.12.2024 00:53, BGB wrote:

    [...]

    Pretty much all higher level control flow can be expressed via
    goto.

    A 'goto' may be used but it isn't strictly *necessary*. What
    *is* necessary, though, that is an 'if' (some conditional
    branch), and either 'goto' or recursive functions.

    Conditional branches, including 'if', '?:', etc., are not
    strictly necessary either.

    No? - Can you give an example of your statement?

    (Unless you just wanted to say that in some HLL abstraction like
    'printf("Hello world!\n")' there's no [visible] conditional
    branch. Likewise in a 'ClearAccumulator' machine instruction, or
    the like.)

    The comparisons and predicates are one key function (not any
    specific branch construct, whether on HLL level, assembler
    level, or with the (elementary but most powerful) Turing
    Machine). Comparisons inherently result in predicates which is
    what controls program execution).

    So your statement asks for some explanation at least.

    Start with C - any of C90, C99, C11.

    Take away the short-circuiting operators - &&, ||, ?:.

    Take away all statement types that involve intra-function
    transfer of control: goto, break, continue, if, for, while,
    switch, do/while. Might as well take away statement labels too.

    Take away setjmp and longjmp.

    And also things like the above mentioned 'printf()' that most
    certainly implies an iteration over the format string checking for
    it's '\0'-end.

    The *printf() functions can be implemented in standard C, under the
    above stated limitations, without needing iteration.

    And so on, and so on. - What will be left as "language".

    I think most C developers would be able to answer that question
    given the above stated description. Is there some part that isn't
    clear to you?

    Would you be able to formulate functionality of the class of
    Recursive Functions (languages class of a Turing Machine with
    Chomsky-0 grammar).

    General rewrite grammars, which is another name IIRC for Chomsky
    Type 0 languages, are computationally equivalent to Turing Machines
    (which incidentally takes me back almost five decades to my formal computability education). The answer is yes.


    Rule out programs with undefined behavior.

    The language that is left is still Turing complete.

    Is it?

    Yes, it is.

    But wouldn't that be just the argument I mentioned above; that a,
    say, 'ClearAccumulator' machine statement wouldn't contain any
    jump?

    No, afaict the two questions have nothing to do with each other.


    Proof: exercise for the reader.

    (Typical sort of your reply.)

    I expect you will see better results if you put more effort into
    listening and thinking, and less effort into making ad hominem
    remarks.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From User One@noreply@invalid.com to comp.lang.c on Sun Feb 9 17:51:17 2025
    From Newsgroup: comp.lang.c

    On 15/12/2024 03:05, Thiago Adams wrote:
    Most features from C99, C11, and C23 are not included.

    I think I'll stick with Visual Studio or if I feel like trying something
    new as a hobby then Pelles C/

    <http://www.smorgasbordet.com/pellesc/>

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Chris M. Thomasson@chris.m.thomasson.1@gmail.com to comp.lang.c on Sun Feb 9 12:43:43 2025
    From Newsgroup: comp.lang.c

    On 2/9/2025 9:51 AM, User One wrote:
    On 15/12/2024 03:05, Thiago Adams wrote:
    Most features from C99, C11, and C23 are not included.

    I think I'll stick with Visual Studio or if I feel like trying something
    new as a hobby then Pelles C/

    <http://www.smorgasbordet.com/pellesc/>


    Yup. Fwiw, I found some interesting "issues" with it:

    https://forum.pellesc.de/index.php?topic=7167.msg27217#msg27217
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Chris M. Thomasson@chris.m.thomasson.1@gmail.com to comp.lang.c on Sat Feb 15 21:01:18 2025
    From Newsgroup: comp.lang.c

    On 12/15/2024 1:01 PM, Chris M. Thomasson wrote:
    On 12/15/2024 2:49 AM, Thiago Adams wrote:
    Em 12/15/2024 1:39 AM, Chris M. Thomasson escreveu:
    On 12/14/2024 7:05 PM, Thiago Adams wrote:
    [...]
    Yes this conversion is not implemented yet.

    Is
    atomic_exchange(&foo.bar.m_atomic, 42);

    The generated code for
    foo.bar.m_atomic =  42;
    ?

    Yes. atomic_exchange is an atomic RMW. Iirc, it defaults to seq_cst memory_order. atomic_exchange_explicit allows us to define a different memory_order.

    I may look this at future.

    Cool. :^)

    The atomic exchange allows one to get at the previous object or word in
    the atomic anchor. God, it's been a long time. 2005 I remember being on
    this group, comp.programming.threads, before it got nuked with spam...
    Yikes!
    --- Synchronet 3.20c-Linux NewsLink 1.2