The last couple of days, to some degree weeks I was implementing a SIP stack for GNU Smalltalk to be used in my Smalltalk GSM project. The first time I encountered SIP was around 2001 when we were excited to run a SIP Phone on our Linux powered iPAQs (Linphone on Opie).
For Smalltalk I started with looking at SipStack by Frank Shearar (who was very responsive to questions regarding his code and SIP in general). The main problem was that his stack was incomplete and as usual it is difficult to pick things up without knowing SIP and not knowing where the code was heading.
Russ Cox of Plan-9 and Go fame posted a blog entry titled Floating Point to Decimal Conversion is Easy. While he is usually right, I believe this time he isn't.
Floating point to decimal conversion is easy if you are okay with ugly results. A good conversion routine will print the shortest decimal representation of the floating-point number, that is, the shortest decimal number whose closest floating-point representation equals the original number. You do not want 0.30000000001, you want 0.3, because the number right above 0.3 is 0.30000000003 and 0.30000000001 does not provide any extra precision.
The previous post I have show you an example on how to create a simple windows using the objective-c binding.
Still it was working it was not so flexible. If you fetch the latest commit from github you will have enhancement quoted below:
- Direct access to ObjC class
- Unary method pragma for method override
- Super send
- Transparent String and Array
- Bug fix
Note the the binding can run on OSX and use gnustep for other platform. See my previous post for installation details
Recently I have done some work on the gst-objective-c-binding.
Now most of the basic feature is here. Of course a lot of polishing still need to be done.
The binding now support sending message from objective-c to smalltalk and from smalltalk to objective-c.
You can also sublcass some objective-c class like NSView.
In this post I will show you how to get the bridge working and create you first Cocoa app.
(If you have a better name idea feel free to give me suggestions.)
You can fetch the source from github:
$ git clone git://github.com/mathk/gst-objc.git