Monthly Archives: December 2016

Tarantalk

Hi all,

I’ve developed a new database connectivity library for Pharo, called Tarantalk.
https://github.com/mumez/Tarantalk

Tarantalk is a connector for Tarantool.
https://tarantool.org/

Tarantool is a Lua engine with tuple persistence. It is like a GemStone in Lua.

Firstly, Tarantalk can be used as a tuple-centric DBMS. You can store
arbitrary Smalltalk objects as tuples, and retrieve them by multiple
indexes.

tarantalk := TrTarantalk connect: ‘taran:talk@localhost:3301’.
space := tarantalk ensureSpaceNamed: ‘bookmarks’.
primaryIndex := space ensurePrimaryIndexSetting: [ :options | options
tree; partsTypes: #(#string)].
space insert: #(‘Tarantool’ ‘https://tarantool.org’ ‘Tarantool main site’).
space insert: #(‘Pharo’ ‘http://pharo.org’ ‘Pharo main site’).
primaryIndex selectHaving: #(‘Pharo’).
” => #(#(‘Pharo’ ‘http://pharo.org’ ‘Pharo main site’))”

What is more interesting is that Tarantalk can call remote Lua
functions and can evaluate Lua expressions.
So you can extend your database system freely with Lua and Smalltalk!

— Lua
function bookmarkUrls()
local urls = {}
for k,v in box.space.bookmarks:pairs() do
table.insert(urls, v[2])
end
return urls
end
box.schema.func.create(‘bookmarkUrls’)

“Smalltalk”
tarantalk call: ‘bookmarkUrls’.
” => #(#(‘http://pharo.org’ ‘https://tarantool.org’))”

(tarantalk evalWithReturn: ‘(require(“digest”).sha512_hex(…))’
arguments: {‘Hello, Smalltalk’}) value.
” => #(‘ec599e128831b282f6f7a833834c90a3eb2e61453e5757ca3c2bc8a26e94d7c2f76bd6a7ce33df2427f3821e44a12d26781d39eac6782b59a649950ea59f9e13’)”

Moreover, Tarantalk is pretty fast compared to some other NoSQL databases.
https://github.com/mumez/Tarantalk#performance

A simple micro benchmark shows that Tarantalk is about 5x faster than
RediStick Redis client.

Enjoy!

[:masashi | ^umezawa]

Calypso

Hi

I am glad announce first initial version of new system browser called Calypso.
It is implemented from scratch with idea to build model suitable for remote scenario.
But as result it leads to more important goal: provide clean implementation of browser which people could understand and evolve.

Calypso supports most features from Nautilus but also miss many of them. And there are many not nicely looking parts of UI which require more work.
But in same time Calypso provides many new cool features with clean implementation underhood. I put many things from other smalltalks and old browsers which I always miss.

I release Calypso in the state where I finish most design decisions which I think important for project evolution.
Of course there are a lot of things to do and improve. But browser is fully working. And now it is important to community to participate in project and make browser great again :). We need escape from Nautilus pasta world.
Please report any ideas/bugs on github page https://github.com/dionisiydk/Calypso/issues. I already fill it with my wishes.

Next step I will work on documentation/class comments and I will publish couple of posts about Calypso internals.

Read more details on my blog. It includes pictures, videos and loading script.

Best regards,
Denis

Another batch of enhancements

60334
19479 Typo in name attribute of GRVariableAssignedLiteralRule
https://pharo.fogbugz.com/f/cases/19479

19478 Criticsbrowser shows a refactoring class name instead of the text diff
https://pharo.fogbugz.com/f/cases/19478

19438 Widen tolerance for DelayScheduler timing tests
https://pharo.fogbugz.com/f/cases/19438

60333
19484 BaselineOfMorphic references unexisting class
https://pharo.fogbugz.com/f/cases/19484

19483 Add bootstrap specific code in Monticello
https://pharo.fogbugz.com/f/cases/19483
60332
19480 Update Glamour to version 4.27
https://pharo.fogbugz.com/f/cases/19480
60330
18735 DNU on suggestions shortcut in GTDebugger
https://pharo.fogbugz.com/f/cases/18735

19432 Promote DelaySpinScheduler from experimental status (part 2)
https://pharo.fogbugz.com/f/cases/19432

19438 Widen tolerance for DelayScheduler timing tests
https://pharo.fogbugz.com/f/cases/19438
60329
19476 LabelModel default color needs to be theme text color (not hardcoded black)
https://pharo.fogbugz.com/f/cases/19476

19473 empty package Spec-SelectEntity can be unloaded
https://pharo.fogbugz.com/f/cases/19473

19453 NeoUUIDGenerator>>testTwoSameGenerator – intermittent CI failure
https://pharo.fogbugz.com/f/cases/19453

19471 classAffected method for MethodAnnouncement to be polymorphic with other system changes
https://pharo.fogbugz.com/f/cases/19471
60328
19472 QA v3.2.10
https://pharo.fogbugz.com/f/cases/19472

19433 Display critiques in Nautilus inline
https://pharo.fogbugz.com/f/cases/19433

60327
19467 Metalinks: support accessing variables for arguments
https://pharo.fogbugz.com/f/cases/19467

19430 Promote DelaySpinScheduler from experimental status (part 1)
https://pharo.fogbugz.com/f/cases/19430

60326
19341 New class and method tags API
https://pharo.fogbugz.com/f/cases/19341

60325
19464 Clean up Spec-PolyWidgets and Spec-SelectEntity
https://pharo.fogbugz.com/f/cases/19464

19462 Remove all classes of BuildUIWithSpec and BuildUIWithSpec-Reuse
https://pharo.fogbugz.com/f/cases/19462

19460 Make requestor Scope pluggable
https://pharo.fogbugz.com/f/cases/19460

60324
19445 Pattern code ArrayNode matching failure
https://pharo.fogbugz.com/f/cases/19445

18935 Rubric warning are not DarkTheme friendly
https://pharo.fogbugz.com/f/cases/18935

19455 Testcase for reify receiver for before links
https://pharo.fogbugz.com/f/cases/19455
60323
19449 QA v3.2.9 update
https://pharo.fogbugz.com/f/cases/19449

19440 No users of TotalCost and subclasses
https://pharo.fogbugz.com/f/cases/19440

60322
19447 VersionBrowser always shows single method
https://pharo.fogbugz.com/f/cases/19447

60321
19437 Do not log shadowed variables to transcript by default
https://pharo.fogbugz.com/f/cases/19437

19450 Suggestion menu not working on MessageBrowser
https://pharo.fogbugz.com/f/cases/19450

19441 Better description for MessageNotUnderstood
https://pharo.fogbugz.com/f/cases/19441
60320
19442 PharoDocComment
https://pharo.fogbugz.com/f/cases/19442

19443 ProtocolAnalyser
https://pharo.fogbugz.com/f/cases/19443
60319
19412 SpecDebugger cannot work without Glamour
https://pharo.fogbugz.com/f/cases/19412

19428 Silently ignore loading DelayScheduler setting when its the same as existing
https://pharo.fogbugz.com/f/cases/19428

19426 TabsManagerMorph improvements
https://pharo.fogbugz.com/f/cases/19426
60318
19425 Stack underflow with meta links on message nodes
https://pharo.fogbugz.com/f/cases/19425

19284 MetaLink: re-enabling a condition with arguments can not be executed anymore
https://pharo.fogbugz.com/f/cases/19284

18994 Komitter should stringify the commit message (breaks GitFileTree)
https://pharo.fogbugz.com/f/cases/18994

19421 Failing test: WeakAnnouncerTest>>#testNoDeadWeakSubscriptions
https://pharo.fogbugz.com/f/cases/19421

19415 classVariableAdd and classVariableRemove not announce ClassModificationApplied event
https://pharo.fogbugz.com/f/cases/19415

60317
19409 ClassTagRemoved is not announced when packageTag is removed when it becomes empty after class is moved
https://pharo.fogbugz.com/f/cases/19409

19319 Editing methods in filtered MessageBrowser raise error
https://pharo.fogbugz.com/f/cases/19319

19417 Loading new trait methods put them into unclassified category of user classes
https://pharo.fogbugz.com/f/cases/19417

60316
19418 Spec TextModel editor has broken cancel operation after first accept
https://pharo.fogbugz.com/f/cases/19418

19413 GTInspector/Debugger do not work for large/ toolarge intervals
https://pharo.fogbugz.com/f/cases/19413

19420 redu menu item is wrong and not working for rubric
https://pharo.fogbugz.com/f/cases/19420

MQTT for Pharo call for joining effort

Hi,

MQTT is a light-weight publish/subscribe messaging protocol, originally created around 1998. It is now an official open industry ISO standard. It is perfect for large-scale Internet of Things applications and high performance mobile messaging.

The publish/subscribe messaging pattern requires a message broker. The broker is responsible for distributing messages to interested clients based on the topic of a message. Parties communicating with each other over MQTT would all be clients in different roles, like producers and consumers, using the broker as middleware.

Many client libraries for different programming languages and multiple brokers/servers are available. Facebook Messenger and Amazon AWS IOT are two users, among many others.

A good client library for Pharo was not yet available. I started a new MQTT project and I am looking for collaborators to help me finish it. The official specification is quite readable and there is a lot of information available (see the References/Links section at the end).

Right now, a first version of the following features is available:

– reading & writing of all 14 binary packet types
– an experimental client with support for connection open/close, ping, subscribe/unsubscribe, QoS levels 0 (at most once), 1 (at least once) and 2 (exactly once) for application (publish) messages in both directions, message/package IDs and keep alive (heartbeat)
– unit tests, for packet reading/writing and for clients against 3 publicly available sandbox/test brokers

Basically, the code works but needs polishing and maturing. Also, it might be useful to experiment with alternative client API design. Not all features are yet implemented. It would also be nice to implement an actual server/broker, not to replace production quality servers, but as a proof of concept and tools during development.

Code

http://smalltalkhub.com/#!/~SvenVanCaekenberghe/MQTT/

Right now, documentation is limited, but there are class comments and the most important public API methods are commented too. There is no Metacello configuration yet, just load the 3 packages.

References/Links
http://mqtt.org
https://en.wikipedia.org/wiki/MQTT
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html
https://github.com/mqtt/mqtt.github.io/wiki/software
http://mosquitto.org
https://github.com/emqtt/emqttd
http://kamilfb.github.io/mqtt-spy/
https://github.com/eclipse/paho.mqtt-spy/wiki
https://eclipse.org/paho/
https://eclipse.org/paho/clients/c/embedded/
http://www.rabbitmq.com/mqtt.html
https://vernemq.com
https://www.ibm.com/developerworks/community/blogs/c565c720-fe84-4f63-873f-607d87787327/entry/mqtt_security

Sandbox/test Servers/Brokers
iot.eclipse.org:1883
test.mosquitto.org:1883
broker.mqtt-dashboard.com:1883

Sven

2017 Pharo Sprints

Here are the dates of the next official Pharo Sprints
Jan 27 Mar 3 Mar 31 Apr 28 May 26 Jun 30

Book the date and join

http://rmod.lille.inria.fr/contact

Protego – smart way to manage nil in business calculation

Imagine, you have some object with amount and price variables.
And you want to calculate total, put this totals to collection and calculate grand total.

Naive implementation will be something like
total := amount * price for the first task
and something like
grandTotal := totals sum for the latter one.

But what if amount or price are nil’s?
You can add nil checks, of course: total := (amount ifNil:[0]) * (price ifNil: [0]).
And then what if totals will be empty? More checks.
Is it really wise to have total to be zero if amount is nil? More ifTrue:ifFalse: code.
And then you want to add amount := total / price calculation, and you realize that both total and price may be nil, and price may be zero.
More and more and more checks.

Protego (http://www.smalltalkhub.com/#!/~assargadon/Protego) adds “protected” versions of common operators and methods.

So, you just put
total := amount *@ price
and
grandTotal := totals sum_protected
into your code – and everything just works.

total will be nil if any of the operands are nil. grandTotal will be calculated normally, even for empty totals collection (will return nil for empty collection).
Collection can hold nil’s and it will work anyway. If all elements of the collection is nil, result will be nil.

Protected version of addition and subtraction will treat nil’s as zeros until both operands are nil – then it will return nil.
There are protected versions of comparisions, too.

It’s quite simple idea, which is still very useful, and it makes code much more readable, clean and self-commenting.

That’s why I have extracted this part of SmallPOS framework, and have published it as separate package to use it in other, non-SmallPOS applications.

Юрий Мироненко <assargaddon@gmail.com>

 

Ben coman proposed a pattern

Thanks for sharing. A similar thing might be useful for dealing with
“quality” of Process Variable measurement in industrial situations –
where instruments fail from time to time.

I’m not sure of all the pros and cons, but btw an alternative to
hanging special behaviour on a method, would be to hang special
behaviour on a MissingValue class that you could #initialize any
instance variable to.

Object subclass: #MissingValue
instanceVariableNames: ”
classVariableNames: ”
package: ‘AAAA’

MissingValue >> * dummyValue
self inform: ‘debug trace – got here’.
^self

MissingValue >> adaptToNumber: rcvr andSend: selector
^self perform: selector with: rcvr

Collection >> sumProtected
^ self inject: 0 into: [ :sum :each | sum + each value]

Usage…

c := {1.1 * MissingValue new. 1.2 * 10. MissingValue new * 1.3. 10 * 1.4}.
“==> an Array(aMissingValue 12.0 aMissingValue 14.0)”

c sumExcludeMissing
“==> 26.0”

cheers -ben

HTTP requests bench

Plain HTTP access to a Pharo image can be quite fast. Here is quick & dirty benchmark I just did on one of our modern/big machines (inside an LXD container, light load) using a single stock image on Linux.

$ pharo Pharo.image printVersion
[version] 4.0 #40626

$ pharo Pharo.image eval ‘ZnServer startDefaultOn: 1701. 1 hour wait’ &

$ ab -k -c 8 -n 10240 http://127.0.0.1:1701/bytes/32
This is ApacheBench, Version 2.3
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1024 requests
Completed 2048 requests
Completed 3072 requests
Completed 4096 requests
Completed 5120 requests
Completed 6144 requests
Completed 7168 requests
Completed 8192 requests
Completed 9216 requests
Completed 10240 requests
Finished 10240 requests

Server Software: Zinc
Server Hostname: 127.0.0.1
Server Port: 1701

Document Path: /bytes/32
Document Length: 32 bytes

Concurrency Level: 8
Time taken for tests: 1.945 seconds
Complete requests: 10240
Failed requests: 0
Keep-Alive requests: 10240
Total transferred: 2109440 bytes
HTML transferred: 327680 bytes
Requests per second: 5265.17 [#/sec] (mean)
Time per request: 1.519 [ms] (mean)
Time per request: 0.190 [ms] (mean, across all concurrent requests)
Transfer rate: 1059.20 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 2
Processing: 0 2 8.0 2 309
Waiting: 0 1 8.0 1 309
Total: 0 2 8.0 2 309

Percentage of the requests served within a certain time (ms)
50% 2
66% 2
75% 2
80% 2
90% 2
95% 3
98% 3
99% 3
100% 309 (longest request)

More than 5K req/s (10K requests, 8 concurrent clients).

Granted, this is only for just 32 bytes payload and the loopback network interface. But this is the other end of the interval, the maximum speed.

A more realistic payload (7K HTML) gives the following:

$ ab -k -c 8 -n 10240 http://127.0.0.1:1701/dw-bench
This is ApacheBench, Version 2.3
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1024 requests
Completed 2048 requests
Completed 3072 requests
Completed 4096 requests
Completed 5120 requests
Completed 6144 requests
Completed 7168 requests
Completed 8192 requests
Completed 9216 requests
Completed 10240 requests
Finished 10240 requests

Server Software: Zinc
Server Hostname: 127.0.0.1
Server Port: 1701

Document Path: /dw-bench
Document Length: 7734 bytes

Concurrency Level: 8
Time taken for tests: 7.874 seconds
Complete requests: 10240
Failed requests: 0
Keep-Alive requests: 10240
Total transferred: 80988160 bytes
HTML transferred: 79196160 bytes
Requests per second: 1300.46 [#/sec] (mean)
Time per request: 6.152 [ms] (mean)
Time per request: 0.769 [ms] (mean, across all concurrent requests)
Transfer rate: 10044.25 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 1 6 183.4 1 7874
Waiting: 1 6 183.4 1 7874
Total: 1 6 183.4 1 7874

Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 1
80% 1
90% 1
95% 1
98% 1
99% 1
100% 7874 (longest request)

That is more than 1K req/s.

In both cases we are talking about sub 1ms req/resp cycles !

I think all commercial users of Pharo today know what is possible and what needs to be done to achieve their goals. Pure speed might not be the main consideration, ease/speed/joy of development and just being capable of solving complex problems and offering compelling solutions to end users is probably more important.

Sven

Put star on pharo books :)

Do not forget to put nice little stars on our lovely books on github!

https://github.com/SquareBracketAssociates/EnterprisePharo
https://github.com/SquareBracketAssociates/NumericalMethods
https://github.com/SquareBracketAssociates/UpdatedPharoByExample
https://github.com/SquareBracketAssociates/BuildingUIWithSpec
https://github.com/SquareBracketAssociates/TinyBlogTutorial
https://github.com/SquareBracketAssociates/ExploringVMs
https://github.com/SquareBracketAssociates/DeepIntoPharo

Starring a repository allows you to keep track of projects that you
find interesting, even if you aren’t associated with the project. When
you star a repository, you’re actually performing two distinct
actions:

* Creating a bookmark for easier access
* Showing appreciation to the repository maintainer for their work

Many of GitHub’s repository rankings depend on the number of stars a
repository has. For example,repositories can be sorted and searched
based on their star count. In addition, the Explore pageshows you
popular repositories based on the number of stars they have.

=Viewing your starred repositories=

You can see all the repositories that you have starred by going to
your stars page. For more information on interacting with your starred
repositories, see “Managing your stars.”

=Notifications=

Notifications are not affected when a repository is starred. You won’t
receive any information about a repository you’ve starred, unless
you’re also watching the repository. Activity from starred
repositories don’t show up in your dashboard feed, so you don’t have
to worry about missing important notifications for things you are
working on.

PolyMath new release


PolyMath, the science library for Pharo, version 0.66 is out !

We have 622 green tests.
You can download this version in a fresh Pharo 4.0/5.0 image with:

Gofer new
url: ‘http://smalltalkhub.com/mc/PolyMath/PolyMath/main&#8217;;
configurationOf:’PolyMath’;
loadVersion: ‘0.66’

You will find more information here:
https://github.com/PolyMathOrg/PolyMath

If you want to propose new ideas/enhancements/bug reports :

https://github.com/PolyMathOrg/PolyMath/issues

For example, a very simple task is to implement NumPy examples :
See: https://github.com/PolyMathOrg/PolyMath/issues/19

Regards,

Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/