[Cuis-dev] Uniqueness of Characters (Related to NeoCSV)

Luciano Notarfrancesco luchiano at gmail.com
Mon Jul 24 03:46:09 PDT 2023


Yes, I agree that independently of what we do about the bigger issue of
uniqueness of characters, we should replace sends of #== with #= in most
cases.
Having immediate characters for both ascii and unicode would be nice, tho.
Are there good reasons to continue supporting V3 images?

On Mon, 24 Jul 2023 at 04:39 Hernán Wilkinson via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> I think we should keep it the way it is right now and fix the problems
> when they arise.
> The message #== should only be used when doing meta-programming of memory
> stuff related, if not, #= is the right one to use.
> There is a lot of old code that uses #== instead of #=, most of it due to
> "performance" reasons, other due to "ignorance", (new smalltalkers confuse
> == with equality because Java/C#/etc use #== as equality (or message
> equals) and #= as assignment, etc.
>  The truth is that, currently, the impact on performance is negligible
> (performance problems are not due to use #= instead of #==). Using #==
> instead of #= because a possible performance issue is an early optimization
> and we all know that "early optimization is the root of all evil" :-)
>
> Cheers!
> Hernan.
>
> On Sun, Jul 23, 2023 at 5:05 PM Juan Vuletich <juan at cuis.st> wrote:
>
>> Hi Folks,
>>
>> Hilaire had trouble, that he already solved, when updating NeoCSV for
>> current Cuis. The root of the problem is that in older Cuis and in
>> Smalltalk-80 and Squeak `aCharacter == $,` is guaranteed to mean the
>> same as `aCharacter = $,`. In other words, there can exist only one
>> instance of any Character. This is no longer in true today in Cuis: `$,
>> == $, asUnicodeCodePoint` is false.
>>
>> In Cuis we have two character like classes. They are polymorphic, and
>> the only observable difference is when asking #== or #identityHash.
>>
>> The question I ask is: How important is this? Do we need or want
>> uniqueness of characters? What do other dialects do? Would it make sense
>> to give an error or at least a warning when trying to compare with #==
>> against a literal character?
>>
>> It is possible to guarantee uniqueness of characters, but not without
>> some work. The easiest way is what Squeak did, having a single, Unicode
>> wide, immediate Character class. But this can not be done in pre-Spur
>> (V3) images and VMs.
>>
>> Thanks,
>>
>> --
>> Juan Vuletich
>> cuis.st
>> github.com/jvuletich
>> researchgate.net/profile/Juan-Vuletich
>> independent.academia.edu/JuanVuletich
>> patents.justia.com/inventor/juan-manuel-vuletich
>> linkedin.com/in/juan-vuletich-75611b3
>> twitter.com/JuanVuletich
>>
>>
>
> --
>
> *Hernán WilkinsonAgile Software Development, Teaching & Coaching*
> *Phone: +54-011*-4893-2057
> *Twitter: @HernanWilkinson*
> *site: http://www.10Pines.com <http://www.10pines.com/>*
> Address: Alem 896, Floor 6, Buenos Aires, Argentina
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230724/0e9d1917/attachment-0001.htm>


More information about the Cuis-dev mailing list