5 ms·
Pharo: A malleable and powerful platform
- girvo 13y agoI've always considered playing with Pharo (and Seaside). I just... I dabble in a lot of languages, and struggle to make certain ones fit in my toolbox, at times. Where would you put Pharo? Should I attempt web development in it? Server-side apps? Basically, what sort of development takes full advantage of the super-awesome neat features that Smalltalk gives you? Or am I thinking about it the wrong way?
- kilon 13y agoWell the coding universe is divided into 3 galaxies. The C galaxy that dominates desktop , the Java galaxy and the Javascript galaxy. Of course there are other galaxies too, but I think those 3 dominate currently. For C libraries you can use Pharo. Pharo has inherited 2 FFIs from Squeak and has implemented 1 additional FFI called Nativeboost which also allows you to inline assembly code for best performance. There is also the extra option of making VM plugin with smalltalk or C code which in turn interface with C libraries. For Java there is redline smalltalk, but it does not come with the IDE. It can use Java libraries out of the box. And for Javascript there is amber, it comes with the smalltalk IDE but its still a WIP, so its not as extensive as pharo. It can use javascript libraries out of the box. Smalltalk is a chameleon , its a language and an IDE made to fit in any case scenario. I think you will have a real hard time proving that its tool best used for specific scenarios, even in cases where OO approach is ideal, smalltalk approach could be ideal because it still has one of the most powerful OO systems plus refactoring tools, plus IDE, plus many nice toys. Smalltalk is that extremely rare case of software that it makes coding just flow, with no interruptions and no small annoyances. We call this style of coding "Live Coding" and its definetly the biggest reason to try smalltalk and even more try Pharo. Give a try and register in our mailing list, you will find many people passionate about smalltalk and yet a very welcome atmosphere for beginners. I am also a recent convert to Pharo from Python. I love Python but I dont miss it. So far Pharo has been very productive , fun and eye opening experience. You can find more info here -> http://www.pharo-project.org/home http://www.pharo-project.org/home also a forum for the mailing list can be found here -> http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.ht...
- pjmlp 13y agoYou forgot to mention it is also an OS. :)
- bromagosa 13y agoIMO, it's not an OS, but the living proof that OSes are the wrong approach to computing! :)
- kilon 13y agoI agree with both of you, its more like an "OS inside and OS". However do note here that there is a project to make smalltalk into a true standalone OS called SqueakNOS. Of course I dont think of this as a special feature of Smalltalk, any language could be used to do the same. This is because modern languages come with loads of re factoring tools, GUI APIs and user environments. Smalltalk may have been the first to implement this approach (GUI wise) but no longer the only one. Its not so much that smalltalk is an OS , but rather that is a Live Coding OS. The ability to hack application while they run, is something that could have a profound effect on user experience. Such features are hard coded to apps themselves and are not considered languages features for all non smalltalk apps. But with smalltalk is not that you run an OS as much that you can hack any application on the spot , while it runs and see your changes immediately. This happens because smalltalk does not compile source files but rather methods and of course because of the flexibility of the whole system. Smalltalk is an extremely user friendly environment for users that love to hack the easy way and not get insane in the process.
- pjmlp 13y agoNiklaus Wirth used his experience with Smalltalk to build the Native Oberon OS. Where you could get almost a similar experience while using a strong type language, with help of reflection and by having dynamic libraries as the only form of executables. The System 3 version with its Gadgets toolkit was quite nice. Sadly another GUI desktop OS that didn't managed to become mainstream.
- 13y ago
- philippeback 13y agoCurrently doing web and backend stuff with it. Works very well. Also put my money in there as a consortium member. Really a great feel and awesome community.
- girvo 13y agoNeat! What sort of web stuff? Using Seaside or something else? Do you think you could send me an email (in my profile here), I'd love to pick your brains about using Pharo in production!
- kilon 13y agoSeaside is one approach, there is also Aida-Web. Those are implemented in pharo. with Amber you can use also node.js if you want. And any server side node.js library you can get your hands on. Amber can use any js library. You could even mix amber, pharo , node.js and seaside / aida-web .Sky is the limit. Its up to you which specific approach you will choose. You definitely have loads of options.
- philippeback 13y agoI had a shot at Aida-Web, not my cup of tea. Does the job though. Amber is another beast, and is a very good option for single page web apps. Can do proxying of JavaScript objects, so you can harness whatever you like in your code and use the JS API the Smalltalk way. Which is kind of cool. With the Helios IDE, it is a killer. Needs a while to master but worth the time.
- kilon 13y agoWhat you did not like about Aida-Web ? I am no web dev ( I prefer GUIs , graphics and sound) myself just curious.
- bromagosa 13y agoYou forgot Iliad: automagic AJAX, plus clean and short codebase you can read and understand in under a day (vs. thousands of packages in Seaside). There is of course a downside: a really tiny community... took me a while to get used to the Iliad way, but I'm not going back unless Seaside shrinks to 1% of its current size and makes AJAX integration as easy as Iliad does :) Anyway, I guess the future is not about server-side frameworks, but something like Amber + some sort of Pharo REST service (kinda like Seaside-REST) + some sort of magic persistence (kinda like Voyage).
- benjComan 13y agoI started using Pharo a year ago and its been a pleasure to work with. Great community. I really like the Syntax comparison (slides 46-49). And being able to serialize the debugging context of a running program to a file that can be stored for later
- bromagosa 13y agoUnless you're used to the Smalltalk way, you'd never think serializing the debugging context of a running program would have any use at all. I'd never had dreamed it'd be possible to do what I do regularly in my deployed web apps. When the error handler catches an error, it serializes the error and emails it to me in a fuel file. I can then fire up my _local_ Pharo environment, materialize the error, debug it with all its context, fix whatever code I need to and push the changes to my monticello repo.
- kilon 13y agoWow thats really impressive . well done
- endlessvoid94 13y agoI've been playing with Pharo (and seaside) for a couple days now, and I know it's going to be painful to go back to normal tools.
- philippeback 13y agoThat's why I decided not to :-)
- e12e 13y agoVery nice - even managed to duplicate the demo with a bit of effort (once I got 32bit gl librarires installed in my 64bit ubuntu and got the standard 3.0 image/vm to start...). Now, it appears one can do/print with ctrl-d/ctrl-p -- and that it will work for the current line, eg: 1 + 1 <ctrl-p> "prints 2" But how about blocks? Is there a reasonable alternative to either selecting with the mouse, or with shift-arrow? As far as I can tell even simple "two-liners" force my fingers off of home row... Also anyone happen to know if there's a usable vim-like interface/editor/thing for pharo (other than just starting vim and copy/pasting)? For the curious, I got this to work (just copy-paste into a Workspace. Note that I had to change getGif with getJpeg -- but I'm not yet sure how to "live patch" that properly, for now I just abandoned the stack trace, fixed the code and evaluated again (the last line): Gofer it squeaksource: 'MetacelloRepository'; package: 'ConfigurationOfXMLSupport'; load. (Smalltalk at:#ConfigurationOfXMLSupport) project latestVersion load. Gofer new squeaksource: 'XMLSupport'; package: 'XML-Parser'; load. "Get the data, you can try and print this, if you want" data := 'http://picasaweb.google.com/data/feed/api/all?q=puppy' asUrl retrieveContents. "parse it" doc := XMLDOMParser parse: data. "split up" entries := doc allNodesSelect: [ :n | n name = 'entry' ]. "pick one" entry := entries anyOne. content := entry nodesDetect: [ :n | n name = 'content' ]. url := content attributeAt: 'src'. (ZnEasy getJpeg: url) asMorph openInHand . "Opens image"
- radiowave 13y agoAFAIK there's no keyboard shortcut that selects the whole block (taking block to mean a multi-line chunk of code, rather than a closure). What you can do is put empty (or even non-empty!) comments between chunks of code, double-click just after the comment and everything up to (but not including) the start of the next comment will be selected. "" myFoo do: [:each | each bar ] "" ... and so on. Many years ago someone did produce a set of vim key bindings for some version of Squeak (ancestor of Pharo), never tried it and I've no idea how well it would work under Pharo. Googling for vim squeak will get you some starting points.
- ravestar 13y agoMy favorite language. I wish Pharo all the best.
- nnq 13y agoSide-topic question: is anything from the Smalltalk OO model that hadn't made its way into Ruby? I know that Matz took lots of ideas from Smalltalk when he created Ruby, but I wonder if there are any good OO model related things he didn't adopt. I don't mean the whole image based and IDE in the program thing, I know this is something only Smalltalk has.
- philippeback 13y agoLess verbose syntax.
- nnq 13y agoIndeed. But I would'n consider this a "feature" though: the easiest to read syntax I've seen is that of Python, with the "classic" (by classic I mean "C++/Java like") `.` and `(` clearly separating the message receiver, message name, and message parameters, plus indentation based syntax - nothing beats this combo for quickly scanning foreign code, even without syntax highlighting :)
- kilon 13y agoI am python coder. Smalltalk is much more readable than Python and so is Lisp. I dont know why you think dots and parentheses make things easier to read. Maybe its a matter of preferences , but even though I have grown up with this style , I dont find it more readable than smalltalk. I dont see Door.open(1,3,30) as more readable to Door open: 1 times: 3 andCloseAfterMilliseconds: 30 And this is exactly how python code works and how smalltalk works too. Also smalltalk culture is oriented towards clean code alot more than python world. You will rarely see methods in pharo more than a few lines long. And if you do , is most likely that code has not been cleaned up. And I find that a huge plus even more than the syntax itself. Of course if I had to choose without smalltalk, then python would be my first choice for readability. But still nowhere near as to how easy I understand smalltalk , even though I am using it for less than a year.
- nnq 13y ago
- rufugee 13y agoAre there commercial applications done using Pharo? If so, what? It'd be nice to see some examples of companies successfully using it.
- benjComan 13y agoSlides 85-95. http://www.pharo-project.org/about/success-stories http://www.pharo-project.org/about/success-stories