Rewriting 900 methods in a couple of lines

I got 900 methods that I wanted to rewrite so I hacked the ParseRewriter to do it for me ūüôā
| rewriter node method testsels |
testsels := ReTest selectors select: [ :e | e beginsWith: ‘test’ ].
testsels
    do: [ :s | rewriter := RBParseTreeRewriter new.
                   rewriter
¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† replace: ‘self shouldnt: [re compile] raise: Error’
¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† ¬† with: ‘self compileIsOK’.
                   method := ReTest compiledMethodAt: s.
                   node := method parseTree.
                   (rewriter executeTree: node)
                   ifTrue: [
                       method origin
                           compile: node formattedCode
                           classified: method protocol ]]
Stef
Advertisements

[ann] Smallapack in Pharo6

Hi,
I announce the availability of Smallapack in Pharo6.

The ConfigurationOfSmallapack is in
http://www.squeaksource.com/MetacelloRepository and there is a copy in metarepo for Pharo 3/4/5/6.

Currently, the ported version uses a derivative of OpalCompiler patched to handle method with 16+ arguments.
External function calls have not been converted yet to UnifiedFFI, but the patched compiler rather has hook to compile legacy FFI.
Though I did not install the hook to call FFI with more than 15 arguments, so there is at least 1 unit test failing (but not crashing).

I have auto-re-generated all the source code for using UnifiedFFI formats, so the dependency on legacy FFI is not a necessity (apart for simplifying cross dialect maintenance).

But I want to review the generated code method by method rather than filing it in blindly (the wrapper functions are also generated, and I might loose comments or improvments if I'm careless). Unfortunately, the state of diff tools in Pharo6, be it thru MC or worse than all, thru legacy change lists, does not enable such a large scale review, so I think that I will edit in Squeak and run in Pharo...

Now that Smallapack supports Opal, there should be no major problem for porting to Pharo7, but I did not have time to try yet. A few more MC regressions, and the fact to forbid protocol beginning with a * was too serious a cross compatibility hurdle for me. But I'll come back to it, tools are generally better in ph7 than ph6. Stay tuned.

Nicolas Cellier

Visual Studio code Configuration for the VM

Hi guys,

We have been using this week with Pablo a combination of Visual Studio Code, cygwin, and gdb to build and debug the VM to chase some issues during ffi calls in win64.

It was overall simple to setup, and though I thought it was going to be just a text editor with vitamines, it ended up being a really light but versatile IDE with code navigation, compilation and debugging integration.

But, since there were some little things over here and there like gdb
source code mapping that was not so straight forward to find in the
documentation, we thought it would be good to share it.

If somebody is interested in using a similar setup to work with the VM, I've left my configuration files in the following gist, including:

 - cygwin bash terminal integration (also with zsh, but that's pure cygwin)
 - task actions to build cog and stack vms on debug mode
 - launch configs to run both in debug mode with gdb attached

https://gist.github.com/guillep/452a9be3d231db6f89dd40bfb8cf4405

Cheers,
Guille & Pablo

[Ann] Discord Pharo news channel

I am happy to annoyance a new channel in our Discord Server , #news

News is a read only channel (members cannot post there only admins) that I
intended to act as a newspaper of short that you can read with your morning
coffee to get all the latest news in the Pharo land.

The rules of the channel are very simple,
1) Only admins can post there. Its not a dicussion channel, all other
relevant channels can be used for discussing the Pharo news. We already
have tons of them.
2) every post must be no more than 2 lines, similarly to twitter, this is
for headlines not for entire articles
3) every post must contain a link for more info
4) every post must mention the author that the news concern
5)  least news must always be related to Pharo, it can be anything
(article, project, update etc)
6) last but not least I am always open to suggestions in case something
escapes my attention

If you have not done so make sure you join our Discord server following
this link

https://discord.gg/QewZMZa

You wont be getting only news but a very active community always willing to
help you with any questions and problems you may have, real time.

All people are welcomed :)

Kilon

New Pharo Discord channel

Since we got some bots attacks we use now the following discord link to get into discord: https://discord.gg/QewZMZa

 

 

 

[ann] MaterialDesignLite v2.0.0

Hello,

Today I released the version v2.0.0 of MaterialDesignLite for Seaside.
(https://github.com/DuneSt/MaterialDesignLite/releases/tag/v2.0.0)

This release does not brings much new features but it contains all
breaking changes that accumulated in the issue tracker. (That's why it's
a major release).

The main changes are:
- Migration to Tonel (People using Gemstone might need to stick to v1.x.x)
- Removal of all deprecated classes and methods
- I added named URLs in the demo to be able to send links of pages or
example
- Addition of a Pagination widget as extension of MDL
(https://mdl.ferlicot.fr/mdl/Extensions/Pagination)

A migration guide can be found here:

https://github.com/DuneSt/MaterialDesignLite/blob/v2.0.0/resources/migration/v1_to_v2_migration_guide.md

This release is tagged with v2.0.0 and I also introduced tags v2.x.x and
v2.0.x which are moving tags following patch and minor versions.

Here is the full changelog of the release:
https://github.com/DuneSt/MaterialDesignLite/blob/v2.0.0/CHANGELOG.md

If you have issues, need a new feature or have a comment on the project
feel free to open a issue:

https://github.com/DuneSt/MaterialDesignLite/issues

I also updated the demo: https://mdl.ferlicot.fr/

Have a nice day!

-- 
Cyril Ferlicot
https://ferlicot.fr

[Ann] Raw Pharo 70 ChangeLog

Hi,
I’m trying to summarize the changelog for Pharo 7 (based on about 2500 merged PRs, not counting standalone commits to Iceberg and Calypso). If something more should be mentioned, please let me know.
Revolutionary kernel changes
– bootstrap
– modular stateful traits
– traits flattening in kernel packages
– new sources file for every bootstrapped version, empty changes
– new class builder
– binary packages loading (Hermes)
Infrastructure changes
– switch to GitHub
– Tonel code format
– update building infrastructure to Jenkins 2
Code management
– Calypso, the new system browser
  Рnew navigation model
  Рfaster UI
  Рtabs toolbar instead of single source code panel
  Рexplicit commands instead of duplicated menu and shortcuts
  Рextendable by plugins
  Рsuitable for the remote scenario
¬† – “dynamic protocols”, support multiple tags per method
  Рnot required star convention for class extension
  Рsupport multiple tags per class
  Рvisibility option for inherited methods
  Рmethods inherited from traits are not shown by default
  Рvariable view as the special mode for method group view.
  Рbetter keyboard navigation
  Рand many more
Iceberg
– a new friendly user interface
– simplification of solving problems with repositories
– workflow simplification
– better GitHub, BitBucket, GitLab support
– improved code merging and comparisons
– new code serialization format (Tonel)
– repositories metadata
– documentation
– better error handling, tags support
– improved Iceberg-Metacello integration
– credentials store
Cleanups
– remove Nautilus
– remove UpdateStream
– remove all Configurations
– remove ShoreLine-Report
– remove TxText
– remove PluggableTabBarMorph
– remove the old Compiler
– remove Watery theme
– remove Versionner
– remove Komitter
– remove LegacyWeakSubscription
– continue on deprecation of FileStream
– dead code cleanups
– code organization cleanups
– unify categorization of common methods
– cleanups of object inspection protocol
– start with Ring deprecation
– better structure of packages
– package comments
Updates
– Zinc
– Epicea
– FFI
– Metacello
– Fuel
New
– Calypso
– integrate WebBrowser
– integrate ReferenceFinder
– Hermes
– Refactoring 2
– Commander
– ClassAnnotation
Spec
– ComposableModel renamed to ComposablePresenter
– new calendar presenter
– Spec-Demo
– improve Spec linking to domain models
Look & Feel
– use the white theme by default
– improve themes switching
– main menu bar
– new window management shortcuts
– better support of fallback bitmap fonts
– improved Inspector refreshing
– Spotter is looking for opened windows
– display scale factor
– FastTable improvements
VM interface
– DoubleWord and DoubleByte arrays
– add EncoderForSistaV1
– read-only literals support
– improvements and fixes for 64-bit support
– fixes for FullBlockClosure
– support of the new bytecode set
Reflectivity
– breakpoints improvements
– test coverage using metalinks
– reflectivity and metalinks improvements
Other
– startup running in a fresh process
– better pin messages
– NewValueHolder and Model API unification
– better working and image directories meaning separation
– SortFunctions composable
– better OSWindow support
– convert rules to the Renraku architecture
– class and method comments improvements
– extensible Playground (pageActionOrder:)
– optional password management for command line handlers
– system dependencies tests
– unify way to obtain package manifests
Pavel

[ANN] P3 version 1.1

Hi,

I created a new release of P3, the modern, lean and mean PostgreSQL client for Pharo.

https://github.com/svenvc/P3

Version 1.1 contains the following changes:

- added support for Postgres Extended Query protocol (P3PreparedStatement) (thx Jan @jvdsandt)
- added support for reading array type values (currently INTEGER[] FLOAT[] BOOLEAN[] TEXT[] VARCHAR[])
- added P3-Tests package and moved all tests there
- more comments
- more unit tests

https://github.com/svenvc/P3/releases/tag/v1.1


Especially Jan's contribution adds a lot of functionality: the ability to work with prepared statements.

Here is an example doing a batch insert of 100 records (which is more efficient).

| client statement |

client := P3Client url: 'psql://sven@localhost'.

client execute: 'DROP TABLE IF EXISTS table1'.
client execute: 'CREATE TABLE table1 (id SERIAL PRIMARY KEY, created_at TIMESTAMP DEFAULT NOW(), name TEXT)'.

statement := client prepare: 'INSERT INTO table1 (name) VALUES ($1)'.
statement executeBatch: ((1 to: 100) collect: [ :index | Array with: ('Text #', index printString) ]).

client query: 'SELECT * FROM table1'.
client execute: 'DROP TABLE table1'.

statement close.
client close.


Season's Greetings to you all.

Sven

[Ann] Pharo with Style

Hello,

To finish well this year, I’m happy to announce the release of a new book: Pharo with Style.

This little book focuses on key aspects of code: how it communicates with you and your collaborators. I hope it will help you to write great communicating applications.

https://github.com/SquareBracketAssociates/Booklet-PharoWithStyle

PDF on Bintray

S. Ducasse

PostgresV3 with parameter binding

Hi all,

I've modified PostgresV3 to do parameter binding, i.e., parsing SQL and
binding/executing with data are performed in separate protocol steps.
I've add a simple client API with some examples demonstrating usage. The
examples require a PostgreSQL server loaded with the Sakila database.
Instructions on bringing the database up and running the examples are in
my blog post:

  https://www.samadhiweb.com/blog/2018.12.25.postgresv3.html

Season's greetings!

Pierce