Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Klein bottle for rent -- inquire within.


devel / comp.lang.java.programmer / Re: "White House to Developers: Using C or C++ Invites Cybersecurity Risks"

SubjectAuthor
o Re: "White House to Developers: Using C or C++ Invites Cybersecurity Risks"Ross Finlayson

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

<lVydnTRTXJu3yXb4nZ2dnZfqnPednZ2d@giganews.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10097&group=comp.lang.java.programmer#10097

  copy link   Newsgroups: comp.lang.c++ comp.lang.c comp.lang.java.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 08 Mar 2024 18:08:42 +0000
Subject: Re: "White House to Developers: Using C or C++ Invites Cybersecurity
Risks"
Newsgroups: comp.lang.c++,comp.lang.c,comp.lang.java.programmer
References: <us0brl$246bf$1@dont-email.me> <us1lb5$2f4n4$1@dont-email.me>
<us2lfh$2ltj3$5@dont-email.me> <us2s96$2n6h3$6@dont-email.me>
<us3155$2of1i$3@dont-email.me> <us4c66$346tp$3@dont-email.me>
<us5d6f$3besu$3@dont-email.me> <20240305005948.00002697@yahoo.com>
<us5u16$3eidj$2@dont-email.me> <20240305111103.00003081@yahoo.com>
<us8821$90p$4@dont-email.me> <20240306140214.0000449c@yahoo.com>
<us9nib$dski$1@dont-email.me> <20240307000008.00003544@yahoo.com>
<usc58s$10cls$1@dont-email.me> <20240307134401.00007aa2@yahoo.com>
<uscmub$149j3$1@dont-email.me> <usf11f$1mk5l$1@dont-email.me>
<usf63j$1nnsb$1@dont-email.me>
From: ross.a.f...@gmail.com (Ross Finlayson)
Date: Fri, 8 Mar 2024 10:08:44 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <usf63j$1nnsb$1@dont-email.me>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <lVydnTRTXJu3yXb4nZ2dnZfqnPednZ2d@giganews.com>
Lines: 124
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-0bYhLbQZ1EkFQfHHlBV1wNKPfbGAuNj1s9ApCGepMeXncODOkSoIClEIPy5n3bHqXByRPywotrUzutB!xhVsvhQZg/GVJIbSa7OEyAf3GUwxoTd1Jsd50eihB6peGyV3TF1UbC/FVBmJeK1T0OoEKxmXJ3Q=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Received-Bytes: 6505
 by: Ross Finlayson - Fri, 8 Mar 2024 18:08 UTC

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".

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor