Re:Pharo 9
by goatlover on Thursday July 15, 2021 @02:08PM
(#27847979)
Unlike most OOP languages, it's true, and not just marketing, for Smalltalk to make the claim that everything is in an object.
[ Parent
| on HN ]
I was not talking about everything being an object. I was talking about that claim being the key to being nice and comfortable.
Many sibling comments, IMHO, miss the point of the parent and focus on the claim about python and js.
Python and js could perhaps have been completely object based. It still wouldn't make them comfortable for many.
True, but personally I think JS and Python would have benefitted from being more consistent about being object based. JS in particular, since it's prototypal, but has function constructors and class syntax, along with other things added over time that make the language more complex.
The sentence says that it makes Pharo clean and comfortable to learn. Not that it makes every language clean and comfortable to learn :-)
Yes and the comment I replied to vaguely suggested that it didn't make python and js comfortable to learn and everyone focused on the fact that in these languages not everything is an object.
While Python wasn't born pure object based, it is definetly object based in its current version.
Python 3.9.5 (default, May 27 2021, 19:45:35)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 1
>>> type(x)
<class 'int'>
>>> dir(x)
['__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod
__', '__doc__', '__eq__', '__float__', '__floor__', '__floordiv__', '__format__', '__ge__', '__getattribut
e__', '__getnewargs__', '__gt__', '__hash__', '__index__', '__init__', '__init_subclass__', '__int__', '__
invert__', '__le__', '__lshift__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__or__
', '__pos__', '__pow__', '__radd__', '__rand__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__',
'__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__round__', '__rpow__', '__rrshift__'
, '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__',
'__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'as_integer_ratio', 'bit_length', 'conjugate',
'denominator', 'from_bytes', 'imag', 'numerator', 'real', 'to_bytes']
>>>
>>> y = [2]
>>> type(y)
<class 'list'>
>>> dir(y)
['__add__', '__class__', '__class_getitem__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__
doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd
__', '__imul__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '_
_ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '
__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend', '
index', 'insert', 'pop', 'remove', 'reverse', 'sort']
>>>
>>> def sum(a, b): return a + b
...
>>> sum
<function sum at 0x7f673429d1f0>
>>> dir(sum)
['__annotations__', '__call__', '__class__', '__closure__', '__code__', '__defaults__', '__delattr__', '__
dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__get__', '__getattribute__', '__globals
__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__kwdefaults__', '__le__', '__lt__', '__modul
e__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__setat
tr__', '__sizeof__', '__str__', '__subclasshook__']
Apparently everyone keeps forgetting that after the new class type declarations were introduced and the primitive types made subclasses of them, everything in Python is an object as well.I think you are replying to the wrong comment. That's not even my point.
Re:Pharo 9
by dragonwriter on Friday July 16, 2021 @03:33AM
(#27853830)
> Unlike most OOP languages, it's true, and not just marketing, for Smalltalk to make the claim that everything is in an object.
Its not uncommon in dynamic OOP (or even object-first multiparadigm languages); it’s true in Python, Ruby, JS, and others.