5 ms·
The "fusion of a developed program and development environment" idea is very cool. One (maybe dumb) question though: > Simple & powerful language: No construc
by 542458 3y ago
The "fusion of a developed program and development environment" idea is very cool.
One (maybe dumb) question though:
> Simple & powerful language: No constructors, no types declaration, no interfaces, no primitive types.
Are constructors and primitive types really the sort of things that people find to be unnecessary complexity?
- zabzonk 3y agoyou can (and often do) have constructors in smalltalk: https://stackoverflow.com/questions/36878787/making-a-constructor-in-pharo-or-smalltalk https://stackoverflow.com/questions/36878787/making-a-constr... - i think the stuff you quoted was probably written with little thought.
- Cthulhu_ 3y agoConstructors are tools to put an object in a starting state, but there's alternative solutions; in Go, factory functions are pretty common. Primitive types reminds me of Java, which doesn't have primitive types per se (everything is an object under water), but they're adding it soon (or already have) for performance reasons.
- jolux 3y agoJava does have primitives/unboxed types (int, long, boolean, etc) what they’re adding is support for unboxed/value classes created by users. This should help reduce the duplication between int and Integer and so forth.
- emaringolo 3y agoMany languages need constructors (and static methods) because the class is not an object. In Smalltalk the class is the sole instance of another class (MetaClass), so a "static method" becomes a "class-side" method. And so it is inheritable. The meta relationship is hard to understand (at first), but it is part of what causes the parsimony in all the interactions, and the "everything is an object". https://stackoverflow.com/questions/57898036/is-it-true-that-metaclass-class-is-just-metaclass https://stackoverflow.com/questions/57898036/is-it-true-that... Primitives (as in int, double, etc.) are a different subject, and although an Integer or a Smallinteger is a specially optimized object, it has the overhead of being an object (as in "Boxed" Integer in other languages), instead of some bytes at some memory location. Most of the times you don't need the optimized version, and if were the case that you do, then it's when you optimize that piece of execution specifically (maybe making an external call to a more low-level, optimized version).
- scotty79 3y agoPrimitive types are really annoying. If they were about what user needs not about underlying hardware they'd be fine. I dont care about int, long, float or double. I care about number to represent whole amount, or fractional amount or approximate amount with operations that work accordingly lile approximate comparison of approximate numbers. Approximations for when I care about approximation error and for when I don't. Number that are limited to the ranges I care about not some arbitrary MAX_INT. Numbers that have units so that I won't accidently assigned a length to a variable that should hold mass. So yeah, as they are primitive types do introduce unnecessary complexity and none useful complexity unless you want to work close to the metal.
- canadianfella 3y agoI wish more languages handled it like Frink does. https://frinklang.org/ https://frinklang.org/