Hacker News new | past | comments | ask | show | jobs | submit login

Smalltalk system consists of a VirtualMachine and an image. An image is just some Smalltalk code compiled into a form suitable for VM to read it into memory. The initial image contains all the standard classes of Smalltalk plus the GUI and various tools. When you add a method to some class inside the GUI, it gets compiled and added to the image held by the VM in memory. Later, you can dump the modified image to disk, producing a new initial image you can later use.

This is indeed similar to Common Lisp and Emacs.

Back to the original question: the VM runs on Windows/Mac/Linux and on some IoT devices. The code is compiled to bytecode which can then be JIT compiled further on some architectures/OSes. The compiler and the whole infrastructure is exposed and available on runtime.

Pharo has classes for easy FFI to C and for bundling native libraries. I don't know if it's possible to call back from C to Pharo, but I assume yes (many libraries require this). There is no FFI or other integration with any other language (at least as a built-in, there are RPC interfaces for some langs as add-on packages).

As for "standalone binaries" - almost, as you need to bundle the VM with the image; there are some helper scripts for bundling and then launching images.

The most obvious use case is GUI programming, there's also old-school Web programming with Seaside, data crunching and visualization with Roassal. Other than these killer-apps, Pharo is just as capable as any other high-level language, although with a much smaller selection of libraries available.




Some/many Common Lisp implementations. But there are a bunch of Common Lisp implementations which are not image-based.

Another difference might be that most image-based Common Lisp implementations don't use portable byte-code. Some are using byte-code engines, but those are usually not portable across operating systems and/or machine architectures.


You can definitely do GUI programming as the IDE itself is in Smalltalk, but I wouldn't call it super straightforward like using a GUI designer in Visual Studio. I've tried before and got lost in Bloc & Specc?


To be honest, I stopped playing with Pharo around the time when Spec was being designed and beta-tested - I forgot most of it, but I hazily recall that it was a bit too magical for my taste. I hope it got better since then, but I'd have to check.

But, about the GUI, I was thinking about Morphic. It's basically a GUI designer on its own: you can create widgets by instantiating their objects in Playground. It doesn't matter what widget it is: you can create a button or a list item or a textarea on their own. You can then edit them with halo actions or in the inspector until they look like you want, then add them to container widgets, then finally put them in a window. It's bottom-up programming for GUIs! You need to manually track the changes you make via inspector (ie. to copy them to playground), but if you do, you can copy the whole playground into a method and done, you've just designed a GUI app! You later replace some Widgets with their subclasses written by you to handle events and you're done.


I didn't know you could do that. Any chance there is a video on YouTube showing how to do it?


Unfortunately, no, I don't recall anything like this. Executing something like `b := ButtonMorph new openInHand` in the playground would be a start - you can then set click action and caption on `b` and changes should be reflected immediately in the world. Take a look at Morph subclasses and try instantiating ones that seem interesting. Or Alt-Shift-click any widget on the screen to invoke its halo - it will display its class name, and also there's a "duplicate" button in the halo. It's quite discoverable if you put in the effort, although yeah, I'd kill for a good summary and overview of all the various widget kinds and ways of composing them...




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: