[Cuis-dev] Language constructs
Erik Stel
erik.stel at gmail.com
Fri May 1 08:20:35 PDT 2020
Hi,
I’m also in a bit of a limbo with respect to immutable. From the perspective of Ken’s explanation it sounds like a no-brainer: yes want this. From the ‘change everything’ in Smalltalk style, nothing should be really immutable. Sure, you could try to prevent certain things from changing by preventing the regular object interface from making chances, but what if I’m inside a debugger or an inspector and want to fiddle with instances I have at hand? Especially with collection like instances. And yes, you could probably create a new instance that would contain the same elements except for the one you want to change (and do a become: like magic), but I think other code might fail because of expecting immutable behaviour (copies in other processes not getting updated or what not). (And contrary to this, I’m happy Numbers and Symbols, etc are immutable, but I think the discussion was more aimed at other objects becoming immutable. Like arrays, but probably other ‘custom’ objects as well.)
Just to be clear: I’m not trying to criticise everything. I do try to challenge myself in thinking if things are okay the way they are and try to find reasoning (with your help at the moment ;-) for it.
I really like these discussions to get a better understanding of both history and current situation and our wants and needs.
Thx everyone for chiming in!
Erik
> On 1 May 2020, at 16:58, Juan Vuletich <juan at jvuletich.org> wrote:
>
> On 5/1/2020 11:21 AM, ken.dickey--- via Cuis-dev wrote:
>> On 2020-05-01 00:45, Erik Stel via Cuis-dev wrote:
>>
>>> Maybe I wasn't clear (because it was part of another topic, see below) or tread on a sensitive subject, but I'm still eager to hear the reasoning for having backticks (which are not in Squeak nor Pharo) from the simplicity point of view. Would anyone care to elaborate?
>>>
>>> I am also eager to know what others think about language constructs such as #(), {} and `` for daily usage. And I mean this in the sense 'Do you use these often? Could you live without them?'. I do understand how they can be used and what their meaning is ;-). And I can also lookup their current use in the default image, but that does not answer how you/we use them in our (application) code.
>>
>> Erik,
>>
>> I think that array literals are quite useful. As we move toward multi-core VMs, marking out constant data and using functional data structures (e.g. ropes), lockless queueing, and so forth are becoming more important. Also, more interactions with GPUs favors cheap copies -- constants allow for that. Simplifies the deep semantics.
>
> WRT this, I think that _all_ literals should be immutable.
>
>> Not sure of the `#history`.
>
> Went in detail in another message.
>
>> Oh, BTW, we should add something to the #syntax section of the Terse Guide on :: ; `` et al.
>
> :+1:
>
>> Cheers,
>> -KenD
>
> Cheers,
>
> --
> Juan Vuletich
> www.cuis-smalltalk.org
> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
> https://github.com/jvuletich
> https://www.linkedin.com/in/juan-vuletich-75611b3
> @JuanVuletich
>
More information about the Cuis-dev
mailing list