8 ms·
I 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 progr
by virtualized 8y ago
I 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.
- theon144 8y ago>If you aren't interested in a novel immersive programming environment then you can safely ignore Pharo too. I was curious and so downloaded and ran the default image, and I'm beyond captivated by it, but I have to agree that neither the link nor the homepage do a good job of enticing me to do so, or even hinting and what can I expect. If I didn't feel like setting up and checking out random projects I stumble upon, I would have never even seen what Pharo is about, given the abundance of marginally different programming languages that pop up on HN. So yeah, I also think Pharo's best "Hello, World" is just opening it and trying out stuff, but maybe it should try to sell itself, at least a little, for the uninitiated?
- scroot 8y agoFellow Pharo contributors: we should take this feedback seriously
- 4thaccount 8y agoAgreed. The main website could benefit from somehow conveying the mind blowing power of using Pharo. Maybe lots of little gifs?
- smacktoward 8y agoSocial proofs could work too. If you can't show me how powerful Pharo is visually, show me a bunch of people (preferably people whose names, or company/employers' names, I would recognize, but that's secondary) telling me how powerful Pharo is.
- smoe 8y agoOne thing that struck me a bit odd was, that the website makes it look like I have to buy a book or join a (paid?) mooc to get started, because these are the very first sections under "documentation". I was just looking for a basic examples to get some sense what Pharo is about and what the look and feel are. Without downloading and installing it, I wasn't aware that there is a pretty nice interactive tutorial built in. Maybe convey better how Pharo is distinct from other languages/environments and how to get going? Pharo is indeed very easy to get started, but the website makes it appear harder than it actually is.
- detaro 8y agoThere's literally a command-line example (although it doesn't print Hello world, but the factorial of 42) on their front page. That said, Smalltalk isn't something you use from the commandline typically, or only during deployment or for applying external automation. The GUI environment is fairly key.
- igouy 8y agoNo. The website front page does not show a Pharo program being invoked from the OS command-line and using stdio.
- Godel_unicode 8y agoYes it does. The below is copied from the 'A glimpse of Pharo' section. """ $ curl https://get.pharo.org https://get.pharo.org | bash $ ./pharo Pharo.image eval "42 factorial" """
- igouy 8y agoAre we to understand that: — nobody hit the Enter key? — the program does nothing? — the program does something but there was no output? — there was output but not to stdout? etc etc
- andrewl 8y agoFrom the home page, in the A glimpse of Pharo section: $ curl https://get.pharo.org | bash $ ./pharo Pharo.image eval "42 factorial"
- ljm 8y agoI'm not sure about deployment but the 'hello world' is essentially part of the environment: https://i.imgur.com/JwgJ66z.png https://i.imgur.com/JwgJ66z.png You create a new image and then start piecing things together from there. GNU Smalltalk is probably what you want if you want to stick to the CLI. That said, it's not exactly a representative example when you want the same program that prints to stdout or something. I'm curious to know about this aspect of it because my first step after the hello world is usually to figure out how to host the thing. Edit: this would be more useful: https://stackoverflow.com/a/17259369 https://stackoverflow.com/a/17259369
- agumonkey 8y agoin case you get really curious: https://mooc.pharo.org/ https://mooc.pharo.org/ also a hello world will never ever give you any idea about smalltalk/pharo. don't be impatient, this is a system worth playing with, it's quite ~amazing.
- dman 8y agoThink Smalltalk is one case where thinking incrementally from what you already know about programming might be doing yourself a disservice.
- peatmoss 8y agoWe’ve converged on a computing and programming experience that is largely homogeneous across languages and platforms, and Smalltalk is definitely an alternate timeline tech. I kind of like these systems because they remind me of when computers were weird and different and had legitimate tradeoffs. People’s expectations of computers were still rooted in a physical model of interacting with the world. Computers were still very much trying to prove that they were relevant to the “real world.”
- igouy 8y agoSmalltalk is not so limited. COMMAND LINE: /opt/src/vw8.3pul/bin/visual nbody.vw_run.im -nogui -evaluate "BenchmarksGame program" -a 50000000 PROGRAM OUTPUT: -0.169075164 -0.169059907 https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/nbody-vw-1.html#log https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- ben-coman 8y agoPharo does have commandline functionality, but that won't demonstrate its value as a first experience. For an interactive tutorial... open Pharo, then left-click background, Tools > Playground, type & highlight 'ProStef go', right-click & 'do it'. Then try these one-liners in the Playground... https://medium.com/concerning-pharo/elegant-pharo-code-bb590f0856d0 https://medium.com/concerning-pharo/elegant-pharo-code-bb590.... Then (and I know its a video) but maybe serverless PharoLambda would interest you... https://www.youtube.com/watch?v=YUbd0-FX6pI https://www.youtube.com/watch?v=YUbd0-FX6pI
- igouy 8y agoDo you understand that you are not answering `virtualized`s question? The question is not about a Pharo commandline that exists as part of the Pharo GUI. The question is about an OS commandline like "GNOME Terminal" with stdio.
- detaro 8y agoThey do. By saying "there is such functionality, but you should try this instead, because using it from commandline won't tell you why this is interesting". Which isn't directly answering the question, but pointing the asker in a good direction.
- _chi_ 8y agoAs a beginner, ProStef (Mini tutorial) helped me get familiar with environment. To access that tutorial, it's on the welcome page in the Learn Pharo tab when you first launch the image. Hope that helps!
- igouy 8y ago> How do I run a "hello world" program from the command line? You can load and run a smalltalk source file, at the OS command-line, something like — ./pharo Pharo.image st helloworld.st You can pre-load smalltalk source files, save a memory image, and use default startup behavior to run the saved bytecode — ./pharo helloworld.image > deploy that to another machine It's just moving files (VM + bytecode image) so — rsync, ssh
- fwip 8y agoEven after you download it, pick Pharo 7, and open it up, the "Explore Pharo" section points you to a page that doesn't work that says it's accurate for version Pharo 5. [0] I finally found out that the magic invocation was to open up a window by clicking on the background, and navigating to Tools -> Playground, and running `Profstef go.` But they certainly didn't make it easy. [0] https://ci.inria.fr/pharo-contribution/job/UpdatedPharoByExample/lastSuccessfulBuild/artifact/book-result/PharoTour/PharoTour.pdf https://ci.inria.fr/pharo-contribution/job/UpdatedPharoByExa...
- ptrott2017 8y agoNot from command line - but this will hopefully get you up and running in the IDE and have an idea what Pharo can do. or To deploy on another machine you simply copy the image file - so they can run from pharo. The image can be run headless (doesnt display GUI) if you need to deploy on a server. Run PharoLauncher and Load a Pharo image instance. Once the Pharo Desktop IDE appears type CTRL+O+T to open Transcript - the system log console abnd type CTRL+O+W to open playground - Playground is a window into which you can type. It can be used for any purpose, but is most often used for typing Pharo expressions and equickly executing them. (There are windows /icon menu entries for these as well) In playground window type: Transcript show: 'Hello World' and press the play 'do it' icon at the top of the playground window to evaluate it You should now see Hello World appear in the transcript window. What you just did was send the Transcript objects show method the message 'Hello World' Lets do a slightly more complex Cut and paste the following code into the Playground window and click the play button. The first part installs the Roassal visualization framework. It only needs to be run once. The second part uses ROassal's Mondrian API which offers facilities to describe and render graphs. Mondrian allows mapping of metric values and properties into visual dimensions, such as shape and colors. Cut and paste the second piece of code into playground and hit play doit icon to evaluate. In the view panel you should see a simple tree class browser of the installed classes in the Pharo image with size of class coloured and scaled to represent number of source code lines in each class. Note lines in speach marks are comments. "-------------------------------------" "install Roassal visualization engine" "-------------------------------------" Gofer it smalltalkhubUser: 'ObjectProfile' project: 'Roassal2'; configurationOf: 'Roassal2'; loadStable. "---------------------------------------------------" "- Make a Simple interactiver Class Tree Browser -" "---------------------------------------------------" myBrowser := RTMondrian new. myBrowser nodes: Collection withAllSubclasses. myBrowser edges connectFrom: #superclass. myBrowser normalizer normalizeSize: #numberOfMethods; normalizeColor: #numberOfLinesOfCode. myBrowser layout tree. myBrowser