r/programming • • Jan 22 '19

Pharo 7.0 released!

https://pharo.org/news/pharo7.0-released
378 Upvotes

137 comments sorted by

View all comments

62

u/ivosaurus Jan 22 '19

A glimpse of Pharo

Tells me to run a bash command sourcing code from the internet, doesn't even show me what hello world looks like.

35

u/orthoxerox Jan 22 '19

That's because it has no hello world or main. All Smalltalks except the GNU one are basically suspendable VMs that have been running and evolving since 1980. To write a program you basically modify that VM by adding classes and instantiating additional objects, suspend it and then distribute copies of it.

11

u/Smallpaul Jan 22 '19

There is still a way to make your VM say "hello world"!

http://wiki.squeak.org/squeak/2230

9

u/igouy Jan 22 '19 edited Jan 24 '19

hello world

iirc

FileStream stdout nextPutAll: 'Hello, world'; cr.

edit: I'm told FileStream has been deprecated, so —

Stdio stdout nextPutAll: 'Hello, world'; cr.

main

Smalltalk implementations usually have a defined sequence of default startup actions / handlers, which are much-like having a main.

To write a program you basically modify that VM by…

There are usually 4 different things — the Smalltalk VM (like the JVM), the Smalltalk image (run-time state: bytecode, data, …), sources (original source code), and changes log (all the Smalltalk commands that have been done to change the Smalltalk image).

To write a program you use the development tools in the Smalltalk image to change the Smalltalk image.

8

u/stronghup Jan 22 '19

That's a good explanation. I'd add that programming in Smalltalk (IDE) is like being inside the debugger all the time, all variables are inspectable, all programs callable.

That's both the major strength and weakness of Smalltalk, depending on what you use it for. It is its own world.

The weakness is that when two programmers modify their respective "worlds" in their own way it is not always easy to combine their changes. I'm curious about the new git-support. Is all of the class-hierarchy stored in git?

2

u/bencoman Feb 03 '19

> Is all of the class-hierarchy stored in git?

yes... https://github.com/pharo-project/pharo/tree/Pharo7.0/src
and its bootstrapped from those sources. i.e. reproducibilty from starting with zero image

1

u/stronghup Feb 08 '19

Interesting. GIT is a file-based system, so is every class in a file of its own, or is every method?

12

u/Randolpho Jan 22 '19

Sound ghastly

9

u/SergeantAskir Jan 23 '19

We had smalltalk as an enivronment in two uni courses. I can say that it definitely takes some time to get used to and I would never use it for a production environment. But the way it works is definitely interesting and the concepts of smalltalk had a lot of influence in other languages. It will also teach you how object oriented REALLY works. It's a good language to teach and learn design patterns, software design and architecture.

4

u/[deleted] Jan 23 '19

It is really amazing. I use it daily at work as our main development platform (not Pharo but another Smalltalk distribution).

You have one VM image that includes your ide and your app at the same time. Since everything is Smalltalk you can freely modify your ide to include whatever feature you need. This is really neat. Kinda an issue though, if your app hangs for whatever reason, your entire VM hangs, and therefore your ide. Normally this can get resolved though because the VM has a button to send an interrupt that causes the debugger to pop up as if it hit a breakpoint.

You're also not simply distributing copies of your image. Our Smalltalk distribution includes a packaging tool that creates a new image that includes your source code tree and removes all parts of the ide that are not also part of your app (as in GUI parts used for both).

3

u/[deleted] Jan 23 '19

Its ALIVE!

3

u/igouy Jan 22 '19 edited Jan 23 '19

Whether it is ghastly or not, depends on how the developers use the tools.

Nothing prevents them exporting the changes they've made into files; and later importing those files into a clean (original) image file in a systematic way.