Planet Squeak

blogs about Squeak, Pharo, Croquet and family
planet squeak - planet squeak es - planet squeak jp - planet croquet - planet squeak code - planet smalltalk

November 07, 2019

PharoWeekly

Roadmap progress report October 2019

Hello,
This is the log of what we have been working on last month.
As usual, they are just bullets because we assume you are already aware of most of them, but no hesitate to ask if you want more details 🙂
Also, I’m scheduling an open meeting next Thursday to talk with those who want to show up and ask questions, discuss something, comment something.
This are the connection details (yes, you need to install an application, but is free and quality of communication is very good):
Topic: Pharo open meeting
Time: Nov 14, 2019 04:00 PM Paris
Join Zoom Meeting
https://zoom.us/j/148993322
Meeting ID: 148 993 322
One tap mobile
+33170379729,,148993322# France
+33756784048,,148993322# France
Dial by your location
        +33 1 7037 9729 France
        +33 7 5678 4048 France
        +33 1 7037 2246 France
        +1 669 900 6833 US (San Jose)
        +1 929 205 6099 US (New York)
Meeting ID: 148 993 322
Find your local number: https://zoom.us/u/aewx54d7wE
Note: Meeting is 16h France time. Which is +1 UTC now, so it will be 15h UTC.
Roadmap progress report October 2019
Image
Spec2
  • Make “component list” part of the list family.
  • Work on a new SpRichTextPresenter (still WIP)
  • Implement first iteration of “application based styles” (the capability to add application styles to Spec2 applications)
    • Styles can now be nested (e.g. so you can say “make this label dim”)
  • Work on tables and lists properties:
    • sortable (working on morphic, WIP on gtk).
Spec2 – Morphic backend
  • Fix a problem when calculating width of toolbars.
  • Fix component list presenter
  • Make component list presenter able to show rows of different height.
Spec2 – Gtk backend
  • Make exception handling when inside a callback more solid (still need a couple of iterations)
  • Utils: GtkLeakFinder to track different kind of leaks (image side non-GC, vm side non-freed)
  • Utils: compiling a complete gtk3 distribution to allow debugging (not an easy task).
  • Remove all leaks from backend and fight with some incorrect referenced objects.
  • Making GtkRunLoop able to “defer” actions to be able to go back to the main thread.
NewTools
  • Inspector
    • “Remember” pages opened to follow the flow. For example, if you open a panel when you had selected “Items”, it will try to select “items” in the next pane. It also remembers the replaced selection (to allow for example the inspection of images when traversing a collection).
    • Add a “refresh” button to allow refreshing inspections other than the “raw” inspection (who gets refreshed automatically)
    • Migrate some inspector extensions.
  • Debugger
    • pre-debug window now uses a button bar instead a toolbar (which is more correct)
TFFI
  • fix some bugs around new literal syntax.
  • Working in the serialization of callbacks: Callbacks should always return in the order they are called
  • Working in the debugability of Callbacks, the callbacks code should be debuggable without affecting the stability
  • Improving Tests
Image – general
  • Create KMShortcutPrinter to unify the way to show shortcuts all around the image.
  • FastTable now can be configured to have rows of different height (using beRowNonHomogeneous method)
  • For the ones using the headless vm, window losing focus to stop showing the cursor (both gtk and sdl2). Until now, cycle continued drawing the cursor, consuming CPU and making things confusing.
  • create a way to target generic git repositories with iceberg (reacting to Sven request).
VM
  • VM now can sleep when idle.
  • VM now can run in a separated thread from the main thread.
  • Implementing Async I/O in Windows
  • Experiment running SDL2 and Gtk3 in the main thread (Done for the world rendering, WIP for Mars-Gtk).
  • Improving Debugging of callbacks in Gtk / SDL2
  • Preparing and Giving the Pharo Techtalk.
  • Working in GC compactor corruption.
  • Improving the handling of VM Parameters.
  • Improving the API to give support to different experiments.
  • Experimenting of running embedded images.
  • Improving String primitives with checks on Forwarders.
Cheers,
Esteban

by Stéphane Ducasse at November 07, 2019 12:52 PM

October 29, 2019

PharoWeekly

[ann] Material Design Lite for seaside 2.2.0

Hi everyone!

I am happy to announce the version 2.2.0 of Material Design Lite for seaside.

https://github.com/DuneSt/MaterialDesignLite/releases/tag/v2.2.0

This version brings 3 new features:
– Expansion panel in the form of brushes or widget
– A table component that allows one to describe the columns content
instead of providing a collection of rows
– Predefined alerts as an extension of MDL

Thanks to Julien Delplanque who helped a lot to release this version.

You can find a demo of the MDL version at: https://mdl.ferlicot.fr/

Have a nice day

Cyril Ferlicot
https://ferlicot.fr

by Stéphane Ducasse at October 29, 2019 01:44 PM

October 28, 2019

Torsten Bergmann

Rotten Green Tests

Rotten Green Tests explained

There is also a paper called "Rotten Green Tests A First Analysis"

by Torsten (noreply@blogger.com) at October 28, 2019 07:53 PM

Pharo with Style

Pharo with Style explains the difference between code that runs and code that talks to the reader. Found the book on several places:

The books source is on GitHub in https://github.com/SquareBracketAssociates/Booklet-PharoWithStyle

by Torsten (noreply@blogger.com) at October 28, 2019 07:50 PM

Pharo Bootstrapping Challenges

In the beginning of the year 2019 I already wrote that Pharo is able to bootstrap the image. This is based on the Pharo Bootstrap project from Guille and already used in the Pharo Bootstrap process itself to form images like Pharo 7 and Pharo 8 for the releases.

If you look in the Pharo project repository you will find a bootstrap folder with the code that is used to bootstrap the standard pharo image if you are interested.

But sometimes you want to build and bootstrap an own fully custom image. There are new tools helping you to do this like the nice Pharo Bootstrapper project. This project allows you to use Pharo build small images and bootstrap own Smalltalk systems if you like.

I can also recommend to read the paper: "Challenges in Debugging Bootstraps of ReflectiveKernels"

by Torsten (noreply@blogger.com) at October 28, 2019 07:33 PM

Sindarin - advanced debugging in Pharo

Sindarin: is a Versatile Scripting API for the PharoDebugger. Watch the videos below from ESUG 2019 or read the following working paper.




by Torsten (noreply@blogger.com) at October 28, 2019 07:17 PM

October 26, 2019

PharoWeekly

Pharo TechTalk: Headless VM

 

by Stéphane Ducasse at October 26, 2019 08:23 PM

October 23, 2019

PharoWeekly

2019 Lands Platform presentation

The Lands Platform: Lan.guages and D.omain S.yntax,
@sleconf 2019, co-located with @splashcon

https://youtu.be/HMgJK8mVPYw
Showcasing live magic tricks powered by the @pharoproject
Best,
Nick

by Stéphane Ducasse at October 23, 2019 09:14 AM

October 22, 2019

PharoWeekly

Scripting API for Pharo’s talk

Sindarin: a Versatile Scripting API for the Pharo Debugger

 

by Stéphane Ducasse at October 22, 2019 12:24 PM

October 21, 2019

PharoWeekly

[Ann] alpha … Pillar rendering

Cheers,
 

Rendering the Pillar markup inside the Pharo image

This is work in (early) progress, but I think it is far enough for a “technology preview”.

Goal of the project

The goal of the project is to be able to do better in-image documentation. To do this, I am working on several fronts:

  1. Rendering more pillar, expecially I would like to get a solution for tables.
  2. Rendering github markdown in addition to pillar markdown. This will allow me to pull markdown from git and display it in-image.
  3. Giving the “help-system” some love.
  4. In-image tools for writing markdown – a markdown editor
  5. A design for keeping the mark-down texts seamlessly outside of the image

Reg. 1., I can only figure out how to transform a morphic table into an image, and then add that image to the text (not included atm as I find it so ugly a solution). Any other ideas are greatly appreciated.

Reg. 2. I am nearly done on this one, at least for the easy aspects (headers, lists, emphasis, code-blocks).

Reg 3 and 4. Only loose ideas atm.

Trying it out

Load it using Metacello:

Metacello new
   baseline: 'PillarRichTextRender';
   repository: 'github://kasperosterbye/PillarRichTextRender';
   load.

At the moment it will load the whole of Pillar, but I hope to fix that soon.

Once loaded, the class PRRichTextComposer has some examples on the class side.

by Stéphane Ducasse at October 21, 2019 07:33 PM

[Ann] bootstrapping tools

Hello,
I released a first version of the bootstrapping tools in https://github.com/carolahp/pharo/tree/candle


Follow the instructions in the readme for generating the environment for bootstrapping small kernels.
Once you build your development environment, two windows are shown in Pharo by default, each for bootstrapping a different small image: one is Pharo Candle, a tiny image that weights around 160kb and which logs some small benchmarks in a log.txt file. The second one is our minimal image of Pharo, which weights 1.7MB and is able to load precompiled code  using a tool called Hermes. (The generated images will initially have a size of 30mb, and will be resized after executing them for the firs time with the VM, this is a bug that I will fix soon)
The images are generated taking as input the source code of all the classes that will belong to the system (in tonel format) and they are located in the folders pharo/src for the sources of Pharo minimal and pharo/bootstrap/scripts/pharo/PharoCandleSrc for Pharo Candle.
You can check the content of these source files using the button show sources and you can export them in tonel format using the link “export to Tonel” shown in the Calypso view. (If you do that, you need to close the tool and open it again .. I will add an auto refresh soon :p )
When you click the button write , generated images are saved in the folder pharo/bootstrap/scripts/pharo/bootstrapped . You can execute these images using the pharo headless vm 32 bits (you can use the one in pharo/bootstrap/scripts/pharo/.pharo
The current tool also allows you to execute and debug code in the generated image after generating it and before writing it to disk (it has some limitations whose cause and extent I need to explore in the future), and it also allows you to inspect an already generated image (inspect button), showing you it’s special objects array for now.
This is just an early version, but it already allows to play with the bootstrapping in a more friendly way
Cheers
Caro

by Stéphane Ducasse at October 21, 2019 04:04 PM

October 20, 2019

PharoWeekly

[Ann] Beta of the Commander20 booklet

Hi

Just a little post to notify you that we will be releasing the documentation of the new Command v2.0 framework in the coming weeks.
The beta version is available at https://github.com/SquareBracketAssociates/booklet-Commander/releases
Enjoy.
S.

by Stéphane Ducasse at October 20, 2019 05:34 PM

[ANN] HeySql v1.1

Hi, I have just released HeySql, version 1.1 – a database orm for Postgresql.

– Support for migrations
– Generation of migration templates based on classes
– Models can now be subclassed
– Updated license to MIT
– Updated docs
– Some minor stuff

https://github.com/pegesund/heysql

Petter

by Stéphane Ducasse at October 20, 2019 12:08 PM

October 19, 2019

PharoWeekly

[Ann] ActiveX Data Objects (ADO) on Microsoft Windows

Dear all,

A working prototype of PharoADO is now available at
https://github.com/eftomi/pharo-ado. I’d be glad if you can find the time to
test it and report your observations to this list or on the GitHub. PRs are
welcome and much needed 🙂

Firstly, I would like to focus on various database data types. When using
ADOClient and ADORecordset, the availability of data types heavily depends
from PharoWin32/PharoCOM packages, so we have to update both repositories
🙂

The PharoADO package is not huge after all, since ActiveX Data Objects
itself is an abstraction layer and provides much of the needed
functionalities by itself.

Best wishes,
Tomaz

by Stéphane Ducasse at October 19, 2019 09:23 AM

October 18, 2019

PharoWeekly

[Ann] Embeddable Image in VM

Dear Consortium members
 
At ESUG 2019 LabWare people (Mark is on CC) told us that a key requirement for their business 
was to be able to embed an image into the executable.
It was the first time people ask us this feature (It requires that the image does not write on any external resources
and a modification of the VM). Having a silent image is something that we are working since a couple of years
from time to time with the help of V. Blondeau from LAMRC and now Lifeware. 
So we decided to show that we can do it and that we are listening to people.  
Here is the email that Pablo sent us internally and I wanted to share it with you. 
 

Hi,
    I have made a VM with an embeddable image inside, I have done it
for Windows, but the same can be done for other operating systems.

If you want to try it (of course for windows) I have put a zip here:

https://drive.google.com/file/d/1r-_9CO2J5OF6j7kIOSbKeGRNdxw4sKDW/view?usp=sharing

It should not require any account or access.

I have modified some methods and added a way of detecting if the image
is embedded.

Do you consider is a good thing to have in the CI?

Cheers

— 
Pablo Tesone.
tesonep@gmail.com

by Stéphane Ducasse at October 18, 2019 08:26 AM

October 17, 2019

PharoWeekly

[Ann] Sleeping beauty: the VM pharo is now sleeping when doing nothing…

Dear consortium members
I wanted to share with you some news from our effort.
We have now a VM that sleeps where there is nothing to do 🙂

Screen_Shot_2019-10-11_at_15.43.23.png

 

by Stéphane Ducasse at October 17, 2019 08:22 AM

Docker setup

# Stage 1: Load the project on an empty image, in this case this is a development image (should change to use a minimal image)
FROM basmalltalk/pharo:7.0-image AS loader
COPY load-project.st ./
RUN pharo Pharo.image load-project.st –save –quit
# Stage 2: Copy the resulting Pharo.image with our project loaded
# into a new docker image with just the vm
# start in a new stage to keep docker image minimal
FROM basmalltalk/pharo:7.0
USER root
WORKDIR /opt/app
COPY start.sh .
COPY –from=loader /opt/pharo/Pharo.image ./
COPY –from=loader /opt/pharo/Pharo.changes ./
COPY –from=loader /opt/pharo/Pharo*.sources ./
RUN mkdir logs \
  && chmod a+x start.sh \
  && chown –recursive pharo:pharo /opt/app
USER pharo
EXPOSE 8080
CMD [“./start.sh”]
The resulting image size is ~80mb including image, changes & sources
Reference: https://docs.docker.com/develop/develop-images/multistage-build/

As a side note, the final image size is not what really matters, if you have 20 different images all starting from the same base image (eg ubuntu:18.04) the base layer is shared among all images so the network / disk usage is less than the total size of the image.

It’s important to keep the docker image thin, but also to keep layers at a minimum and not adding / removing stuff during the build, because those are stored in the middle layers (multi stage helps to remove that).
Cheers.
Julian Maestri

by Stéphane Ducasse at October 17, 2019 05:40 AM

October 16, 2019

PharoWeekly

@PharoConsortium Testimony

Hi,
 
Over the past couple of months we encountered a couple of blockers in our work.
 
One was the issue with Windows 1903 that, while affecting everyone, constituted an immediate blocker for one of our customers. The Pharo team dealt with it promptly.
 
Another issue takes place right now. We want to utilize the new threaded FFI implementation and during our testing we encountered a few problems. We work together with the Pharo team to smoothen these out. Again, while TFFI will benefit everyone, the fact that our concerns are being addressed now is provides a significant benefit.
 
So, thank you!
 
Cheers,
Tudor

by Stéphane Ducasse at October 16, 2019 08:14 AM

October 14, 2019

PharoWeekly

Activity Digest

Here’s the Weekly Digest for pharo-project/pharo:


ISSUES

Last week 55 issues were created.
Of these, 28 issues have been closed and 27 issues are still open.

OPEN ISSUES

💚 #4897 Writing to a new zip archive member without explicitly creating it raises MNU, by theseion
💚 #4896 Autocompletion is slow for images with a lot of source code, by VincentBlondeau
💚 #4888 4886-Epicea-cant-multi-select-sessions, by tinchodias
💚 #4887 White balance is sometimes wrong when opening a JPG, by jecisc
💚 #4886 Epicea: can’t multi-select sessions, by tinchodias
💚 #4884 Comments in temporaries declaration are not the right color, by jecisc
💚 #4883 FileSystemResolver should let the user add its own origins, by jecisc
💚 #4878 Protocol>>#methods is missleading, by jecisc
💚 #4876 Recover lost changes unavailable, by demarey
💚 #4875 Recover lost changes does not apply changes in right order, by demarey
💚 #4874 [RBRefactoring]RBBrowserEnvironment implementorsOf: doesn’t handle well when anding envs, by VincentBlondeau
💚 #4872 Browse it in code search is broken…, by Ducasse
💚 #4869 Epicea does not log super class changes, by demarey
💚 #4867 [DO NOT MERGE] Adding an additional instance variable to hold an additional methodDict, by tesonep
💚 #4866 ClyFullBrowser class>>#worldMenuOn: checks if nautilus is in the image, by juliendelplanque
💚 #4865 Improve #printString implementations, by leonardoce
💚 #4864 Add a browse menu item, by leonardoce
💚 #4863 Completion in class comment leads to DNU, by Ducasse
💚 #4862 CTRL + M does not work anymore under windows, by VincentBlondeau
💚 #4860 DrTest – Browse on Test class generates DNU, by tesonep
💚 #4859 Dr. Test should be more keyboard friendly, by tesonep
💚 #4856 printOn: methods should avoid calling blindly printString on their elements…, by Ducasse
💚 #4855 printString reimplementations look suspicious, by Ducasse
💚 #4852 Subclasses of SpPresenter should not define initializeWidgets but initializePresenters, by Ducasse
💚 #4850 #removeDuplicates fails on Arrays, by jecisc
💚 #4847 No text annotation for background color , by kasperosterbye
💚 #4845 4837-Typing-Point-in-Transcript-raises-a-DNU-on-completion, by MarcusDenker

CLOSED ISSUES

❤ #4895 Remove-code-that-should-not-be-in-pharo, by jecisc
❤ #4894 Revert “Add new #printOneLineString and related methods”, by MarcusDenker
❤ #4893 4843-Semantic-Analysis-add-a-temp-variable-for-the-Temp-Vector-Copied-Var, by MarcusDenker
❤ #4892 RBRefersToClassRule-should-ignore-isAbstract-methods, by jecisc
❤ #4891 Improve-browse-rule-command, by jecisc
❤ #4890 Add-command-to-browse-rule-class, by jecisc
❤ #4889 Improve Comments MustBeBoolean, by MarcusDenker
❤ #4885 4883-FileSystemResolver-should-let-the-user-add-its-own-origins, by jecisc
❤ #4882 4881-RBImplementedNotSentRule-is-disabled, by MarcusDenker
❤ #4881 RBImplementedNotSentRule is disabled, by MarcusDenker
❤ #4880 2808-do-not-run-RBBadMessageRule-for-tests, by MarcusDenker
❤ #4879 Rename-Protocol-methods-into-methodSelectors, by jecisc
❤ #4877 Integrate-ObservableSlot-as-part-of-VariablesLibrary, by jecisc
❤ #4873 uffi-add-missing-methods, by estebanlm
❤ #4871 Deprecation Rewrites Dr Tests, by MarcusDenker
❤ #4870 Compiler: Clean dead code, by MarcusDenker
❤ #4868 Compiler: Document and simplify #lookupVar:, by MarcusDenker
❤ #4861 Revert “use #lookupVar: instead of #lookupVarForDeclaration:”, by MarcusDenker
❤ #4858 Opal: compiler shoud not copy AST for pluging, by MarcusDenker
❤ #4857 Simplify TempVector Offset from IR, by MarcusDenker
❤ #4854 Add new #printOneLineString and related methods, by leonardoce
❤ #4853 Opal: remove #variableNamed:, by MarcusDenker
❤ #4851 use #lookupVar: instead of #lookupVarForDeclaration:, by MarcusDenker
❤ #4849 Introduce Object>>printOneLineString, by Ducasse
❤ #4848 add-shortcut-printer, by estebanlm
❤ #4846 Simplify morph creation from Athens surface, by leonardoce
❤ #4844 Document and Improve TempVector Access, by MarcusDenker
❤ #4843 Semantic Analysis: add a temp variable for the Temp Vector Copied Var, by MarcusDenker

LIKED ISSUE

👍 #4855 printString reimplementations look suspicious, by Ducasse
It received 👍 x1, 😄 x0, 🎉 x0 and ❤ x0.

NOISY ISSUE

🔈 #4854 Add new #printOneLineString and related methods, by leonardoce
It received 17 comments.


PULL REQUESTS

Last week, 40 pull requests were created, updated or merged.

OPEN PULL REQUEST

Last week, 1 pull request was opened.
💚 #4867 [DO NOT MERGE] Adding an additional instance variable to hold an additional methodDict, by tesonep

UPDATED PULL REQUEST

Last week, 10 pull requests were updated.
💛 #4888 4886-Epicea-cant-multi-select-sessions, by tinchodias
💛 #4865 Improve #printString implementations, by leonardoce
💛 #4864 Add a browse menu item, by leonardoce
💛 #4845 4837-Typing-Point-in-Transcript-raises-a-DNU-on-completion, by MarcusDenker
💛 #4630 4629-ClassDefinitionParser-should-allow-global-message-node-receivers-for-slots, by astares
💛 #4621 4620-Simplify-FloatArray-handling, by astares
💛 #4601 2335-MemoryFileWriteStream, by hilaire
💛 #4579 new version of add testcase for setting/getting a pointer to a long, by estebanlm
💛 #4492 Fix compilation of fullblock closures, by tesonep
💛 #4148 4026 migration of critic browser spec to spec 2 , by CafeKrem

MERGED PULL REQUEST

Last week, 29 pull requests were merged.
💜 #4895 Remove-code-that-should-not-be-in-pharo, by jecisc
💜 #4894 Revert “Add new #printOneLineString and related methods”, by MarcusDenker
💜 #4893 4843-Semantic-Analysis-add-a-temp-variable-for-the-Temp-Vector-Copied-Var, by MarcusDenker
💜 #4892 RBRefersToClassRule-should-ignore-isAbstract-methods, by jecisc
💜 #4891 Improve-browse-rule-command, by jecisc
💜 #4890 Add-command-to-browse-rule-class, by jecisc
💜 #4889 Improve Comments MustBeBoolean, by MarcusDenker
💜 #4885 4883-FileSystemResolver-should-let-the-user-add-its-own-origins, by jecisc
💜 #4882 4881-RBImplementedNotSentRule-is-disabled, by MarcusDenker
💜 #4880 2808-do-not-run-RBBadMessageRule-for-tests, by MarcusDenker
💜 #4879 Rename-Protocol-methods-into-methodSelectors, by jecisc
💜 #4877 Integrate-ObservableSlot-as-part-of-VariablesLibrary, by jecisc
💜 #4873 uffi-add-missing-methods, by estebanlm
💜 #4871 Deprecation Rewrites Dr Tests, by MarcusDenker
💜 #4870 Compiler: Clean dead code, by MarcusDenker
💜 #4868 Compiler: Document and simplify #lookupVar:, by MarcusDenker
💜 #4861 Revert “use #lookupVar: instead of #lookupVarForDeclaration:”, by MarcusDenker
💜 #4858 Opal: compiler shoud not copy AST for pluging, by MarcusDenker
💜 #4857 Simplify TempVector Offset from IR, by MarcusDenker
💜 #4854 Add new #printOneLineString and related methods, by leonardoce
💜 #4853 Opal: remove #variableNamed:, by MarcusDenker
💜 #4851 use #lookupVar: instead of #lookupVarForDeclaration:, by MarcusDenker
💜 #4848 add-shortcut-printer, by estebanlm
💜 #4846 Simplify morph creation from Athens surface, by leonardoce
💜 #4844 Document and Improve TempVector Access, by MarcusDenker
💜 #4842 Remove bounds ivar from AthensBalloonPath, by leonardoce
💜 #4832 Fix #2853. When removing a class, also log its contained methods, by tinchodias
💜 #4801 4800-AltGrdot-is-interpreted-as-user-interrupt-OSWindow, by pavel-krivanek
💜 #4682 2874-clampLowHigh, by hilaire


CONTRIBUTORS

Last week there were 5 contributors.
👤 MarcusDenker
👤 jecisc
👤 Ducasse
👤 estebanlm
👤 leonardoce


RELEASES

Last week there were no releases.


That’s all for last week, please 👀 Watch and ⭐ Star the repository pharo-project/pharo to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

by Stéphane Ducasse at October 14, 2019 06:16 PM

October 10, 2019

PharoWeekly

Neo Universal Binary JSON – 2

Here are some details/benchmarks.

1. A typical JSON payload

data := ZnConstants httpStatusCodes associations
collect: [ :each | { #code->each key. #reason->each value } asDictionary ].

[ NeoUBJSONWriter toByteArray: data ] bench. “‘11108.114 per second'”

bytes := NeoUBJSONWriter toByteArray: data.

bytes size. “2290”

[ NeoUBJSONReader fromByteArray: bytes ] bench. “‘4412.670 per second'”

[ NeoJSONWriter toString: data ] bench. “‘11542.783 per second'”

json := NeoJSONWriter toString: data.

json size. “2358”

[ NeoJSONReader fromString: json ] bench. “‘4814.711 per second'”

2. A 1K integer array

data := (1 to: 1024) asArray.

[ NeoUBJSONWriter toByteArray: data ] bench. “‘6945.444 per second'”

bytes := NeoUBJSONWriter toByteArray: data.

bytes size. “2822”

[ NeoUBJSONReader fromByteArray: bytes ] bench. “‘3280.632 per second'”

[ NeoJSONWriter toString: data ] bench. “‘4523.095 per second'”

json := NeoJSONWriter toString: data.

json size. “4014”

[ NeoJSONReader fromString: json ] bench. “‘1253.749 per second'”

3. A 1K byte array

data := ByteArray new: 1024 streamContents: [ :out |
1024 timesRepeat: [ out nextPut: 256 atRandom – 1 ] ].

[ NeoUBJSONWriter toByteArray: data ] bench. “‘538493.501 per second'”

bytes := NeoUBJSONWriter toByteArray: data.

bytes size. “1031”

[ NeoUBJSONReader fromByteArray: bytes ] bench. “‘216269.200 per second'”

[ NeoJSONWriter toString: data ] bench. “‘4579.084 per second'”

json := NeoJSONWriter toString: data.

json size. “3686”

[ NeoJSONReader fromString: json ] bench. “‘1297.362 per second'”

Right now, only ByteArray got a highly optimised implementation. In the future, FloatArray and IntegerArray could receive the same treatment.

Sven

PS:

Note that UBJSON is not the same as BSON, nor CBOR, nor MessagePack, which all exist in the same space.

by Stéphane Ducasse at October 10, 2019 03:18 PM

October 03, 2019

PharoWeekly

Mini orm for Postgres

Hi, nice to meet you all 🙂
As my first Smalltalk attempt I have written a mini orm for Postgres, based on the P3-library.
Some features:
– Closely connected to sql
– Easy to use
– Runtime compiled methods based on server side statements
– Generated methods for insert, update on method objects
– Generate tables
It can be found here: https://github.com/pegesund/heysql I did also write something about the code, Pharo and what I think on my kind-of-blog, if anyone is interested: https://ramblings.work/posts/2019-02-10-heysql.html
GitHub
Sql-based orm based on smalltalk reflection ideas. Contribute to pegesund/heysql development by creating an account on GitHub.

by Stéphane Ducasse at October 03, 2019 11:11 AM

September 29, 2019

Craig Latta

Caffeine updated for Pharo 7

Pharo 7 running on the SqueakJS virtual machine in Chrome, debugged by Squeak in a DevTools panel

I’ve updated Caffeine to run Pharo 7; please try it out! There was one virtual machine bug (primitivePerformWithArguments wasn’t manipulating the stack correctly), and I had to turn off a few Pharo features (like libGit support, which uses LibC, something I haven’t faked in the virtual machine yet).

Many thanks to the Pharo hackers in the RMOD team at INRIA Lille, for hosting me at their sprint on Friday, 27 September 2019. It was great hanging out and coding with you all. We’ll get that Pharo Apple Watch screenshot soon. :)

by Craig Latta at September 29, 2019 01:01 PM

September 26, 2019

PharoWeekly

PharoCom

Hi,

I finally got some time to check Pablo’s PharoCOM package closely. At first
I had problems with simple things, like making Word visible with
properyNamed:put: (it’s frustrating when you see the app on the processes
list but you cannot control it :-)) but then I found the reason – it was a
tiny detail in Win32VariantBool>>#write:to:, and then – voila!

Here’s an example of opening Word for Windows, adding a blank document,
typing some text and getting this text back to Pharo:

Ole32Lib uniqueInstance initLibrary.
wrd := COMDispatchInstance createInstanceByName: ‘Word.Application’.
wrd propertyNamed: ‘Visible’ put: true.

docs := wrd propertyNamed: ‘Documents’.
docs dispatch: ‘Add’.

sel := wrd propertyNamed: ‘Selection’.
sel dispatch: ‘TypeText’ withArguments: {‘Hello from Pharo!’}.

sel dispatch: ‘WholeStory’ .
Transcript show: (sel propertyNamed: ‘Text’); cr.

Another example is with Active Data Objects to get DB access:

conn := COMDispatchInstance createInstanceByName: ‘ADODB.Connection’ .
conn dispatch: ‘Open’ withArguments: { ‘DSN=this; Uid=that; Pwd=theOther;’ }
.
conn propertyNamed: ‘State’ . –> true!
rst := (COMDispatchInstance createInstanceByName: ‘ADODB.Recordset’) .
rst dispatch: ‘Open’ withArguments: { ‘SomeTableName’ . conn . 3 . 1 }.

The last line raises an exception because not all of the data types that
functions are reporting are implemented yet, as Pablo mentioned in his post.

The package is really nicely prepared. The most impressive is it’s
reflective capability. My “proof of concept” work with DispHelper library
that I mentioned in another forum topic was successful (I can get to the SQL
Server :-)), however it’s a dead-end regarding the reflection.

I’m very interested in COM implementation since I found Pharo to be very
useful as a tool, and since I work in “windowed” environment the COM
interaction is crucial to me. I decided to spent my free evenings working on
the project finalization. I’m not sure of how long will it take though 🙂
Pablo, I hope that I can count on your help regarding the questions about
the overall architecture that you set.

Is anybody else interested in this? Maybe we can join our efforts.

Best wishes,
Tomaz

by Stéphane Ducasse at September 26, 2019 05:29 AM

September 22, 2019

Craig Latta

Exploring the Netflix player with the Caffeine Chrome extension

debugging Better Call Saul with Caffeine

With the latest version of the Caffeine Chrome extension, you can run Caffeine in a Chrome DevTools panel, with access to all the Chrome debugging APIs. I’ve been using it to explore the Netflix video player, for an app I’m writing that enables the viewer to edit narratives by rearranging scenes.

From a quick look at the DOM element tree for the player, it’s apparent that it’s a React app. By following a reference chain from a user interface element (like the skip-forward button), through the bound “this” object of its click-event listener, I found the internal React properties for all the player’s UI elements, and all the player functions they use (for example, for seeking forward in a video).

With those functions in hand, I made a Netflix player class in Smalltalk, which can manipulate the Netflix player React app interactively from Smalltalk code. Other objects I made representing show elements (like scenes, episodes, seasons, and series) can use my player to compile analytic information about shows, and present them in different ways. For example, you could watch an episode of Better Call Saul consisting only of scenes that include a certain character, or that take place at a certain location, or with flashbacks placed in chronological order. This is for a webapp I’m writing called Arc.

I’m eager to see what else you explore using the Caffeine extension in the DevTools!

by Craig Latta at September 22, 2019 03:08 PM

September 20, 2019

PharoWeekly

[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

by Stéphane Ducasse at September 20, 2019 11:14 AM

September 18, 2019

Craig Latta

Caffeine Chrome extension updated

Caffeine running as a Chrome DevTools panel, debugging the Croquet Studios site, with Hydra graphics in the background.

I’ve updated the Caffeine Chrome extension in the Chrome Web Store. This version, 77.1, makes the entire Caffeine user interface available as a Chrome DevTools panel, and can access all of the Chrome APIs. With Hydra graphics support included, it’s the most convenient and geeky way to access Caffeine, perfect for your next Algorave. :)

by Craig Latta at September 18, 2019 11:49 AM

September 13, 2019

PharoWeekly

Spec2 new PR in Pharo 80

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

Features

Commander 2 integration

Bugfixes

Cleanings

Infrastructure

Commander 2 integration of the 13 of September 2019

Features

Bug fixes

Cleanings

by Stéphane Ducasse at September 13, 2019 03:26 PM

September 11, 2019

Craig Latta

a Web UIs update

livecoded Vue versions of the Smalltalk devtools

I’ve created working Vue versions of the traditional Smalltalk workspace and classes browser, livecoded in the web browser from the full Squeak IDE. These use the vue-draggable-resizable component as the basis of a window system, for dragging and resizing, and the vue-menu component for pop-up context menus. Third-party Vue components are loaded live from the network using http-vue-loader, avoiding all offline build steps (e.g., with webpack). Each Smalltalk devtool UI is expressed as a Vue “single-file component” and loaded live.

When enough of the Smalltalk devtools are available in this format, I can provide an initial Squeak object memory snapshot without the UI process and its supporting code, and without the relatively large bitmaps for the Display, drop-shadows, and fonts. This snapshot will be about two megabytes, down from the 35-megabyte original. (I also unloaded lots of other code in The Big Shakeout, including Etoys and Monticello). This will greatly improve Caffeine’s initial-page-load and snapshot times.

I’m also eager to develop other apps, like a proper GUI for the Chrome devtools, a better web browser tabs manager, and several end-user apps. Caffeine is becoming an interesting platform!

by Craig Latta at September 11, 2019 10:18 PM

September 03, 2019

PharoWeekly

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

by Stéphane Ducasse at September 03, 2019 06:38 PM

August 28, 2019

PharoWeekly

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

by Stéphane Ducasse at August 28, 2019 03:30 PM