17 ms·
Pharo, the Modern Smalltalk
- tangue 9y agoThere's a Mooc starting in december by the INRIA ( French Institute for Research in Computer Science and Automation ) https://www.fun-mooc.fr/courses/course-v1:inria+41010+session02/about https://www.fun-mooc.fr/courses/course-v1:inria+41010+sessio...
- vesak 9y agoOddly, I'm more fascinated that I'll be able to learn French reading through the materials of that course. Perhaps Smalltalk will follow on the side :)
- carlosgg 9y agoThe course is bilingual.
- throwaway7645 9y agoI could never get the posted English vids to work
- abecedarius 9y agoYou're probably joking, but fwiw I'm 7 weeks into Duolingo's French lessons right now and found most of this course page to be easily readable without reference to the English. It's much easier than Le Petit Prince, a children's book for which I still need to hit the dictionary a lot.
- vesak 9y agoNo, not joking. I have some French courses under my belt from my childhood, but I never got very fluent with it because I never had any use for it. Having an actual need to use the language would be great.
- abecedarius 9y agoGreat! I'd be tempted too if I hadn't done enough Smalltalk to feel comfy already. (I'll have to find other stuff in French. Maybe Laplace on probability? Or more likely Tin-tin...)
- carlosgg 9y agoBeat me to posting it. :) Edit: Actually, the course starts on October 16.
- baldfat 9y agoI 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.
- muraiki 9y agoAfter starting out in Python, I did exactly the same thing with Racket and Smalltalk, which substantially improved my programming ability. I'm glad to know that I'm not the only crazy person here. :) I haven't used Pharo recently, but when using other languages (especially dynamic ones) I really miss it!
- akkartik 9y agoOn a tangent: I wonder how everybody who writes for Medium feels about the new Quora-style nag screens. (I can only go on tangents since I saw the nag screen and bounced.)
- imglorp 9y agoIt strikes me as identical to the newspapers' paywalls, in that they need the income. Except in this case, the income is from your information, not from your wallet. I think some system of anonymous digital micropayments, integrated with the browser, is the only thing that's going to save us from paywall/adwall hell.
- eadmund 9y agoNo nag screens with NoScript!
- edmundhuber 9y agoIs there a snippet of example code to look at? I browsed the pharo.org website, but couldn't find an example to give me a taste. I even tried googling "pharo example" and with a brief look at the results didn't find an example. Today, there are hundreds of programming languages competing for attention. It is in your interest to put an example front and center of why one should spend time looking into yet another programming language.
- protomyth 9y agoYou can download whole books with Pharo examples http://files.pharo.org/books/ http://files.pharo.org/books/
- Y_Y 9y agoMaybe a whole book is overkill. When I'm checking out a new language I like to see a couple of short, accessible examples to get a feel for the language. Like this clock[0]: Time now asValueHolder in: [ :clock | [ [ 1 second asDelay wait. clock value: Time now ] repeat ] fork. clock inspect ] [0] https://medium.com/concerning-pharo/elegant-pharo-code-bb590f0856d0 https://medium.com/concerning-pharo/elegant-pharo-code-bb590...
- SomeHacker44 9y agoI 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).
- IshKebab 9y agoNot really: https://rustbyexample.com/ 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://ceylon-lang.org/ https://www.dartlang.org/ https://www.dartlang.org/ https://golang.org/ https://golang.org/ https://www.rust-lang.org/en-US/ 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 how well all those sites do. Most smaller programming languages get this bit horribly wrong.
- Tepix 9y agoIf you want to get into Pharo, there's a MOOC by France Université Numérique starting October 16th: http://files.pharo.org/mooc/ http://files.pharo.org/mooc/
- louiscyphre 9y agoYou gave the wrong URL. See https://www.fun-mooc.fr/courses/course-v1:inria+41010+session02/about https://www.fun-mooc.fr/courses/course-v1:inria+41010+sessio...
- Tepix 9y ago"Wrong"? That URL is linked from the page I posted. Click on "France Université Numérique".
- tempodox 9y agoMy 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?
- islanderfun 9y agoComing from a place of ignorance, how does Smalltalk not integrate?
- tom_mellior 9y agoThe 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. GNU Smalltalk is different: It doesn't have this traditional interaction mode. Many Smalltalk fans will probably find that that's a disadvantage.
- igouy 9y ago> is not "launch an application which interacts on the console or opens some windows" 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).
- naasking 9y agoA Smalltalk environment is practically its own operating system, complete with its own isolated UI/window manager, shells and desktop environment.
- EdwardCoffin 9y ago
- z3t4 9y agoThey 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"
- dwringer 9y agoFWIW the PDF of the book "Pharo By Example" is available for free. It has also been revised for version 5 - I tried using edition 1 with Pharo 4 and kept having to look up the new names for things, to the point where it was frustrating to try and follow. They appear to have put a lot of work into updating the guide.
- igouy 9y agoAnd here it is! http://files.pharo.org/books-pdfs/updated-pharo-by-example/2017-01-14-UpdatedPharoByExample.pdf http://files.pharo.org/books-pdfs/updated-pharo-by-example/2...
- methehack 9y agoiirc correctly once you launch it after download there is a wealth of help w/in the (vastly superior to anything still even though it's literally 40 years old) IDE/workspace. It makes sense I think to do it there because then the documentation can be interactive
- methehack 9y agoAlso... http://pharo.org/documentation http://pharo.org/documentation Too much to click on the "documentation" link in the header?
- throwaway7645 9y agoThere is a profStef tutorial once you load the image. I think you just need to send "go" to the object. Something like: ProfStef go. And right-click do after highlighting. Stefan Decasse is a French professor that does a lot for the project.
- JohnStrange 9y agoOkay, so lot's of praise for a language. But I have three questions that aren't answered by the article: 1.) How fast are programs written in Pharao? 2.) Is it possible to write complete and halfway modern looking desktop end-consumer GUI applications in Pharao? 3.) How good is it at parallel programming (i.e. multicore support, not just concurrency with green threads)? I'm always interested in learning a new language, if not just for fun. Currently my new language on the Todo list is Nim. However, I do not want to take a look at a language for which the answer to all of the above questions is "Meh".
- pathsjs 9y ago1) Last time I tried it was reasonably fast for a dynamic language - somewhat slower than javascript (V8) but faster than python (cpython) to give you a ballpark 2) Yes, but ou will not use native widgets. The way you write applications is: you write code by modifying the behaviour of objects in the Pharo application (which is your editor, debugger, GUI, version control system and so on), then you strip off the parts you don't need (such as what you used to write the application in the first place). Hence you will probably use the default Pharo widget system (take a look at some Pharo screenshots to get an idea) 3) Last time I checked it was planned, but there was nothing yet
- JohnStrange 9y agoMy current main language for my own projects is Racket, but there are performance issues with text% and the support for parallelism is not good enough. So I guess with this respect Pharao will not be a good alternative for me either. However, I've looked at screenshots and the default widget system seems fairly reasonable. So I'll check it out anyway. Thanks a lot for the replies, they were helpful!
- flavio81 9y ago1) Last time I tried it was reasonably fast for a dynamic language - somewhat slower than javascript (V8) but faster than python (cpython) to give you a ballpark If this is true, then it's much slower than LuaJIT, Lisp (SBCL) and probably Chez Scheme: Three great dynamic programming languages worth checking out, by the way.
- dmzkrsk 9y agoAny good article describing Smalltalk features for C/Python/Go/JS developer?
- agentultra 9y agoI like Pharo. I was able to build a widget that scraped the front page of HN in an afternoon with it just by following the built-in tutorial and googling. One interesting "killer app" might be the Moose platform [0]. It's basically an interactive environment for the analysis of software. Writing a parser is rather straight-forward and turning the AST into a visualization is also quite easy. This sort of feels like how I imagine a good IDE should be. [0] http://www.moosetechnology.org/ http://www.moosetechnology.org/ update spelling.
- vbuwivbiu 9y agocan confirm. My day job is coding in Clojure, which I love, but if I get a spare Sunday afternoon I'll do some coding in Pharo, playing with Roassal
- thedaemon 9y agoI'm sorry but the 3d image of the light house is horrible. It reminds me of POV-Ray renders from the 90s. Is Medium so poor that they can't afford a competent artist?
- magnusdeus123 9y agoMedium is just a platform for posting content. The image was selected by the author.
- flavio81 9y ago>Smalltalk has the cleanest, purest implementation of object-oriented concepts; not even Java, Ruby, nor CLOS can lay claim to that. I'll take "powerful" versus "cleanest and purest" any day, thank you very much. Sorry but i'm staying with CLOS whenever i want to do object-oriented programming without feeling limited. The author is on a pro-Smalltalk crusade (which I find just fine, Smalltalk is a great lang, and in a perfect world, it would be as popular as Javascript is today), but does so at the expense of constantly deriding Clojure, Common Lisp and Racket, which I find silly.
- systems 9y agoi would take "large ecosystem" over "powerful" or "cleanest and purest" whenever i am in the process of picking a language for a project, i check if there is a library for what i want to do
- SomeHacker44 9y agoEvery time I use Clojure for the nuts and bolts of software engineering it reminds me why I prefer Common Lisp. Every time I need to get something done of any magnitude, it reminds me why I prefer Clojure to Common Lisp. So... What "systems" said. Truly, Clojure is a Lisp for Getting Stuff Done, as it has access to an astounding number of libraries targeting the JVM, largely allowing you to focus on your product's core.
- flavio81 9y agoYes but on the other hand Smalltalk is an established language with a long history, i wouldn't be surprised if you are able to find all the libraries you need.
- louiscyphre 9y agoSorry, but the author has never derided Clojure and Racket. Common Lisp, yes, but not Clojure and Racket. He actually likes Scheme. He has factually pointed out that most people are turned off by Lisp syntax. This is not an insult, simply a statement of fact.
- eternalban 9y agoThis language is a drama queen. "I languish I languish". O cruel cuts of an ignorant world or a language still in search of timely niche to call home. Could've been a contender on the browser but missed that boat too and we're now stuck with Javascript -- I still can not believe it -- and so what are you good for honey? Die already.
- sctb 9y agoPlease don't post unless it's going to be within the guidelines, like we've asked before. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- eternalban 9y agoWhen have you asked before? And how is this not within the guidelines?
- paulajohnson 9y agoI wouldn't take Capers Jones' estimates of SLOC/function point as evidence of anything. In most cases (including these two) this seems to be Jones taking a look at the language Wikipedia page and guessing a number.
- igouy 9y ago> this seems to be This seems to be you maligning Capes Jones without evidence.
- louiscyphre 9y agoCapers Jones is a well-respected expert in software metrics. He's done some ground-breaking work in this area. Unless you're an expert too, I wouldn't denigrate him.
- stutonk 9y agoFor those wondering what it's like to program in Pharo or why there aren't a lot of code snippets floating around in Pharo materials: it's because the way you program in Pharo somewhat different than most languages. Pharo is an IDE in the true sense, i.e. while it's technically possible to open up a workspace (text editor) window and write a new class all on one screen this is not how things are done in practice. Programming 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.
- Koshkin 9y agoTo an inexperienced eye, Smalltalk's syntax seems to be suffering from colon "cancer". (I don't get a similar feeling from Lisp, for some reason.)
- claystu 9y agoHow do you get started with GUI programming? I can't seem to find anything on this for Pharo6...and barely anything for earlier versions (which I'm assuming are now obsolete).
- scroot 9y agoSpec [1] is one way. You can also find a list of books on the Pharo website [2]. [1] http://files.pharo.org/books/spec-tutorial/ http://files.pharo.org/books/spec-tutorial/ [2] http://books.pharo.org http://books.pharo.org
- keithnz 9y agoIs Pharo open source?
- dragonwriter 9y agoYes. MIT license.
- ScottBurson 9y agoSmalltalk’s use of live coding is easy and elegant; not even Common Lisp, Forth, nor Java (hot swapping) can lay claim to that. Does anyone understand what this is talking about? I may not understand exactly what is meant by "live coding", but I think I do it in Common Lisp (via SLIME) all the time. How is it better in Smalltalk?
- coliveira 9y agoThis is certainly an exaggeration, but I think they are referring to the integration between the language and UI elements, which can be easily changed live. The difference is that the Smalltalk UI was designed so that you can swap the code behind it during a development session and save the result in an image file, while other toolkits use a more traditional build-and-display approach.
- i_feel_great 9y agoIn Smalltalk, you can pause your application and inspect the objects alive in a stack at the time you paused it, go backwards and forwards in the stack, change them to see an alternative future, make changes and resume. It is the weirdest shit.
- ScottBurson 9y agoCommon Lisp implementations admittedly vary in how well they support interacting with the stack in this way, but some of them do it just fine, as did the Lisp Machines. (The Lisp Machine developers were heavily influenced by Smalltalk, so I'm not saying Smalltalk doesn't deserve credit for the innovation; I'm just wondering what I'm missing, if anything, by using CL today.)
- igouy 9y agoAnd because it's been around for decades, people figure out how create something like that functionality for other languages: JavaScript Time-Travel Debugger https://www.microsoft.com/en-us/research/project/javascript-time-travel-debugger/ https://www.microsoft.com/en-us/research/project/javascript-... https://channel9.msdn.com/blogs/Marron/Time-Travel-Debugging-for-JavaScriptHTML https://channel9.msdn.com/blogs/Marron/Time-Travel-Debugging...
- vanderZwan 9y agoI enjoyed playing around with Pharo a few years back, and often look at what else the people working on it have been thinking of lately. Having said that, the PharoJS website mentioned in the article could use some love, I just get an unstyled webpage[0]. Now, I love avoiding website bloat as much as the next guy, but from the point of view of a web developer who might be interested in exploring what Pharo and Smalltalk in general might have to offer, that seems a bit too minimal. Amber, by comparison, runs a full SmallTalk on the website itself, which is pretty cool[1]. Doesn't seem to have maintained momentum beyond 2014 though. [0] https://pharojs.github.io/ https://pharojs.github.io/ [1] http://www.amber-lang.net/index.html http://www.amber-lang.net/index.html
- scroot 9y agoFYI for anyone reading / interested: Amber is apparently still under active development, but they moved from Github to a self hosted platform [1]. Last code update was 3 days ago. [1] https://lolg.it/amber/amber https://lolg.it/amber/amber
- vanderZwan 9y agoOh, that's good! But the website and documentation is pretty outdated then. I guess all current development goes into code?
- jmarinez 9y ago*ACM, want to see how bad things are, read this thread.... To understand Smalltalk in general one neeeds to understand the impetus; and behind it is Alan Kay. What we do today isn’t really “computing” as envisioned and then created in the 70s. Lots of those terms used back then are used now, but the meaning has been transformed into something entirely different. It’s unfortunate that most of the things we call “state of the art” are bastardized and horrible versions of those from the 60s and 70s. Yet here we are in 2017 and we can’t have the majority of “computer users” create an essay defending his/her views on climate change with an actual editable running model upon which a civil discussion could be based on. But hey, we will have an iPhone X, so who cares? Smalltalk is like a gem, a remnant from a magical world that existed and went away - but still possible - if we just took a look way, way back as to where it all originated. For the CS students out there, get your money’s worth and start asking where all this stuff we have now came from and more importantly, why. Here’s a good start: A Personal Computer for Children of All Ages: https://www.mprove.de/diplom/gui/kay72.html https://www.mprove.de/diplom/gui/kay72.html “The basic idea is to exploit the duality between functions and tables (or processes and memory). English has nouns which refer to "objects", and verbs which refer to "actors" and "relators". This is a Newtonian epistemology. Modern physics and philosophy tend towards the idea that both "objects" and "actors" are just different aspects of the notion of process. A process has state (a set of relations having only to do with it) which changes as time (defined as interactions with other objects) passes. Using this view "data" is a process which changes "slowly", "function" is a process which changes more rapidly. Each process has the logical attributes of a complete "micro" computer: they can have inputs, give back outputs, act as a memory on file system, perform computations, be interrupted, etc. Since a "computer" can simulate all other computers (modulo time and space), having the notion of a process in a language allows useful idea such as arrays, records, recursive procedures, etc., to be added to the the repertoire at any time.”
- t420mom 9y agoMy personal experience has been that the live coding aspect makes a huge difference to my development speed. A while ago I was going through Project Euler in less-mainstream languages, just as a warm-up/distraction from work. I would do one problem at a time and then go back to work. One day I switched from Object Pascal (with Lazarus) to Pharo. I completed the problem (which I hadn't attempted before, so no prior knowledge) so quickly, that I proceeded to complete five problems in the time it usually took me to do one. Because everything was so immediate, it was really easy to maintain a flow state. I had to force myself to stop and get back to work. The object inspector is really nice, also being able to redefine methods in the debugger and continue the current computation is super cool. Beats poring over Java stack traces. It would be nice if there were more open source libraries available, but SmalltalkHub is getting better: http://smalltalkhub.com/list http://smalltalkhub.com/list