Lights and shadows of floating point in GNU Smalltalk

Tagged:  •    •    •

For a dynamically-typed pure object-oriented language, the performance delivered by GNU Smalltalk is impressive. The benchmark ran more than twice as fast as Python and 3.4 times the speed of Ruby—“modern” languages often considered descended from Smalltalk. GNU Common Lisp in compiled mode just edged out GNU Smalltalk by about 2%.

Experiences with GNU Smalltalk

Parser: partially completed
El Smalltalk que no miramos (Spanish)
New GNU Smalltalk Site Launched
Gnu-Smalltalk a un site web (French)

List comprehension using select and collect

In trying to figure out the "Smalltalk way" to do things like list comprehensions I stumbled across some very neat functionality:

Smalltalk does not have list comprehensions, but it does have higher-order map and filter methods, called collect and select respectively.

coll := ((1 to: 100) select: [:x| ( x * x ) > 3]) collect: [:x | (x * 2)].

You can try this out in gst pretty easily to see the result:

st> | coll |

Hunting down CP1252 with Iconv


I was looking for ways to improve a character encoding guesser in PHP, and decided that it was time to look at Iconv.

One important step to understanding how encoding or "charsets" works in GST is to understand that it is very similar to the ISO C90 model. We reinterpret the traditional String just as C strings were reinterpreted; a String is no longer quite what it appears to be.

A terrifying Presource macro: #tclCase:choose:


In reference to a comment about Tcl switch, enjoy a #tclCase:choose: macro for Presource. I reproduce its class comment here:

TclSwitchMacro comment:
I expand the #tclCase:choose: pseudo-message macro, which efficiently implements something approximating the Tcl `switch' command.

A #tclCase:choose: message looks like this:

 someInput tclCase: #(#regex #nocase) choose:
     {'^<?xml' -> [#xmlFile].
      '<html>' -> [#htmlFile]}.

Syndicate content

User login