Planet Smalltalk

April 24, 2017

Pharo Weekly - Gathering statistics on messages sent to an object

If you subscribe to pharo-dev you will have seen that I’ve been looking
at the primitives used in DiskStore.

As part of that investigation I wanted to get an idea of which messages
are typically sent to DiskStore and how often.

Denis Kudriashov provided a neat package that implements a “halt on
next object call”.  I’ve been wanting to play with the package for a
while and decided this was a good opportunity.

I’ve extended that package to keep count of how many times messages are
sent to a target object, e.g.:

| point trace |

point := 2@3.
trace := ExternalSendStats logStatsFor: point.
point
x;
y;
angle;
x.
trace stats.
“a Dictionary(
#angle->1
#x->2
#y->1 )”

The package is probably too simplistic, and there’s bound to be other
ways to do this, but it met my immediate needs and gave me a chance to
try out the Ghost package.  I’ll extend it if and when I need to.

Many thanks to Denis for making the Ghost package available, and
hopefully this is useful for someone, or at least triggers some new
ideas.

Denis’ original article is at: http://dionisiydk.blogspot.cz/2016/04/halt-next-object-call.html

The extensions can be installed with:

Metacello new
baseline: ‘AkgGhost’;
repository: ‘github://akgrant43/akg-ghost:master/mc’;
load

Cheers,
Alistair

 

Hi Alistair.

Do you know that you are able to count any message send? (not only external).
For this you need prevent meta recursion. Now inside message processing you do:
aMessage sendTo: anObject

which produces another intercepting message #perform:withArguments which repeats original message send.

Fortunately Ghost handles such kind of meta recursion and there is no infinite loop here: any self-sends are ignored in such cases.
If you want intercept any message try following code:
ExternalSendTrace>>send: aMessage to: anObject
| method |
announcer announce: (ExternalSendAnnouncement message: aMessage trace: self).
method := anObject class lookupSelector: aMessage selector.
^GHMetaMessages executeWith: anObject andArguments: aMessage arguments method: method
In that case we lookup and execute method by using mirror primitive which not sends any message to object.
For example:
rect := 10@30 corner: 100@300.
trace := ExternalSendStats logStatsFor: rect.
rect area.
trace stats.
 “a Dictionary(#area->1 #height->1 #width->1 )”

April 23, 2017

Pharo Weekly - Pharo Sprint App to improve coordination during Pharo Sprint

 

Hi,
We are happy to announce a new application called Pharo Sprint App. The main idea of the application comes from the whiteboard that have been used during Pharo Sprints and was also adopted in Chile.
unnamed.jpg
As the Pharo Sprint is organized in several places around the world, we miss the connection with other guys. For that reason we decided to move the physical whiteboard to the internet and developed Pharo Sprint App.
Sprint.png
How does it work? Participants choose a case from the ‘proposed’ or ‘all’ list. Once they are done, they move it to the ‘done’ list. We believe that the application will encourage other people, especially newcomers, to join us during the events and have a fun, together with other developers.
How To Use It?
• Execute the image, using the corresponding VM for Pharo 6
• Run the application from World Menu / Communication / Pharo Sprint
• Login, using your FogBugz account, wait a bit, then choose a case and have a happy programming 🙂

Everybody participating in the sprints should use the Pharo Sprint image.

The upcoming event is on Friday April 28https://association.pharo.org/event-2492488
The application is deployed in Pharo 6 (32 and 64bits). More details are available at: https://github.com/JurajKubelka/PharoSprint
I will appreciate any feedback.

April 20, 2017

ESUG news - CFP - IWST 2017

International Workshop on Smalltalk Technologies - CALL FOR PAPERS

Goals and scopes

The goals of the workshop is to create a forum around advances or experience in Smalltalk and to trigger discussions and exchanges of ideas. The topics of your paper can be on all aspect of Smalltalk, theoretical as well as practical. Participants are invited to submit research articles or industrial papers. This year we want to open two different tracks: one research track and one industrial track with less scientific constraints. We expect papers of three kinds:

We will not enforce any length restriction.

Important Dates

Topics

We welcome contributions on all aspects, theoretical as well as practical, of Smalltalk related topics such as:

Best Paper Award

To encourage the submission of high-quality papers, the IWST organizing committee is very proud to announce a Best Paper Award for this edition of IWST. We thank the Lam Research Corporation for its financial contribution which makes it possible for prizes for the three best papers: 1000 USD for first place, 600 USD for second place and 400 USD for third place. The ranking will be decided by the program committee during the review process. The awards will be given during the ESUG conference social event. The Best Paper Award will take place only with a minimum of six submissions. Notice also that to be illegible, a paper must be presented at the workshop by one of the author and that the presenting author must be registered at the ESUG conference.

Publication

Both submissions and final papers must be prepared using the ACM SIGPLAN 10 point format. Templates for Word and LaTeX are available at http://www.acm.org/sigs/sigplan/authorInformation.htm. This site also contains links to useful informations on how to write effective submissions.

Submission

All submissions must be sent via easychair: https://easychair.org/conferences/?conf=iwst2017

Program chairs

April 19, 2017

ESUG news - UK Smalltalk User Group meeting - Monday, 24th April

The next meeting of the UK Smalltalk User Group Meeting will be on Monday, 24th April.

We'll meet at our usual venue The Counting House at 7pm.

If you'd like to join us, you can just show up at the pub. You can also sign up in advance at the meeting's Meetup page

See you there!

April 17, 2017

UK Smalltalk - UK Smalltalk User Group Meeting - Monday, 24th April

The next meeting of the UK Smalltalk User Group will be on Monday, April 24th.

We'll meet at our usual venue, the Counting House, from 7pm onwards.

If you'd like to join us, you can show up at the pub. You can also sign up in advance on the meeting's Meetup page.

April 15, 2017

Marten Feldtmann - PUM – Overall Application Structure

Sometimes its not clear, where PUM is targeting – a graphic may show this much better. In this graphics one can see the general application structure we have used with PUM and the other languages against Gemstone/S database in several projects so far.

The parts in dark blue are actually in production usage, Android and Java have been tested in small application and the practical tests for iPhone are still missing.

 

Marten


Filed under: Smalltalk Tagged: Android, C#, Electron, ExtJS, Gemstone, iPhone, Java, PI, PUM, Python3, Raspberry, Sencha, Xamarin

April 14, 2017

Nicolas Cellier - Astonishing C++ streams

Let's talk about about C++, as it deserves it from time to time.
Especially because I've lost a couple of days on a not-enough-advertised-feature:

    std::ifstream in;
    in.open("somefile",std::ifstream::out);

https://www.wired.com/wp-content/uploads/2012/01/watduck1.jpg
 (https://www.destroyallsoftware.com/talks/wat)

Opening an input file stream for output is not at all convoluted.
It's both a crystal clear code and a brilliant idea! 
Good enough to transcribe it in the standard library:

http://www.cplusplus.com/reference/fstream/ifstream/open/


What difference does it make with fstream? Or should I rather open an ofstream for input? It leaves plenty of room for speculation. if someone knows, he shall write a blog post immediately!
But if the standard offers some weird path, by virtue of Murphy's law, be sure that someone will follow it, whether accidentally or not.

Murphy's law has more to offer: Microsoft implementation changed somewhere between .NET 2003 and .NET 2010, so that opening an input file stream for output on a write-protected file does now fail, what it didn't previously...
Of course, the file has to be read only at deployment site, not in developer's configuration where we have debuggers, otherwise things would be much too trivial.

Recompiling a legacy application while not exerting enough code review is a dangerous thing, so let's not blame C++ for our own mistakes. Except that C++ did not especially help here.

My colleagues said: "tu-mourras-moins-bete" (auf deutsch). Not so sure: I feel like this kind of information is not going to reduce the entropy in my brain.
 
I'm not going to change C++. I can't. But I'm itching to simplify our own Squeak Stream hierarchy with such reduction of entropy in mind. Don't push me!

Nicolas Cellier - Alignment strikes back

Previous post was about alignment problems in Smallapack matrix inversion. Let us look at another one that crippled the jpeg plugin for 64 bits windows flavour of opensmalltalk Virtual Machine (issue 119).

The problem originate at win64 requirement for jmp_buf type used in setjmp/longjmp: it must be 16-bytes aligned. I couldn't find a reference to this requirement, but there is a definition in some header that ensure such alignment. Appropriate cygwin grep in /usr/x86_64-w64-mingw32/sys-root/mingw/include will reveal:

setjmp.h:  typedef _JBTYPE jmp_buf[_JBLEN];
setjmp.h:  typedef SETJMP_FLOAT128 _JBTYPE;
setjmp.h:  typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {

With such definitions, the C compiler will manage to properly align the data, so we don't have to worry... Or do we?

We use setjmp/longjmp for the purpose of error handling (and properly quiting the primitive). But we had the brilliant idea to put such jmp_buf member in a structure (see JPEGReadWriter2Plugin/Error.c).

The layout of the structure cannot vary for each instance, so if we want one member to be aligned on 16bytes boundary, the sole solution is to align the whole structure itself to 16bytes boundary, and fill enough gaps between members. Alas, both gcc and clang fail to do so. I don't know if I should report a bug for that.

Imposing that requirement to our own structure, in a portable and future-proof way is less than obvious. So the workaround was rather to use a pointer on a jmp_buf - see pull request #120.

This kind of bug is pretty tricky, but if you have to implement some VM parts in C, what do you expect?

Pharo Weekly - Snap package for Pharo 6

Hi Everyone,

I’ve made a snap package for Pharo 6 which I think is far enough along
for some wider testing.

To get Pharo up and running on Ubuntu 16.04:

# Install Pharo
$ sudo snap install –edge pharo –classic
# If your system isn’t configured for threaded heartbeat:
$ sudo pharo.config
# Download the latest Pharo 6 image
$ pharo.getimage
# Go…
$ pharo.ui Pharo.image
# or:
$ pharo Pharo.image eval 4+3

To get a list of available commands:

$ snap info pharo

If you’re on Debian or Ubuntu 14.04 you’ll need to install snapd, see
https://snapcraft.io/docs/core/install

The VM is the threaded heartbeat, dated 201704101933.

The installation flags are:

–edge – The edge channel is for development versions.  It
progresses to beta, candidate and then stable.
–classic – Snap packages are normally sandboxed for security
reasons.  Since Pharo is a development environment
in which we want to be able to run any executable,
or load any library, it is installed with access to
the entire system (as the running user).

Why use snap packages?

– They include all dependencies.  In particular, for the 32 bit
versions, this means that it isn’t necessary to install all the 32 bit
architecture and associated dependencies.
– Including dependencies means that there shouldn’t be any problems with
incompatible library versions when upgrading.

Why not use snap packages?

– It’s a relatively new technology, with a number of rough edges.
– There may still be issues with its sandboxing that I haven’t
discovered yet.
– Please let me know of any others to be listed here.
– Because the package uses classic confinement, it isn’t
cross-distribution in practice (unfortunately).

If you don’t trust me to configure your system correctly (which requires
sudo):

– All the scripts that make up the sub-commands are visible, e.g.
pharo.config can be viewed at /snap/pharo/current/usr/bin/CONFIG

The packaging code is at: https://github.com/akgrant43/pharo-snap

I’m interested to know if people would like to see this eventually
become a supported package format.

Cheers,
Alistair


Pharo Weekly - 64 bits call for tests

Hello list,

We are approaching to release and one big thing of this one is the 64bits supports for Pharo (limited, since there is still not support for Windows, but it will arrive, eventually 😉 )
I asked you to test a couple of months ago but now we are in better shape to do it.
– VM and image are getting more and more stable and crashes shouldn’t happen (but that’s why I want you to test: to discover possible bugs/crashes)
– I made 64bits a zeroconf citizen: http://get.pharo.org/64
Now, you can test it by just doing:
curl get.pharo.org/64/60+vmLatest | bash
(In linux or mac, remember it will not work for Windows)

April 13, 2017

Benoit St-Jean - Perceptron et Pharo

Ceux qui s’intéressent aux classifieurs linéaires et à Pharo et/ou Smalltalk seront heureux d’apprendre qu’il existe maintenant une implémentation de perceptron en Pharo Smalltalk!!

Tous les détails sont ici.


Classé dans:algorithmes, informatique, Pharo, Smalltalk Tagged: classifieur linéaire, perceptron, Pharo, Smalltalk

April 12, 2017

Pharo Weekly - [Consortium] 3-9 April 2017

Hello!

This is my weekly ChangeLog, from 3 April 2017 to 9 April 2017.
You can see it in a better format by going here: http://log.smallworks.eu/web/search?from=3/4/2017&to=9/4/2017

ChangeLog
=========

7 April 2017:
————-

*    Fixed the small but annoying [issue 323](https://github.com/npasserini/iceberg/issues/323)
(DNU when creating a local repository )

*    Today I’m working on [Iceberg](http://github.com/npasserini/iceberg).

I fixed a bug on locating existing repositories for +gitlocal:+ Metacello protocol, but most amusing,
I added a new plugin: “Install Baseline”, who allows you to install a project from a baseline listed in
“Packages” tab from repositories browser.

6 April 2017:
————-

*    I worked a lot preparing the new deployment model for VMs.

Basically, now it will be like this:

* nightly builds will be still built by our CI (to produce test VMs)
* latest VMs will be produced on opensmalltalk-vm, using blessed sources.
* stable VMs will be promoted by me 🙂

I’m thinking on change a bit this scheme, but for now it will work like that.

I finisged the [OpenSmalltalk](http://github.com/OpenSmalltalk/opensmalltalk-vm) part, now I need to adapt
also [Pharo-Project](http://github.com/pharo-project/pharo-vm) (tomorrow).

Then, we still need to fix one problem with a primitive… and we will be good to go.

*    I worked on [case: 19921](https://pharo.fogbugz.com/f/cases/19921), to allow Athens to run fine on 64bits (linux).

5 April 2017:
————-

*    I worked on +UnifiedFFI+, making sure different architectures of linux (i386, x86_64) will have methods to
find their libraries.

In particular, I added: +#unix32ModuleName+ and +#unix64ModuleName+. Both are redirecting to
+#unixModuleName+ by default as a way to provide backward compatibility (also, libraries could)
be in same place in different architectures, like the case of libraries distributed by ourselves
(libgit2, libssl, libssh2, libsdl2).

4 April 2017:
————-

*    I made some fixes on [Iceberg](https://github.com/npasserini/iceberg)... in particular, this two issues:

* [Issue 317](https://github.com/npasserini/iceberg/issues/317), which adds the posibility of removing a package from FileSystem.
* [Issue 319](https://github.com/npasserini/iceberg/issues/319), forcing unix line endings to commit messages (as is required by git).

*    I fixed a problem when building the VM for Windows: thing is, as it was, it was building cairo library without
freetype support, so frameworks like Roassal to fail.

Problem was that pkgconfig was failing to find correct version of +freetype+ effectively letting it outside.

I needed to change the build script (for Windows) to this:

—-
$(THIRDPARTYLIBDIR)/$(CAIROLIBNAME): $(CAIROARCHIVE)
tar x -f $(CAIROARCHIVE) -C $(THIRDPARTYDIR)
cd $(CAIRODIR) \
&& ./configure \
–prefix=”$(THIRDPARTYOUTDIR)” \
–host=i686-w64-mingw32 \
PKG_CONFIG=”$(PKG_CONFIG)” \
PKG_CONFIG_PATH=”$(PKG_CONFIG_PATH)” \
CFLAGS=’$(THIRDPARTY_CFLAGS) -I$(THIRDPARTYINCLUDEDIR) -march=pentium4′ \
LDFLAGS=’$(THIRDPARTY_LDFLAGS) -L$(THIRDPARTYLIBDIR) -march=pentium4′ \
FREETYPE_LIBS=”-L$(THIRDPARTYLIBDIR) -lfreetype -lz” \
FREETYPE_CFLAGS=”-I$(THIRDPARTYINCLUDEDIR) -I$(THIRDPARTYINCLUDEDIR)/freetype2″ \
–disable-silent-rules \
–disable-xlib \
–disable-dependency-tracking \
&& sed -i ‘/.* sh .\/make-/i\\ttest -e \$$\@ \&\& rm \$$\@’ test/Makefile \
&& make \
&& make install
—-

Now averything seems working.

cheers!
Esteban


Pharo News - [ANN] Pharo MOOC: Online Course

<p> The Pharo MOOC is a new online course about Live Object Programming in Pharo. </p> <ul> <li>More information and registration <a href="https://www.fun-mooc.fr/courses/inria/41010/session01/about?platform=hootsuite">here</a></li> <li>The Teaser-trailer is <a href="https://www.dailymotion.com/video/x3qedvo_fun-mooc-programmation-objet-immersive-en-pharo_school">online</a>: </li> </ul> <iframe width="640" height="480" autoplay="false" src="http://www.dailymotion.com/video/x3qedvo_fun-mooc-programmation-objet-immersive-en-pharo_school?autoplay=0" frameborder="0" allowfullscreen></iframe>

April 11, 2017

Pharo Weekly - Commander library

Hi.

I am glad to announce Commander library which implements command pattern based on first class objects.
In Commander every application action is implemented as separate class with #execute method and all state required for execution.
Commands are reusable objects and applications provide various ways to access them: shortcuts, context menu, buttons, etc.. This information is attached to command classes as activator objects. Currently there are three types of activators:
– CmdShortcutCommandActivator
– CmdContextMenuCommandActivator
– CmdDragAndDropCommandActivator
Activators are declared in command class side methods marked with pragma #commandActivator. For example following method will allow RenamePackageCommand to be executed by shortcut in possible system browser:
RenamePackageCommand class>>packageBrowserShortcutActivator
      <commandActivator>
      ^CmdShortcutCommandActivator by: $r meta for: PackageBrowserContext
And for context menu it will be:
RenamePackageCommand class>>packageBrowserMenuActivator
       <commandActivator>
       ^CmdContextMenuCommandActivator byRootGroupItemFor: PackageBrowserContext
Activators are always declared with application context where they can be applied (PackageBrowserContext in example). Application should provide such contexts with information about application state. Every widget can bring own context to interact with application as separate tool. For example system browser shows multiple panes which provide package context, class context and method context. And depending on context browser shows different menu and provides different shortcuts.

Marten Feldtmann - PUM – Adding JavaDoc support

With the version today I added initial JavaDoc support in the generated source code.


Filed under: Smalltalk Tagged: Java, JavaDoc, PUM

Smalltalk Jobs - Smalltalk Jobs – 4/11/17

4 jobs in Europe:

  1. Villach Austria – Lam Research.  They supply wafer fab equipment to the semiconductor industry.  They would prefer Visual Works.
  2. Brest, France – Thales Defense.  They are looking for someone to work in their center for Radar and Electronic Warfare and other defense systems.
  3. Groot-Bijgaarden, Belgium (near Brussels) – MediaGeniX supplies software for radio and TV channels.  They have both a junior and senior position available.  They are interested in Dutch and English, and, mention often the idea that you write clean code.

Filed under: Employment

Pharo Weekly - New consortium member

Hi

We are happy to announce that CS department of University of Bretagne Occidental is now an academic member of the Pharo Consortium.

Stef


April 10, 2017

Cincom Smalltalk - Introducing Change Type Filtering for the Package Comparison Tool

When a customer wants to upgrade to a newer version of Cincom® ObjectStudio® or Cincom® VisualWorks®, I and other members of our Smalltalk Support team here at Cincom will suggest […]

The post Introducing Change Type Filtering for the Package Comparison Tool appeared first on Cincom Smalltalk.

German Arduino - Sistema de Registración a Eventos

Arduino Software se complace en anunciar un nuevo servicio para sus clientes, se trata de un sistema de registración para eventos de todo tipo, con múltiples opciones. Los detalles se pueden leer en este enlace.





April 08, 2017

Smalltalk Jobs - Smalltalk Jobs – 4/8/17

  • Ann Arbor, MISoftware Engineer at Shoshana Technologies
    • Required Skills:
      • Willingness to work closely with others/do pair programming
      • Willingness to participate in significant architectural decisions and to understand and challenge existing code
      • Object-oriented programming
      • Current and cutting-edge web development technologies
      • Test-driven development
    • Wanted Skills:
      • AngularJS 2.0 / TypeScript
      • Smalltalk (Ruby is also an excellent point of reference)
      • Ionic/Cordova
      • Relational databases
    • Pay:
    • Additional listings:
Good luck with your job hunting,
James T. Savidge

View James T. Savidge's profile on LinkedIn

This blog’s RSS Feed


Filed under: Employment Tagged: jobs, Smalltalk, Smalltalk jobs

April 07, 2017

Torsten Bergmann - ImageWorker for Pharo

Interesting project: the image-worker uses OSProcess to easily run tasks in a separate image.

April 06, 2017

Pharo Weekly - Pharodays draft website

Hi guys

Here is the draft of the pharo days 2017 conference

http://www.pharo.org/2017pharodays

Full program and registration is coming.

Stef


April 05, 2017

April 04, 2017

Noury Bouraqadi - PhD position

We are pleased to announce that we are looking for a good and talented student for doing a PhD with us and our colleagues from ENSTA Bretagne. More infos: PhD Description PetitPoucet

April 03, 2017

Tom Koschate - Almost there

I found that using a combination of James’ tutorial, and Cincom’s documentation got me to within a stone’s throw of where I wanted to be.  What I want now is a StORE reference for ENVY users.


Benoit St-Jean - That guy

We all know that guy. You know, that guy who sees performance improvements everywhere, all the time?

That programmer who squeezes everything into bitmaps because « it’s so much faster » ?  And when I say everything, I mean everything! Even if your class only has one flag!

That guy who caches everything in the application because « that’s the optimal way to do it« ?  Even if the data that is cached is just accessed only one time?

That guy who fits a date into an integer in the database because « it’s so much more compact » ?  There goes all your SQL and date functions!

That developer who always ends up re-implementing another sorting algorithm because he read a « great paper » on the subject and « it’s proven that it’s 0.2% faster than the default sort » available?  And after an insane debugging session, you finally realize he has overriden SortedCollection>>#sort: ?  And that his code just doesn’t work properly!

You know, that guy with a C/C++ background who spends countless hours optimizing everything not realizing he has to « make it work » first! You know, that guy who still doesn’t get that often times you only need to optimize very small parts of an application to make a real difference?

You know that guy with strange concepts such as « defensive programming » who tells you nobody ever caught a bug in his code in production? You know, that guy who came up with the « clever » catch-everything method #ifTrue:ifFalse:ifNil:onError:otherwise: ?

You know that guy who never works for more than 4 months at the same place because « they didn’t get it, they’re a bunch of morons » ?

You know, that guy who prefers to implement complex database queries with a #do: loop and a gazillion SELECT statement because « SELECT statements with a 1-row lookup are very optimized by the database server » instead of using JOINs. And then he blames the slow response time of his « highly optimized » data retrieval code on the incompetence of the DBAs maintaining the database?

You know, that guy who once told me « inheritance in Smalltalk is very bad because the deeper the class in the hierarchy, the slower the method lookup is going to be » so that’s why he always preferred « flattened hierarchies » (meaning promoting ALL instance variables into one root class) with 2-3 levels deep in the worst case? « Besides, my code is easier to understand and debug since everything is in one place« .

Well, I was going through some of the sh*ttiest code I’ve seen in a long time last night and I remembered that guy and his ideas about « highly optimized flattened hierarchies » and thought I’d measure his theory!  Here’s the script.

Basically, it creates a hierarchy of classes (10000 subclasses) and times message sends from the top class and the bottom class to measure the difference.

Well, that guy was right… There’s a 1 millisecond difference over 9 million message sends from the root class as compared to the 10000th class at the bottom of the hierarchy.

I wanted to tell that guy he was right but his email address at work is probably no longer valid…

CAVEAT: Make sure you do not have a category with the same name as the one in the script because the script removes the category at the end (and all classes in it!).  Also, be warned it takes a very very very long time to execute!

P.S. All the stories above are real. No f*cking kidding!  Those guys really existed : I’ve worked with them!


Classé dans:database, Smalltalk Tagged: coding, database, horror, optimization, performance, Smalltalk

April 01, 2017

Marten Feldtmann - PUM – Updating VASmalltalk Generator

When looking around the generators I noticed, that I forgot to made several changes to the VASmalltalk generator (e.g. remove the needs for cookies).

Therefore the runtime had to be changed and I changed the created methods for VA to look them more like the ones I created for the mainstream languages.

 


Filed under: Smalltalk Tagged: PUM, Smalltalk