Re: alleviate the load of the GC

  • From: Laurent Deniau <Laurent.Deniau@xxxxxxx>
  • To: "<luajit@xxxxxxxxxxxxx>" <luajit@xxxxxxxxxxxxx>
  • Date: Wed, 2 Sep 2015 21:56:24 +0000

On Sep 2, 2015, at 11:13 PM, Gath-Gealaich
<gath.na.gealaich@xxxxxxxxx<mailto:gath.na.gealaich@xxxxxxxxx>> wrote:

On Sep 2, 2015 11:00 PM, "Laurent Deniau"
<Laurent.Deniau@xxxxxxx<mailto:Laurent.Deniau@xxxxxxx>> wrote:



with the same syntax. In C++ at least overloading operator= is
expected to have the same user-facing semantics as the default
behavior, but this suggestion doesn't preserve that.

Why do you think that this proposal do not preserve that?


Just guessing here...because it horribly breaks the beautiful and crystal clear
Lisp/Scheme-derived value/variable/binding semantics if some assignments are
actually value mutations under the hood?

The proposal does not change anything to existing code, so if something
"horrible" happens, it will be in "your new code" that provides an __assign
metamethod with non-conventionnal semantic behind the scene. Breaking
"beautiful and crystal clear" semantic is easy in almost all mainstream
languages including Lua, Haskell, C, C++ and others, but it rarely happens
because most people just want to do a useful good job (don't consider everyone
has a fool that want to mess your protected area). C++ has grown by steps (even
between ARM and C++98), looking at the community for proposal with interesting
rationale and implementations. Without exploration and tentative
implementation, you have little chance to know if it is feasible and useful or
not. And consider that the exercise can teach me a lot. But since for now I
don't have a single useful information to start with, there is little chance
that I give it a serious try...

Madness, torment, and insanity lie in that direction.

(It's not such a problem for C++ because it's less obvious an more difficult to
distinguish and recognize two different kinds of clusterf**ks, so people won't
mind, or even notice.)

Many C++ developers catch only half of the language, so they effectively won't
mind. And it is so easy to change the behaviour of a code with SFINAE, CRTP,
Koenig lookup, macros, etc, that we don't have really the choice...

Best,
Laurent.

Other related posts: