9 ms·
Where does the Pharo runtime run? To which platforms can I bring its solutions? are these standalone binaries or can I create libraries or code which play well
by nudpiedo 8y ago
Where does the Pharo runtime run? To which platforms can I bring its solutions? are these standalone binaries or can I create libraries or code which play well with other languages and systems?
Every time I look at a programming language, and at the HN it is every second day, I think about what kind of problems can it solve, and for what kind of platforms these compile/run their runtimes.. and surprisingly not many programming languages inform properly about the most basic feature, and prefer to go deeper into their.
- nudpiedo 8y agoWhy the downvotes? is there anything wrong in my question? I read the webpage and the answer is nowhere (at least I could not find it), and looking at the docs is not so easy to find this information, it seems that I have to get deep in a chapter of a book or a video in order to find out whether this tool has anything to do with my work, tool or area at all. Does it compile to other platforms? Binary code, compile to C, to LLVM? Does it compile to other VMs like Java and it is compatible with javascript engines? For me this is a basic aspect of a language.
- Tomte 8y agoThe download page clearly shows Windows, Mac and Linux.
- nudpiedo 8y agoBut that's the development environemnt/compiler and tooling. It still could generate binaries for microcontrolers for example.
- Tomte 8y agoNo, it couldn't. It's image-based. Your application is the development environment. That's the point of Smalltalk.
- klibertp 8y agoBut it does, apparently: https://github.com/pharo-iot/PharoThings https://github.com/pharo-iot/PharoThings EDIT: Nope! I was wrong, see comment below. It promises Arduino support but via some firmware with Pharo itself still running on the desktop.
- detaro 8y agoThat runs the VM on the embedded Linux computer, and provides remote access to the development tools/an API to run development tools against.
- deleted 8y ago[deleted]
- ljm 8y agoFor what it's worth I think these are decent questions to ask, even if others think they're worthy of a downvote. As far as I understand it: it doesn't necessarily compile in that sense. You are constructing an 'image', which is basically a living environment that your program runs in, and maybe it corresponds somewhat to a VM. But you're not really treating the code that the VM runs as separate to the VM itself. In some sense I think you might map it to something like a Lisp machine, where you can interact with a running program and its state through a REPL. Someone more knowledgeable might be able to elaborate on that (or correct the misunderstandings), but it felt worth offering something other than a straight up dismissal of your question.
- klibertp 8y agoSmalltalk 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.
- lispm 8y agoSome/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.
- fstephany 8y agoLike Java, it runs on a VM. This VM works on the mainstream OS. One of the peculiarity of Pharo (and Smalltalk) is that when you shutdown the system, you can persist the whole system on disk (called "the image"). Next time you open it, you start exactly where you left. All the development tools are mixed with your code. There is no differences between the coding time and runtime (i.e., you code at runtime). If you are familiar with IRB in Ruby, imagine a GUI running in IRB. This means that it is hard to see the limit between your code and Pharo's code. Pharo 7 seems to bring a bootstrap process where you can build images from scratch. This is an interesting evolution that will vastly improve the development/reproducability/deployment story.
- tome 8y ago> Why the downvotes? Please don't complain about downvotes, especially not within the first 23 minutes. It's common to receive one random downvote and a couple more piling on, but given a few hours a decent comment will be back in the black.
- virtualized 8y agoI looked for any useful documentation for a few minutes and just gave up. I don't want to read a book. I don't want to watch a video. This is not my first programming language, thank you. I just want a "hello world" example to get an idea what I am actually dealing with. How do I run a "hello world" program from the command line? How can I deploy that to another machine that doesn't necessarily have a GUI?
- Tomte 8y agoYou don't. Smalltalk means GUI, pretty much.
- lukego 8y ago> I just want a "hello world" example to get an idea what I am actually dealing with. How do I run a "hello world" program from the command line? The trouble is that what you are dealing with is a graphical interactive programming environment. Sure, you can run it from the command line like /bin/perl, but to understand what you are dealing with you have to open it up and try it on its own terms. If you aren't interested in a novel immersive programming environment then you can safely ignore Pharo too.
- 8y ago
- lukego 8y ago> Where does the Pharo runtime run? Pharo runs in a VM that's compiled to C and runs as a stand-alone native application on Linux, Mac, Windows. You can also build from source but most people don't and there are some rough edges. There are plenty of libraries and mechanisms for connecting to the rest of the world e.g. subprocesses, sockets, FFI, and libraries built on those. My favourite computer science paper of all time is about how they develop this virtual machine. https://news.ycombinator.com/item?id=12577087 https://news.ycombinator.com/item?id=12577087
- d-mason 8y agoDevelopment is entirely via the most integrated GUI you've ever experienced. It runs on MacOS, Windows, and Linux. For deployment, you can run it headless. You can also deploy as Javascript for Node/Browsers via a tool called PharoJS (http://pharojs.org http://pharojs.org - full disclosure, I'm one of the principals of PharoJS), but it's a work in progress (with a Slack workspace to support it). GNU Smalltalk can deploy to a standard executable, so you could do most development in Pharo, and then switch to GNU Smalltalk, but you'd lose the fabulous IDE.
- SomeHacker44 8y agoI have not looked at Pharo, but the Lisp development environment on my Symbolics computers is amazingly integrated, so this is a very high bar to surpass if true.
- 4thaccount 8y agoRunning Pharo (or Cincom Smalltalk or Squeak Smalltalk) on an OS like Windows is similar in many ways to an old Symbolics machine, but Symbolics didn't need to sit on top of an OS, but was lisp all the way down. This existed in the past with Smalltalk as well at Xerox Park where it introduced the GUI and Mouse. I forget the machine's name, but someone on HN rebuilt one recently. The hardware was expensive at the time much like Lisp machines. The best lisp comparison to Smalltalk on Windows is likely SBCL + Emacs Slime, but even that is an inadequate comparison as Emacs Slime is mostly just a super powerful text editor and Pharo is fully graphical. You can run some code to generate a rotating 3D image and recompile any of the methods on the fly and instantaneouly see changes. Even the IDE is fully modifiable and you can change the language to make True = False and break everything. Both SBCL Common Lisp & Pharo use the image concept. So you can save your work and system state in the image.
- lispm 8y agoThere are emulators for the old Lisp Machines. The best were Medley (for the old Interlisp-D system from Xerox) and Open Genera from Symbolics. They are philosophical relatively near to Pharo. But Pharo has seen more development in the past decade. For Common Lisp there are/were many integrated IDEs: Macintosh Common Lisp, Allegro CL, LispWorks, Clozure CL on the Mac, Corman Lisp on Windows upto McCLIM for several CL implementations. A general difference to Pharo is usually that these CL IDEs use mostly native user interfaces. Pharo comes with its own user interface, graphics, window system, display code, event handling, ... Example: Pharo windows on a Mac are not Mac windows. Clozure CL windows on the Mac are Cocoa windows. Similar: most CL systems use native code. The real commercial Smalltalk machines were underpowered compared to some of the Lisp Machines - for example those from Symbolics - but those were also quite a bit more expensive. It was possible to spend more than $100k for a Symbolics Lisp Machine with accelerated color graphics and HDTV in/out. The main difference of Pharo with integrated Lisp environments: 1) Pharo uses portable system independent images. Most Lisp systems uses system (OS / architecture) specific images, since code is natively compiled. 2) Pharo code is not native AOT compiled, IIRC. Common Lisp is either source interpreted or AOT compiled - some are even AOT compiled only - with incremental AOT runtime compiler. 3) Pharo uses its own user interface & gui system. Most Common Lisp systems use a native backend for their GUI. Recent exception is Mezzano, which a CL on the metal, which comes with its own GUI. 4) Pharo/Smalltalk usually manages and tracks source code for the user. Most CL IDEs use files and the user works with files and systems of files. CL then more or less tracks the code in these files. 5) Pharo offers to save state in an image between sessions - Lisp systems use that mostly on demand and less as a session state mechanism. LispWorks has some support for sessions.
- ben-coman 8y ago> are these standalone binaries or can I create libraries or code which play well with other languages and systems? Traditionally Pharo could only create standalone applications, but the minheadless builds are making good progress on stripping the windowing code to facilitate it being embeddable. A platform specific VM runs on Windows, Linux, OSX. All those VMs run a single application binary.