Category Archives: Unsorted

Characterizing Pharo code

Hello,

We have analyzed the source code of the 50 projects selected from the Pharo ecosystem and reported our findings in this document:

https://hal.inria.fr/hal-02440055v1

Perhaps, you will find it interesting.

Here are some fun facts that we have discovered:

  • 25% of classes have no more than 3 methods in them, and 50% of classes have no more than 6 methods
  • The average number of lines of code in Pharo methods is 5.8, the median of this number is 3, meaning that 50% of methods have no more than 3 lines.
  • About a quarter of source code are message sends (method names) – they take 27.3% of source code tokens and 26.3% of characters.
  • On a character level, 22.5% of source code are string literals, and 19.4% are literal arrays. Together literals take 44% of characters in source code, but only 7.1% of tokens.
  • Positive statements are much more common than negative ones. ifTrue: is used 3 times more often than ifFalse:. Similarly, ifTrue:ifFalse: is 26 times more common than ifFalse:ifTrue:.
  • After tokenizing the code of 151,717 methods, splitting identifier names by camel case, and removing non-alphabetic characters, we received a sequence of almost 3 million words (e.g. … ordered collection with all command line arguments…). This sequence contains only 8,211 unique words (including all misspellings such as arrray, clipped words such as arr, and nonsense words such as ddd or xdkh). Compare this to over 40,000 unique words used in roughly the same amount of printed English prose.
  • At least 5,480 of those 8,211 unique alphabetic sequences are valid English words.

Have a nice day, and let us know what you think.

We would be happy to receive your feedback.

Oleks

[Ann] VLC binding for Pharo

Hello there,

I just want to let you know that I’ve developed an FFI binding to VLC.
Since, version 2.1.1 you can use it on Windows, Linux, and OSX.
https://github.com/badetitou/Pharo-LibVLC

Thanks to the binding you can play easily sounds and videos from Pharo.

The next steps are:

Feel free to use the binding and tell me if you need help with it.

Benoît Verhaeghe

[ann] Embedded image in Windows

Hi,
I have produced an example of using the headless VM to have an
embedded image in Windows. The example is hosted in Github
(https://github.com/tesonep/pharo-vm-embedded-example)

The example is a CMake project to generate a new small executable that
uses the VM as a library. Also, it shows how to perform the branding
of applications (I have used the same Pharo icon, but we can use
anything else).

In the example, I am opening one of the SDL2 examples, it opens a
window where we can draw in an Athens Canvas.

It requires a Cygwin environment, but if you are able to build the
headless VM you already have it!.

I will do other examples of the use case we are thinking for the headless VM!

Cheers,
Pablo


Pablo Tesone.
tesonep@gmail.com

[Ann] Phoedown an FFI to hoedown

Hi all,

I've published Phoedown, an FFI to hoedown, the standards compliant, fast, secure Markdown
processing library written in C. 

- https://github.com/PierceNg/Phoedown
- https://github.com/hoedown/hoedown

A simple example:

    | md |
    md := (FileSystem memory / 'somefile.md')
    	writeStreamDo: [ :ws |
    		ws nextPutAll: 
    '
     ```smalltalk
    Transcript show: ''Happy New Year!''; cr
     ```
    ' ];
    	contents.
    HdHtmlRenderer new
    	setMarkdownExtension: HdMarkdownExtensions FencedCode;
    	setMarkdownExtension: HdMarkdownExtensions NoIntraEmphasis;
    	render: md

This is the output:

    <pre><code class="language-smalltalk">Transcript show: 'Happy New Year!'; cr
    </code></pre>
 
Pierce

[Ann] Cozy:

Hello

I decided that in 2020 I will not turn around the glitches and I will follow the example of Cyril Ferlicot who adapted Pharo with many cool extensions (check his https://github.com/jecisc/pharo-scripts).

So I worked over holidays on Cozy https://github.com/Ducasse/Cozy/. I adapted, refactored and …. well changed his scripts. Since I wanted to explore I forked and expanded. But I made sure that Cyril can copy back my utilities by making sure that Cozy and cohabit with Pharo-Scripts.

Here is the package readme.

A little package to create a more cozy and productive working environment for Pharo.

It is based on Pharo-scripts from Cyril Ferlicot and probably QuickAccess from Torsten Bergman (I do not know since I started from pharo-scripts). But I want to thank them both. I made sure that Cozy can be loaded without impacting pharo-scripts to support cross-fertilization.

Cozy supports

  • Iceberg configuration via files saved in your settings (password, ssh, share repo). See IcePick.
  • Automatic Iceberg configuration for Pharo contribution
  • scan of your github repo to populate iceberg in one click
  • many cool scripts
  • a superb new them called “A day at the beach”: yes with a nice blue and orange style!

Next version should

  • clean some duplicated functions
  • support modular definition of script (instead in a single class because relying on protocols does not work with class extensions.
  • make sure that my lovely scripts are nicely packaged.
  • check pharo-scripts support for multiple pharo versions.
  • a way to manage (as Pharo-scripts all) the settings folder in github.
  • smoother theme integration.

Here is a picture of the “A day at the beach” theme.

Screenshot 2020-01-05 at 16.20.17.png

Happy new year.

My resolution for this year is to me a lot more efficient 🙂

 

[ann] SlideBuilder

 

Hi everyone, my name's Pablo and I'm from Argentina. I'm taking my first steps in Pharo and created this tool (https://github.com/pablo1n7/Smallbook) to share with my colleagues and show them the power of Pharo.

It's a simple library to create slide presentations and show them in a web browser.

I used Zinc HTTP for the server, JS for the presentation controls and CSS for the styles.

It's not 100% complete, I'm still working on it. I hope you find it useful and any suggestion is welcomed


Best Regards, Pablo.

[Ann] Draft of Concurrent Programming Booklet

Hi

Since a couple of years I had some chapters for a little book on concurrent programming in Pharo. During holidays, I spent some time to revisit and improve the text to be able to release a first version.

Feedback, errors, suggestions are welcome.

https://github.com/SquareBracketAssociates/Booklet-ConcurrentProgramming/releases

Thanks in advance for your time

S.

Happily surprised

Hi

We are happily surprised to see the new Logiciel web site of Inria showing Pharo :).

https://www.inria.fr/fr/logiciel

S. Ducasse for the Pharo consortium

[Ann] Subtitles on Mooc.pharo.org

Hi

Just a little post to let you know that http://mooc.pharo.org now has direct pointers to the slides of the presequel and to the subtitles in french, english, spanish and japanese. The subtitles were on the FUN platform but not on our web site.

Now this is fixed.

We thank again all the contributors.

Quote of the day:

  • I have just completed week seven of the Pharo Mooc (beginner and object oriented  tracks) I am starting a redo of the Mooc with the web track (TinyBlog project).  I have already learned so much ! I have spent the last 20 years or so in software development and, following this Mooc, I realized I hadn’t really grasped the essence of object-oriented design.