News for hackers. Stuff that matters.
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by noughtme on Saturday December 21, 2019 @02:59PM (#21853051)
Every time this comes up it makes me want to learn Smalltalk, but the current tooling/IDEs don’t seem to have been kept up to date. Is it possible to learn Smalltalk without a Smalltalk-specific IDE? Or, is there a relatively small current language that is similar to Smalltalk?
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by e12e on Saturday December 21, 2019 @03:33PM (#21853231)
Smalltalk was always a system first, language second. That said, if you want to ignore half (not all!) of what makes Smalltalk interesting, there's always GNU Smalltalk ("Smalltalk for people who can type"):

https://www.gnu.org/software/smalltalk/

There's the free/open Pharo ("Squak for grown-ups"): https://pharo.org/

(Recently featured on hn in the guise of smalltalk on truffle/graalvm https://news.ycombinator.com/item?id=21735782 )

And commercial offerings like Gemstone:

https://gemtalksystems.com/products/gs64/

The recently open sourced dolphin: http://www.object-arts.com/gettingstarted.html

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by ljm on Saturday December 21, 2019 @06:02PM (#21853844)
To add to this comment; if you use Pharo, the impressive part is right in the first-run tutorial. It gives you the basics but you have to write the code to update the environment to give you the next/previous buttons for each step.

You can run whatever code you want in those windows, but just by finishing the tutorial you'll have an idea of what you're getting into.

It's on my backlog of things to toy with, along with Prolog. And after playing with Objective-C long enough I quite enjoy the syntax.

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by Gene_Parmesan on Saturday December 21, 2019 @06:38PM (#21853995)
I can definitely highly recommend Prolog for playing. I found it to be a mind-opener in the same way learning Scheme for the first time was a mind-opener. Programming with predicates/relations is extremely powerful.

As a teaser, consider a predicate Concat(X, Y, Z). In Prolog, capitalized identifiers are considered as unbound variables. There aren't return values; instead, you compute via unification.

So we can approximate the idea of a list concat funtion by entering something like `Concat([1, 2], [3, 4], X).` The Prolog evaluator will answer that X must be [1, 2, 3, 4] in order for the predicate to hold true. Looks like a standard function with a quirky way to provide an out param.

But these are predicates, not functions. Concat's internal logic defines a logical relation among the various values. This logic holds no matter which values you leave unbound. So here are some other things you get for free:

`Concat(X, Y, [1, 2, 3, 4]).` -- this will, in turn, iterate through all possible values of X and Y that make this predicate true. Thus Prolog will give us X: [], Y: [1,2,3,4]; but also X: [1], Y: [2,3,4]; and so on.

`Concat(X, [3, 4], [1, 2, 3, 4]).` -- this will give us X: [1, 2]; alternatively, it will give us the answer 'no' (sort of equivalent to false) if [3, 4] is not some tail of the provided list.

`Concat([1, 2], [3, 4], [1, 2, 3, 4]).` -- will give us "yes", for true.

This is a simple example, but now perhaps the potential power of Prolog is more visible. Imagine the possibilities -- for instance, a constructed grammar can tell you not only if a given candidate sentence is valid, but it can also (in theory) generate every single valid sentence in turn.

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by ljm on Saturday December 21, 2019 @07:02PM (#21854133)
I've been feeling this out through the Adventures in Prolog book. It's also a fascinating insight into how SQL engines work and what it means to write declarative code.

I've had an idea for a prolog side-project for a while, but just haven't learned enough yet to know how I could implement it. In my mind, reserving a slot in a calendar or otherwise finding the next best opportunity is a valid use-case.

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by saagarjha on Saturday December 21, 2019 @08:25PM (#21854498)
> And after playing with Objective-C long enough I quite enjoy the syntax.

Interestingly, I enjoy Objective-C despite its syntax.

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by e12e on Sunday December 22, 2019 @08:25AM (#21857001)
Should probably also mention cuis smalltalk, also of Squak heritage (like pharo):

http://cuis-smalltalk.org/

"Cuis is a free Smalltalk-80 environment with a specific set of goals: being simple and powerful. It is also portable to any platform, fast and efficient."

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by baron_harkonnen on Saturday December 21, 2019 @03:20PM (#21853162)
“Operating System: An operating system is a collection of things that don't fit into a language. There shouldn't be one.” — Daniel Ingalls “Design Principals Behind Smalltalk” [0]

Learning the Smalltalk “world”/vm is an essential part of learning Smalltalk the language. Many people are initially put off by this but if you try to find a “Smalltalk without a Smalltalk-specific IDE” you are missing out on an enormous part of what Smalltalk is.

0. https://www.cs.virginia.edu/~evans/cs655/readings/smalltalk....

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by rektide on Saturday December 21, 2019 @07:13PM (#21854190)
It's kind of amazing to me how few how little our work has been in developing "extras", general services, between language & user.

The os has become a passive tool to run stuff on, but once it was an involved middle layer that the user might be tapping throughout their use, with the os & user capable of understanding exposing & controlling some of the items in the program space. Now the program is more of a blind space to the os, doing it's own thing. Adjusting a program's volume & resizing it's window is all the interaction most users project from os space into program space.

More general systems research please!

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by skore on Sunday December 22, 2019 @01:30AM (#21855618)
The frustrating thing is - the more you learn about what the OS can do, the more you realize that many programming languages and the applications written in them quite often reimplement large parts of the OS for an astonishingly large portion of their codebase. That isolates developers from learning about the OS in the first place. (They always end up needing to learn about it, anyhow, so it's a bit futile. Now, however, they feel smug about it and pretend like they shouldn't need to learn all this OS stuff.)

I guess developers always implement their own ignorance to a certain degree (and how could they not!? except, you know, spending more time learning their craft). What they don't know the OS can do, they will recreate - often poorly - in their own software. It does get rather comical and the various frameworks that you can subscribe to in modern programming languages repeat the concept, just that now, you're reimplementing things that the language can already do, but in the framework.

My favorite example is the various kinds of "service" patterns, like dependency injection - in many instances that I've seen, you could boil most of its use down to simple function calls. But since global functions are ew, you instead create a service that you inject and then call a method in. Boom, the gods of OOP are happy and nobody is allowed to say: "Wait a minute, if I take a few steps back and squint a little, what you're doing looks surprisingly similar to a global function call."

(And yes, I know, DI is supposed to be about overriding functions, yada yada very few people actually do that and it's often such an organizational hassle with downstream problems that projects eventually resort to put up conventions from doing that most of the time. Anyways - tell that to the people that I've seen implement, I kid you not, a CamelCaseService.)

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by DaiPlusPlus on Sunday December 22, 2019 @03:41AM (#21855981)
DI services are usually abstracted behind interfaces - and most systems allow you to replace the service interface implementation at runtime.

So if you have a class that uploads files to a cloud storage provider - it would make use of IStorageProvider, and you might have AmazonS3StorageProvider, AzureBlobStorageProvider, LocalDiskStorageProvider, and for testing you would have DevNullStorageProvider.

A program using DI without interfaces with different implementations is missing the other advantages of DI.

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by ProfHewitt on Sunday December 22, 2019 @09:50AM (#21857371)
Ingalls was completely correct: It should be Actors all the way down (and Actor Systems all the way up).

Soon there will be packages with millions of Actor cores for quadrillions of Actors. Operating systems, e.g. Linux, will be inadequate for Reusable Sacalable Intelligent Systems.

See the following: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3428114

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by JulianMorrison on Saturday December 21, 2019 @05:13PM (#21853639)
That feels like a sentiment from gentler, single-user time. Unless Smalltalk has grown some serious security chops in the interim.
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by cbdumas on Saturday December 21, 2019 @06:11PM (#21853880)
I disagree, a system implemented at the language level this way can in principle provide far stronger security guarantees than a typical operating system. Security issues can still come up obviously but they could essentially be isolated to the language runtime.
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by JulianMorrison on Saturday December 21, 2019 @07:04PM (#21854147)
And then you're getting into things like capability-passing languages, but Smalltalk is not that.
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by true_religion on Sunday December 22, 2019 @12:09AM (#21855323)
Bear in mind, it’s Ben about a decade since I last used Smalltalk, but at the time there was a web framework called Seaside based completely on using stored closures instead of normal Ajax.

Digging into the code, I found that the VM just gives a code block access to all top level objects by default, but that isn’t a requirement. You can instantiate your own “global” and run the block within that. Back then I believe it was being used because old closures needed to see old top level class objects that might have been changed in the meanwhile. So you can use this to sandbox functions.

I would imagine it isn’t perfect, but it could be made so.

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by mark_l_watson on Saturday December 21, 2019 @03:09PM (#21853107)
Whoa, hold your horses!

Pharo is a modern open source Smalltalk that was derived from Squeak. Nice UI, vibrant ecosystem and community. https://pharo.org/

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by jchw on Saturday December 21, 2019 @03:20PM (#21853165)
Instantly was enticed by this, but quickly ran into the depths. I'm on NixOS unstable and I realize this is not ever going to be a well-supported place to be in terms of running random software, but thankfully there are in fact Pharo attributes in nixpkgs. Sadly though, I can't figure out how to use it.

It looks like I want to start with Pharo Launcher, so I've installed the Pharo VM and Pharo Launcher, but when I try to start Pharo Launcher a window pops up and it just exists. All I can see in the terminal is a message about pthread_setschedparam failing, which does not seem fatal.

I wonder whether my problem is with not understanding what I'm doing, or with NixOS, or something in between...

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by e12e on Sunday December 22, 2019 @08:31AM (#21857031)
> All I can see in the terminal is a message about pthread_setschedparam failing,

Just spotted this on Cuis smalltalk github page:

"If you get this error message (you won't get it if you run Cuis as root or sudo):

pthread_setschedparam failed: Operation not permitted ...

Then you need to do this (just one time):

sudo cp Cuis-Smalltalk-Dev/squeak.conf /etc/security/limits.d/squeak.conf

Log out and log back in, or reboot the machine."

Might be something similar for pharo?

https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/ma...

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by e12e on Saturday December 21, 2019 @03:38PM (#21853246)
Did you try the zip from here? http://pharo.org/download

I'd guess you could get some hints by running ldd on the vm (I'm assuming it's not strictly a static binary).

You need the vm and an image - the launcher I imagine is a vm and just enough image to display a menu and get a "proper" image downloaded.

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by jchw on Saturday December 21, 2019 @04:16PM (#21853410)
I have the VM seemingly working through the NixOS package, and if I run the Pharo image downloaded from there, it seems to show a window with nothing on it but a menu item labelled "Pharo" that does nothing.

Perhaps I'm missing something but I doubt the Linux VM download on that page will help me. Ordinary binaries don't tend to run on NixOS without at least some ELF patching due to the Nix store architecture.

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by e12e on Saturday December 21, 2019 @05:22PM (#21853670)
Sounds like a ui/x toolkit library mismatch. I've seen similar issues with Java gui apps under Linux (long ago though).
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by mark_l_watson on Saturday December 21, 2019 @03:40PM (#21853252)
I can’t help you. I sometimes have NixOS running in a VirtualBox container, but don’t have one available right now. Do you have a plain Linux running anywhere, or as a container inside NixOS? Except for occasional font problems, Pharo works fine on Linux.
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by emp on Saturday December 21, 2019 @03:19PM (#21853154)
The IDE is where the super powers are. Like any IDE it just takes a little time. https://pharo.org/ has an online course to get into it. Being in a live system is unlike anything else - the first time a debugger appears and you fix the bug in the debugger and just hit the “continue running” button is a rush. TDD inside the debugger is amazing. And do much more. You really need to experience it, else it just sounds like hot reloading features of current tech.
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by gdxhyrd on Saturday December 21, 2019 @05:32PM (#21853706)
> the first time a debugger appears and you fix the bug in the debugger and just hit the “continue running” button is a rush

That is possible in other many other languages, including system ones like C.

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by goatlover on Saturday December 21, 2019 @11:06PM (#21855116)
Being that other languages are Turing-complete ...

Which doesn't really mean much when it comes to the standard developer experience and how that differs between programming a live image and the tooling built around that versus manipulating text and the tooling built around that. One lives at the abstraction level of running code and the other at the level of syntax.

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by gdxhyrd on Sunday December 22, 2019 @10:42AM (#21857698)
Sorry, but all those are buzzwords.

In C/C++, I can do live debugging, reverse-time debugging, edit-and-continue debugging, multi-device debugging, multi-threading debugging... We also got language servers, on the fly retesting and recompiling, all kinds of profiling... All that with free or open tools readily available, not to mention paid, proprietary ones.

In higher-level languages, fancy features are even more prevalent.

So, what are we missing exactly from Smalltalk?

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by coldtea on Sunday December 22, 2019 @03:22PM (#21859400)
You have everything in a subpar way. Smalltalk has it first class.
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by pulse7 on Saturday December 21, 2019 @03:27PM (#21853200)
Smalltalk is an IDE + runtime together on a single VM. This brings many advantages (very fast software development; almost no compile time; you can change the running system, ...), but also disadvantages (harder to integrate external libraries, hard to separate final runtime/binary from development)...
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by JulianMorrison on Saturday December 21, 2019 @03:19PM (#21853153)
Objective C is very Smalltalk-ish.
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by skybrian on Saturday December 21, 2019 @05:24PM (#21853676)
Wren is a small scripting language with a bit of Smalltalk flavor, though syntax is more like Ruby. It's written by the author of Crafting Interpreters so if you've read that (particularly the C chapters) you'll understand quite a bit about the implementation.

http://wren.io/

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by frou_dh on Saturday December 21, 2019 @03:21PM (#21853172)
Something like Pharo is more like learning a whole new OS in addition to a language. Unless you have the energy to do that, it's probably best left on the bucketlist. I bailed.
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by ska on Saturday December 21, 2019 @03:34PM (#21853233)
> Something like Pharo is more like learning a whole new OS in addition to a language.

That's kind of the point.

Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by frou_dh on Saturday December 21, 2019 @03:54PM (#21853310)
Along with the edifying stuff there is a lot of incidental difference in the OS that is not edifying. That's why I mentioned energy. You need a lot of energy to be able to follow through and make a proper go of things on a different planet.
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by ska on Saturday December 21, 2019 @03:55PM (#21853318)
I hear you, it's a real commitment - but I don't think the two can really be effectively separated.
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by jolmg on Saturday December 21, 2019 @03:38PM (#21853249)
There is GNU's smalltalk, which comes with a REPL. You should be able to write smalltalk from vim or any other text editor.
Re:Alan Kay: Smalltalk is not about objects, it’s about mess... by soapdog on Saturday December 21, 2019 @03:52PM (#21853302)
The smalltalk IDEs are light years ahead of the rest. Just check Pharo.