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

Juan Vuletich juan at cuis.st
Mon Jul 24 05:03:03 PDT 2023


Hi Folks,

Dave, do you still need or prefer using V3 images? Anyone else?

Today, in Spur images, UnicodeCodePoints are immediate. And Since 
Smalltalk-80 (and in all Cuis versions), Characters are "quasi 
immediate": they are unique and never allocated once the CharacterTable 
is built. So, only the pointer matters.

Unifying Character and UnicodeCodePoint in a single class would mean 
that we would no longer be able to have ASCII-only images, Unicode would 
be included in any image.

Supporting only Spur images could simplify a few details. It is not a 
big deal, though. Truth is that if we chose to use only UnicodeCodePoint 
(perhaps renaming it 'Character'), then all characters would be 
immediate in Spur. And we can also keep the first 256 code points in a 
class var, as we do with Character, to make them unique also in V3. The 
downside would be that (only in V3 images) codepoints after 256 would 
not be unique. I gave this some thought, and found that this can also be 
'fixed'. But is there a need for characters to be unique?

I guess the questions are:

- Would there be any real advantage in unifying Character and 
UnicodeCodePoint?
- Would we gain something valuable if we make all character like objects 
immediate in Spur?
- Would we gain something valuable if we make all character like objects 
unique?
- Would we get a real advantage by dropping support for V3 images?

If none of the answers turns out to be a clear YES, the should we bother?

Please share your thoughts. Maybe we can make a thoughtful decision and 
settle this at least for some time.

Thanks!

On 7/24/2023 7:46 AM, Luciano Notarfrancesco via Cuis-dev wrote:
> 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 <mailto: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
>     <mailto: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 <http://cuis.st>
>         github.com/jvuletich <http://github.com/jvuletich>
>         researchgate.net/profile/Juan-Vuletich
>         <http://researchgate.net/profile/Juan-Vuletich>
>         independent.academia.edu/JuanVuletich
>         <http://independent.academia.edu/JuanVuletich>
>         patents.justia.com/inventor/juan-manuel-vuletich
>         <http://patents.justia.com/inventor/juan-manuel-vuletich>
>         linkedin.com/in/juan-vuletich-75611b3
>         <http://linkedin.com/in/juan-vuletich-75611b3>
>         twitter.com/JuanVuletich <http://twitter.com/JuanVuletich>
>
>
>
>     -- 
>     *Hernán Wilkinson
>     Agile 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 <mailto:Cuis-dev at lists.cuis.st>
>     https://lists.cuis.st/mailman/listinfo/cuis-dev
>


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230724/f2daabcb/attachment-0001.htm>


More information about the Cuis-dev mailing list