News for hackers. Stuff that matters.
Re:On Learning Smalltalk by jonathaneunice on Tuesday January 11, 2022 @09:04AM (#29891543)
I learned Smalltalk in the Elder Days (1985). Coming from C and Pascal, the power and majesty of true collections—dynamic lists! that you didn't have to build yourself with pointers! sets! dictionaries! iteration over objects not integers! selection, rejection, injection!—was astounding. The ability to define behaviors in a generic not intensely specific way, the ability to meta-program, the ability to twiddle your environment directly—just so many world-changing innovations. Thankfully most of these advances are now baked into Ruby, Python, JavaScript, etc. (either right into the language, or with ready-to-hand libraries like itertools, more-itertools, and Underscore.js).

The image—all your code, data/state, your entire OS and windowing system, your IDE, all rolled up into one—that was an interesting approach but honestly that is the worst thing about Smalltalk. No modularity. No version control. Your image persists your data and changes forever—including any mistakes you make, knocking around inside big ball of ever-declining clarity and reliability. Over time every image collects entropy, mistakes, and bitrot like no one's business! Eventually it gets to be impossible to figure out how to fix it, or takes so much energy to maintain you won't bother. Then you have to chuck it and start afresh. Rinse and repeat! Give me today's alternative, non-persistent dev environments and version control, any day.

Re:On Learning Smalltalk by taylodl on Tuesday January 11, 2022 @11:18AM (#29893424)
I learned Smalltalk in 1994, which was well past the Elder Days. I came from a strong C++ background. I had the same experience you had in that Smalltalk showed a completely different way of doing things. Unfortunately we were hampered by garbage collection. We tried to tune and optimize as much as the environment would allow to no avail - when it came time to garbage collect the system would freeze for several seconds, sometimes up to tens of seconds. That was completely unacceptable for commercial software. Marketing also wasn't thrilled the UI came bundled with the environment. It was rather ironic that Java would come out the next year and the entire industry would pour so many resources into solving the garbage collection problem. Nowadays on a multi-processor system with concurrent garbage collection enabled the garbage collection can run faster than on manually-managed memory! That sure didn't seem like it would ever be possible in 1994!
Re:On Learning Smalltalk by worik on Tuesday January 11, 2022 @04:24PM (#29898172)
> [a] system with concurrent garbage collection enabled the garbage collection can run faster than on manually-managed memory

Maybe. But not predictably. It will have delays, they may be small, but there is know way to know when they will come. This can be managed but it is all overhead. Manual memory management has none of that run-time overhead (but a tonne of programmer overhead)

Re:On Learning Smalltalk by maemre on Wednesday January 12, 2022 @02:09AM (#29903295)
Manual memory management is much more predictable (which is really nice for interactive/real-time programs), it does have nontrivial runtime overhead: malloc and free aren't free (pun slightly intended), and often costlier than a bump allocator most moving/copying GCs use (just increment a pointer and have a very branch-predictable conditional to check OOM). Also, moving/copying GCs increase data locality by bringing live objects closer, which is more cache friendly.

I agree that manual memory management is much more predictable than garbage collection, I just wanted to touch on the nuances of the memory overhead of manual memory management.

Also, if the program creates lots of short-lived objects (which is often the case), a generational garbage collector would be pretty fast because it will reclaim/move a few objects rather than deallocating many objects. An arena collector or allocating on the stack might be better (and manual methods) in this scenario though.

Re:On Learning Smalltalk by jhgb on Wednesday January 12, 2022 @06:44AM (#29905063)
> It will have delays, they may be small, but there is know way to know when they will come.

It was my understanding that C4 doesn't do pauses.

Re:On Learning Smalltalk by worik on Wednesday January 12, 2022 @09:50PM (#29916212)
On the face of it, I do not believe it. "Mostly dosen't pauses" is believable. Great strides have been made

But what is it? Where can I find out about it? A deterministic garbage collector would (a) prove me wrong and (b) be a Very Good Thing

Re:On Learning Smalltalk by igouy on Tuesday January 11, 2022 @01:46PM (#29895839)
I taught myself Smalltalk in 1988 coming from Modula-2.

It's simply anachronistic to judge Smalltalk implementations of that past decade against version control of this decade, when there have been newer Smalltalk implementations with version control.

Even back in 1983 the blue book discussed "Storing the set of Changes on a File" (page 465) and "Commands that check for conflicts" ( http://rmod-files.lille.inria.fr/FreeBooks/TheInteractivePro... page 472).

"Whether your development team consists of one person, or many: Do understand and use the change manager. The change manager is one of the most important tools for software development in the Smalltalk-80 environment. … It allows you to selectively browse [changes], remove [changes] incorporate them into another version of the system, check for conflicts, and prepare the changes for release to other members of the development team or to end users." (page 500 "Smalltalk-80 Software Development Do's and Dont's")

> Your image persists your data and changes forever—including any mistakes you make…

Even back in 1988, source code changes made with the Smalltalk IDE were automatically logged to a text file (the change log) and we could choose which of the logged source code changes to apply later to an unchanged image file.

So no, mistakes were not forever.

Re:On Learning Smalltalk by smackeyacky on Tuesday January 11, 2022 @11:02PM (#29902124)
I don't know about that. For most of the VisualWorks programmers I was tasked with helping in the 1990s, the change log was an error prone way of sharing changes amongst your team members - this was before ParcPlace implemented packages properly and whatnot.

All of it was pretty useless compared to using Envy/Developer which was a unique version control system that was based entirely around Smalltalk and collected up your changes in a way that made sense for sharing.

The guys at ParcPlace never seemed to quite understand what we were facing back then - your average departmental programmer trying to replace a green screen in a team of 20 other programmers not only had to cope with a complete change of paradigm for the programming language, but the version control systems were non-existent or useless even compared with simple systems like SCCS. Change logs just didn't cut it when you got past 2 developers.

The vanilla VisualWorks simply didn't scale to multiple users trying to share code. Envy/Developer fixed that (and how! Still the best version control system I have ever used).

The "forever" thing might be an exaggeration, but in practical terms I had a lot of guys destroy images accidentally by over-ridding something in Object or whatever while they were learning and causing havoc for themselves. Trying to piece together their good work from the change log was...effectively impossible until they learned what they were doing due to the total scattergun approach a lot of them used. So perhaps not "forever", but given the time constraints in a normal development environment, it was forever for certain values of forever.

Re:On Learning Smalltalk by igouy on Wednesday January 12, 2022 @02:04PM (#29911384)
> … didn't scale to multiple users trying to share code…

Just curious, what process did you tell them to get past their "scattergun approach"?

I never looked at the 1984 "Smalltalk-80 The Interactive Programming Environment" book until about a year ago, so very much with the benefit of hindsight —

"At the outset of a project involving two or more programmers: Do assign a member of the team to be the version manager. … The responsibilities of the version manager consist of collecting and cataloging code files submitted by all members of the team, periodically building a new system image incorporating all submitted code files, and releasing the image for use by the team. The version manager stores the current release and all code files for that release in a central place, allowing team members read access, and disallowing write access for anyone except the version manager." (page 500)

http://rmod-files.lille.inria.fr/FreeBooks/TheInteractivePro...

Re:On Learning Smalltalk by smackeyacky on Thursday January 13, 2022 @01:20AM (#29917425)
Initially we followed that model, we would have a designated integrator that incorporated changes when you hit a milestone, and ways of filing that into other developers images as they went, but it was very error prone and a lot of regressions would pop up for the integrator as they struggled to keep up.

Envy fixed that, you could start with a fresh envy image and grab your updates. You could also isolate developers in their own branch like git and get proper warnings when you had integration issues when merging.

Basically the integration job went from full time to a couple of hours a week.

Re:On Learning Smalltalk by igouy on Thursday January 13, 2022 @01:57AM (#29917647)
Thanks. fwiw Seems to me that what you describe is different.

> … filing that into other developers images as they went…

Seems to me that after "building a new system image" all their developers worked with that same fresh system image (built from known archived sources).

(Perhaps I'm wrong about that.)

Re:On Learning Smalltalk by smackeyacky on Thursday January 13, 2022 @09:42AM (#29921215)
It was a bit of a combination. We tried using pre built images but managing them got out of hand pretty quickly and there was no easy way to diff images so whoever did it had to be careful.

Then we settled on pre built images with just the across team shared code. But that got difficult too, as some teams didn't want to upgrade as quickly as others on the shared code base, so we were maintaining several versions of that.

The teams themselves had regular image consolidations saved, plus file outs and some PVCS for those, but it got increasingly harder to make a consistent merged image no matter what and devs were spinning their wheels in a kind of code merge hell at the method level that is unique to smalltalk.

Then we got envy and it fixed everything.

ParcPlace did eventually come up with a different structure for packaging and sharing code but it was too late and too simplistic to be useful.

Re:On Learning Smalltalk by igouy on Thursday January 13, 2022 @12:52PM (#29924052)
> … code merge hell at the method level … envy and it fixed everything.

Puzzled. ENVY/Developer is still Smalltalk and code merge still method level?

Perhaps what was shared within teams and between teams changed?

Re:On Learning Smalltalk by smackeyacky on Thursday January 13, 2022 @04:15PM (#29926966)
Yeah, there were a lot of side channels for sharing code that made merging things more difficult than they could have been. Poor discipline when devs were in a mad rush.
Re:On Learning Smalltalk by igouy on Friday January 14, 2022 @12:11PM (#29937088)
Seems to me that "sharing changes amongst your team members" is much more about process than it is about tools; and the process (whatever it is) must be followed by everyone every-time.

(With the benefit of hindsight) seems to me that many teams made their mistakes with vanilla Smalltalk and avoided those same mistakes when they moved to ENVY/Developer.

Re:On Learning Smalltalk by smackeyacky on Saturday January 15, 2022 @09:49PM (#29952790)
Envy enforced discipline in a way, which helped a lot. Sure, the devs could have had that discipline with filed out classes but because envy made sharing code easier, they inherited that process as well.
Re:On Learning Smalltalk by igouy on Tuesday January 11, 2022 @11:42PM (#29902405)
> … effectively impossible until they learned what they were doing due to the total scattergun approach a lot of them used.

You tell us the people didn't know what they were doing — so why blame the tools?

(Incidentally, I used Envy/Developer for years.)

Re:On Learning Smalltalk by smackeyacky on Wednesday January 12, 2022 @08:35AM (#29906101)
I blame the tools because they were inadequate at the time and inferior to even rudimentary things like sccs.

Not every programmer is a superstar. Visual basic was a much better environment for average guys doing green screen replacement jobs.

Re:On Learning Smalltalk by igouy on Wednesday January 12, 2022 @01:37PM (#29911039)
> … replace a green screen in a team of 20 other programmers…

I was briefly involved with a project that sounds a bit like that — a 2 week training course for current staff, then rewrite everything from data model to U/X in half-the-usual time because someone said OO is more productive.

That project used ENVY/Developer. The staff admin deleted the repo. The staff wouldn't have passed phone screen for Smalltalk work (maybe some would have in 6 or 12 months). When the people don't know the basic tools, that's what matters.

Re:On Learning Smalltalk by smackeyacky on Thursday January 13, 2022 @01:29AM (#29917476)
It does help if they know the tools. The main struggle we had wasn't that they weren't smart, most of them were fantastic domain experts who just didn't have that inquisitive tech spark that sets different breeds of IT people apart. There is nothing wrong with being a domain expert who isn't that keen on cutting edge tools, but back then giving them smalltalk was a mistake. VB and powerbuilder were theoretically inferior, but far more productive for guys like that.
Re:On Learning Smalltalk by coliveira on Tuesday January 11, 2022 @11:31AM (#29893647)
This is like saying that using an OS with long term storage is a problem because it accumulates incorrect files, mistakes, and other long term choices that will hamper your productivity. It may be true, but it is not necessarily the case. You can use images in the way you describe, but you can also use them as a support technology that is available only when useful for development. Modern development in Smalltalk uses source control like any other language.
Re:On Learning Smalltalk by jrumbut on Tuesday January 11, 2022 @02:09PM (#29896192)
> an OS with long term storage is a problem because it accumulates incorrect files, mistakes, and other long term choices that will hamper your productivity

This is why containers became so successful, IMO. For a long time I thought being able to log in to a server and set up a new cron job to deal with some maintenance task was a strength. It turns out that over time it does become a problem.

Re:On Learning Smalltalk by esfandia on Tuesday January 11, 2022 @12:04PM (#29894191)
I don't know about the current state of Smalltalk, but back in the late 90s there was a very elegant version control system for Smalltalk called Envy. It provided version control at the level of each method, and it was integrated nicely in the IDE.
Re:On Learning Smalltalk by swamp_cypress on Tuesday January 11, 2022 @06:53PM (#29900212)
I use Envy on VA Smalltalk professionally. Coming from Mercurial and SVN, when I first encountered it, I thought "WTF".

Now I regard it as the greatest version control tool I have ever used. (It is also a package manager as well as a build tool). Version control at the method level!

Re:On Learning Smalltalk by smackeyacky on Tuesday January 11, 2022 @11:05PM (#29902146)
I would second that. Incredible control aimed at the strengths of Smalltalk. I'm not sure the way it worked would ever really translate to other languages but I really miss it sometimes. It was very expensive though.
Re:On Learning Smalltalk by igouy on Tuesday January 11, 2022 @12:57PM (#29895063)
Re:On Learning Smalltalk by methehack on Tuesday January 11, 2022 @03:29PM (#29897380)
Any persistent storage will exhibit the cruft problem over time for any system of even limited complexity. You're describing people, not Smalltalk. And Smalltalk has had version control for more than a decade.

Smalltalk always felt like it was from the future to me. Its vision and respect for human thought and creativity is so grand it makes me blush. It represents a real belief in technology and what people might do with it. It's full of hope and humanity. It's basically the Shire of programming environments -- if the Shire were part of the Standford campus.

If you haven't checked Smalltalk out, you should free your mind and give it a shot.

Re:On Learning Smalltalk by 0x445442 on Tuesday January 11, 2022 @10:03AM (#29892214)
Most of the Smalltalk implementations I know support version control via Git or some other mechanism as a means of code distribution. And as I understand it, production code is built with CI/CD pipelines using a base image and checking out the code that's the app from a repo.
Re:On Learning Smalltalk by coliveira on Tuesday January 11, 2022 @11:27AM (#29893572)
That's correct, while using an image for development is possible, it is not the preferred way to operate. Any industrial application in ST will use version controlled files, like in other languages.
Re:On Learning Smalltalk by snek_case on Tuesday January 11, 2022 @10:08AM (#29892280)
> Over time every image collects entropy, mistakes, and bitrot like no one's business! Eventually it gets to be impossible to figure out how to fix it, or takes so much energy to maintain you won't bother.

That's an interesting perspective, thank you for sharing.

Smalltalk was trying hard to be different, and there were a lot of neat ideas in there, but while it seems like a very powerful concept to have your OS/editor and language all rolled up into one, that doesn't mean it's a good idea. Kind of like LISP macros. Seems like such a powerful and useful concept, but on the other hand, if you give programmers too much power, they are guaranteed to misuse it.

Re:On Learning Smalltalk by igouy on Tuesday January 11, 2022 @01:51PM (#29895909)
> That's an interesting perspective, thank you for sharing.

One person's perspective; here's another:

https://news.ycombinator.com/item?id=29895839

Re:On Learning Smalltalk by taeric on Tuesday January 11, 2022 @12:53PM (#29894966)
I will note that image based deployments seems to be what the ml world has moved to.

Such that I'm curious if moving models around for use would have been easier in some image based languages.

Re:On Learning Smalltalk by jimbokun on Tuesday January 11, 2022 @09:48AM (#29891995)
That seems to be the common complaint about image bases systems like Smalltalk and (some versions of) Common Lisp. The difficulty of collaborating, auditing, deploying, continuous integration and rolling back to specific versions of the code.

Seems like it makes operational tasks, and really anything that involves distributing the code to anyone who is not the developer, is more difficult than with non-image based languages.

Re:On Learning Smalltalk by scroot on Tuesday January 11, 2022 @09:55AM (#29892117)
There have been several different version control systems available for most Smalltalks for a while now. In the big open source Smalltalks (Squeak, Pharo, etc) there is even Git integration.
Re:On Learning Smalltalk by emschlr on Tuesday January 11, 2022 @10:05AM (#29892244)
Can't we just deploy the Smalltalk or Common Lisp code and not make changes to the live image? Then we can deploy Smalltalk/Common Lisp projects just like we deploy Python/Ruby prjoects. Can't we?
Re:On Learning Smalltalk by vindarel on Tuesday January 11, 2022 @10:16AM (#29892404)
For Common Lisp: sure we can. We can run a program from the sources, as a script, just like Python, and we can build a binary, with all dependencies baked in. CL has the feature to save the current image: it's excellent for development (see how Ravenpack ships images with several GBs of data baked in: the image will start instantly, you won't have to wait for your development data to be initialized again).

And we can run the Lisp program and not touch it. But… if we want, we can easily connect to the running Lisp image, introspect it, change a couple parameters… or do a software upgrade, which can involve installing Lisp libraries… and we could connect to the image on the remote server from our editor and develop the app (while still saving the changes in source control locally), but that would be silly and it isn't a standard way.

Re:On Learning Smalltalk by scroot on Tuesday January 11, 2022 @11:08AM (#29893226)
Yeah, just don't save the image. Whenever you restart the program use a fresh image. This is pretty much indistinguishable from a "normal" program's state when it is running.
Re:On Learning Smalltalk by igouy on Tuesday January 11, 2022 @12:39PM (#29894745)
Here are some libraries and a program in Smalltalk Interchange Format being loaded into a Smalltalk image, the image being saved, and the saved image being used to run the program on the command line —

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

    ./bin/visual nbody.vw_run.im -nogui -pcl MatriX -filein nbody.vw -doit 'ObjectMemory snapshotThenQuit'
    ...
    ...
    ./bin/visual nbody.vw_run.im -nogui -evaluate "BenchmarksGame do: 50000000"
    ...
    ...
    -0.169075164
    -0.169059907
Re:On Learning Smalltalk by vindarel on Tuesday January 11, 2022 @10:09AM (#29892302)
What CL versions could they be? Even in versions with their own, very interactive IDE (LispWorks), we work with source files, with git and all, and we can run a program either from the sources as a script or from a pre-built binary (which is built from clean sources, not from our development image).
Re:On Learning Smalltalk by igouy on Wednesday January 12, 2022 @03:43PM (#29912407)
> … common complaint…

For sure! Is it a well-founded complaint or just an obvious difference?

What if the Smalltalk image is a cache not an archive?

What if source code is exported from the image as text files and archived, and each week the source code is loaded into a base image for test?

https://news.ycombinator.com/item?id=29911384

Re:On Learning Smalltalk by xkriva11 on Tuesday January 11, 2022 @09:55AM (#29892106)
Pharo has all this solved quite well.
Re:On Learning Smalltalk by jimbokun on Tuesday January 11, 2022 @01:04PM (#29895166)
Can you elaborate?
Re:On Learning Smalltalk by xkriva11 on Tuesday January 11, 2022 @01:27PM (#29895536)
Pharo uses libgit2 binding and adds nice tools on top of it. The development of Pharo itself is based on Git/Github. So it uses standard Git workflow with branches, pull-requests, CI building and testing etc., but because it has methods based granularity, it is even better than plain Git for operations like merging and cherry-picking (it can, for example, easily resolve conflicts that plaintext based Git cannot). Moreover, it allows things like listing the history of a particular method. Even CI building can benefit from still-present image capabilities because you can have a basic prebuild image with project dependencies and then just load what you are really interested in in a few seconds (while still having an option to bootstrap it completely).
Re:On Learning Smalltalk by jimbokun on Tuesday January 11, 2022 @02:35PM (#29896632)
That sounds pretty cool.
Re:On Learning Smalltalk by rbanffy on Tuesday January 11, 2022 @01:21PM (#29895427)
I once interviewed James Gosling and one of the questions was precisely that - what did Smalltalk do wrong and what did Java do right for one to fail and the other to dominate the market?

The “doesn’t play well with others” problem of Smalltalk was kind of a killer.

Re:On Learning Smalltalk by igouy on Tuesday January 11, 2022 @01:57PM (#29896016)
Might he possibly have had an agenda to promote? :-)
Re:On Learning Smalltalk by rbanffy on Tuesday January 11, 2022 @03:17PM (#29897217)
At that point I doubt it. I was expecting that answer in fact. Smalltalk had a couple problems Java didn’t. Its syntax scared people used to C while Java made them feel comfortable. The tooling was also free, which was not the case for Smalltalk at the time. Finally, the idea of storing source code inside a memory image didn’t help with interoperability (something I also observed while working with Zope).
Re:On Learning Smalltalk by igouy on Tuesday January 18, 2022 @11:52AM (#29981894)
> … storing source code inside a memory image didn’t help with interoperability…

Here's some "play well with others” "interoperability" —

Sept 21, 1987 — "A version of the Smalltalk-80 object-oriented development environment … has been announced by Parcplace Systems.

Smalltalk-80 DE version 2.2 is said to provide Unix environments with interprocess communication via sockets and access to Unix C shells. On the Apple Macintosh, it provides access to Desk Accessories and provides the ability to cut and paste between the Smalltalk-80 system and the clipboard."

https://books.google.com/books?id=ldk7z4Q-WWYC&pg=RA4-PA4&lp...

Re:On Learning Smalltalk by igouy on Tuesday January 11, 2022 @06:11PM (#29899768)
"The Rise and Fall of Commercial Smalltalk" discussions provide a fuller picture:

https://news.ycombinator.com/item?id=29223880

> … storing source code inside a memory image didn’t help with interoperability…

"Interoperability" covers a lot of things, was there something particular you had in mind?

Re:On Learning Smalltalk by rbanffy on Tuesday January 11, 2022 @06:18PM (#29899862)
In this case it was about being adaptable to the tools programmers already used. Smalltalk required one to buy into the whole thing - it’s an IDE with its own OS and GUI.
Re:On Learning Smalltalk by igouy on Tuesday January 11, 2022 @08:03PM (#29900938)
What if those already-used tools weren't as-good for writing Smalltalk programs?

----

> … its own OS and GUI.

Well there are examples of bare metal Smalltalk (I'm guessing we could say the same of Java?)

    https://github.com/michaelengel/crosstalk
but that was kind-of unusual and afaik commercial Smalltalk implementations targeted specific host OSes.

----

Similarly back in the '80s commercial Smalltalk implementations provided their own GUI L&F (and in the '90s Java provided their CrossPlatformLookAndFeel aka Metal).

When OS GUIs became available in the '80s, Smalltalk implementations either targeted specific host OS GUIs (so on MS Win use MS Win controls) or provided portable GUIs based on emulated L&Fs (OS/2, Motif, MacOS, MSWin) (and in the '90s Java provided AWT/Swing…).

IBM Smalltalk (Visual Age) GUIs were based on what would become in the '90s Java SWT.

----

So no, not really "its own OS and GUI" — when GUIs became provided by the host OS, Smalltalk implementations provided ways to use the platform L&F.

Re:On Learning Smalltalk by arendtio on Tuesday January 11, 2022 @04:17PM (#29898048)
I agree. While there are many things to admire about Smalltalk (e.g. clean syntax, real Object Orientation, feeling of a high-level language), the image idea is certainly the least favorite of mine.

The idea of a bundled IDE is also something I am not completely convinced that it is the best solution. On the one hand, it allows powerful operations, but on the other hand, every feature has to be developed explicitly for that language.

Instead, I prefer the modularity of Unix tools which can be used to develop tools by combining multiple technologies.

Re:On Learning Smalltalk by 7thaccount on Tuesday January 11, 2022 @05:37PM (#29899283)
Text based technologies able to be called from via the command line and piped around to each other with other Linux commands is best for me.
Re:On Learning Smalltalk by tonyg on Wednesday January 12, 2022 @10:08AM (#29907310)
https://github.com/tonyg/squeaker

"Like Docker, but for Smalltalk images."