• Re: "White House to Developers: Using C or C++ Invites Cybersecurity Risks"

    From Ross Finlayson@ross.a.finlayson@gmail.com to comp.lang.c++,comp.lang.c,comp.lang.java.programmer on Fri Mar 8 10:08:44 2024
    From Newsgroup: comp.lang.java.programmer

    On 03/08/2024 06:07 AM, David Brown wrote:
    On 08/03/2024 13:41, Paavo Helde wrote:
    07.03.2024 17:36 David Brown kirjutas:

    CPython does use garbage collection, as far as I know.


    AFAIK CPython uses reference counting, i.e. basically the same as C++
    std::shared_ptr (except that it does not need to be thread-safe).

    Yes, that is my understanding too. (I could be wrong here, so don't
    rely on anything I write!) But the way it is used is still a type of
    garbage collection. When an object no longer has any "live" references,
    it is put in a list, and on the next GC it will get cleared up (and call
    the asynchronous destructor, __del__, for the object).

    A similar method is sometimes used in C++ for objects that are
    time-consuming to destruct. You have a "tidy up later" container that
    holds shared pointers. Each time you make a new object that will have asynchronous destruction, you use a shared_ptr for the access and put a
    copy of that pointer in the tidy-up container. A low priority
    background thread checks this list on occasion - any pointers with only
    one reference can be cleared up in the context of this separate thread.


    With reference counting one only knows how many pointers there are to
    a given heap block, but not where they are, so heap compaction would
    not be straightforward.

    Python also has zillions of extensions written in C or C++ (all of AI
    related work for example), so having e.g. heap compaction of Python
    objects only might not be worth of it.





    Wondering about mark-and-sweep or abstractly
    whatever means that detects references, vis-a-vis,
    reference counting and reference registration and
    this kind of thing, sort of is for making the automatic
    cleanup along the lines of stack-unwinding.

    Like how C++ works on stack objects, ....

    Then, that makes de-allocation part of the routine,
    and adds reference-counts to objects, but it would
    be pretty safe, ..., and the GC would never interrupt
    the entire runtime.

    One might figure that any time an lvalue is assigned
    an rvalue, the rvalue's refcount increments and any
    previous assigned revalue's refcount decrements,
    then anything that goes out of scope it's rvalue
    is assigned null, its un-assigned rvalue refcount decrements,
    that any refcount decremented to zero results deletion.

    Isn't that smart-pointers?

    https://en.wikipedia.org/wiki/Smart_pointer

    Maybe the big code cop should say "you should use smart pointers".

    I think smart pointers should usually be the way of things,
    any kind of pointer, then with, you know, detach() or what,
    manual management.

    I suppose it's nice that syntactic sugar just does that,
    or, that the runtime makes a best effort sort of
    inference, while, it would be nice if when an object's
    purpose is fulfilled, that it can be canned and it results
    freeing itself.

    Static analysis and "safe programming"
    is an option in any deterministic language, ...,
    given "defined behavior" of the runtime, of course.

    How about "ban USB and PXE" and
    "proxy-defeating DNS", "read-only
    runtime", "computer literacy suprise quiz".

    The idea of memory pools and freelists and
    arenas and slabs and dedicated allocations
    for objects of types and the declaration at
    definition-time of the expected lifetime and
    ownership of objects, gets into a lot of ways
    to have both efficiency and dedication by design.


    Shadow stack, NX bit, shared register protection,
    Orange Book, journaling, link-layer?

    A usual behavior of Java crashing is leaving
    the entire heap in a heap-dump file, ....

    These days a usual sort of approach is, like,
    the old "trust but verify", static analysis and
    all, figuring that type-safety first is the greatest
    possible boon to correctness, then that
    memory-management would better be a
    sort of "if you could just explicitly close your
    resources when you're done then maybe
    have a mark-and-sweep on the side, and
    mark lifetime resources as so, then anything
    left would be waste".




    I'm a big fan of C/C++ coders and it's nice
    to know about Java which I think is great
    and I mostly think in it, vis-a-vis,
    Go and JavaScript and similar event loops,
    like Windows, or the Pythonic or something like
    that, there's something to be said for that
    Haskell is probably cooler than me, these
    days I'm looking at the language specs and
    the opcode instructions as from assembler
    languages with regards to "modular modules
    with well-defined modules and modularity".

    Figuring "modular modules" and "scope the globals".


    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Ross Finlayson@ross.a.finlayson@gmail.com to comp.lang.c,comp.lang.c++,comp.lang.java.programmer on Fri Mar 8 21:36:14 2024
    From Newsgroup: comp.lang.java.programmer

    On 03/06/2024 12:13 PM, David Brown wrote:
    On 06/03/2024 20:50, Kaz Kylheku wrote:
    On 2024-03-06, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
    On 3/6/24 09:18, Michael S wrote:
    On Wed, 6 Mar 2024 13:50:16 +0000
    bart <bc@freeuk.com> wrote:
    ...
    Whoever wrote this short Wikipedia article on it got confused too as >>>>> it uses both Ada and ADA:

    https://simple.wikipedia.org/wiki/Ada_(programming_language)

    (The example program also includes 'Ada' as some package name. Since >>>>> it is case-insensitive, 'ADA' would also work.)


    Your link is to "simple Wikipedia". I don't know what it is
    exactly, but it does not appear as authoritative as real Wikipedia

    Notice that in your following link, "en" appears at the beginning to
    indicate the use of English. "simple" at the beginning of the above link >>> serves the same purpose. "Simple English" is it's own language, closely
    related to standard English.

    Where is Simple English spoken? Is there some geographic area where
    native speakers concentrate?


    It is meant to be simpler text, written in simpler language. The target audience will include younger people, people with dyslexia or other
    reading difficulties, learners of English, people with lower levels of education, people with limited intelligence or learning impediments, or simply people whose eyes glaze over when faced with long texts on the
    main Wikipedia pages.



    Yet, why?

    There's "Simplified Technical English", which is a same
    sort of idea, with the idea that manuals and instructions
    be clear and unambiguous.

    https://en.wikipedia.org/wiki/Simplified_Technical_English

    Heh, it's like in the old days, when people would get
    manuals, and be amused as it were by the expression.


    What I'd like to know about is who keeps dialing
    the "harmonization" efforts, which really must
    give grouse to the "harmonisation" spellers,
    when good old-fashioned words "spelt" their own way,
    which of course is archaic "spelled".

    It reminds me of "Math Blaster" and "Typing Games",
    vis-a-vis, "the spelling bee", and for that matter,
    of course, weekly spelling quizzes all through
    elementary school.

    I'm so old the only games we had were how to
    compute and how to spell.

    And Tooth Invaders. Just kidding I had 50+ floppies
    for my Commodore64. Like GI Joe and Beachhead II.

    But we didn't get promoted in school if we
    didn't pass our spelling tests.

    (We couldn't even have dangling prepositions
    or sentence fragments like the above.)

    We had a class in school we couldn't even pass
    until we could type thirty words a minute.


    The Simplified Technical English though is a good idea,
    it's used in technical manuals and instructions, widely.


    Really, whever harmonization dials away a word,
    I'm like, hey, I'm using that word.


    There's something to be said for a, "source parser",
    the idea being a, multi-pass parser of sorts, with
    any number of, forms, so that it results, parsing
    languages sort of opportunistically, and results,
    sort of lifting, sections, of source, into regions
    of syntax, so that as syntaxes get all commingled,
    that all the syntax and grammar definitions get piled
    together, where it sort of results then for comments
    and quoting, and, usual ideas of brackets, and comma,
    for joiners and separators and groupers and splitters,
    observing mostly usually the parenthetical and indentation,
    for all sorts of languages, into, a pretty common sort of
    form.

    So, what is there, "Simplified Compilation Source",
    basically reflecting, "if it's source somehow it
    parses, if being ambiguous among languages then
    in editions of each or according to the source
    locale", these kinds of things....

    For a long time I've been thinking about "modular
    and composable parsers", with mostly the usual
    goal of relating productions in grammar to source
    locations, that one figures it would be a most usual
    sort of study, to result, all the proliferation of
    little languages, get all parsed, then for the great
    facility of "term re-write rules" and "term-graph
    re-write rules", or "re-write systems", or for
    extracting signatures, identifiers, and logic,
    for any kind of language.

    I think everybody reading this has a most usual
    sort of exposure to the theory of parsing as after
    Backus-Naur format, vis-a-vis syntax diagrams or
    railroad diagrams, and Chomsky hierarchy, and lexers
    and parsers and the interpreted and all these kinds
    of things, but I don't know a sort of wide-open
    framework that parses any kinds of sources and
    happens to also re-write itself to any sort of target,
    parsing any source language in any source language.

    Did I miss the memo?

    What I got into was defining languages in terms
    of comments and quoting, and, brackets and commas,
    and, space and line, in terms of, sequence and alternation,
    for basically that all the source is loaded or mapped into
    memory, then instead of an abstract syntax tree or sorts,
    results an abstract syntax sequence of sorts, those "lifted"
    over the source text for its location, then that any sort
    of lexicalizing and syntax and grammar, all get put together
    as modules and any one just enumerates or makes equivalent
    whatever kind of source it is, then according to the
    language, results usual sorts constructs and productions,
    for functional and procedural languages, and data,
    and, you know, language.

    Tesniere, Tesniere is the great complement to Chomsky,
    where after Chomsky is like, "this finite state machine
    builds models of productions in minimal resources", to,
    something like, "Simplified Compilation Source", parser,
    "this algorithm works in fixed or linear resources in
    up to factorial time and parses anything, and unparsed
    sections are their source text, and iterating the data
    structure or any segment iterates the source under it
    that it's lifted over".


    See, look at that, "lifted over", I would get a bad
    mark for that. Of course that's since been relaxed,
    figuring it's natural to dangle and OK to continue.
    And so on.


    So anyways as long as we're talking about all the usual
    languages, uh, is that all "Common Source Language"?

    CS language?

    So, for something like, "Common Compilation Components",
    figuring all sorts usual functional and procedural
    productions sort of have a usual form and thusly
    can be a great fabric of re-write rules, or targetting,
    basically is for making common-enough productions and
    the algorithm be multi-pass as necessary, to result
    a usual sort of workbench for languages of the source.





    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.lang.c,comp.lang.c++,comp.lang.java.programmer on Tue Mar 12 00:07:23 2024
    From Newsgroup: comp.lang.java.programmer

    On Fri, 8 Mar 2024 21:36:14 -0800, Ross Finlayson wrote:

    What I'd like to know about is who keeps dialing the "harmonization"
    efforts, which really must give grouse to the "harmonisation"
    spellers ...

    Some words came from French and had rCL-izerCY, others did not and had rCL-iserCY.
    Some folks in Britain decided to change the former to the latter.

    rCLTeleviserCY, rCLmerchandiserCY, rCLadvertiserCY -- never any rCL-izerCY form.

    rCLSynchronizerCY, rCLharmonizerCY, rCLapologizerCY -- rCL-izerCY originally. --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Ross Finlayson@ross.a.finlayson@gmail.com to comp.lang.c,comp.lang.c++,comp.lang.java.programmer on Mon Mar 11 20:05:19 2024
    From Newsgroup: comp.lang.java.programmer

    On 03/11/2024 05:07 PM, Lawrence D'Oliveiro wrote:
    On Fri, 8 Mar 2024 21:36:14 -0800, Ross Finlayson wrote:

    What I'd like to know about is who keeps dialing the "harmonization"
    efforts, which really must give grouse to the "harmonisation"
    spellers ...

    Some words came from French and had rCL-izerCY, others did not and had rCL-iserCY.
    Some folks in Britain decided to change the former to the latter.

    rCLTeleviserCY, rCLmerchandiserCY, rCLadvertiserCY -- never any rCL-izerCY form.

    rCLSynchronizerCY, rCLharmonizerCY, rCLapologizerCY -- rCL-izerCY originally.




    Hey thanks that's something I hadn't thought,
    that the harmonization was coming from this
    side of the pond besides vice-versa, with regards
    to that "harmonization" is an effort in controlled
    languages in terms of natural languages which
    are organic though of course subject their extended
    memory the written corpi, which I write corpi, not corpora.

    It's like when the dictionary adds new words,
    the old words are still words, in, the "Wortbuch",
    an abstract dictionary of all the words, that I read
    about in Curme. (I'm a fan of Tesniere and Curme.)

    About parsing and re-writing systems, I'm really wondering
    a lot about, compilation units, lines, spacing and indentation,
    blocks, comments, quoting, punctuation, identifiers,
    brackets, commas, and stops, how to write grammars
    for all sorts usual source language in those, and result,
    a novel sort of linear data structure above those,
    in whatever languages so recognized in those,
    and any sections it doesn't as the source text.


    I looked around a bit and after re-writing on the Wiki
    and "multi-pass parser" there are some sorts ideas,
    usually in terms of fungible intermediate languages
    for targeting those to whatever languages, here
    though mostly to deal with a gamut of existing code,
    there are lots of syntax recognizers and highlighters
    and this kind of thing, "auto-detect" in the static
    analysis toolkit, the languages, then as with regards to
    that a given compilation unit is only gonna be one or
    a few languages in it, with regards for example to
    "code in text" or "text in code", about comments,
    sections, blocks, or "language integrated code"
    or "convenience code", "sugar modes", you know,
    about what the _grammar_ specifications would be,
    and the lexical and syntax the specifications, to
    arrive at a multi-pass parser, that compiles a whole
    bunch of language specs, finds which ones apply
    where to the compilation unit, then starts building
    them up "lifting" them above the character sequence,
    building an "abstract syntax sequence" (yeah I know)
    above that, then building a model of the productions
    directly above that, that happens to be exactly derived
    from the grammar productions, with the same sort
    of structure as the grammar productions.

    (Order, loop, optional, a superset of eBNF, to support
    syntaxes with bracket blocks like C-style and syntaxes
    with indent blocks though I'm not into that, the various
    inversions of comments and code, the various interpolations
    of quoting, brackets and grouping and precedence,
    commas and joining and separating, and because SQL
    doesn't really comport itself to BNF, these kinds of things.)

    Of course it's obligatory that this would be about C/C++
    and as with regards to Java which of course is in the
    same style, or that its derivative, is for example that
    M4/C/C++ code is already to a multi-pass parser, and,
    Java at some point added language features which
    fundamentally require a multi-pass parser, so it's not
    like the entire resources of the mainframe has to fit
    a finite-state-machine on the read-head, in fact at
    compile-time specifically there's "it's fair to consider
    a concatenation of the compilation units as a linear
    input in space", then figuring the "liftings" are linear
    in that, in space, then that the productions whence
    derived are as concise as the productions a minimal
    model, thus discardable the intermediate bit, is for
    introducing a sort of common model of language
    representation, source language, for reference
    implementations of the grammars, then to make
    the act of ingestion of sources in languages as a
    first-class kind of thing, I'm looking for one of those,
    and that's about as much I've figured out it is.

    It's such a usual idea I must imagine that it's
    commonplace, as it's just the very most simple
    act of the model of iterating these things and
    reading them out.

    I probably might not care about it but getting
    to where it takes a parser that can parse SQL
    for example, or, you know, when there are lots
    of source formats but it's just data and definitions,
    yeah if you know that there's like a very active
    open project in that I'd be real interested in a
    sort of "source/object/relational mapping", ...,
    as it were, "source/grammatical-production mapping",
    what results you identify grammars and pick sources
    and it prints out the things.

    I'm familiar with the traditional approaches,
    and intend to employ them. I figure this
    must be a very traditional approach if
    nobody's heard of it.

    --- Synchronet 3.21d-Linux NewsLink 1.2