4 ms·
Which Smalltalk?
- stcredzero 16y agoPharo - There are people interested in supporting it for commericial users. They're trying to get everything MIT licensed or compatible, and Eilot Miranda is working on a fast JIT VM for Pharo and Squeak.
- igrekel 16y agoI have an application that started being developed and deployed in squeak. I then moved to Pharo when it started. I had almost nothing to do, just a few changes to the way I was dealing with character encodings. Slightly over a year ago, I moved deployment to Gemstone, that involved quite a few changes, the hardest ones were because of ill placed "." as the compiler on Gemstone seems to be a little bit more sensible. I still develop in Pharo and deploy in Gemstone and I believe that scenario is not uncommon at all. It means my deployment is different from the one described in the post, I don't "clean-up" my image for deployment; I save my code changes to a monticello package, transfer it to the server through scp and load the package into Gemstone. Most of the time, I was able to just let the tools perform an auto-migrate on all existing instances.
- futuremint 16y agoPharo. The latest stable version runs in the Cog VM (a fast JIT VM), and runs Seaside 3.0 great. However, choose your persistence carefully. The open-source Smalltalk landscape is littered with abandon-ware databases. If you want an OODB, you can just save the image itself, use Magma (an open-source OODB, but its not very wel documented) or use Gemstone (through GLASS), which is commercial but well documented. SQL support is weak if you want a nice ORM (like Rails' Active Record), and I've had success using CouchDB (a JSON document pretty much just maps straight to an object: keys -> values = instVars -> values).
- sigzero 16y agoThere is a driver for mongodb as well...
- jcromartie 16y agoI give bonus points to CouchDB because there is no driver needed, just HTTP.
- futuremint 16y agoYeah, the one library I'm using is pretty lightweight. It just does JSON parsing of responses over a socket connection and handles a few HTTP details. I've been really happy with it, and its been reasonably fast in the Cog VM. I haven't explored using CouchDB's list views yet, but I'm considering that for just loading pre-built HTML for larger document lists.
- stcredzero 16y agoORM is weak? What about GLORP?
- gecko 16y agoI agree completely that the ORMs in Squeak are bad, and many abandoned, but as of six months ago, ROE still worked. ROE is not an ORM per se; rather, it's something close to LINQ on a SQL database: you write your queries in relational algebra, building up an AST. The AST is only ever compiled to SQL and sent to the database when you're finally ready to do the query. This allows easily building up a query over many methods by passing around the query object and avoids dealing with an ORM, since at the end of the day you're still just getting back the SQL model, rather than trying to cram it into an object. A quick overview of Roe is at http://www.cincomsmalltalk.com/userblogs/avi/blogView?showComments=true&entry=3246121322 http://www.cincomsmalltalk.com/userblogs/avi/blogView?showCo... and the current source is at http://squeaksource.com/ROE.html http://squeaksource.com/ROE.html . Note that ROE only supports PostgreSQL, but that's okay, because that's the only meaningfully supported SQL driver in Squeak/Pharo. Supporting other databases is actually quite easy in one front, but useless on another: I ported it to SQLite and MySQL around 2005, but never shared the changes, because MySQL simply cannot meaningfully optimize the queries generated by ROE, and SQLite at the time required a very unstable FFI wrapper that crashed the image constantly. If there's interest, I think I still have that code lying around somewhere.
- S_A_P 16y agoCould anyone here give me some insite as to why to use smalltalk? I've been toying with objective C which is about the extent of my experience with anything remotely like it. This article mentions ease of debugging- what is easy about it? What sort of problems does this language solve eloquently?
- fstephany 16y agoYou don't have distinction between runtime and development time. Which means you can debug live. It's a bit like being logged in an IRB session on your rails application. Except that you have better tools than a plain command line. Ruby feels closer to Smalltalk than Obj-C to me. If you're familiar with Cocoa/Obj-C, you can have a look at http://www.fscript.org/ http://www.fscript.org/
- S_A_P 16y agothanks for this- this looks very helpful indeed.
- jcromartie 16y agoSmalltalk tries to solve the problem of mutable state in a unique way. Where some languages say "mutable state is bad, minimize or isolate state changes," Smalltalk gives you amazing tools for monitoring the state of objects in the system. The level of control at every level of execution is unlike any other language. You can open up live inspectors on any object, edit a method in the debugger and restart the stack frame you are looking at, and persist all of it across programming sessions in the image.
- cwp 16y agoHere's a short description of the debugging process for web apps written in Seaside: http://news.ycombinator.com/item?id=1887874 http://news.ycombinator.com/item?id=1887874 For me the key thing about Smalltalk is that its handling of abstraction scales well. On one hand, it's a modern, garbage collected, dynamic language in the same vein as Ruby, Python or Javascript. On the other, it give the programmer a lot more low-level control than any of those languages. For example, Seaside makes heavy use of continuations. In most languages, you're at the mercy of the language designer as to whether continuations are supported: Ruby has them, but Python and Javascript don't. Smalltalk hasn't traditionally supported continuations, but it provides low-level control of the stack, and Seaside implements continuations as part of the framework. Here's another, less exotic, example. Smalltalk provides GC-safe ways of manipulating raw chunks of memory, which other dynamic languages tend not to do. A couple of years ago, I needed to implement a specialized type of timestamp in Smalltalk. For my application, there would be many timestamps in memory at once, so optimized for memory usage. Internally each instance stored the number of seconds since March 1, 1980 as a 32-bit unsigned integer. More recently, I implemented a timestamp object in Javascript. Without the level of control that Smalltalk allows, I ended up just wrapping Javascript Date objects. I don't know what the internal storage of Date objects looks like, but I bet it's more efficient than anything I could implement in Javascript. You see this kind of thing all over the place in Smalltalk. Here's a comment I wrote a while back on syntax: http://news.ycombinator.com/item?id=1289177 http://news.ycombinator.com/item?id=1289177 It's a bit hard to quantify, but I find this scalability of abstraction to be one of the key things I look for in a programming language. I'm not a Lisp hacker, but my impression is that this is one of the primary virtues of Lisp as well.
- cwp 16y agoGood article. One small quibble: Pharo and Squeak's licensing are identical, so "clearer licensing" isn't a reason to choose one over the other. That said, Pharo is clearly a better choice for Seaside projects, since Pharo is the reference platform for Seaside.
- sigzero 16y agoI think the Squeak license changed with version 4.0...originally it was not the MIT one. Edit: In looking into the history, it seems the license has changed several times.
- cwp 16y agoThat's right. It took a major effort to track down all the contributors (including Apple and Disney!) and get them to sign a relicensing agreement. Both Pharo and Squeak include relicensed code, and both Pharo and Squeak require that all new contributions be made under the MIT license. Claiming that Squeak has "unclear licensing" is just FUD.
- randallsquared 16y agoOr, since Squeak 4.0 is the newest version according to their download page, maybe, just maybe, it was a simple mistake, rather than FUD. :)
- gecko 16y agoIt's even more nuanced than that: the Squeak project took the time to actually do a full hunt for all of the old contributors, figured out who they were, rewrote their code when necessary, and got signed legal agreements authorizing the relicensing of their code under the MIT license. The Pharo project took a more practical but somewhat more cavalier approach without the lawyers and signatories. So there is actually the chance, though I want to emphasize very strongly a ridiculously tiny chance, that something in Pharo is incorrectly licensed at this point, whereas Squeak is legally unquestionably fully MIT licensed. That said, unless you wear a tinfoil hat, I cannot imagine anyone seriously not using Pharo due to the above.
- andreiursan 16y agothis month I asked the same question on stackoverflow => http://stackoverflow.com/questions/4441368/is-there-any-good-open-source-smalltalk-implementations http://stackoverflow.com/questions/4441368/is-there-any-good...
- hvs 16y agoI think I just found a project for my Christmas vacation.
- praptak 16y agoDo serious Smalltalk projects use version control? If so, which one? How do they solve the apparent mismatch between Smalltalk philosophy of having everything in one image and the usual "files in directories" expected by version control? Last time I used Smalltalk (a small project) I just kept the sources in files outside the image and reloaded from there but it felt clunky.
- gecko 16y agoYou're correct that most Smalltalks have a changes file that keeps a log of everything you've done, but that's now how you do version control or share changes. The changes file in practice is more of a kind of local version control, or unlimited undo buffer. For actually sharing changes, there are two systems that I'm familiar with: Pharo and Squeak Smalltalk have a DVCS client named Monticello that they use. It works similarly to Git/Mercurial/Bazaar/what-have-you, except that it versions classes and methods semantically instead of the actual changes file. This ends up working fine, and even has some major benefits (you can kiss whole swaths of problems goodbye when you're doing a semantic merge),but it does mean that your Smalltalk code requires its own version control. You can see a quick tutorial of how Monticello handles merging at http://www.lukas-renggli.ch/blog/monticello-merging http://www.lukas-renggli.ch/blog/monticello-merging , and there's what amounts to a command-line interface called Gofer you can read about at http://www.lukas-renggli.ch/blog/gofer http://www.lukas-renggli.ch/blog/gofer . Most people I've seen just use the graphical interface though, which is documented (somewhat) at http://wiresong.ca/monticello/v1/docs/ http://wiresong.ca/monticello/v1/docs/ . VisualWorks Smalltalk has its own version control system, also semantic, but not distributed, called StORE. I haven't worked with it much, but the general idea is the same: version classes and methods rather than the changes file. I know it can at least import Monticello repositories as well, and possibly work with them natively, but I've never done that, so you'd have to do some more research.
- avibryant 16y agoWe solve it by building Smslltalk-specific version control. Monticello, which cwp and I built for Squeak, is a Smalltalk-only DVCS that predates git and hg and has become the de-facto standard. Earlier systems include ENVY and StORE. After using any of these, flat-file, language un-aware version control feels clunky.
- pietrofmaggi 16y agoBTW Smalltalk Zen has started a series on deploying a Smalltalk (Pharo) server to a cloud hosted service - http://smalltalkzen.wordpress.com/2010/12/22/a-remote-server-deployed-hello-world-with-squeakpharo-seaside-and-ubuntu-linux/ http://smalltalkzen.wordpress.com/2010/12/22/a-remote-server... .
- icey 16y agoWhat does the Smalltalk scalability story look like? Could you build something like Twitter or a Farmville backend on Smalltalk with similar scaling strategies used in Python and Ruby?
- avibryant 16y agoWith Smalltalk? Sure. With Seaside? No, that's not what it was designed for. I haven't yet convinced Twitter to do a rewrite in Smalltalk ;). But it would be a step up from Ruby, even if only to get a better garbage collector.