My beef with Smalltalk is that it's far too much a world onto itself for my taste. Java is already a bad enough citizen of Unix but Smalltalk takes it to a new level. If Lisp and Scheme can integrate well into Unix, why can't Smalltalk?
Lisp and Scheme don't actually integrate with UNIX. Their UNIX versions are handicapped versions of themselves. Languages with rich runtimes and developer tooling are always shoehorned into POSIX model to "feel UNIX".
Pharo, the Modern Smalltalk
61–70 of 178 posts
Re: Pharo, the Modern Smalltalk
#62They need to work on the presentation. How do you get started ? How does the code look like ? etc. Not just "download this program and buy this book"
Re: Pharo, the Modern Smalltalk
#63Earlier quoted context omitted.
I have found that O'Reilly's "Nutshell" books tell me everything I need to know when learning most new languages, and then some. For some languages, though, they have features that might make this sort of overview challenging if you do not understand the core paradigms (such as Rust's ownership concepts).
Not really: https://rustbyexample.com/ There's no excuse for not having any examples of a programming language on that programming language's home page. Here are some languages that do it right: https://ceylon-lang.org/ https://www.dartlang.org/ https://golang.org/ https://www.rust-lang.org/en-US/ Notice there at least one example (often executable!) on the home page of each site. I'm actually pleasantly surprised ho…
I see examples on their home page.
Re: Pharo, the Modern Smalltalk
#64Earlier quoted context omitted.
Simply a) keep a copy of the original image [clean slate] b) keep a copy of your changes/additions [use version control if you like] c) import b into a. Repeat daily or weekly as you please. > You always modify code on the fly Since back in the '70s when Smalltalk was being created at Xerox PARC and used there for experimental systems development, changes were automagically recorded in a changes .cha text file. For m…
> Simply a) keep a copy of the original image [clean slate] b) keep a copy of your changes/additions [version control] c) import b into a. Really? So we're back to "MyImage.img.bak.2.old.works", "MyImage.img.bak.3.works", "MyImage.img.bak.2.test"? Now that is an experience I do not want to ever have to experience again.
No, that's a bizarre suggestion you just invented, it has nothing to do with what I wrote.
Re: Pharo, the Modern Smalltalk
#65Programming in Pharo is usually done either in the class browser or the debugger so that you're only ever seeing the code for one method (called a message in Pharo) at a time. Pharo and other Smalltalk variants tout simplicity of syntax but leave off the fairly complicated class hierarchy and message coupling semantics ergo the necessity for an extremely powerful browser. In the browser, messages for each class are further separated into 'protocols' such as methods for 'accessing' or 'initialization' (these are not part of the Smalltalk syntax, just a convenient layer of organization). At each level in the hierarchy, the Pharo code browser gives you a nice template to edit when you want to make a new package, class, or message. The overall effect is that you're only ever working with a handful of lines at a time and, indeed, Pharo will warn you if it thinks your message is too complex. Doing things this way actually makes everything quite manageable. One of the nice features of being pure OO is that everything is a pure black box so you just need to know that a class exists and take a peek at its interface to use it effectively.
To that end, Pharo actually has an excellent search tool that's not present in other Smalltalk variants like Squeak or Cuis. It does some kind of intelligent voodoo and can find anything from definitions to instantiated objects to senders and receivers of a certain message and so on. You can also open up a playground window to experiment with whatever code in the REPL style. But it's actually a little bit more robust than a traditional REPL because of the pure OO nature of Smalltalk. The thing you get back from evaluation isn't just some text. It's an object with all the associated possibility of reflection and manipulation (which can all be done from a UI, not just from evaluating more code).
One of the things Pharo does better than almost every other language is debugger integration. Pharo is like LISP in the sense that you can start an application, have it encounter an error (or just pause execution at will), drop into the debugger and change some stuff, reify whichever execution stack frame, then resume the program as if nothing ever happened. This is the essence of the other common Pharo workflow: write some partial code and then fill it in incrementally in the debugger until you have a fully functional and bug-free application. In addition, Pharo has its own robust unit testing system called Sunit that, coupled with the debugger workflow, creates a fantastically ergonomic TDD experience.
No matter where you are in the Pharo environment, Smalltalk code gets full treatment (E.G. syntax highlighting, code completion). So what does the syntax look like? Well, it actually has that concatenative elegance of Forth plus a few other constructs. Pretty much everything is a message send. Message sends come in three flavors: unary, binary, and keyword. Constructs like conditionals are also just message sends. In addition, there are first-class lambdas (called blocks in Smalltalk). Here's the canonical factorial program:
"Factorial function" fac := [ :n | (n = 0) ifTrue: 1 ifFalse: [ n * (fac value: (n - 1)) ] ].
where " ... " is a comment, ':=' is assignment, '[ ... ]' is a block, ':n' is the block's argument, arithmetic operators are actually binary message sends, things like 'ifTrue:' are keyword message sends (unary message sends are similar but don't have colons or parameters e.g. 'SomeObject new.'), and the statement is terminated with a period. Apparent recursion is fine because Smalltalk uses late binding. Aside from some syntax for strings and class declaration, that's basically it.
Pharo also has a lot of other nice features such as keeping a log of code changes in case of program crash or power outage, an integrated package manager/version control system, and optional git integration. It's all pretty easy to use and overall the system is quite impressive with a high degree of polish and decent performance (comes close to or exceeds node in my experience). However, as others have stated, it's a walled garden. All UI interaction happens within the Pharo environment with no option for native. If you want to break out on UNIX, you have write some kind of server and use sockets or the filesystem (which isn't a huge handicap in the grand scheme of things). On the other hand, application deployment is a little iffy. There's no readily apparent scheme to pare an image down to just what your project uses and then distribute that; users would have to install your package from within their own Pharo environment.
Re: Pharo, the Modern Smalltalk
#66My beef with Smalltalk is that it's far too much a world onto itself for my taste. Java is already a bad enough citizen of Unix but Smalltalk takes it to a new level. If Lisp and Scheme can integrate well into Unix, why can't Smalltalk?
"GNU Smalltalk -- The Smalltalk for those who can type"
http://smalltalk.gnu.org/Re: Pharo, the Modern Smalltalk
#67Earlier quoted context omitted.
Not really: https://rustbyexample.com/ There's no excuse for not having any examples of a programming language on that programming language's home page. Here are some languages that do it right: https://ceylon-lang.org/ https://www.dartlang.org/ https://golang.org/ https://www.rust-lang.org/en-US/ Notice there at least one example (often executable!) on the home page of each site. I'm actually pleasantly surprised ho…
> There's no excuse for not having any examples of a programming language… https://pharo.org/ I see examples on their home page.
Then there is a textual example consisting of two lines of Posix shell, embedded in which is indeed a tiny Pharo program in a string.
The parent's point mostly stands.
(Oh, and there is a frickin' popup for a frickin' email newsletter hiding the content.)
Re: Pharo, the Modern Smalltalk
#68I start from stupid since I was 8 on Programming Languages. I taught myself Assembly and Pascal before I was a teenager. I learned Racket and Smalltalk to be a better problem solver. I ended up becoming a MUCH better programmer due to these two. Racket stuck and I use it for all my personal projects but Pharo is a great learning tool at the very least.
Re: Pharo, the Modern Smalltalk
#69They need to work on the presentation. How do you get started ? How does the code look like ? etc. Not just "download this program and buy this book"
Re: Pharo, the Modern Smalltalk
#70Earlier quoted context omitted.
Coming from a place of ignorance, how does Smalltalk not integrate?
The default mode of interaction with Pharo and most other Smalltalk-based systems is not "launch an application which interacts on the console or opens some windows", but rather "launch Pharo, then inside the big Pharo window launch an application which interacts on the Pharo console or opens some windows inside the big Pharo window". I think there are ways around this, but you may have to dig deep to find out how. G…
Actually, the standard end-user experience is to launch an application which interacts on the console or opens some windows.
(There'll be some system startup methods which define what happens when the image launches -- don't open the development environment windows, open the application windows).