[ANN] New Windows VM – Fixes 1903 error

Hello,
a new stable VM has been deployed. This VM uses a new version of libSSH allowing us to work in the latest Windows version.

It can be directly updated using Pharo Launcher or downloaded using ZeroConf scripts.

To update from Pharo Launcher you have to access to the VM Manager window.
Just click on the marked button and then in “Update”

updateVM.png

A little information I was missing, the fixed VM is for both Pharo 7 and Pharo 8

Thanks Guille and Pablo!

Pharo Team

Advertisements

Spec2 new PR in Pharo 80

https://github.com/pharo-project/pharo/pull/4589

Features

  • Add padding management of SpBoxLayout for Morphic
  • Add demo on Box Layout (978220b)
  • Add package comments (20ffe7a)
  • Add contextMenu to Athens presenters (78aefa5)
  • Allow to add an image in the layout without declaring an image presenter (748bc59)
  • Add InputPort to SpPresenterWithModel (5f7d07c)
  • Improve demos (d2e1bf1)
  • Add possiblity to pass action to link presenter (3903717)
  • Add component list presenter (cb26690)
  • Add possibility to defer UI via Spec (da86831)
  • Introduce new API: initializePresenters and connectPresenters instead of initializeWidgets and initializePresenter (6c7ebc1)
  • Use toolbar and not toolBar (f2f807f)
  • Create builder for SpActionBarPresenter (c5f1e59)
  • TextPresenter Add a placeHolder (7b7d4b5)
  • Add the method clearContent in the class SpAbstractTextPresenter (16a842d)
  • feature/improvementsForIceberg (246c1a7)

Commander 2 integration

  • Change dependency to Commander2 so it uses v110 (5ca15b3)
  • Update commander2 version (4ac485a)
  • Change dependency to Commander2 for v120 (15945ac)
  • Migrate Spec to use Commander2 v200 (c4c5350)
  • Implement method to convert spec command as ButtonPresenter (dab0312)
  • Allows one to change the default context set on commands when their context is nil (152af5e)
  • Commander2 should provide easier way to use command group on list tree etc (d80a965)
  • Commander2 layer should set the presenter as context of commands when not done (d0f2889)

Bugfixes

  • Replace Smalltalk references (c1cc561)
  • Fix grid layout tests (85719bc)
  • SpAbstractPresenter should be abstract (de681a0)
  • Migrate more layouts to executable layouts (cee71ae)
  • Use theme instead of hardcoded color in Modal adapter (be583d8)
  • TextPresenter placeholder does not work in Pharo 7 (6bbdc7b)
  • Instance of TreeTablePresenter did not understand activatesOnDoubleClick (9cda46c)
  • Fixing SpCodePresenter in pharo8 (fc5b7e8)
  • Some table columns are editable (c630a0e)
  • Fixing Baseline (3f3ac6d)

Cleanings

  • Migrate initializeWidgets and initializePresenter to new API (dd74217)
  • Clean package structure (a0706ba)
  • Remove dependency between Spec2 Commands and Commander (56ae6d4)
  • Commander2 v2 migration (0d029c0)
  • Remove all commented pragmas (ed6e844)
  • cleanup (05839d7)
  • Deprecate asSpAdapter (cb5f47c)
  • Move spec related methods on class side of CmCommand and CmCommandGroup to spec integration package (f95eca0)
  • Remove ComposablePresenter references (ef8c984)
  • Unnecessary initialize method in SpMorphPresenter (4b6828b)
  • SpExecutableLayoutresolvePresentermodelbindings should be SpExecutableLayoutresolvePresenterpresenterbindings (caa37db)
  • Fix calls to canBeRun and replace them with canBeExecuted (822db0c)
  • PolyWidget SpChooseMethod improvement (fe964f9)
  • Comment of SpPresenter mentions ComposablePresenter (d46e348)
  • Rename SpTestingComposerWithModel into SpTestingPresenterWithModel (092e6c4)

Infrastructure

Commander 2 integration of the 13 of September 2019

Features

  • Add #register:after: and #register:before:. (ad5041c)
  • Implemented part of the missing API and implemented corresponding tests. (5c91fac)

Bug fixes

  • Added missing deprecation methods to make transition from v1 to v2 smoother. (3fef319)
  • Changed string returned by #defaultDescription to be ‘Not described command.’ (71ad574)

Cleanings

  • Preparing for major release, removing deprecated methods we do not want in next major version: – #canBeRun – #canBeRunBlock – #canBeRunBlock: – #defaultCommandName – #runWith: (3dbd6b1)
  • Updated baseline to be more flexible. – Do not provide migrator in default group. – Provide core,test and migrator groups. (7a7491b)
  • Enhanced comment. (8379fb3)
  • Did migration with the following renamings (order is important): #name -> #dynamicName. #description -> #dynamicDescription. #basicName -> #name. #basicDescription -> #description. (1a8f4e8)
  • wrap environment into RBNamespace. (723cddd)
  • Put #runWith: in deprecations package. (cc9025d)
  • Removed #runWith: (c78dd09)
  • Renamed #defaultCommandName as #defaultName. Used deprecation. (c1bad44)
  • Renamed #canBeRunBlock as #canBeExecutedBlock via a deprecation. (5a87a11)
  • Moved spec related methods in class-side of CmCommandGroup to spec package. (4ae2f84)
  • Moved spec-specific methods on class side of CmCommand to Spec integration package. (11d7997)
  • Renamed #canBeRun as #canBeExecuted to be more consistent. Created a deprecation to ease migration of users. (152e6a7)
  • Reclassified all #canBeRun methods in ‘testing’ protocol. (813cda2)
  • Reclassified #execute methods in ‘executing’ protocol. Brings consistence and solves issue #9 (19c1ee0)
  • Renaming of CmCommandGroupTest to CmCommandsGroupTest. (5f20942)
  • Renamed test class to match class under test. (8ab2c3b)

Fund rising for a book on Spec20

Hello Pharoers and Smalltalk Friends
Often you or other complain that there is not enough documentation, tutorials…. (even if we have a MOOC worth 155 K euros http://mooc.pharo.org, several great books http://book.pharo.org), but yes we should update them.
Now I started to work on a new book on Spec 20 with Cyril Ferlicot and I decided that I will not write it for free because it will take me at least 6 months.
So I decided that if this community wants more books and documentation, it should prove its will 🙂
I created a fundraising campaign to check if people can align their wishes and their means.
So feel free to sponsor this great book.

Building user interfaces with spec 20 –  

https://www.okpal.com/building-user-interfaces-with-spec/?utm_campaign=01DKKYM06QR7GF0K4S5YA3VVZ0&utm_medium=campaign_edit-okpuid_01DKKYKZ99J5VPEAKHNXH8375A-20190903&utm_source=share_directlink

Organisations can also do it.
BTW: the crowd funding system and other cost will cost us 10% and after we will pay taxes
on this. So I prefer not to count our hour cost because else I would really not write a book at all.
Stef

Pharo-Headless-Linux-VM debugging

Guille’s procrastination experiments inspired me to procrastination of my own,
with an experiment around debugging Pharo-Headless-Linux-VM using Visual Studio running on Windows.
I’ve refined the steps-from-scratch to reproduce down to the following…
Overview…
1. Install Windows Subsystem from Linux
2. Install Visual Studio 2019
3. Build and run hello-world exercise inside WSL
4. Build and run Pharo-Headless-VM inside WSL

Now lets get started…

###############################
Install Windows Subsystem from Linux
###############################
1A. On a Windows 10 box, go to the Windows App Store and Ubuntu 18.04…

Ref: https://docs.microsoft.com/en-us/windows/wsl/install-win10

1B. Ensure this configured as the default (otherwise later the $defaultWSLPath variable doesn’t work and you may see a Visual Studio error “Could not open windows subsystem shell”)…

C:\Users\Ben>wslconfig /l
Windows Subsystem for Linux Distributions:
Legacy (Default)
kali-linux
Ubuntu-18.04
Ubuntu-16.04

C:\Users\Ben>wslconfig /setdefault Ubuntu-18.04

C:\Users\Ben>wslconfig /l
Windows Subsystem for Linux Distributions:
Ubuntu-18.04 (Default)
Legacy
kali-linux
Ubuntu-16.04

Ref: https://www.howtogeek.com/344688/how-to-set-your-default-linux-distribution-on-windows-10/

btw, my Windows 10 box recently upgrade to latest version.
C:\Users\Ben> ver
Microsoft Windows [Version 10.0.18362.295]

1C. Start Ubuntu-18.04, then update/upgrade/install pre-requisites…
“`
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install clang gcc gdb make rsync zip        # Visual Studio requirement
sudo apt-get install uuid-dev                      # Pharo VM build requirement
“`

While that is running…

####################

Install Visual Studio 2019
####################
2A. Download and run the installer for Visual Studio Community 2019 (not Visual Studio Code)

Ref: https://visualstudio.microsoft.com/free-developer-offers/

2B. When the “Visual Studio Installer” opens, under its “Workloads” tab, select “Linux development with C++” and click **Install**.

Ref: https://docs.microsoft.com/en-us/cpp/linux/download-install-and-setup-the-linux-development-workload?view=vs-2019

#####################################
Build and run hello-world exercise inside WSL

#####################################
3A. Start Visual Studio 2019
and at its opening window, under “Get started” click “Create a new project”.
Then scroll down and choose “CMake Project” and <Next>.
and configure…
Project name: hello-world
then click <Create>.

Ref: https://docs.microsoft.com/en-us/cpp/linux/cmake-linux-project?view=vs-2019

Now it may immediately start the CMake build and get an error because its using the default “x64-Debug” configuration.

Ignore that, we will create a new configuration to build on Windows Subsystem for Linux.

3B. From the “Configuration drop-down” (where you see “x64-Debug”)
select “Manage Configurations…”
Delete “x64-Debug”.
Add… “WSL-Debug” and use all defaults then press <CTRL-S> to save.

Inside WSL, Cmake will start generating the makefiles.

At some point you might see “Supported CMake version is not present on WSL. Install CMake binaries built by Microsoft?”
YES, do that.

3C. After “CMake generation finished”,
pull down “Select Startup Item” and select “hello-world”
then press the green PLAY button.

Inside WSL, the make build will start and after its done the pharo executable will run there.
In the [Output] tab, it was successful if you see  “The thread ‘hello-world’ (0x1f7a) has exited with code 0” .

3D. For proof that its running inside WSL, lets write a file!
In the “Solution Explorer” tab, browse to “hello-world.cpp” and change its contents to…
“`
#include <stdio.h>
int main()
{
FILE* fp;
int i;
/* open the file for writing*/
fp = fopen(“/tmp/built-by-visual-studio”, “w”);
fprintf(fp, “It worked.\n”);
fclose(fp);
return 0;
}
“`
then press the green PLAY button.
After you see “thread ‘hello-world’ has exited with code 0”
open a WSL shell and run…
$ cat /tmp/built-by-visual-studio
It worked

3E. To experience debugging Linux from Visual Studio, first remove the test file…
$ rm /tmp/built-by-visual-studio
then put a breakpoint on “fopen” and click the PLAY button.
Check if the file is there…
$ cat /tmp/built-by-visual-studio
cat: /tmp/built-by-visual-studio: No such file or directory
<STEP OVER> fopen
$ cat /tmp/built-by-visual-studio
<STEP OVER> fprintf
$ cat /tmp/built-by-visual-studio
<STEP OVER> fclose
$ cat /tmp/built-by-visual-studio
It worked

3F. All done…
File > Close Folder

#####################################
Build and run Pharo-Headless-VM inside WSL
#####################################
4A. From Visual Studio 2019 opening window, under “Get started” click “Clone or check out code”
Repository location: https://github.com/bencoman/opensmalltalk-vm.git
then click <Clone>.
https://docs.microsoft.com/en-us/visualstudio/get-started/tutorial-open-project-from-repo?view=vs-2019

4B. In the bottom-right status bar, click the “branching” icon and choose “Manage Branches”.
Expand “remotes/origin”,
then right-click “headless-WSL-VisualStudio” and “Checkout”

A fixed “WSL-Debug” configuration is a part of this branch, so its CMake-build should auto-start and complete successfully.

4C. After “CMake generation finished”,
pull down “Select Startup Item” and select “pharo (build/vm/pharo)”
then press the green PLAY button.

Don’t worry if it sits for a long time on “BalloonEnginePlugin>>primitiveAddRect”

The [Error List] tab pops up with 116 Warnings.
Switching back to the [Output] tab, you hopefully see “thread ‘pharo’ (0x4d0d) has exited with code 0”

So the VM just built and ran headless under Windows Subsystem for Linux.

Now lets debug that from Visual Studio.

4D. Browse to src/main.c and put a breakpoint in main() on the call to parseArguments()
Then click the PLAY button.
Once stopped at the breakpoint, <STEP INTO>.
In the [Autos] tab, expand the “parameters” variable.  Observe “imageFile” is empty.
Notice “imageFile” becomes “Pharo.image” after <STEP OVER> splitVMAndImageParameters().

So now I leave you to play.  I’d be interested in hearing about people’s experiences.

Placing the correct PharoHeadless.image in the right place to actually run the image
is left as an exercise for the reader.
cheers -ben

[Ann] Pharo Consortium New Bronze Member: Object Guild

The Pharo Consortium is very happy to announce that the Object Guild has joined the Consortium as a Bronze Member.

Object Guild

Simply Revolutionary
High fidelity software solutions for values-driven organisations.
We help you to help the world become a better place.

Object Guild differentiates itself as a custom software design and development shop in the following ways:

– by a commitment to use technology and software to make the world a better place;
– by seeking and serving clients who are equally committed to social and environmental enhancement;
– by focusing on “Software that Fits,” that seamlessly integrates with and enhances the complex system where it is deployed;
– by our commitment to Pharo and Smalltalk development, including expanding and enhancing Pharo;
– by a focus on education and training, internal and for clients, that advances the “state-of-the-practice” of software development.
https://objectguild.com

The goal of the Pharo Consortium is to allow companies and institutions to
support the ongoing development and future of Pharo.  http://consortium.pharo.org

Individuals can support Pharo via the Pharo Association. http://association.pharo.org

[ann] pre-release Voyage 1.6

I made a pre-release for voyage 1.6 at

It enables to usage in pharo8. Also included is a first preview of using ArangoDB [1] with Voyage
Norbert

[ann] Iterator framework for Pharo

Hello,

I wanted to have an iterator framework for Pharo for a long time.
So I started building it step by step and today I think that, while it still requires more documentation, it is ready to be announced and used by others.
The idea is that, as described by the iterator design pattern, any object that needs to be walked provides one or many iterators.
In the library, #iterator method is the convention to get the default iterator of any object (if it has one).
Iterators provides a DSL to deal with iterators combination.
It is inspired from shell’s streams manipulation syntax:
– The pipe “|” allows one to chain iterators
– The “>” allows one to create a new collection with data transformed through chained iterators
– The “>>” allows one to fill an existing collection with data transformed through chained iterators
For example, one can write:
iterator := #(1 2 3) iterator.
iterator
| [ 😡 | x * 2 ] collectIt
| [ 😡 :y | x + y ] reduceIt
> Array “#(12)”
Or
iterator := #(1 2 3) iterator.
collectionToFill := OrderedCollection new.
iterator
| [ 😡 | x * 2 ] collectIt
| [ 😡 :y | x + y ] reduceIt
> collectionToFill.
collectionToFill “anOrderedCollection(12)”
The equivalent of “/dev/null” in Linux also exists:
iterator := #(1 2 3) iterator.
iterator
| [ 😡 | x * 2 ] collectIt
| [ :object | object logCr ] doIt “Just print incoming objects in transcript.”
> NullAddableObject “Special object that ignore incoming objects.”
There are documentation and examples on the GitHub repository.
Initially, the goal was to avoid to duplicate all collection’s iterator methods (e.g. #collect:, #select:, etc) in composite objects.
Thus, it provides an IteratorWithCollectionAPI which wrap an iterator and provides all the methods we want (#collect:, #select:, …).
Via IteratorWithCollectionAPI, your objects automatically gets the Collection API, you just need to access it via #iterator message:
myObject iterator select: [ 😡 | x isFoo ]
This is another way to use the framework, just to avoid code duplication.
Future work is to provide the possibility to have iterator with multiple inputs.
I already have an undocumented prototype on the repository that works like this:
it1 := (1 to: 10) iterator.
it2 := (1 to: 10) iterator.
it1 & it2
| [ 😡 :y | x@y ] mergeIt
> Array. “{(1@1). (2@2). (3@3). (4@4). (5@5). (6@6). (7@7). (8@8). (9@9). (10@10)}”
Yes, “&” operator will again kind of mimic the one from the shell.
Hope it helps other people.
Feedback is welcome.
Cheers,
Julien

[Ann] Magritte ready for Pharo 80

Just a little announce to let you know that magritte is now ready for Pharo 80.

https://github.com/magritte-metamodel/magritte/

S

[ann] PolyMath 1.0

Dear all,

we are happy to announce the release of PolyMath 1.0, the
computational framework for Pharo.

Please find more information about the project here:
https://github.com/PolyMathOrg/PolyMath

Changelog of modifications is available here:
https://github.com/PolyMathOrg/PolyMath/milestone/1?closed=1

You can install the 1.0 version in a fresh Pharo 7.0 with the
following code snippet:

Metacello new
repository: ‘github://PolyMathOrg/PolyMath:v1.0/src‘;
baseline: ‘PolyMath’;
load

Thank you Hemal, Oleks, Atharva, Nikhil, Konrad and Werner for your
help on this release.
I will do a PolyMath 1.0 talk at ESUG 2019.

Regards,

Serge Stinckwich

[ANN] Pharo Pomodoro now on GitHub

I migrated my Pomodoro timer project to GitHub now:

https://github.com/astares/Pharo-Pomodoro

and you can load it using Catalog or script. I tested with Pharo 8.

See also https://twitter.com/TorstenAstares/status/1161212424982290435

Bye
T.

And yes – additionally to my blog http://astares.blogspot.com
you will also find my news on Twitter now https://twitter.com/TorstenAstares

Advertisements