Showing posts with label lively-kernel. Show all posts
Showing posts with label lively-kernel. Show all posts

Thursday, February 23, 2012

Lively TclTk


Lively-Kernel meets Tcl/Tk?

My latest install of Tcl/Tk 8.5 from Activestate left a link in Windows to Tk demos.  One is named "A Celebration of Rube Goldberg" and should impress Self-as-JavaScript  fans of Sun LivelyKernel or Avocado.

Regardless of the grief in getting Tcl with OO out of 8.6 beta, the demos are a great presentation.  I continue to use Html Viewer 3 (Tcl/Tk's hv3 browser) as a light-weight browser when my laptop's sole-core is over-loaded with a few of today's greedy app's wildly swapping in and out (and no, the worst offender happens not to be from Microsoft.)

Btw, Squeak Smalltalk is working to get their base image down to about 10Mb.  Remember when shared DLL's were to keep us all happy below 640K ?  Gates' Hades, Hades' Gates.

PS: I have added a label/tag for Pharo Smalltalk - now the preferred ST for Seaside?

PPS: here is the Avocado blog: there.



Friday, December 10, 2010

Inspecting Global Variables in Pharo Smalltalk 1.1.1

I cannot resist posting this: it creates an interable collection of associations of all current global identifiers and their current types:

"A recipe from Squeak wiki at http://wiki.squeak.org/squeak/1824

Smalltalk keys select:
   [:k | ((Smalltalk at: k) isKindOf: Class) not]
     thenCollect:
        [:k | k -> (Smalltalk at: k) class]


"The code is in SystemDictionary's class comment."

Smalltalk implementations and VM's are evolving - but just compare what has to be done today in other dynamic languages to achieve the same ...

One notable exception is the Io Lobby object.  With a little care, the same result can be very succinct in Rebol 2.7.6. and even simpler in Rebol3.

Here is a node.js shell result on startup:
for (var s in process) { s}
'listeners'
In a Pharo One-Click I get an Array of 127 assocs.

Python does have dir(obj) which is hardly a Smalltalk inspection widget ...

in JavaScript there had been access to the Arguments object for a top-level function callee/caller to get into the activation/call object - But what will that kludge's fate be now that ECMAScript5 is here and Mozilla JavaScript 2.0 is coming?

In all fairness, in Smalltalk and Rebol the unwary traditionally can clobber anything.  But in Smalltalk you can inspect almost anything non-primitive - even during startup. And a bootstrapping JavaScript interpreter written in JavaScript achieves almost the same transparency.  See also: The avocado variant of Lively-Kernel.

see: JavaScript Function.call and Function.apply and ECMAScrip5 Function.prototype.bind