Uplevel e-solutions

Webware and Rich Internet Applications

Adobe Air and Smalltalk integration example

Another good news for someone who really likes Adobe Flex/AIR and Smalltalk environments. Last time I wrote here about Glare project, and now there is an excellent example to build simple Adobe Air app with Smalltalk backend. I have only a one wish, if Glare will be available on other smalltalk platforms for example Squeak not only commercial VisualWorks, that’s gonna be something called “dreams come true”.

adobe air and smalltalk example

Here is an example to do something like on picture above.

  • Comments
  • Filed under: AS3, Flex, smalltalk
  • Smalltalk and Adobe Flex

    Some time ago i have written about seaside and squeak on my polish blog - here. reason for that was because people do not always realized that smalltalk didn’t die at the same time as dinosaurs. Anyway, i’m lucky and working not only with one technology so was very happy to find something called Glare. What it is ? This is simple speaking a project that integrate smalltalk (visualworks in that case) and adobe flex. Sounds brilliant at the first look, but when i thought about it, was really confused. Why ? Smalltalk for example in Squeak or VisualWorks implementation is for development the same thing like ipod for music listening. It’s just incredible well thought. Everything is in one place, and we have IDE which is really truly intregrated. This IDE is not like NetBeans for Rails for example -  there are not a big difference to develop with simple editor or complicated IDE. But here IDE is one of the biggest advantage of using Suqeak for example. So now, when you think about it, we have two different style of thinking about web development:

    1. Adobe Flex & AS3 - brilliant RIA framework with AS3, which is not the best language ever and comparing to smalltalk really complicated (+ use with puremvc, caingorm etc.)
    2. Smalltalk (VisualWorks & Squeak) - brilliant language with DSL, Metaprogramming and IDE which gives us improvement kick.
    Old-Simpl—Beautiful and New-Complicated-Enterprise, it is good connection or not ? Not so simple to asnwer, but i’m not a big enthusiast of connecting milion technologies in one place, unfortunatelly often it’s a must. I’m also using Ruby on Rails and Flex but the best practice will be using one technology, one language, sadly you are not doing what you want everytime. But glare is really interesting thing to try. On other hand remember that we have here Gemstone/S giving really scallable possibilities. I’m not sure we can use it inside glare but if so, this solution will be brilliant.
  • Comments
  • Filed under: Flex, smalltalk
  • BDD with Smalltalk

    One of the most exciting thing in Ruby and Ruby frameworks like Rails and Merb is Behavior Driven Development framework - RSpec. Generally BDD provides new quality in testing and documenting our code. RSpec is a brilliant example of Ruby possibilities, I mean DSL ( Domain Specific Language ). But like I said last time DSLs aren’t only Ruby but also (or maybe more) Smalltalk. We know that “Smalltalk can do nothing but build domain specific languages”, so it’s natural that we should have something like RSpec in our Smalltalk world, and we have ! It called SSpec. Of course you probably say that we have SUnit which is satisfactory, and you’re right. What is more SUnit is excellent and like everything in my favorit Squeak outstanding integrated with it. But it’s still TDD, and what we need here is BDD - next generation of testing family. So if you want to try it, go to the www.squeaksource.com/SSpec/ and download it, helpfuly will be also SSpec documentation which you can download here:

    http://daveastels.com/files/sspec_manual.pdf
    http://daveastels.com/files/sSpec_QuickRef.pdf

    SSpec is maybe not so active and popular like RSpec but really interesting, so if you want to try BDD testing in your Smalltalk project you should use it :)

  • Comments
  • Filed under: smalltalk
  • DSL and Metaprogramming with Smalltalk

    Today I’ve been thinking about beauty of Smalltalk, about how productive we can be with Squeak or Seaside. Of course everone has a different opinion about productivity and efficiency. For me it means that I don’t need to worry about nothing else but only logical aspect of some programming problem, I mean - code at the speed of thought. It’s more a pragmatic, practical way of thinking but it works. Today we have many outstanding frameworks, languages, but even if you choose my favorit Ruby on Rails you have to still answer on several questions:

    • What IDE or Editor is the best for me ?
    • What version controll system is more powerfull, SVN ? GIT ? ok GIT so I must change my repository.
    • What debugging tools are the best for my new environment or language ?
    • WTF ? Why it doesn’t work again ?!

    This is only the top of the iceberg. You haven’t these problems with Squeak or Seaside, you have one image and there is everything - version controll, IDE, debugger (great debbuger!), editors. What is more, you can save your image and copy to other computer in one move and it still works , it’s so simple. For me Seaside or Squeak is something like an iPod, you have only features which are really important nothing else. One small shiny button which gives you unlimited possibilities :).

    But back to my topic DSL (domain-specific language) with Smalltalk, it’s really iteresting because I was always talking here about Ruby and power which gives us. For example BNL (Business Natural Languages) or of course simple stunnig Ruby DSL example - RSpec. But .. again things still could be better, Ruby is great to build DSL although Smalltalk is even better. Smalltalk seems much more a notation, we can simple say “that can do nothing but build domain specific languages.” - sentence from really good onsmalltalk blog. Why it is so ? “Ruby isn’t object oriented at the level Smalltalk is, is still falls back to procedural constructs and special syntax for many things. Smalltalk, is pure, objects all the way down, at every level, even the simplest and most common domain specific language of all, predicate logic. When you create a domain specific language in Smalltalk, your code never looks different than code provided by the compiler writer himself, it’s one syntax to rule them all.”. There is also an interesting podcast called Smalltalk is a DSL. DSLs have always been part of the Smalltalk farbic  - “Code should read like a conversation“. Sounds nifty and it really is, Smalltalk is so elegant in all these things and this elegance is in my opinion simple way to create great programs.

    Another thing is Metaprogramming, discipline in which Smalltalk always wins. Here is a good example of metaprogramming from Randal Schwartz’s blog:
    “You can even create anonymous classes and give them behavior, then instantiate them.”

    
    | myClass myInstance |
    myClass := Behavior new. "create anon behavior"
    myClass compile: 'theAnswer ^42'. "add a method for instances"
    myInstance := myClass new. "create an instance"
    Transcript show: myInstance theAnswer; cr. "shows 42"
    

    Look also at SOUL(The Smalltalk Open Unification Language). If we are in “Meta World” there is another interesting thing in smalltalk called Magritte - fully dynamic meta-description framework.

    So generally as we can see Smalltalk is very very flexible and powerful language in which we can solve all our problems in very elegant and simple way.

  • Comments
  • Filed under: Inne
  • Seaside and Rails

    Last time there was an another great article about Smalltalk called Back to the future for Smalltalk. Looks like a smalltalk back to the game :) It’s maybe the same history like a Ruby, today Ruby is really popular because DHH created Rails. But in Smalltalk we have Seaside which is also outstanding. Im generally a Ruby programmer, now im working with Squeak. I just wanna try how productive could I be with Seaside. Today I was a little worry about generally Squeak performance because there are many tests where people said “Ohh no ohh no, its so slow in this hello world test”. But after that I realized how long i was working with Ruby and Rails, and i’ve never had problems with performance at all. What is more Smalltalk is even faster than Ruby. So for me more important is how productive these frameworks are (and both are so efficient) than thousand extremelny weird speed tests. In one test someone said that Java is so cool, it’s so fancy and generally great because it’s faster than Ruby and Smalltalk. But I don’t care about performance if i must write thousands lines of Java code which displays simple “hello world”, I can do the same in one line here.

    Here is a short video about comparison Rails and Seaside (rather developing style). Another demonstrates that Seaside is a sever and an IDE in one. But what is the most important I watched Giles Bowkett really interesting presentation about Rails and Seaside and here is it:
    Seaside and Rails (The 2007 Goto) from giles goat boy on Vimeo.

  • Comments
  • Filed under: Ruby, RubyOnRails
  • Interesting stuff

    There are two really interesting tools (or maybe a business solutions) I want to share with you. I was working with both and i’m simple impressed.

    First one called Dabble DB.

    It is a web-based application that lets you work with data on your own terms. Instead of downloading an application, you upload your data and then build your own database application. Import Data,  Extend it or change it as you go. Restructure and redefine how you organize your data on a whim. Its made by Avi Bryant and working on SeaSide framework !! (also listen Avi conversation about SeaSide and Dabble DB) You can find video presentation there which will tell you why its so good :)

    Second one (maybe not so staggering and powerfull but also good) called Viviti

    It’s a website builder in which you can easy create structure, content and design of your website. And it really good works, has nice usability and everything you need. Viviti is integrated with many social portals like flickr, youtube etc.. So just try it ;) if you want to do it now i have some invitations on my account so tell me only.

  • Comments
  • Filed under: Inne
  • MagLev - smalltalk and ruby works together

    Everybody last time (since last RubyConf) are talking about MagLev. What the MagLev generally is ?

    MagLev is a Ruby VM based on the GemStone S64 VM, which runs Smalltalk (my favorit last time). The Smalltalk VM has been extended with special byte codes to make it Ruby (also my favorit) compatible. GemStone’s Smalltalk VM has been used for over 20 years in sectors such as real time financial markets and the worldwide shipping industry. It as a mature, fast, stable, distributed, and transactional data store which can hold over a trillion objects or 17PB (Petabytes) worth of information. The goal of the MagLev project is to bring this distributed object technology to the world of Ruby on Rails.

    Here is a vide from RailsConf:


    MagLev presentation at RailsConf 2008 - part 1 from Monty Williams on Vimeo.

    Other interesting resources:

    Chad Fowler about MagLev
    MagLev, JRuby, And Rubinius: Who Will Win?
    Avi Bryant - MagLev Recap

  • Comments
  • Filed under: Ruby
  • Seaside and continuations

    Generally if you haven’t read about continuations yet, you have to do it now ! There are also good IBM’s articles to understand continuations idea : Crossing borders: Continuations, Web development, and Java programming and Use continuations to develop complex Web applications - really cool stuff.

    The basic idea is this: You can let your programming framework load your application’s state before a request and save your application’s state after each request. It may shock you to learn that you can do Web development and get a stateless experience for the user with a stateful model for the programmer. Of course there are not only adventages but you will see that continuations represent a real advancement in web development frameworks and makes you more productive.

    Several languages have continuations-based approaches. The most common: Lisp, Ruby, and of course Smalltalk. The most popular continuation server and framework is Seaside. Im writing about it because I’ve just started to use it and I’m really excited about it :) See Seaside tutorials and videos. Other interesting projects are: Iowa (Ruby framework), Wee (Ruby), Continuity (Perl) or VieWeb (Lisp). Have fun ! :)

  • Comments
  • Filed under: Inne