Re: [Pharo-users] 2 questions around gitlab, gitfiletree, BaselineOf

2017-07-07 Thread Thierry Goubier
Hi Sabine,

I have makefiles to do the sort of thing you describe automatically (build
an image from local, git managed repositories) and a baseline: I write
stuff like

./pharo-cli pharo/Pharo.image --no-default-preferences eval --save
Metacello new baseline: \'MyProject\'\;
repository:\'gitfiletree://`pwd`/../src/\'\; load

(works once gitfiletree has been loaded)

notice the `pwd` embedded in there which allows you to put your local git
clone anywhere you like.

One thing I can't do, however, is having a dependency in
BaselineOfMyProject to a locally hosted project (say BaselineOfANiceLib
stored in ~/Project2017/ClientX/) because when I write the baseline, I
can't be sure where it will be on-disk.

If you're ok with gitfiletree doing the clone from gitlab on its own, one
could still write a direct access to your internal gitlab server, in the
baseline of MyProject, like that:

spec repository: 'gitfiletree://
gitlab.intra.example.com/ANiceLib:master/placeWhereAreThePackages';

The oldest such scripts I have are for Pharo3.

Does that answer your questions ?

Thierry

2017-07-07 15:48 GMT+02:00 Sabine Manaa :

> Hi,
>
> we have our own gitlab running now and I succeeded to move our code from
> sthub to it.
> I can push my new code into it from Pharo. All fine.
> I also created a Baseline (based on my former configurationOf).
> Loading the code from others (e.g. seaside) with this baseline is also
> fine.
>
> There are 2 Points where I am sure it could be better (it is worse)
> 1) For loading my own code, I currently have a bad solution
> It is in the postLoadBaseline and does this:
>
> | gitRepository |
> gitRepository := MCFileTreeRepository new
> directory:
> '/Applications/Pharo5.0-7.app/Contents/Resources/spf-gitlab/repository'
> asFileReference.
> {'RKA24-Model' . 'RKA24-System' . 'RKA24-Translator' .
> 'RKA24-View' .
> 'RKA24-Test' . 'RKA24-Report' . 'RKA24-Overwrites'}
> do: [ :each |
> Gofer it
> repository: gitRepository;
> package: each;
> load ].
>
> I would like to load it within my baseline like this below but I dont know
> what to write in the fileTreeRepository method...
>
> baseline: spec
> 
> spec
> for: #common
> do: [ spec blessing: #baseline.
> spec repository: ##self fileTreeRepository##.
> "here I load all the the oher stuff"
> spec
> package: 'RKA24-Model';
> package: 'RKA24-System';
> package: 'RKA24-Translator';
> package: 'RKA24-View';
> package: 'RKA24-Test';
> package: 'RKA24-Report';
> package: 'RKA24-Overwrites' ]
>
> 2) Also, when I take a new Image, I have to do several steps
>
> load gitfiletree from catalog
> add/open my gitfiletree repository from Monticello
> load BaselineOfRKA24 manually with
> (BaselineOfRKA24   project map at: 'baseline') load
>
> I think this is not the best way, I would like to make it right.
>
> Can anyone give me some hints how to improve this two steps?
> I use Pharo 5 and I don't want to go to Pharo 6 right now.
> I develop on mac and production server is on windows.
>
> Regards
> Sabine
>
>
>
>
>
> --
> View this message in context: http://forum.world.st/2-
> questions-around-gitlab-gitfiletree-BaselineOf-tp4953877.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] 2 questions around gitlab, gitfiletree, BaselineOf

2017-07-07 Thread Thierry Goubier

Hi Sabine,

as far as I remember when I implemented it, the use of a config file 
shouldn't be an issue, because GitFileTree rewrites exactly the 
git@SPF_GITLAB the way you would expect, as long as it manages to 
identify correctly the parts in the URL (and to identify those parts, it 
relies on Zinc).


Now, have you tried with:

gitfiletree://SPF_GITLAB/SPF/Spesenfuchs

?

Zinc correctly identifies SPF_GITLAB as the host, but it writes it 
non-capitalized (spf_gitlab), which may makes it miss your .ssh/config

entry.

In that case, could you add the spf_gitlab entry as well in your config 
file ?


Thierry

Le 07/07/2017 à 21:32, Sabine Manaa a écrit :

Hi Thierry, Gabriel and Peter,

thank you very much. First I had a look at this because it would be nice 
to load directly from Gitlab (with then generating a local repository 
automatically):


spec repository: 
'gitfiletree://gitlab.intra.example.com/ANiceLib:master/ 
placeWhereAreThePackages';


I did not manage to use it because I would need to give a port as 
parameter (we do  not use port 22). I chatted in discord with Peter Uhnak.


It seemed that this is not yet possible because of my case that i do not 
use port 22 and I use a config file.


On the command line, this command succeeds with cloning my repository 
from gitlab:


git clone git@SPF_GITLAB:SPF/Spesenfuchs.git


There is a config file which defines my host:

host SPF_GITLAB
HostName 192.168.1.61
Port 30001

I try to write my baseline with this

spec repository: 'gitfiletree://SPF_GITLAB:SPF/Spesenfuchs.git'.


This did not work in the beginning.

I played around and found out that there are 2 points where I had to 
change the system to make this work:


1) ZnUrl>>parseHostPort:
stream atEnd
ifFalse: ["portNumber := Integer readFrom: stream ifFail: [ 
ZnPortNotANumber signal ].
(portNumber between: 1 and: 65535) ifFalse: [ DomainError signalFrom: 1 
to: 65535 ]."

self port: 30001 "portNumber" ] ]
->> here, it is assumed that there is always a port integer after the :
If i set it hard to my port I skip this problem

2) MCFileTreeGitRepository>>basicFromUrl: aZnUrl
here I changed the code also hard from

repo remoteUrl: 'git@' , aZnUrl host , ':' , path
to
repo remoteUrl: 'git@SPF_GITLAB:SPF/Spesenfuchs.git'

->> here, aUZnUrl host is in lowercase but my name is in uppercase
:SPF is missing

the existing code would make this:
git@spf_gitlab:Spesenfuchs.git
instead of
git@SPF_GITLAB:SPF/Spesenfuchs.git

With this 2 changes, my code could load.

So my question: Are this 2 points issues to fix or should I create my 
own workaround (create my own loader, not making THIS changes )?


Regards
Sabine





2017-07-07 16:06 GMT+02:00 gcotelli [via Smalltalk] <[hidden email] 
>:


Hi Sabine,
for your own baseline you don't need to specify a repository. Just
load it with something like:

Metacello new
baseline: 'RLA24';
repository: 'filetree://disklocation/repository';
load: 'Group To Load'

Also you can have local copies of your dependencies in case you
don't want to use an internet connection for dowloading, just use
the lock command of Metacello to "overwrite" the repository
definitions. For example take a look at:

https://gist.github.com/gcotelli/d4521656358786ae2aca12a70478980f


Regards,
Gabriel


On Fri, Jul 7, 2017 at 10:48 AM, Sabine Manaa <[hidden email]
> wrote:

Hi,

we have our own gitlab running now and I succeeded to move our
code from
sthub to it.
I can push my new code into it from Pharo. All fine.
I also created a Baseline (based on my former configurationOf).
Loading the code from others (e.g. seaside) with this baseline
is also fine.

There are 2 Points where I am sure it could be better (it is worse)
1) For loading my own code, I currently have a bad solution
It is in the postLoadBaseline and does this:

 | gitRepository |
 gitRepository := MCFileTreeRepository new
 directory:
'/Applications/Pharo5.0-7.app/Contents/Resources/spf-gitlab/repository'
asFileReference.
 {'RKA24-Model' . 'RKA24-System' . 'RKA24-Translator' .
'RKA24-View' .
'RKA24-Test' . 'RKA24-Report' . 'RKA24-Overwrites'}
 do: [ :each |
 Gofer it
 repository: gitRepository;
 package: each;
 load ].

I would like to load it within my baseline like this below but I
dont know
what to write in the fileTreeRepository method...

baseline: spec
 
 spec
 

Re: [Pharo-users] How to specify metacello package dependencies in a git world?

2017-07-09 Thread Thierry Goubier

Hi Tim,

Le 09/07/2017 à 10:31, Tim Mackinnon a écrit :
Hi - I am trying to specify a simple package dependency(NeoJSON) for a 
hello world type simple project and I’m hitting problems.


I’ve been reading the DeepIntoPharo chapter and have looked at the blog 
post by Uko 
(http://blog.yuriy.tymch.uk/2015/07/pharo-and-github-versioning-revision-2.html)


But I’m hitting some simple issues and I’m hoping someone can put me 
straight.


My first attempt was the following (my Package is “Lambda” and has been 
versioned and put into GitHub using iceberg defaults).


baseline: spec


spec for: #common do: [
spec
package: 'Lambda' with: [ spec requires: 'NeoJSON' ].
spec
  project: 'NeoJSON'
  with: [
 spec
className: 'ConfigurationOfNeoJSON';
version: #stable;
repository:
   
'https://github.com/svenvc/NeoJSON/tree/master/repository' ]

].


This url won't work: you can access a github repository either with a 
github: url, or a gitfiletree: url (or an iceberg url?)


github://svenvc/NeoJSON:master/repository

or:

gitfiletree://github.com/svenvc/NeoJSON:master/repository

(You may want to use a tag instead of master).

My first question is, what should the repository URL be? No-one seems to 
talk about this in the git world where the gitfile tree info can be in 
different places per project (some put it in the root of the repo, other 
src, others repository or packages etc.). Am I right in thinking this 
url should be where the .package file is located?


Yes. There are repositories where you have a directory with the main 
packages, and other directories with secondary packages. For example, 
FileTree has a main repository/ directory with the packages, and many 
secondary repositories with test packages.


So you need to indicate where the .package are.


When I try the above example by trying:

(BaselineOfLambda project version: 'baseline') load.

  I get a talkback - Could not resolve: ConfigurationOfNeoJSON 
[ConfigurationOfNeoJSON] in 
/Users/macta/Dev/Smalltalk/Pharo/Pharo-6-60495-c/pharo-local/package-cache 
https://github.com/svenvc/NeoJSON/tree/master/repository


(Strangely, that file path is wrong as its pointing to some other 
directory on my filesystem - and I’ve posted a question about this on 
the thread about the working directory implementation, as it looks like 
MCCacheRepository uniqueInstance is getting the wrong default directory).


I don't know, but maybe that could be linked. Would you have preferences 
pointing to the wrong place ?


Anyway - as the above didn’t work, I tried to find an example of someone 
else using Neo and of course Sven had and example but his looks like this:


baseline: spec


spec for: #common do: [
spec configuration: 'NeoJSON' with: [
spec
versionString: #stable;
repository: 'http://mc.stfx.eu/Neo' ].
spec
package: 'Lambda' with: [ spec requires: 'NeoJSON' ].
].

I dan’t seen anyone mention spec configuration before (is this a better 
way?) - although looking at this directory, it seems this is where 
normal Mcz files are, so is it because of that you use this other method?


Anyway , when I try the above - I get a similar error to the above, but 
now it fails loading my Lambda package (presumably because if the 
filesystem error?).


Am I on the right track with the above?


I think you are...


Tim



Regards,

Thierry



Re: [Pharo-users] 2 questions around gitlab, gitfiletree, BaselineOf

2017-07-11 Thread Thierry Goubier

Hi Sabine,

I have a slightly different script, a Makefile, which uses another 
trick: put everything into a pharo/ subdirectory. Like that, just rm -rf 
pharo/ erases everything before rebuilding.


I think I would implement the support you need for you to simply be able 
to write:


Metacello new baseline: \'RKA24\'\; repository: 
\'gitfiletree://192.168.1.61:3/SPF/Spesenfuchs.gitspf:1.0?protocol=http\'\;load


so that the clone + Metacello over filetree isn't necessary.

(at the moment, I'm just pretty sure GitFileTree doesn't handle http and 
the port number, but that wouldn't be hard to add)


Regards,

Thierry


Le 11/07/2017 à 12:43, Sabine Manaa a écrit :

After several questions and trials I ended with a script like this:

cd /Applications/Pharo5.0-7.app/Contents/Resources
rm Pharo.image
rm Pharo.changes
curl get.pharo.org/50  | bash
rm -rf spfClonedGitlabRepository
git clone http://192.168.1.61:3/SPF/Spesenfuchs.git 
 --branch 1.0 
spfClonedGitlabRepository
Pharo Pharo.image --no-default-preferences eval --save "(CatalogProvider 
projectNamed: 'GitFileTree') installVersion: #stable. Metacello new 
baseline: 'RKA24'; repository: 'filetree://spfClonedGitlabRepository';load."


It creates a local clone (of a certain version) of my gitlab repository 
(deleting old stuff before) and starts with a new image, loading the 
given branch.


With this, I can always start with a new image, loading exactly the 
version I want from gitlab.


For pushing into gitlab I use the MCFileTreeGitRepository browser and push.

Big thank you for all who helped me, here and in discord.

2017-07-08 18:31 GMT+02:00 Pierce Ng-3 [via Smalltalk] <[hidden email] 
>:


On Fri, Jul 07, 2017 at 06:48:50AM -0700, Sabine Manaa wrote:

> 1) For loading my own code, I currently have a bad solution 
> I would like to load it within my baseline like this below but I dont know

> what to write in the fileTreeRepository method...
>
> baseline: spec
>
>spec
>for: #common
>do: [ spec blessing: #baseline.
>spec repository: ##self fileTreeRepository##.
  ^^^
Here I use 'http://127.0.0.1:20080/', where the http server serves
my filetree
repo directory. The easiest way (for me on Linux/Mac) to get the
http server
running is 'python3 -m http.server 20080'.

This method works for a directory full of .mcz files too.

Pierce




If you reply to this email, your message will be added to the
discussion below:

http://forum.world.st/2-questions-around-gitlab-gitfiletree-BaselineOf-tp4953877p4954007.html



To start a new topic under Pharo Smalltalk Users, email [hidden
email] 
To unsubscribe from Pharo Smalltalk Users, click here.
NAML







View this message in context: Re: 2 questions around gitlab, 
gitfiletree, BaselineOf 

Sent from the Pharo Smalltalk Users mailing list archive 
 at Nabble.com.





Re: [Pharo-users] get output of a forked process on windows

2017-07-18 Thread Thierry Goubier
Hi Christophe,

You have to use ProcessWrapper.

Metacello new
  configuration: 'ProcessWrapper';
  repository: 'http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo40/main';
  load

(as extracted from the baseline of GitFileTree for Pharo4)

Regards,

Thierry


2017-07-18 15:34 GMT+02:00 Christophe Demarey :

> PharoConsole.exe is only available for image versions > 50.
> I need a solution that works on older image versions.
>
> Thanks for the advice,
> Christophe
>
> Le 18 juil. 2017 à 14:26, Guillermo Polito  a
> écrit :
>
> Have you checked the Console version of the windows VM?
>
> On Tue, Jul 18, 2017 at 10:48 AM, Christophe Demarey <
> christophe.dema...@inria.fr> wrote:
>
>> Hi,
>>
>> I would like to evaluate a Smalltalk expression in a forked process (i.e.
>> something like OSProcess thisOSProcess waitForCommandOutput: 'pharo
>> Pharo.image eval "SystemVersion current dottedMajorMinor"').
>> It is doable on linux/mac with OSProcess but not on Windows. Is there
>> another way to do that on Windows? I would prefer to avoid to write to a
>> file.
>>
>> Thanks,
>> Christophe
>>
>
>
>
> --
>
> Guille Polito
>
> Research Engineer
> French National Center for Scientific Research - *http://www.cnrs.fr*
> 
>
>
> *Web:* *http://guillep.github.io* 
> *Phone: *+33 06 52 70 66 13 <+33%206%2052%2070%2066%2013>
>
>
>


Re: [Pharo-users] Why do we separate class/instance methods in the browser?

2017-07-23 Thread Thierry Goubier

Hi Tim,

if you're looking for experiments, you may want to look for the already 
existing (or past) experiments on alternative systems browsers.


There are a few floating around, and some of them already have an answer 
for what you are considering (change the way class side and instance 
side methods are shown). Since you're interested in GTInspector as well, 
maybe adding GT extensions to a class could let you experiment on that.


Regards,

Thierry

Le 23/07/2017 à 17:04, Tim Mackinnon a écrit :

I think my thread is misunderstood - I’m not saying change how methods work, 
class methods are fine, instance methods are fine - I’m just saying I don’t 
think its ideal anymore to see them so separately in our UI. It was really 
driven home watching great programmers struggle (sure Smalltalk is a bit 
different - and there are many elegant things we have, but class methods are 
pretty normal in many languages) - and I have a similar frustration in that I 
find it a straight jacket that we have to click that class button just because 
we want to write what is effectively a constructor that occurs to us when we 
are writing an instance method. Its very jarring and breaks your flow to 
“switch mode” to type one in.

I think Pharo is an environment to experiment with how we think about 
programming (in Smalltalk as well as other languages) - GTInspector is 
marvellous, that is something that really shows how thinking about the problem 
differently can make such a difference. While, I think our standard code 
browsers are ok - they are stuck in a rut that we need to break. Calypso is a 
hint at what is possible, but I want GTinspector type thinking more prevalent… 
with similar types of ideas that inspire us to code better.

Anyway, it seems like I need to take this away and try some experiments by 
myself.

Tim



On 23 Jul 2017, at 12:45, Stephane Ducasse  wrote:

Hi subbu

I used the same metaphor :)

Stef


On Sat, Jul 22, 2017 at 4:37 PM, K K Subbu  wrote:

On Saturday 22 July 2017 06:51 PM, Tim Mackinnon wrote:


The one that stuck out for me (and is actually mentioned in another
thread this week) was the class/instance method difference. They
conceptually understood the difference coming from other languages
but our UI is tricky to understand with the Class button toggle we
have, and if you get methods on the wrong side, like with a test,
it's quite confusing.



It is an easy mistake to make and I have often seen this confusion in
beginners. With the attention on the methods panel and text input, it is
easy to overlook the class toggle button :-(.

An easy fix is to switch background color to differentiate between class and
instance methods in both code and input panels. A better way would be to use
tabs (like in Inspector).

BTW, I use the metaphor of toys (objects), moulds (classes) and mould
factory (metaclass). A mould is an object from the perspective of the mould
maker. Therefore operations on classes are 'methods' from the maker's
perspective (note the recursion!).


Anyway - this got me thinking - why do we bother having a toggle in
our UI for this these days? Of course we know there is a class and a
metaclass but given that we have icons for methods now (and also have
a Protocol pane ) why don't we just show all the methods we have in
one list and let you filter them or even see them all? It seems much
easier and way more efficient to rapidly code this way.



This perspective comes from the traditional way - code and compile. In
Pharo, we code one method at a time and sources are held in an external file
and a pointer stored in each method, so displaying all methods in one panel
would result in multiple file reads.


The only question then would be how to create methods of the right
type - whether to have a button to create the right template (and put
the  browser code pane in the right context) or whether to indicate
it by convention of the method name when creating it like + new:
aSize etc. (Or even: class new: aSize etc).

The more I think about it, the more it seems like something we should
consider trying both for making ourselves more efficient (I'll bet
everyone has written a method on the wrong side by mistake) and also
helping newcomers.



Such mistakes are part of the learning curve and decrease with time.

Regards .. Subbu












Re: [Pharo-users] Why do we separate class/instance methods in the browser?

2017-07-23 Thread Thierry Goubier

Le 23/07/2017 à 18:58, Attila Magyar a écrit :

Maybe if the protocol list was a tree instead of a list then it would make
sense to include the class methods there. This would also make easier to
move methods from class side to instance side or vica versa with simple drag
and drop (without relying on the refactor/move to class side option).


The AltBrowser has been providing that tree view for a few years.

That view is very convenient when you want to see class methods names 
while writing an instance method (and the reverse).


Never thought of that need for the drag and drop feature. Maybe I'll add 
it (or simply check how it currently behaves for that use case).


Thierry





--
View this message in context: 
http://forum.world.st/Why-do-we-separate-class-instance-methods-in-the-browser-tp4956231p4956439.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.







Re: [Pharo-users] Cloning code from GitHub using Iceberg

2017-07-24 Thread Thierry Goubier

Le 24/07/2017 à 21:55, Hernán Morales Durand a écrit :

2017-07-24 4:29 GMT-03:00 Alistair Grant :

Hi Hernan,

On Sun, Jul 23, 2017 at 06:22:52PM -0300, Hern??n Morales Durand wrote:

Hi guys,

I am trying to import code - in Pharo 6 - from a GitHub repository:
https://github.com/jigyasa-grover/CORMAS-Pharo. The repository doesn't
include a Baseline, and so it is not loadable using a Metacello
expression right?

I've tried to clone it with Iceberg with Remote URL:
https://github.com/jigyasa-grover/CORMAS-Pharo.git

I ended with a "Repository CORMAS-Pharo is invalid" so I wonder what's
exactly is invalid? I can browse the history but I don't know if any
code from that repository was already loaded in my image.

The URL should be specified as the ghost text suggest? Currently the
ghost text is: g...@github.com:user/project.git

Should I fill the "Code subdirectory" field?


I just:

1. opened Icerberg
2. pressed "Clone repository"
3. Entered https://github.com/jigyasa-grover/CORMAS-Pharo.git as the URL
4. Left the subdirectory blank (opening the repository in a browser you
can see that the packages are in the top level directory)
5. Clicked Create repository
6. Selected the repository, the packages tab and loaded the
ConfigurationOfComas

without any problem.

Pharo 6.0
Latest update: #60501



Thank you! This worked also in 6.1.


Is there an easy way to tell which version of Iceberg I have loaded?
I'm sure it is 0.5.x, but not what the x is.


It would be nice to have something like

(RPackage organizer packageNamed: 'Iceberg') version


This information is available via Metacello, if it was properly loaded 
via a configuration.


(MetacelloProjectRegistration registry
registrationForExactClassNamed: ConfigurationOfIceberg
ifAbsent: [  ]) ifNotNil: [:r | r printString]

See MetacelloProjectRegistration>>#printOn: for the details of querying 
the spec of the project.


Baselines have no version information; if there is (like in git-based 
scenario), it is in the repository url and one has to decrypt it.


Thierry


Cheers,

Hernán



Cheers,
Alistair









Re: [Pharo-users] Loading and saving packages to filetree repos

2017-08-18 Thread Thierry Goubier

Hi Luke,

if you use gitfiletree with AltBrowser and configurations/baselines, 
then you'll see that you have a command to do the writing for you, 
without metadata and with a single git commit.


Regards,

Thierry

Le 17/08/2017 à 13:25, Luke Gorrie a écrit :

Hoi,

I want to have a quick "cheat mode" for loading and saving the Smalltalk 
packages in my project. This is to make life easy for newbies who are 
not very familiar with Monticello and Metacello.


The "cheat" is to assume that there is one filetree:// repository that 
contains all of the relevant packages, and all we need to do is load or 
save each of those packages in that repository.


I have the loading part working already:

 repo := MCFileTreeRepository new directory: '/foo/bar/baz' 
asFileReference.

 repo allFileNames do: [ :file |
 (repo versionFromFileNamed: file) load.
   ].

but now I am wondering how to do the saving part? That is, given a path 
to a filetree repo like '/foo/bar/baz', how do I save each package in 
that repo i.e. export the code in the image?


Ideally I would like the same operation to skip metadata that is likely 
to cause conflicts when the code is checked into Git later e.g. package 
timestamps and versions.


Tips would be appreciated :).








Re: [Pharo-users] Loading and saving packages to filetree repos

2017-08-20 Thread Thierry Goubier

Hi Luke,

ok, it's a high tech solution, this is more because I could not on the 
spot remember what you would need as a script (and also because your 'no 
metadata' requirement makes the filetree solution problematic).


But I'd suggest still one bit of advice that is implicit in my solution: 
create at least a baseline for your project (covering say all packages 
in your repository); instead of hacking around with Monticello and 
FileTree, it will allow you to use a simple Metacello command to load 
everything and prepare correct, long term use of your project.


And you will have the save everything as well.

Regards,

Thierry

Le 20/08/2017 à 10:36, Luke Gorrie a écrit :

Hi Thierry,

I am really looking for a "low-tech" solution here - five line 
Monticello code snippet - that will be easy for me to understand (as a 
newbie) and also easy for new contributors to my project to understand 
(who will have no prior exposure to Pharo.)


I don't know what AltBrowser is, but just as a user I need to get a bit 
more "winnage" before I am ready to take another iteration at learning 
more tools. The tools currently represent barriers in the way of solving 
my problems. I am sure this will change over time with more gradual 
learning and experience.



On 18 August 2017 at 16:28, Thierry Goubier <mailto:thierry.goub...@gmail.com>> wrote:


Hi Luke,

if you use gitfiletree with AltBrowser and configurations/baselines,
then you'll see that you have a command to do the writing for you,
without metadata and with a single git commit.

Regards,

Thierry


Le 17/08/2017 à 13:25, Luke Gorrie a écrit :

Hoi,

I want to have a quick "cheat mode" for loading and saving the
Smalltalk packages in my project. This is to make life easy for
newbies who are not very familiar with Monticello and Metacello.

The "cheat" is to assume that there is one filetree://
repository that contains all of the relevant packages, and all
we need to do is load or save each of those packages in that
repository.

I have the loading part working already:

  repo := MCFileTreeRepository new directory: '/foo/bar/baz'
asFileReference.
  repo allFileNames do: [ :file |
  (repo versionFromFileNamed: file) load.
].

but now I am wondering how to do the saving part? That is, given
a path to a filetree repo like '/foo/bar/baz', how do I save
each package in that repo i.e. export the code in the image?

Ideally I would like the same operation to skip metadata that is
likely to cause conflicts when the code is checked into Git
later e.g. package timestamps and versions.

Tips would be appreciated :).











Re: [Pharo-users] [ann] moldable editor - with expandable elements

2017-08-26 Thread Thierry Goubier
2017-08-26 14:46 GMT+02:00 Denis Kudriashov :

>
> 2017-08-26 14:31 GMT+02:00 Tim Mackinnon :
>
>> Denis - that's a very cool idea if I've understood you - expand in the
>> source code of the current method, literally inline? So you could scroll up
>> and down to view the context as you expand it out?
>>
>
> Yes, exactly.
>

Then that would look a bit like the NewSpeak code browser, if you would
like to try the concept.

There are disadvantages to that paradigm. One of those is that the system
browser in Pharo is ill-suited to long methods.

Thierry


>
>
>> One of the complaints around refactoring is that you lose context of
>> surrounding code - intelligent in place expansion would be the best of both
>> worlds...
>>
>> Tim
>>
>> Sent from my iPhone
>>
>> On 26 Aug 2017, at 11:40, Denis Kudriashov  wrote:
>>
>> This is really cool. It opens so many possibilities.
>>
>> I imaging method editor where message sends can be expanded to
>> implementors just in place.
>>
>> 2017-08-26 1:03 GMT+02:00 Tudor Girba :
>>
>>> Hi,
>>>
>>> We are really pleased to announce another major advancement in the
>>> development of the moldable editor, and most of it was enabled because of
>>> one new feature: expandable elements. We think this will impact
>>> significantly our day to day interactions.
>>>
>>> To exemplify what we mean, we will make use of two more alpha projects
>>> that we did not announce yet: GT Documenter (a set of documentation tools
>>> based on Pillar and GT Examples) and GT Mondrian (the graph visualization
>>> engine), both of which are being implemented in Bloc.
>>>
>>> Please take a look at the following pictures showing the documentation
>>> Pillar file that ships together with GT Mondrian. What stands out are the
>>> two embedded pictures. These are actually not pictures, but
>>> visualizations rendered live during the viewing of the document out of a
>>> referenced GT Example.
>>>
>>>
>>> Now, GT Examples are likely also new for most people. We introduced them
>>> a couple of years ago based on the original idea of Markus Gaelli. These
>>> are a kind of tests that return an object and that can be built out of
>>> other examples. The nice thing is that they are always executable and
>>> testable. So, of course, if you see the resulting object,  you can also see
>>> the code that created it, and if you see the code, you can even execute it
>>> live, right in place (notice the preview of the second snippet).
>>>
>>> 
>>>
>>> Perhaps the most controversial part of GT Examples is that they offer a
>>> mechanism to define static dependencies via pragmas. Please, let’s leave
>>> this debate to another occasion, but please also notice that tools can use
>>> that static information to unfold the code of the referenced method (notice
>>> the nested code editors).
>>>
>>> A side note: if you look closer at the list with three items at the top
>>> of the Tutorial section, you will notice numbering next to #. That is
>>> actually syntax highlighting and so is the mechanism that embeds the
>>> expandable elements. It’s really cool.
>>>
>>> Taking step back, when we introduced the editor a few weeks ago, we
>>> called it moldable because we said we can make it take different shapes
>>> easily. GT Documenter with everything you see in the above screenshots has
>>> currently ~500 lines of code, and all this while still having an editor
>>> that is highly scalable.
>>>
>>> We think that Bloc and Brick will change dramatically face of Pharo and
>>> now we can start to get a glimpse of what is possible. For example, the use
>>> case presented above is more than a technical tool, and we think this will
>>> change both the way we write documentation and the way we consume it.
>>>
>>> All these will be presented at ESUG both during presentations and at the
>>> Innovation Awards competition. In the meantime, those that want to play
>>> with it can execute the following in both Pharo 6.1 and Pharo 7.0:
>>>
>>> Iceberg enableMetacelloIntegration: true.
>>> Metacello new
>>>baseline: 'GToolkit';
>>>repository: 'github://feenkcom/gtoolkit/src';
>>>load.
>>>
>>> And then inspect:
>>> './pharo-local/iceberg/feenkcom/gtoolkit/doc/mondrian/index.pillar'
>>> asFileReference
>>>
>>> Cheers,
>>> The feenk team
>>>
>>> --
>>> www.tudorgirba.com
>>> www.feenk.com
>>>
>>> "Innovation comes in the least expected form.
>>> That is, if it is expected, it already happened."
>>>
>>>
>>
>


Re: [Pharo-users] [ann] moldable editor - with expandable elements

2017-08-26 Thread Thierry Goubier
2017-08-26 15:44 GMT+02:00 Denis Kudriashov :

> No Thierry, Newspeak do not allow it. And it not looks similar to what I
> want.
>

Hum, you would still get the same overall approach: editor inside editor
(or view inside view). Now, you can say it is not the same, up to you.

For me, it has the same effect: the editor isn't in a single place anymore.
You may consider it doesn't matter; IMHO it does matter (and it makes for
me the Newspeak editor slightly less efficient; the same that the Smalltalk
system browser seemed more effective than the Self in-place method edit,
for having used both).


>
> Now command+click on selector opens implementors window. In past it moved
> browser to single implementor. It was nice and it is how other IDEs are
> working.
>

You miss the past behaviour? Why not adding it again?


> But as Tim notice it always loses context. And it is quite difficult to
> browse long call chain which include many small methods.
>

I'm not sure it would solve that one.

Either it is a long call chain with a fan-out of one, in which case the
developper is creating many useless single line methods because it is "the
right way"(tm), or it has a fan-out greater than one (your typical
polymorphic code) and then each time you open, you have half a dozen
implementors.

For that, you already have the flow browser.


> So with new editor command+click will be able expand implementor just in
> place. I think it will be big improvement for IDE.
>

As I said, with Calypso and Nautilus handling badly long methods, then a
method inside a method just makes the top level method longer... I'd like
to see you do that on Metacello or SmaCC code, where important methods
easily go over 50 lines before you expand anything.

I'd say there that the GTInspector approach would work better -> expand on
the right, with the ability to keep two side by side, and overlaid with
lines clearly showing what has been expanded (for that "context" thing).

Regards,

Thierry


>
> 2017-08-26 14:59 GMT+02:00 Thierry Goubier :
>
>>
>>
>> 2017-08-26 14:46 GMT+02:00 Denis Kudriashov :
>>
>>>
>>> 2017-08-26 14:31 GMT+02:00 Tim Mackinnon :
>>>
>>>> Denis - that's a very cool idea if I've understood you - expand in the
>>>> source code of the current method, literally inline? So you could scroll up
>>>> and down to view the context as you expand it out?
>>>>
>>>
>>> Yes, exactly.
>>>
>>
>> Then that would look a bit like the NewSpeak code browser, if you would
>> like to try the concept.
>>
>> There are disadvantages to that paradigm. One of those is that the system
>> browser in Pharo is ill-suited to long methods.
>>
>> Thierry
>>
>>
>>>
>>>
>>>> One of the complaints around refactoring is that you lose context of
>>>> surrounding code - intelligent in place expansion would be the best of both
>>>> worlds...
>>>>
>>>> Tim
>>>>
>>>> Sent from my iPhone
>>>>
>>>> On 26 Aug 2017, at 11:40, Denis Kudriashov 
>>>> wrote:
>>>>
>>>> This is really cool. It opens so many possibilities.
>>>>
>>>> I imaging method editor where message sends can be expanded to
>>>> implementors just in place.
>>>>
>>>> 2017-08-26 1:03 GMT+02:00 Tudor Girba :
>>>>
>>>>> Hi,
>>>>>
>>>>> We are really pleased to announce another major advancement in the
>>>>> development of the moldable editor, and most of it was enabled because of
>>>>> one new feature: expandable elements. We think this will impact
>>>>> significantly our day to day interactions.
>>>>>
>>>>> To exemplify what we mean, we will make use of two more alpha projects
>>>>> that we did not announce yet: GT Documenter (a set of documentation tools
>>>>> based on Pillar and GT Examples) and GT Mondrian (the graph visualization
>>>>> engine), both of which are being implemented in Bloc.
>>>>>
>>>>> Please take a look at the following pictures showing the documentation
>>>>> Pillar file that ships together with GT Mondrian. What stands out are the
>>>>> two embedded pictures. These are actually not pictures, but
>>>>> visualizations rendered live during the viewing of the document out of a
>>>>> referenced GT Example.
>>>>>
>>>>>
>>>>> Now, GT Examples are likely also new for most p

Re: [Pharo-users] [ann] moldable editor - with expandable elements

2017-08-26 Thread Thierry Goubier
Hi Tim,

2017-08-26 23:27 GMT+02:00 Tim Mackinnon :

> I think you pose some interesting design challenges - but it's worthy of
> experimentation.
>
> I share Denis' enthusiasm to build something better - but it's true it's
> not an easy problem space.
>
> I'm a big fan of GTInspector, but sometimes I slide across and lose my
> context (not always, and not for all types of problems).
>

I think you may be on the key issue, the loss of context when navigating
through the code. In the 90's, that was called the 'lost in hyperspace'
problem linked with hypertexts and hypermedia.

I'm not sure it was ever resolved (I stopped following that research
community during my PhD), apart from considering that google solved it for
the web. At least, this would be the choice made by Newspeak: consider that
the code is like the web, and build a system web browser.


>
> For unique extractions - inlining is a no brainer (it's just like code
> folding in many editors). For non-unique, maybe something in the gutter
> might let you easily flip... I don't know, but I'm not convinced our
> current way is always optimal.
>

Agreed. I have changed the way I code to reduce the context needed to
understand it.


>
> Still, the whole moldable idea is to make it easy to experiment - and
> that's the cool bit. That's where we thrive.
>

Smalltalk has allways been open to that sort of experiment. The moldable
bit may make it easier, or at least not more complex than it was when
Smalltalk systems were a lot smaller. Now, is that moldable implementation
really that free, or has it sacrificed certain freedoms to make moldable
things easier?

Regards,

Thierry


>
> Tim
>
> Sent from my iPhone
>
> On 26 Aug 2017, at 18:38, Thierry Goubier 
> wrote:
>
>
>
> 2017-08-26 15:44 GMT+02:00 Denis Kudriashov :
>
>> No Thierry, Newspeak do not allow it. And it not looks similar to what I
>> want.
>>
>
> Hum, you would still get the same overall approach: editor inside editor
> (or view inside view). Now, you can say it is not the same, up to you.
>
> For me, it has the same effect: the editor isn't in a single place
> anymore. You may consider it doesn't matter; IMHO it does matter (and it
> makes for me the Newspeak editor slightly less efficient; the same that the
> Smalltalk system browser seemed more effective than the Self in-place
> method edit, for having used both).
>
>
>>
>> Now command+click on selector opens implementors window. In past it moved
>> browser to single implementor. It was nice and it is how other IDEs are
>> working.
>>
>
> You miss the past behaviour? Why not adding it again?
>
>
>> But as Tim notice it always loses context. And it is quite difficult to
>> browse long call chain which include many small methods.
>>
>
> I'm not sure it would solve that one.
>
> Either it is a long call chain with a fan-out of one, in which case the
> developper is creating many useless single line methods because it is "the
> right way"(tm), or it has a fan-out greater than one (your typical
> polymorphic code) and then each time you open, you have half a dozen
> implementors.
>
> For that, you already have the flow browser.
>
>
>> So with new editor command+click will be able expand implementor just in
>> place. I think it will be big improvement for IDE.
>>
>
> As I said, with Calypso and Nautilus handling badly long methods, then a
> method inside a method just makes the top level method longer... I'd like
> to see you do that on Metacello or SmaCC code, where important methods
> easily go over 50 lines before you expand anything.
>
> I'd say there that the GTInspector approach would work better -> expand on
> the right, with the ability to keep two side by side, and overlaid with
> lines clearly showing what has been expanded (for that "context" thing).
>
> Regards,
>
> Thierry
>
>
>>
>> 2017-08-26 14:59 GMT+02:00 Thierry Goubier :
>>
>>>
>>>
>>> 2017-08-26 14:46 GMT+02:00 Denis Kudriashov :
>>>
>>>>
>>>> 2017-08-26 14:31 GMT+02:00 Tim Mackinnon :
>>>>
>>>>> Denis - that's a very cool idea if I've understood you - expand in the
>>>>> source code of the current method, literally inline? So you could scroll 
>>>>> up
>>>>> and down to view the context as you expand it out?
>>>>>
>>>>
>>>> Yes, exactly.
>>>>
>>>
>>> Then that would look a bit like the NewSpeak code browser, if you would
>>&g

Re: [Pharo-users] [ann] moldable editor - with expandable elements

2017-08-27 Thread Thierry Goubier
Hi Doru,

2017-08-27 9:24 GMT+02:00 Tudor Girba :

> Hi,
>
> > On Aug 27, 2017, at 12:06 AM, Thierry Goubier 
> wrote:
> >
> > Hi Tim,
> >
> > 2017-08-26 23:27 GMT+02:00 Tim Mackinnon :
> > I think you pose some interesting design challenges - but it's worthy of
> experimentation.
> >
> > I share Denis' enthusiasm to build something better - but it's true it's
> not an easy problem space.
> >
> > I'm a big fan of GTInspector, but sometimes I slide across and lose my
> context (not always, and not for all types of problems).
> >
> > I think you may be on the key issue, the loss of context when navigating
> through the code. In the 90's, that was called the 'lost in hyperspace'
> problem linked with hypertexts and hypermedia.
> >
> > I'm not sure it was ever resolved (I stopped following that research
> community during my PhD), apart from considering that google solved it for
> the web. At least, this would be the choice made by Newspeak: consider that
> the code is like the web, and build a system web browser.
> >
> >
> > For unique extractions - inlining is a no brainer (it's just like code
> folding in many editors). For non-unique, maybe something in the gutter
> might let you easily flip... I don't know, but I'm not convinced our
> current way is always optimal.
> >
> > Agreed. I have changed the way I code to reduce the context needed to
> understand it.
> >
> >
> > Still, the whole moldable idea is to make it easy to experiment - and
> that's the cool bit. That's where we thrive.
> >
> > Smalltalk has allways been open to that sort of experiment. The moldable
> bit may make it easier, or at least not more complex than it was when
> Smalltalk systems were a lot smaller. Now, is that moldable implementation
> really that free, or has it sacrificed certain freedoms to make moldable
> things easier?
>
> Please let me intervene briefly :).
>
> Smalltalk was always indeed open. However, we noticed that regardless of
> the application domain, tools essentially looked the same for these
> systems. All Smalltalkers I asked extended Object at least once, but before
> the GTInspector, most of them never extended the inspector. Our language
> was extremely dynamic, but our tools less so. That is a conceptual problem
> that we address with what we call moldability.
>

Hum. From 1992 to now, I would make the same statement in the Smalltalk
world, mostly talking a certain conservatism first (look at how much the
system browser has evolved over the years), but also some questions about
efficiency of alternative forms.

For example, the code view of the GTInspector remain for me as one of the
clumsiest, worse view I've ever seen in the Smalltalk world for editing
code.


>
> The goal of moldability is to make it inexpensive to customize. To this
> end, we approach the IDE as a language and the moldability is captured in
> the operators that language provides. Of course, there are limitations to
> what can be doable inexpensively. However, it turns out that if you do
> manage to bring the cost to a radical low cost, you get much more
> extensions and experimentations going on.
>

I'm a bit missing where the moldability of the IDE went, in that context.
You seem to stear very clear from anything related to the system browser...


>
> All infrastructures make certain things easier and others less so. The
> value of all this does depend on what are the operators and how deep in the
> infrastructure they are placed. For example, the moldable editor shows
> these expandable elements as part of syntax highlighting. Syntax
> highlighting existed since a long time, so making it also able to show
> other things is quite powerful and requires nothing hardcoded. In fact, I
> do not know of any other editor that can do that while still having the
> performance we get.
>

? Especially that last statement.

Adding non text elements in an editor has allways been a fairly easy
endeavour in ST, as long as I could remember (1993?).

Performance on long texts is orthogonal to Bloc, right? It is present in
all editors that do formatting on long documents since the first WYSIWIG
editors appeared in the 80's.

And, so far, the examples you're showing means that editor isn't as capable
as Doc (in 1989/1990?) was.

I a bit worried about that syntax highlighting approach. It seems to me
very tied to a text + attributes representation instead of an object
representation, and I find that API in Pharo horribly clumsy and
ineffective, for the apparent benefit of slightly reducing object storage
size with a kind of RLE compression.


>
> But, even more impor

Re: [Pharo-users] [ann] moldable editor - with expandable elements

2017-08-27 Thread Thierry Goubier
Hi Doru,

thanks for the explanation...

I'll end up with three questions:

- What makes Bloc different compared to the InterViews and Amulet toolkits?
And Unidraw?

- Will some of your workflows enables exploration of parallel,
non-deterministic programs?

- Will we be able to have non-linear execution paths and explorations
through examples and documentation?

Regards,

Thierry

2017-08-27 13:37 GMT+02:00 Tudor Girba :

> Hi Thierry,
>
> Indeed, you noticed correctly that we stayed away from the code browser.
>
> We found several years ago that Morphic  was too limiting. During the
> Spotter implementation we found ourselves having to construct a
> mini-Morphic in order to do what we wanted to do. With text we had several
> prototypes for a different kind of editing experience, but we hit a wall.
> The interface from the GTInspector is the most rudimentary solution we
> could put in place, and it is there mostly as a placeholder to get over the
> bridge.
>
> This is why we joined the Bloc project and we focused all our tool
> development effort on it. The goal is to be able to build interfaces that
> do not yet exist and that enable workflows that are radically different. We
> showed can do that once we have an infrastructure, and we will continue to
> do it until we have a full development experience.
>
> We did not start from the experience of writing code explicitly. That is
> because the IDE should encompass all activities including the way we
> understand a system, and we think that focusing on reading is to be left
> for the previous century. So, we started from the inspector and debugger
> and we are making our way towards the writing part.
>
> Writing code is certainly of deep interest to us. However, the system
> browser is the least interesting of the places where we want to write code.
> That is because we want to code against live objects, not against dead
> text. The main use case the system browser is good for is to organize code
> and to find a starting place for getting to a living object. For the rest
> of the use cases, there are other solutions that are better. For example,
> even with the current Playground, we have people spending more time in
> there than in the code browser. That says something given that the
> Playground is quite bare at the moment.
>
> We do not think in terms of tools, but the overall workflows we want to
> support. It’s not a race against features, but a reimagining of what an
> experience can be like. For example, let’s take documentation: right now,
> both producing and consuming documentation happens mostly outside of the
> environment. So, the I in the IDE is failing in this respect. We want to
> make both of these activities more attractive inside the environment and
> the demo you see here is a step in that direction. There is no name for
> this tool yet because we tend to not phrase the problem like that.
>
> Related to other editors, there are indeed WYSWIG tools, but they are
> typically not dynamic. There are viewers that are dynamic, but they tend to
> not scale well and not be editable. There are tools that scale, but they
> are not too visual. And even when there exist some, they are not in an IDE.
> So, yes, there are pieces that already exist, but the way we apply them is
> novel.
>
> As for syntax highlighting, it is tied to text and attributes but only to
> the extent we wanted it to be. The current implementation is 2k lines of
> code. In comparison, just the core of Rubric is 5.5k. But, the rendering is
> not related to text whatsoever. Word and adornments are just element that
> conform to a layout. So, this means that people can build something else at
> a much smaller costs should they want to.
>
> Cheers,
> Doru
>
>
> > On Aug 27, 2017, at 10:43 AM, Thierry Goubier 
> wrote:
> >
> > Hi Doru,
> >
> > 2017-08-27 9:24 GMT+02:00 Tudor Girba :
> > Hi,
> >
> > > On Aug 27, 2017, at 12:06 AM, Thierry Goubier <
> thierry.goub...@gmail.com> wrote:
> > >
> > > Hi Tim,
> > >
> > > 2017-08-26 23:27 GMT+02:00 Tim Mackinnon :
> > > I think you pose some interesting design challenges - but it's worthy
> of experimentation.
> > >
> > > I share Denis' enthusiasm to build something better - but it's true
> it's not an easy problem space.
> > >
> > > I'm a big fan of GTInspector, but sometimes I slide across and lose my
> context (not always, and not for all types of problems).
> > >
> > > I think you may be on the key issue, the loss of context when
> navigating through the code. In the 90's, that was called the 'lost in
> hyperspace' problem linked with h

Re: [Pharo-users] [ann] moldable editor - with expandable elements

2017-08-28 Thread Thierry Goubier
2017-08-28 9:15 GMT+02:00 Tudor Girba :

> Hi,
>
> > On Aug 27, 2017, at 7:13 PM, Thierry Goubier 
> wrote:
> >
> > Hi Doru,
> >
> > thanks for the explanation...
> >
> > I'll end up with three questions:
> >
> > - What makes Bloc different compared to the InterViews and Amulet
> toolkits? And Unidraw?
>
> Bloc is a low level GUI framework. The widgets and the interaction model
> for building complete applications belongs to a layer above it. This is
> what Brick is supposed to be. We are right now at the level of building
> widgets and did not yet decide on the concrete the interaction model. That
> is why to make it useful, we use the editor embedded inside a Morphic-based
> interface.
>

What do you mean by the interaction model? Because, even at low-level, Bloc
has already chosen a interaction model (probably a thread per window
dispatching events to components arranged in a tree model by bounding boxes
+ a focus for input, and propagation of damage events upstream).

Do you means something like MVC or PAC-Amodeus?


>
> I did not know Amulet, but Interviews and Unidraw I read about more than a
> decade ago and even then I did not manage to get my hands on a working
> copy. Unidraw is a high level component-based engine for building
> applications that bares more similarities with something like Glamour.
> Nevertheless, I never saw Unidraw in practice and from the documentation
> that is available it is hard to distinguish the details, and details matter
> a lot.
>

The InterViews code (and UniDraw) is easy to find; it has been maintained
for open source system under the name ivTools. In it, iDraw is a fine
example of UniDraw, and it's GUI (the way it shows scrolling without
scrollbars is typical of the visualisation community). Another example is
TkInetd.

Something that is not usually built in ivTools, but which I think is an
absolute must study item for anybody doing GUI toolkits, is Doc. The source
is available, probably in the InterViews 3.0 source distribution. Doc is
also described in the book Design Pattern.


>
> So, perhaps the most important difference is that Bloc works now in Pharo.
> This does not mean that it is the best possible framework, only that it is
> the best we could do. We are confident it is quite good, but it remains to
> be seen whether it will be enough to be practical.
>

I agree about that: works in Pharo. I expect it to be good, on the level of
those toolkits from the 90's, which means probably as good as anything
commercially available today, and perfectly suited to Pharo needs.


>
>
> > - Will some of your workflows enables exploration of parallel,
> non-deterministic programs?
>
> This is certainly an area of interest, although not an easy one. We
> already used logging that collected signals from multiple processes and
> explored them inside GT Inspector, but certainly more is needed.


>
> > - Will we be able to have non-linear execution paths and explorations
> through examples and documentation?
>
> I am not sure what you mean by execution paths, but when it comes to
> exploration, this is exactly one of the things we are after: there are
> multiple contexts one might want to “consume" code in and most of these are
> unforeseen. For example, showing a method inside a piece of documentation
> provides an entry point that invites a kind of navigation that is
> orthogonal to the default code structure. The whole idea behind humane
> assessment is that we should craft tools to match the current context of
> interest and this implies new angles of exploration, and this is what GT
> offers. Last year at ESUG I provided some examples of such exploration
> paths:
> https://youtu.be/XWOOJa3kEa0?list=PLqvTNJtc942Cs9Qo4ikCGrUNtAw93Q0JA


Well, the question arise because I think one of the thing you seems to be
targeting for documentation is iPython, and iPython is sequential (the flow
of statements through the document) and well suited to its purpose. And the
GTExamples pragmas looks like a poor man's graph of dependents examples.

At the same time, I see the GT concrete realisation as working often with a
single object; that is a single GT inspector showing two panes on a screen
(or a playground, which means a single object and a script).

So I wonder if that restriction is significant.


> But, I am not sure I actually addressed your question.
>

I'm not sure I know what I am looking for exactly myself. So that make that
question difficult to answer?

I'm starting to piece around what I would need for this, one item at a
time. It's not important however; it does not has enough research value,
just that it could be interesting.

Regards,

Thierry


>
> Cheers,
> Doru
>
> > Regards,
> >
> >

Re: [Pharo-users] [ann] moldable editor - with expandable elements

2017-08-28 Thread Thierry Goubier
Hi Stephan,

2017-08-28 10:50 GMT+02:00 stephan :

> On 26-08-17 18:38, Thierry Goubier wrote:
>
> For me, it has the same effect: the editor isn't in a single place
>> anymore. You may consider it doesn't matter; IMHO it does matter (and it
>> makes for me the Newspeak editor slightly less efficient; the same that the
>> Smalltalk system browser seemed more effective than the Self in-place
>> method edit, for having used both).
>>
>
> A concrete problem with the Newspeak editor/browser is the invisibility of
> multiple open edits when editing a large class. There might be changes
> scrolled away. What it misses is an efficient way of looking only at the
> open edits. That could be achieved by having a view collapsing all
> non-edited code.


Would a class-level save work? One could trigger the collapse there as well.

Thierry



>
>
> Stephan
>
>
>


Re: [Pharo-users] How to create a minimal image ?

2017-08-28 Thread Thierry Goubier
Hi Pavel,

what would be the expression for building such an intermediate image out of
the minimal image? This?

Metacello new
  baseline: 'BasicTools';
  repository: 'github://pharo-project/pharo:master/src';
  load

Regards,

Thierry

2017-08-28 13:24 GMT+02:00 Pavel Krivanek :

> What do you expect from such minimal image? Because we can produce several
> intermediate steps on the way to the standard full Pharo image
> (BaselineOfMorphicCore, BaselineOfMorphic, BaselineOfUI,
> BaselineOfBasicTools...)
>
> -- Pavel
>
> 2017-08-28 13:17 GMT+02:00 Dimitris Chloupis :
>
>> oh , then its not what I am thinking as minimal image. Pity, oh well , I
>> will wait for bootstrap to mature then :)
>>
>> On Mon, Aug 28, 2017 at 2:09 PM Pavel Krivanek 
>> wrote:
>>
>>> The minimal image is headless image without any GUI. It is useless to
>>> try to open it this way.
>>>
>>> -- Pavel
>>>
>>> 2017-08-28 13:03 GMT+02:00 Dimitris Chloupis :
>>>
 hmm does not work for me, it open the icon of pharo on macos sierra
 dock and it stays there doing nothing
 right clicking on it and choosing quit does nothing, so I am have to
 use force quit to make it close

 I have downloaded pharo 6.1 from the website, default download, 32 bit,
 minimal 32 bit image. I drag and drop image on top of pharo.

 On Mon, Aug 28, 2017 at 10:29 AM Pavel Krivanek <
 pavel.kriva...@gmail.com> wrote:

> 2017-08-26 19:31 GMT+02:00 Dimitris Chloupis :
>
>> I remember that the website used to link to a minimal image download
>> but it does not seem there is one anymore
>>
>> Is still minimal image maintained ?
>>
>
> yes, as part of the bootstrap process
>
>
>> Are there ways to make a image minimal ?
>>
>
> it is created in bootstrap/scripts/build.sh under
> name Pharo7.0-metacello-* and saved on files.pharo.org as
> http://files.pharo.org/image/70/latest-minimal-32.zip or
> http://files.pharo.org/image/70/latest-minimal-64.zip
>
> So you do not need to do it by yourself.
>
> -- Pavel
>

>>>
>


Re: [Pharo-users] How to create a minimal image ?

2017-08-28 Thread Thierry Goubier
2017-08-28 14:41 GMT+02:00 Pavel Krivanek :

> It is not that simple. The baseline expects that you will have a pharo
> repository clone in a folder named 'pharo-core' in your working directory.
> Then you need data  like files or icons.
>
> set -e
> wget http://files.pharo.org/sources/PharoV60.sources
> unzip pharo-core/resources/fonts/BitmapDejaVuSans.fuel -d .
> mkdir icon-packs
> cd icon-packs
> wget http://github.com/pharo-project/pharo-icon-packs/archive/idea11.zip
> cd ..
> pharo Pharo7.0-metacello-32bit-82ecd43.image --no-default-preferences
> eval --save "Metacello new baseline: 'UI';repository:
> 'filetree://pharo-core/src'; load"
>

Thanks.


>
> Unfortunatelly the resultant image is not usable - it immediately falls
> into the emergency evaluator - because of the dependencies on translation
> and fast table. We need to provide some care to it again because it is not
> generated regularly -> it gets quickly broken.
>

Understood. I think it may have an overall huge benefit by making the
system far more modular once done. But maybe, for it to work effectively,
one needs to have a usable minimal image with the GUI and very simple core
tools.

Regards,

Thierry


>
> -- Pavel
>
>
> 2017-08-28 13:47 GMT+02:00 Thierry Goubier :
>
>> Hi Pavel,
>>
>> what would be the expression for building such an intermediate image out
>> of the minimal image? This?
>>
>> Metacello new
>>   baseline: 'BasicTools';
>>   repository: 'github://pharo-project/pharo:master/src';
>>   load
>>
>> Regards,
>>
>> Thierry
>>
>>
>> 2017-08-28 13:24 GMT+02:00 Pavel Krivanek :
>>
>>> What do you expect from such minimal image? Because we can produce
>>> several intermediate steps on the way to the standard full Pharo image
>>> (BaselineOfMorphicCore, BaselineOfMorphic, BaselineOfUI,
>>> BaselineOfBasicTools...)
>>>
>>> -- Pavel
>>>
>>> 2017-08-28 13:17 GMT+02:00 Dimitris Chloupis :
>>>
>>>> oh , then its not what I am thinking as minimal image. Pity, oh well ,
>>>> I will wait for bootstrap to mature then :)
>>>>
>>>> On Mon, Aug 28, 2017 at 2:09 PM Pavel Krivanek <
>>>> pavel.kriva...@gmail.com> wrote:
>>>>
>>>>> The minimal image is headless image without any GUI. It is useless to
>>>>> try to open it this way.
>>>>>
>>>>> -- Pavel
>>>>>
>>>>> 2017-08-28 13:03 GMT+02:00 Dimitris Chloupis :
>>>>>
>>>>>> hmm does not work for me, it open the icon of pharo on macos sierra
>>>>>> dock and it stays there doing nothing
>>>>>> right clicking on it and choosing quit does nothing, so I am have to
>>>>>> use force quit to make it close
>>>>>>
>>>>>> I have downloaded pharo 6.1 from the website, default download, 32
>>>>>> bit, minimal 32 bit image. I drag and drop image on top of pharo.
>>>>>>
>>>>>> On Mon, Aug 28, 2017 at 10:29 AM Pavel Krivanek <
>>>>>> pavel.kriva...@gmail.com> wrote:
>>>>>>
>>>>>>> 2017-08-26 19:31 GMT+02:00 Dimitris Chloupis 
>>>>>>> :
>>>>>>>
>>>>>>>> I remember that the website used to link to a minimal image
>>>>>>>> download but it does not seem there is one anymore
>>>>>>>>
>>>>>>>> Is still minimal image maintained ?
>>>>>>>>
>>>>>>>
>>>>>>> yes, as part of the bootstrap process
>>>>>>>
>>>>>>>
>>>>>>>> Are there ways to make a image minimal ?
>>>>>>>>
>>>>>>>
>>>>>>> it is created in bootstrap/scripts/build.sh under
>>>>>>> name Pharo7.0-metacello-* and saved on files.pharo.org as
>>>>>>> http://files.pharo.org/image/70/latest-minimal-32.zip or
>>>>>>> http://files.pharo.org/image/70/latest-minimal-64.zip
>>>>>>>
>>>>>>> So you do not need to do it by yourself.
>>>>>>>
>>>>>>> -- Pavel
>>>>>>>
>>>>>>
>>>>>
>>>
>>
>


Re: [Pharo-users] #parseMethod:onError: isn't as obvious as expected - is it me?

2017-09-01 Thread Thierry Goubier
Hi Tim,

The RB ast has a specific method for finding the right node: in AltBrowser,
I use ast bestNodeFor: aTarget selectionInterval.

For the second case (parse what is selected), you may want to look into
SmaCC: it has specific entry points (used for refactoring) to try all
possible starts in a parser for a given piece of text and returning all the
possible correct asts. As a hand-writen parser, the RBParser can't do that
unless you add the necessary entry points by hand and hack around the error
handling, because most of the parse attempts end on an error (as they
should).

Regards,

Thierry

2017-09-01 8:50 GMT+02:00 Tim Mackinnon :

> Marcus - I'd be interested in how you thought to solve this.
>
> My solution seems to work - but it's not the most elegant. Retrying lots
> of different ways like I show, smacks a bit of desperation (this said, it
> is quite compact).
>
> Apart from that - I was actually interested in thoughts on the parse
> method - the onError naming is a bit misleading compared to other methods
> in the image. I wonder if it should be called something like
> "onErrorMerge:"  to signal that it's going to reuse the results?
>
> Stef - with regards to broken source, my proposed solution reuses what is
> already there - thus if you highlight specific code, it reverts to the
> original strategy and tries to compile just that code. This bugs me however
> - so if you highlight nothing, it tries to compile the source multiple
> ways, I drop down to chopping the source up to where your cursor is - which
> seems like a decent cheap strategy.
>
> I don't know if our parser is able to recover from simple errors and just
> have error nodes in the ast, and whether the #bestNodeFor method then
> ignored error nodes... this is what I think Dolphin used to do.
>
> Tim
>
> Sent from my iPhone
>
> > On 31 Aug 2017, at 19:11, Marcus Denker  wrote:
> >
> >
> >> On 31 Aug 2017, at 19:07, Stephane Ducasse 
> wrote:
> >>
> >> On Wed, Aug 30, 2017 at 9:50 PM, Tim Mackinnon 
> wrote:
> >>> I’m looking for some feedback on the usage of  RBParser>>#parseMethod:
> onError:.
> >>>
> >>> I am looking at ways of improving the way we edit code - and making
> things work (as least for me - but maybe for everyone) a bit more like
> IntelliJ where they have some great code operations and very good keyboard
> support. We are certainly close, but at times feel a bit clumsy - which is
> a shame as we have far better infrastructure to support equivalent
> features. So I thought I would have a go.
> >>
> >> Excellent!!!
> >>
> >>
> >>> Anyway - step one (which I think I’ve come close on), was to teach
> senders/implementors to look at the AST so you don’t have to highlight
> exactly what you want to search on - instead it can infer from your cursor…
> however my next step was to improve how we can select code to ease
> refactoring, bracketing etc…
> >>
> >> Yes but we have to handle broken code then.
> >> Did you check how smart suggestions did it for code that compiled?
> >>
> >
> > I looked some weeks ago and made some notes what to do… but I fear this
> has to wait for next week,
> > there is no way that I can do anything till ESUG…
> >
> >Marcus
>
>
>


Re: [Pharo-users] #parseMethod:onError: isn't as obvious as expected - is it me?

2017-09-07 Thread Thierry Goubier
Hi Tim,

2017-09-01 13:39 GMT+02:00 Tim Mackinnon :

> Thanks Thierry - this is proving an interesting problem domain ...
>
> I too am using #bestNodeFor: although I don't find it always gives the
> best node (it does if you are clearly in the target range, but if you are
> on the outer boundary like the next position after a selector or next to a
> "." or ";" it favours the parent and not the closest node. So in usage I
> find I need to tweak it a bit.
>

Yes, when you are on a boundary, then finding the right node may be
difficult. When developping the ancestor to smart suggestion, I considered
#bestNodeFor: as good enough, but I considered looking into "up" and "down"
ast navigation at a time, and I wasn't alone (I think it was active in the
Pharo editor at a point).


>
> I'll look at smacc though - also there is that experimental setting to
> allow parse errors, I don't know if it helps in any way.
>

There is a general question there, which is how you try to parse as much as
possible while jumping over the error, making the error area as small as
possible (that would be really great for syntax highlighting, by the way).

The problem is that in hand-written parsers, you need to hard-code the
error management in the parser. With a table-driven parser (as is SmaCC),
then you can explore in a systematic way what are the possible states that
would allow the parsing to continue correctly after making the error area
as small as possible.

This would make for a very nice internship subject...


> All this said, I think I have a workable suggestion that is not much code
> that might be open to scrutiny from those wiser than me.
>
> Looking at the keyboard handling in the system - it's quite sprawling and
> tricky to follow. I think there is lots of room for refactoring.
>

It is very easy in Pharo to implement a nice and clean keyboard handling;
all the necessary components have been in place for years, and we already
have implementations (using the KM API).

Now, most Pharo developpers just jump into hardcoding keyboard handling
instead.

Thierry


>
> I'm also not sure if I like the pragma usage either - I find it quite
> difficult to follow what's calling what.
>
> Tim
>
> Sent from my iPhone
>
> On 1 Sep 2017, at 09:18, Thierry Goubier 
> wrote:
>
> Hi Tim,
>
> The RB ast has a specific method for finding the right node: in
> AltBrowser, I use ast bestNodeFor: aTarget selectionInterval.
>
> For the second case (parse what is selected), you may want to look into
> SmaCC: it has specific entry points (used for refactoring) to try all
> possible starts in a parser for a given piece of text and returning all the
> possible correct asts. As a hand-writen parser, the RBParser can't do that
> unless you add the necessary entry points by hand and hack around the error
> handling, because most of the parse attempts end on an error (as they
> should).
>
> Regards,
>
> Thierry
>
> 2017-09-01 8:50 GMT+02:00 Tim Mackinnon :
>
>> Marcus - I'd be interested in how you thought to solve this.
>>
>> My solution seems to work - but it's not the most elegant. Retrying lots
>> of different ways like I show, smacks a bit of desperation (this said, it
>> is quite compact).
>>
>> Apart from that - I was actually interested in thoughts on the parse
>> method - the onError naming is a bit misleading compared to other methods
>> in the image. I wonder if it should be called something like
>> "onErrorMerge:"  to signal that it's going to reuse the results?
>>
>> Stef - with regards to broken source, my proposed solution reuses what is
>> already there - thus if you highlight specific code, it reverts to the
>> original strategy and tries to compile just that code. This bugs me however
>> - so if you highlight nothing, it tries to compile the source multiple
>> ways, I drop down to chopping the source up to where your cursor is - which
>> seems like a decent cheap strategy.
>>
>> I don't know if our parser is able to recover from simple errors and just
>> have error nodes in the ast, and whether the #bestNodeFor method then
>> ignored error nodes... this is what I think Dolphin used to do.
>>
>> Tim
>>
>> Sent from my iPhone
>>
>> > On 31 Aug 2017, at 19:11, Marcus Denker  wrote:
>> >
>> >
>> >> On 31 Aug 2017, at 19:07, Stephane Ducasse 
>> wrote:
>> >>
>> >> On Wed, Aug 30, 2017 at 9:50 PM, Tim Mackinnon 
>> wrote:
>> >>> I’m looking for some feedback on the usage of
>> RBParser>>#parseMethod:onError:.
>> >>>
>

Re: [Pharo-users] Pharo 7 license question

2017-09-22 Thread Thierry Goubier
2017-09-22 10:27 GMT+02:00 Hilaire :

> The appropriate and neutral term to describe GPL licence is "recursive".
>
> GPL licence was designed to build a better computing community, where
> freedom is 1st consideration, even at the expense of a lower acceptance.
>

And the little technical fact that you can't link code in the Smalltalk
world, only create a derivative work, has nothing to do with the community
stance on MIT versus GPL.

Thierry


>
> Hilaire
>
>
> Le 20/09/2017 à 21:30, Jimmie Houchin a écrit :
>
>> So my question to you. What words would you use instead of viral and
>> infection that equally describe that characteristic of the GPL and variants?
>>
>
> --
> Dr. Geo
> http://drgeo.eu
>
>
>
>


Re: [Pharo-users] How to include DeployUtils in a Configuration?

2017-09-27 Thread Thierry Goubier
Hi Hernán,

I think what is happening is you're not including completely the
DeployUtils baseline. You need to write something like:

spec baseline: 'DeployUtils' with: [
spec repository: 'github://fstephany/DeployUtils/repository'];
import: 'DeployUtils'.

And have one of the packages (or groups?) of DeployUtils listed as
dependency of one of your packages.

Regards,

Thierry

2017-09-25 20:19 GMT+02:00 Hernán Morales Durand :

> I am trying to include DeployUtils in a ConfigurationOf (Pharo 6.1)
> following instructions at:
>
> https://github.com/fstephany/DeployUtils
>
> If I include the dependency as suggested:
>
> spec baseline: 'DeployUtils' with: [
> spec repository: 'github://fstephany/DeployUtils/repository'].
>
> then when I load the configuration I get:
>
> Error: Unable to resolve project package for 'DeployUtils'. It is
> likely that that the configuration referencing this project will not
> validate properly (see MetacelloToolBox
> class>>validateConfiguration:).
>
> If I include the dependency as:
>
> spec
> project: 'DeployUtils' with: [
> spec
> className: #DeployUtils;
> versionString: 'baseline';
> repository: 'github://fstephany/DeployUtils/repository'
> ];
>
> Then I get DU multiple missing dependencies:
>
> This package depends on the following classes:
>   StringStreamLogger
>   Log
>   StdoutStreamLogger
> You must resolve these dependencies before you will be able to load
> these definitions:
>   DUFileLogger
>   DUFileLogger>>#withFileLocator:
>   DUFileLogger>>#addLogHook:
>   DUFileLogger>>#defaultFormatter
>   DUFileLogger>>#defaultStream
>   DUFileLogger>>#fileLocator:
>   DUStdoutStreamLogger
>   DUStdoutStreamLogger>>#addLogHook:
>   Log>>#debug:tag:
>   Log>>#info:tag:
>   Log>>#warning:tag:
>
> And finally a MNU with
>
> #loader: was sent to nil
>
> (also when I try to inspect I got a #gtInspectorProjectsIn: was sent to
> nil)
> Any ideas?
> Cheers,
>
> Hernán
>
>


Re: [Pharo-users] X11 options on Ubuntu VM / Athens rendering problems

2017-10-01 Thread Thierry Goubier

Le 01/10/2017 à 09:26, Hilaire a écrit :
All these difficulties are good argument to get the appropriate 
libcairo/libpng shipped with the Linux VM, as done with Windows and 
MacOSX VM


This cause surprising problems in Pharo integration with the platform: 
for example, if you use a system library or an external command with 
Pharo as it is set now, that command will use Pharo libpng instead of 
the one it was compiled with (because pharo use of LD_LIBRARY_PATH will 
be inherited).


Took me a while for example to understand that, when using the snap 
version of Pharo, Python3 scripts called from Pharo would be unable to 
import libraries such as numpy. But that works fine with the zeroinstall 
version of Pharo.


Thierry


Hilaire


Le 30/09/2017 à 21:58, Igor Stasenko a écrit :

Sure. But i didn't done much, so there's nothing to appriciate yet :)
But i want to help, if it won't require reinstalling OS, because i 
need my machine in working condition almost 24/7.. so i cannot take 
too much risk with it :(







Re: [Pharo-users] Behold Pharo: The Modern Smalltalk

2017-10-11 Thread Thierry Goubier
What about a seaside-based system browser oriented towards code
documentation? That would fit both paradigms: html-like reference + live
browsing.

You could even make it buzzword compliant: have a REST interface to
documentation and code.

Note how the panes in a system browser could make for a nice URI: just look
for

pharo://Kernel/Number/mathematical%20functions/raisedTo:

And we could even include version numbers, etc

pharo://6.1/Kernel/Number/mathematical%20functions/raisedTo:

Not very different from the github url for the pharo project relevant
file...

https://github.com/pharo-project/pharo/blob/development/src/Kernel.package/Number.class/instance/raisedTo..st

Thierry

2017-10-11 17:01 GMT+02:00 Offray Vladimir Luna Cárdenas <
offray.l...@mutabit.com>:

> Yes. I know them. I mean API docs as static files. I don't really sold on
> them compared with a live system and I don't think static API docs are
> critical for Pharo success.
>
> Cheers,
>
> Offray
>
> On 11/10/17 09:52, Dimitris Chloupis wrote:
>
> Ah and my static website was built with Pillar and Bootstrap, using
> bootstrap templates was easy because Pillar supports mustache that makes
> html manipulation much easier
>
> http://www.kilon-alios.com
>
> Pillar of course is not made for generating websites but it’s an awesome
> Pharo library that allows for great degree of freedom so I thought , why
> not ?
> On Wed, 11 Oct 2017 at 17:48, Dimitris Chloupis 
> wrote:
>
>> Docs are available in static online html format , at least the book I was
>> working on
>>
>> Pharo By Example
>>
>> You can find those links here
>>
>> https://github.com/SquareBracketAssociates/UpdatedPharoByExample
>>
>> Our documentation system , Pillar , outputs pdf , html and markdown
>> files.
>>
>> If the book in question is built like PBE with CI of Inria where most
>> Pharo related official projects are built then it should have at least pdf
>> and html with online access so you can easily link to.
>>
>> Don’t quote me on this but I think the html output of pillar generate
>> links even for paragraphs you can do an even more process linking to the
>> documentation.
>> On Wed, 11 Oct 2017 at 17:40, Offray Vladimir Luna Cárdenas <
>> offray.l...@mutabit.com> wrote:
>>
>>> The more I use Pharo, the less I use web documentation. For me seems
>>> pretty suboptimal compared to live environment with code browser and
>>> GT-Spotter. Regarding the comment on Medium, it also took me little to find
>>> #raisedTo:, so the millage can vary. What I was missing was proper books
>>> for particular domains, but Pharo books are covering that. I don't know if
>>> a Q&A site could improve search-ability for newbies (certainly you can find
>>> little stuff in Stack Overflow).
>>>
>>> My bet is about trying to create more "end user" tools (Grafoscopio is
>>> kind of this), besides tools for developers. There is a broad community of
>>> people who can be active contributors and members of the community, welcome
>>> Pharo and live coding a lot and don't complain that much about stuff that
>>> is not already pretty similar to what they already know (being that only
>>> English MOOC or online static html docs).
>>>
>>> Cheers,
>>>
>>> Offray
>>>
>>> On 11/10/17 07:34, Dimitris Chloupis wrote:
>>>
>>> for me it is a yes and no situation, yes its very coold to have your
>>> entire system in your fingertips but Pharo has serious issues with code
>>> organisation and I find the lack of namespaces quite inconvenient. You have
>>> to be careful how to name your classes which does not sound to me very OOP
>>> friendly.
>>>
>>> Also the IDE does not handle spaggetification very well, sure you can
>>> find implementors , senders etc but if the execution chain is complex ,
>>> welcome to spaggeti hell. But that is a problem with most other IDEs if not
>>> all as well. Problem is in this case that we have the very good rule of
>>> using sort methods which multiplies this problem and makes navigation even
>>> harder. Code becomes much easier to read per method and messages but much
>>> harder to understand in a bird eye view.
>>>
>>> Some of that pain has been aleviated with the introduction of GTSpotter
>>> which I have praised quite a lot and I will continue to do so. But yeah
>>> there are more needed to be done in the department to make Pharo code
>>> navigation a more comfortable task.
>>>
>>> On Wed, Oct 11, 2017 at 2:57 PM Vitor Medina Cruz 
>>> wrote:
>>>
 I dunno, maybe I’m weird, but I find the System Browser a fantastic way
 to explore the class library. If you find a class or method that isn’t well
 documented, write a comment and send a change request. Stef told me this
 ages ago. I might add, if you find a bug you should write a test that
 exercises the bug and submit it on fogbugz (the bug tracking system).


 I will reference of response of mine to a similar opinion made by
 Richard: https://medium.com/@vitormcruz/i-disagree-it-is-
 much-harde

Re: [Pharo-users] [ANN] Libusb binding + HID support for Pharo

2017-10-12 Thread Thierry Goubier
Very cool. Would that be doable to adapt for a 64bits version?

Thierry

2017-10-12 13:29 GMT+02:00 Julien :

> Hello,
>
> A bit late, there is a Libusb [1] binding (using UFFI) and support for the
> Human Interface Device [2] (that uses the binding but is written in pure
> Smalltalk) for Pharo.
>
> Everything is on the github repository [3]. « Install »  and « Quick
> start »  sections give you all you need to start using the project.
>
> One could also have a look at the wiki [4].
>
> It works on Linux but hasn’t been tested on Mac OS nor Windows (it should
> work since libusb library works on these platforms).
>
> Do not forget to install the 32 bits versions of libusb on your computer.
>
> The purpose of this library is to provide the ability to use USB devices
> directly from Pharo.
>
> For example, one could get data from a PS3 controller, a mouse, a
> keyboard, an Arduino device, etc…
>
> Cheers,
>
> Julien
>
> PS: I realised this project during an internship in TaMère SCRL company
> [5]. Thanks to them!
>
> Links:
> [1]: http://libusb.info
> [2]: https://en.wikipedia.org/wiki/Human_interface_device
> [3]: https://github.com/tamerescrl/libusb-pharo
> [4]: https://github.com/tamerescrl/libusb-pharo/wiki
> [5]: http://tamere.eu
>


Re: [Pharo-users] [ANN] Libusb binding + HID support for Pharo

2017-10-12 Thread Thierry Goubier
2017-10-12 15:05 GMT+02:00 Guillermo Polito :

>
>
> On Thu, Oct 12, 2017 at 2:49 PM, Julien 
> wrote:
>
>> Normally, it should be possible.
>>
>> Libusb can be compiled for 64bits architectures. I don’t know if it
>> changes something in the UFFI binding side?
>>
>
> It should not, besides the library's location.
>
>
That was the first hurdle. Easily solved.


> And, if you find a case where the binding does not work on 64 bits it is
> either:
>  - a UFFI bug in the type mappings (e.g., a wrong mapping between a type
> name and the correct 32/64 bit size and marshalling)
>  - or a bug in the bindings using the wrong types (e.g., using long
> instead of void*)
>

And the first FFI call fails (the lib init).

Thierry


>
>
>>
>> Julien
>>
>> Le 12 oct. 2017 à 14:41, Thierry Goubier  a
>> écrit :
>>
>> Very cool. Would that be doable to adapt for a 64bits version?
>>
>> Thierry
>>
>> 2017-10-12 13:29 GMT+02:00 Julien :
>>
>>> Hello,
>>>
>>> A bit late, there is a Libusb [1] binding (using UFFI) and support for
>>> the Human Interface Device [2] (that uses the binding but is written in
>>> pure Smalltalk) for Pharo.
>>>
>>> Everything is on the github repository [3]. « Install »  and « Quick
>>> start »  sections give you all you need to start using the project.
>>>
>>> One could also have a look at the wiki [4].
>>>
>>> It works on Linux but hasn’t been tested on Mac OS nor Windows (it
>>> should work since libusb library works on these platforms).
>>>
>>> Do not forget to install the 32 bits versions of libusb on your computer.
>>>
>>> The purpose of this library is to provide the ability to use USB devices
>>> directly from Pharo.
>>>
>>> For example, one could get data from a PS3 controller, a mouse, a
>>> keyboard, an Arduino device, etc…
>>>
>>> Cheers,
>>>
>>> Julien
>>>
>>> PS: I realised this project during an internship in TaMère SCRL company
>>> [5]. Thanks to them!
>>>
>>> Links:
>>> [1]: http://libusb.info
>>> [2]: https://en.wikipedia.org/wiki/Human_interface_device
>>> [3]: https://github.com/tamerescrl/libusb-pharo
>>> [4]: https://github.com/tamerescrl/libusb-pharo/wiki
>>> [5]: http://tamere.eu
>>>
>>
>>
>>
>
>
> --
>
>
>
> Guille Polito
>
> Research Engineer
>
> Centre de Recherche en Informatique, Signal et Automatique de Lille
>
> CRIStAL - UMR 9189
>
> French National Center for Scientific Research - *http://www.cnrs.fr
> <http://www.cnrs.fr>*
>
>
> *Web:* *http://guillep.github.io* <http://guillep.github.io>
>
> *Phone: *+33 06 52 70 66 13 <+33%206%2052%2070%2066%2013>
>


Re: [Pharo-users] "Building-With versus Building-on"

2017-10-13 Thread Thierry Goubier
Hi Andrew, Stephane,

thanks for the read. It was interesting, albeit a bit confusing at times. I
do like your evaluation of the thesis.

2017-10-12 23:10 GMT+02:00 Stephane Ducasse :

> Thanks Andrew I read it fast and I will reread it. It is really
> interesting to me because I never took the time to understand "worse
> is better".
>

Reading through "worse is better", and the follow-up "worse is better is
worse" by the same author, I'm not sure there is much to understand ;)

Apart if you want to study how a misunderstood quote can become a driving
force in software development...

Thierry


>
> On Thu, Oct 12, 2017 at 5:50 PM, Andrew Glynn  wrote:
> > https://medium.com/@dasein42/building-with-versus-building-
> on-c51aa3034c71
> >
> >
> > This is an article not specifically about Pharo, rather on the state of
> the
> > industry
> > in general and how it got that way, but positing Pharo as a way to learn
> > building-on rather than building-with, where in the latter case on
> > every project you start at essentially the same place.
> >
> >
> > As a result it does put in front of people a fair amount of info on
> Pharo,
> > and challenges them to try it.
> >
> >
> > cheers
> >
> > Andrew Glynn
>
>


Re: [Pharo-users] Namespaces (was Re: Behold Pharo: The Modern Smalltalk)

2017-10-13 Thread Thierry Goubier
Hi Kilon,

disclaimer: I've used Parcplace Smalltlk without namespaces, then
VisualWorks with namespaces.

2017-10-13 9:08 GMT+02:00 Dimitris Chloupis :

> Personally I dont get it, we find the path to bootstrap the pharo image
> clear and we cannot see the path to namespaces ?
>

Because namespaces, by essence, come with serious issues. I won't take
someone seriously on namespaces until he can cite those faithfully.


>
> it makes zero sense to me
>
> Plus what you say, countless and countless of implementation of namespaces
> out there. And again what you say about perfection.
>
> If C++ can improve, If C++ can dream of namespaces planning the
> introduction of modules(in future version) in replacement (not removal) of
> his awful header file format I think we got the excuse to be confident
> we can come up with something decent.
>

C++ is about adding incidental complexity to the development process, i.e.
how to make something complex where it could be done in a simpler way.

So I'd be very wary of any innovation coming from that direction.


>
> We develop a freaking IDE for crying out loud.
>
> No it wont be a walk in the park, no it wont get done in one or next
> version, and no it cannot be an individual our outside effort. But we have
> the community super qualified to do it.
>

And qualified enough maybe to also see it doesn't make that much of sense.

Please remember that the design of a programming language consists not just
in a laundry list of features, but also in making judicious choices of what
to *omit* and, more importantly, in establishing design principles that are
easy to understand [Steele, 2003]

Thierry


> On Fri, Oct 13, 2017 at 8:51 AM Ben Coman  wrote:
>
>> On Thu, Oct 12, 2017 at 8:52 PM, Sean P. DeNigris 
>> wrote:
>>
>>> horrido wrote
>>> > Having separate namespaces would be really good.
>>> > VisualWorks has them. Why not Pharo?
>>>
>>> I can't remember ever hearing disagreement on this subject. It seems the
>>> only questions have been: 1) how to do them *right*,
>>
>>
>> The default position would be leveraging someone else's experience, so
>> this begs the question, what is wrong in namespace implementations in VW,
>> Gemstone, Squeak (as our immediate neighbours, then plus Dolphin,
>> SmalltalkX, other languages)
>> Are there been any research papers around comparing these?
>>
>> I found the "Pharo on Gemstone VM" talk impressive.  The "develop on
>> Pharo deploy on Gemstone" philosophy seems like a nice synergy for Pharo's
>> commercial future.  So a naive approach would be to do namespaces just like
>> Gemstone.  Maybe its not the best, but would it be "good enough" --
>> perfection being the enemy of done and all that jazz.
>>
>> cheers -ben
>>
>>
>>> and 2) where they fall on the endless prioritized todo list
>>>
>>


Re: [Pharo-users] Namespaces (was Re: Behold Pharo: The Modern Smalltalk)

2017-10-13 Thread Thierry Goubier
2017-10-13 10:12 GMT+02:00 Dimitris Chloupis :

> fair enough you think namespaces are not the right solution, what you
> think is the right solution then ?
>

I told you. Namespaces are a solution, but they come with issues.


>
> As much I hate C++ , no I will have to disagree with your there, bad
> language design sure, but many of the "bad design" choices they make are
> based on the fact that this is a pure performance orientated language. Oh
> and we still wait for the real C++ alternative. Rust people claim they are
> close, D people claim they are close, everyone claims its very close, but
> still no alternative. Well I dont count C becaue its not OO, even if you
> claim C++ an abomination of OOP. I can guarantee that the dude that will
> come up with a language as fast as C++ and much better design he is going
> to make a fortune. In the mean time , those that have to use C++ will
> continue to use C++ and wait for the extemely remote competition to catch
> up. In the mean time C++ is the undisputed king in its speciality.
>

No. In the HPC world, a common held position is that Fortran code is 30%
faster than C++.

Remember that part of my job is to write compilers.

I'm also consider a guy to talk to when someone has deep issues with some
of the new features of C++... even if I don't do C++, I can often reframe
what the feature means in the overall scheme of programming languages.


>
> Unfortunately coming up with a top performance language is a lot more than
> language design, live coding and OOP. Took ages for C and C++ to get to the
> level of optimisation they are nowdays. That's no easy feat even if you or
> I dont find interesting.
>

I find it very interesting. I consider that current compilers are very good
optimising code that is written in a language that obscures the developper
intent in the first place.


>
> So yes the modules that C++ will come up with, will be as ugly as hell,
> templates that suppose to be there as an alternative to dynamic typing etc
> are ugly as hell, but I dont see much protest in getting them removed. And
> there cases you cannot even use these "improvements" because ... well
> performance issues. While other languages worry how many times slower they
> are compared to C++, C++ worries about how much percentage of performance
> it loses with each added feature. C++ exits in a diffirent universe than
> the one that Smalltalk, Python, Ruby etc exist on and is a very lonely one.
>

As I told you, I work in a world where performance is paramount and C++ is
strongly criticized for the fact its incidental complexity makes it very
very hard to reach or maintain performance levels (compared to Fortran,
say).

Thierry


>
> On Fri, Oct 13, 2017 at 10:55 AM Thierry Goubier <
> thierry.goub...@gmail.com> wrote:
>
>> Hi Kilon,
>>
>> disclaimer: I've used Parcplace Smalltlk without namespaces, then
>> VisualWorks with namespaces.
>>
>> 2017-10-13 9:08 GMT+02:00 Dimitris Chloupis :
>>
>>> Personally I dont get it, we find the path to bootstrap the pharo image
>>> clear and we cannot see the path to namespaces ?
>>>
>>
>> Because namespaces, by essence, come with serious issues. I won't take
>> someone seriously on namespaces until he can cite those faithfully.
>>
>>
>>>
>>> it makes zero sense to me
>>>
>>> Plus what you say, countless and countless of implementation of
>>> namespaces out there. And again what you say about perfection.
>>>
>>> If C++ can improve, If C++ can dream of namespaces planning the
>>> introduction of modules(in future version) in replacement (not removal) of
>>> his awful header file format I think we got the excuse to be confident
>>> we can come up with something decent.
>>>
>>
>> C++ is about adding incidental complexity to the development process,
>> i.e. how to make something complex where it could be done in a simpler way.
>>
>> So I'd be very wary of any innovation coming from that direction.
>>
>>
>>>
>>> We develop a freaking IDE for crying out loud.
>>>
>>> No it wont be a walk in the park, no it wont get done in one or next
>>> version, and no it cannot be an individual our outside effort. But we have
>>> the community super qualified to do it.
>>>
>>
>> And qualified enough maybe to also see it doesn't make that much of sense.
>>
>> Please remember that the design of a programming language consists not
>> just in a laundry list of features, but also in making judicious choices of
>> what to *omit* and, more importantly, in establ

Re: [Pharo-users] Namespaces (was Re: Behold Pharo: The Modern Smalltalk)

2017-10-13 Thread Thierry Goubier
Hi Kilon,

then the discussion is a bit different. As your example points out, the
syntax is already there, but the notion of a module is still open and ties
into the package management.

I've played a bit with Metacello to have a working "project" concept
synchronized with Metacello, and I could imagine providing module like
objects (the baseline itself?) giving access to more generic names instead
of the internal, prefixed ones.

One suggestion maybe: what about trying it for yourself with one of your
projects? With a kind of overall class which has the name of the module,
and automatically adding methods to it (or a #doesNotUnderstand: that
handles those) for all the classes in the module, removing from the class
name the prefix? It would allow an experiment, to see how the code looks
like and if it is understandable, or if a special syntax is necessary.

Thierry


2017-10-13 11:51 GMT+02:00 Dimitris Chloupis :

> to be more specific what I mean because apparently I may know nothing
> about namespaces , I was talking in terms of Python's module and package
> system
>
> even though python uses special syntax "import" to import a module, a
> source file, the real functionality is actually a method but of an object
> dealing with the handling of modules and packages , packages are basically
> file directories containing mutliple modules
>
> as soon as you do the import the syntax is the usual object syntax
>
> so
>
> Dog.bark()
>
> can be anything
> 1) A class method call, Dog being the class
> 2) A instance method call, Dog being the instance
> 3) or a function call, Dog being the function , which is also an object
> (methods in python are basically function object taking the reference to an
> instance as first argument, hence why the weird syntax of adding self as
> first argument when we define instance method) and Dog is the module
> imported.
>
> of course in case (3) you can collapse the module "name" so you can do
> only bark() if you import via "from Dog import *" which means from module
> Dog import every object.
> But from import is frown upon in the python world because obviously it
> makes it easier to have name collision which is what the module system try
> to avoid in the first place.
>
> So the equivelant of pharo would be
>
> MyModule MyInstance myMessage:
>
> or if you include packages as well
>
> MyPackage MyModule MyInstance myMessage:
>
> which follows pharo syntax and OO design. That's my general idea at least.
>
> Please enlighten me :)
>
> On Fri, Oct 13, 2017 at 12:30 PM Dimitris Chloupis 
> wrote:
>
>> On Fri, Oct 13, 2017 at 11:31 AM Thierry Goubier <
>> thierry.goub...@gmail.com> wrote:
>>
>>> 2017-10-13 10:12 GMT+02:00 Dimitris Chloupis :
>>>
>>>> fair enough you think namespaces are not the right solution, what you
>>>> think is the right solution then ?
>>>>
>>>
>>> I told you. Namespaces are a solution, but they come with issues.
>>>
>>>
>>
>> Then I misunderstood you but I am geniouly interested in what those
>> problems are and I think the infromation is something others will find
>> interesting as well.
>>
>> No. In the HPC world, a common held position is that Fortran code is 30%
>>> faster than C++.
>>>
>>
>> Cannot even rememeber the last time a 3d graphics developers mentioned
>> Fortran.I occasional frequent forums and mailing lists plus keeping in
>> contact with Blender developers.
>>
>> I have heard that Fortran can outperform C++ in numeric computation
>> around the percentage you mentioned but first time I heard that its
>> generally faster.
>>
>> Language Benchmark seems to strongly disagree
>>
>> http://benchmarksgame.alioth.debian.org/u64q/compare.php?
>> lang=ifc&lang2=gpp
>>
>> of its widely criticized but then what benchmark is not
>>
>>
>>> Remember that part of my job is to write compilers.
>>>
>>>
>> I knew that you write compilers (SmaCC) I did not realise you are a pro
>> and especially on ones that generate highly optimised machine code
>>
>>
>>> I'm also consider a guy to talk to when someone has deep issues with
>>> some of the new features of C++... even if I don't do C++, I can often
>>> reframe what the feature means in the overall scheme of programming
>>> languages.
>>>
>>
>> On other hand I have close to zero experience on compilers
>>  .
>>
>>
>>> I find it very interesting. I consider that current compilers are very
>>> good opti

Re: [Pharo-users] Exchanging information between 2 pharo applications (2 images running on two different computers)

2017-10-27 Thread Thierry Goubier
Hi Cedric,

a short answer: some of what you're trying to do has been traditionnally
handled by object databases - multiple images retrieving and updating
objects on a central store ensuring lots of good properties : see Gemstone.

Another answer, since you're looking at content-addressable distributed
file systems. You can resolve the offline mode with object duplications
(duplicate all objects in the images using them), and, when coming back
online, have a merge approach to reconcile changes between versions of
shared objects. Content-based hashes as identifiers in a distributed store
have very nice properties for that purpose, because, if image C has
modified object 0xcdaff3, then that object has in fact become object
0xee345d for that image (and the unmodified object is still 0xcdaff3 for
images A and B).

I wouldn't be against a slightly higher granularity when dealing with
object transfers, however.

Regards,

Thierry

2017-10-27 10:43 GMT+02:00 Cédrick Béler :

>
> Nothing complex about two images exchanging messages, its not even complex
> to transmit objects via fuel, you even transmit a debugger or any part of
> the live environment or even make an "internet" of images that join objects
> together. Sky is the limit. Pharo already provides you will all the
> tools/libraries to do this.
>
>
> Yes. That’s why I asked for better practices.
>
>
> A streamsocket (not to be confused with regular sockets) will delay the
> messages (a collection of bytes) until they arrive to the receiver or until
> they have reached the timeout period. Offline mode is pretty much
> obligatory even for plain old internet web apps because of drops in
> connection or the plain fact a connection can become slow.
>
>
> Offline mode is to me of first importance.
>
> Let’s say I have a sets of Pharo app (nodes).
> Each one are independent running on different devices/computers.
>
> I want to exchange information between  them according to some kind of
> contracts and also on connection availability.
>
> What I find different from usual message exchanges between two images is
> that I want to have full control on it. Plus I consider images offline by
> default (meaning two images have different versions of the same info). So
> conflict is the norm.
>
> Also, I don’t want to send message remotely (with behavior), I just want
> to send/share an information and sync them (when possible).
>
> Connection between 2 images can be through a network but eventually
> through a serial connection (usb cable, Bluetooth,...).
>
> So what I try to do as a proto is having connection controlled by my apps
> (I put the app offline (not by switching off wifi but by switching
> logically). I can see nodes availability and activate connexion manually
> then see if conflict resolution is ok, + I log every connecitions changes
> and exchanges).   This is my plans for now but it may change ! ^^
>
>
> I used streamsockets in my Pharo to Python bridge (Atlas) because the
> execution was not necessary synchronous , I was sending Python command to a
> 3d application from Pharo and I had to make sure that the bridge was
> working even in the case of a command that could take hours to execute like
> a rendering process.
>
>
> I’ll look  at stream sockets and mq stuffs.
>
>
> Cheers,
>
> Cédrick
>
>
> One cool trick I did was to send the Python errors back to Pharo and
> trigger them as Pharo's regular MessageNotUnderstood , this is a nice way
> to make sure that you can fix a wrong message after it has been executing
> without going to the image that is executing it.
>
> The limitation with sockets which what every frameworks uses because AFAIK
> they are the only means to communicate remotely is that they are not top
> performance so that mean that you can send long loops but executing
> communication inside long loops will either slow you down considerably or
> simply timeout your socket. Sockets can timeout from both ends if they feel
> that for some reason they lost communication with the other side and
> reached their timeout period. Timeout period is customization.
>
> This is a problem I did not tackle with my implementation because I dont
> think there can be an actual practical solution better than avoiding this
> scenario.
>
> Only shared memory seems to overcome this but it can be used only locally
> and not remotely (aka on same computer) .
>
> On Wed, Oct 25, 2017 at 4:41 PM Cédrick Béler  wrote:
>
>> I had a look and this is not (natively) possible.
>>
>> The idea of the off-line mode would be to delay messages that are sent to
>> the peer until a connection is established.
>>
>> I think I have to try to do it by myself (like having a list of
>> information exchange that wait until a connexion is established).
>>
>> What I try to do is not as complex as two general image exchanging
>> messages on objects (like on TelePharo).
>>
>> I just want a repository of information (mainly a collection of static
>> information/data versions) on both peers 

Re: [Pharo-users] Exchanging information between 2 pharo applications (2 images running on two different computers)

2017-10-27 Thread Thierry Goubier
2017-10-27 11:28 GMT+02:00 Cédrick Béler :

>
> Hi Cedric,
>
> a short answer: some of what you're trying to do has been traditionnally
> handled by object databases - multiple images retrieving and updating
> objects on a central store ensuring lots of good properties : see Gemstone.
>
>
> Yes , I’d like to avoid this centralized approach.
>

I mean that they have already some of the mechanisms in place, even if
centralized.


>
>
> Another answer, since you're looking at content-addressable distributed
> file systems. You can resolve the offline mode with object duplications
> (duplicate all objects in the images using them), and, when coming back
> online, have a merge approach to reconcile changes between versions of
> shared objects. Content-based hashes as identifiers in a distributed store
> have very nice properties for that purpose, because, if image C has
> modified object 0xcdaff3, then that object has in fact become object
> 0xee345d for that image (and the unmodified object is still 0xcdaff3 for
> images A and B).
>
>
> You nailed it. This is what I’d like to reproduce.
>
> Existing implementations out there seems to uses whatever nodes on the
> network to replicate the information.
>

Yes, because that makes them decentralized :)


>
> I’d like to control nodes where it is replicated. My nodes (all my app
> instances + nodes of person I’m exchanging information with + eventually
> friend of friend).
>

We've done recent work on capability-based content adressing, but, first
it's very slow (so you use a two level cryptosystem: the crypted header
contains the key to decrypt the content, and the crypted header can only be
decrypted if your private key has the right level of capabilities on the
data item.


>
> What hash function would you use ?
>

Anything that is fast, bonus points if it uses CPU special instructions
(that you can't use from Pharo, of course ;)), and has the right
cryptographic properties. Unless you go into a specific cryptosystem, I'd
say that it is not important.


>
> To get something compatible with ipfs, I’d need something like:
> https://github.com/multiformats/multihash
> It looks to me quite universal as self describing. But any (existing) hash
> method compatible with content hashing would do the job.
>

Interesting, but it looks like a minor issue in the overall scheme. Makes
some of your system robust to evolution in the hash used, but, since first
bytes are not well distributed, can you use it safely to build a multi-hash
function system? Probably not.


>
>
> I wouldn't be against a slightly higher granularity when dealing with
> object transfers, however.
>
>
> You mean at the pharo level ? Higher granularity means having more control
> on the exchange/merge ?
>

No, just that the content-based address scheme is costly... and that a
practical implementation would probably look to provide addresses only to
large enough entities (a page containing objects, for example, or a large
objects containing smaller ones). So that you donc create an address for
each character of the string object describing the name of a person, say).

Regards,

Thierry


>
> Cheers,
>
> Cédrick
>


Re: [Pharo-users] perspective request for those earning alivingfromSmalltalk

2017-11-06 Thread Thierry Goubier

Hi Andrew,

Le 06/11/2017 à 19:59, Andrew Glynn a écrit :
I /suspect/ that a (mostly repressed) underlying sense that a reliable, 
inexpensive platform, if popular, would have been more detrimental to 
IBM than to its smaller competitors. The same goes for the VisualAge 
family -> Smalltalk (sold now by Instantiations at v. 9.0), Java, C++ 
and COBOL.  One of the (largely unthought) reasons for Smalltalk’s 
difficulties in the 1990’s, when hardware could run it decently, was 
that it took a fair number of resources/time to write a decent version, 
while using it would have been a bigger advantage to smaller companies 
than to the companies with the money to develop one.  The result was 
that only a few, very expensive versions were publicly available.  VA 
Smalltalk still retails at ~$8500 / seat.


Those kinds of hazy (because not admitted to oneself) reasons for doing 
things end up resulting in apparently contradictory actions such as 
spending large amounts writing something, releasing it, then failing to 
support it with any sales or marketing push, and even actively 
undermining it.  Nobody wants to fully admit that inefficiencies are 
actually to their advantage, which is the reason it’s repressed 
(implying both known /and/ not known, simultaneously).


I’m totally speculating of course and may be dead wrong, but it fits 
with other IBM actions and non-actions.  IBM is a strange company that 
sees itself, partly for good reason, as a business that must make money 
/and/ as an international resource that must continue to exist. Though 
the latter depends to a degree on the former, they don’t always imply 
the same specific decisions.


Interestingly, to prove the scalability of a VM based system IBM wrote 
“RVM” (originally meaning “Renaissance VM”), and proved near linear 
scaling to 1024 cores, but RVM is a VM for Squeak and earlier versions 
of Pharo, not IBM Smalltalk (the source is available, on GitHub I believe).


https://github.com/smarr/RoarVM

I wouldn't say it is IBM, instead that it is David Ungar work (of Self 
and a few other things)...


Has probably ties to the Jikes RVM as well.

Arca Noae (meaning “New Box”), the company that released v.5.0 in June, 
was set up because too many big customers can’t migrate crucial apps 
from OS/2 to anything else.  The new version looks more modern, 
borrowing icons and other things from Linux, mainly KDE.  It can run a 
fair number of Win32 apps, and supports virtually all modern hardware, 
scaling to 128 threads and 16GB RAM, though it’s still 32 bit in most 
senses.


As you can imagine, given the base requirements are a Pentium Pro with 
64MB RAM, on an average laptop today it flies.


I'm not nostalgic, but the object model and how it was handling 
versionning was cool.


Anybody remember Taligent?

Thierry



Andrew

Sent from Mail  for 
Windows 10


*From: *Richard Sargent 
*Sent: *Monday, November 6, 2017 11:55 AM
*To: *'Any question about pharo is welcome' 

*Subject: *Re: [Pharo-users] perspective request for those earning 
alivingfromSmalltalk


Andrew,

I worked with OS/2 in the early 90s and really liked it; I adopted it 
for my personal use as well. I really enjoyed reading the details you 
provided earlier.


I have a hypothesis that when IBM tried to sell OS/2 (Warp) via a retail 
channel that it "hurt". A company whose DNA was channel sales would find 
dealing with retail issues to be entirely different from everything they 
knew. So, I speculate that there were enough people to felt (and argued) 
that OS/2 wasn't "worth it".


Any thoughts you would care to share on that supposition would be 
appreciated.


*From:*Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] *On 
Behalf Of *Andrew Glynn

*Sent:* November 6, 2017 04:18
*To:* Any question about pharo is welcome
*Subject:* Re: [Pharo-users] perspective request for those earning a 
livingfromSmalltalk


Thank you.  I will see if I can get to it today or tomorrow.

Andrew

Sent from Mail  for 
Windows 10


*From: *Davorin Rusevljan 
*Sent: *Monday, November 6, 2017 4:17 AM
*To: *Any question about pharo is welcome 

*Subject: *Re: [Pharo-users] perspective request for those earning a 
livingfromSmalltalk


On Sat, Oct 28, 2017 at 7:59 PM, Andrew Glynn > wrote:


Your history is accurate, but there’s a few things I’d  like to add,
due to having been employed by IBM at exactly that period working
specifically on VisualAge, not only for Smalltalk, but for Java, C++
and Cobol as well.  (my NDA’s finally having expired also helps
😉).  It’s not a correction or contradiction, but a complement to
your description, providing a relevant but different perspective.

Andrew,

please find a way to write an arti

Re: [Pharo-users] Binary Decision Diagram Package in Smalltalk

2017-11-07 Thread Thierry Goubier
Hi Andrew, Steffen,

2017-11-07 13:10 GMT+01:00 Prof. Andrew P. Black :

>
> > On 28 Oct 2017, at 17:37 , Steffen Märcker  wrote:
> >
> > Does that mean the sets/bdd would be constructed mainly at comile time?
> Anyway, Andrew, feel free to contact me, I might help you with this.
> >
>
> Thanks for the offer, Steffen!  The problem is that I need to use SmaCC
> for my current project, and really do not have a month to take off and
> re-design the way that it builds its scanner.  I’ve talked to Thierry
> Goubier about, and he doesn’t have time either!  It would be a fun project,
> though, and it ought to be fairly separate from other parts of SmaCC.  I’ve
> spent a fair bit of time thinking about how to do it, but don’t think that
> I will be able to actually focus on it.
>

Yes, this is the essence of the issue. There are a few alternatives about
it, but none we have the time to pursue.


>
> An alternative approach, which Thierry has suggested, is to make SmaCC
> work on the UTF-8 representation of the Unicode.  Then we could represent
> character sets as prefix trees.  But the core problem would still exist:
> you can’t run an algorithm that repeatedly executes
>
> for all characters in the alphabet do:
>
> when there are 2^21 characters in the alphabet!
>

The main issue is that `for all characters`... All the literature on
scanner building uses 'for all characters do'.

Thierry


>
> Andrew
>
>
>
>
>


Re: [Pharo-users] Binary Decision Diagram Package in Smalltalk

2017-11-07 Thread Thierry Goubier

Le 07/11/2017 à 23:00, Steffen Märcker a écrit :
I am not familiar with the literature on scanners. May I ask you about 
some details on the "for all characters" algorithms you are referring to?


The two main ones available, from the typical Aho/Ullman textbook, are:

- NFA to DFA conversion (i.e. build a NFA with your regular expressions, 
then convert it to a DFA)


- Direct regular expression to DFA construction

Both of them have loop of the type:

for (each input symbol a) {
...

Building a (or connecting to) a BDD library would be fun, indeed. But 
within that time frame it seems not realistic. Anyway, after finishing 
my thesis, I'd like to come back to that idea.


It would certainly be interesting. Please contact us again when you'll 
have time :)


Regards,

Thierry


Ciao, Steffen


Am 7. November 2017 16:33:03 MEZ schrieb Andrew Glynn :

A possible way to accomplish it would be to use an object graph with
an incremental query engine, such as EMF/CDO with Viatra or
something similar.  You could then put different character sets in
connected objects and query only as far as you need to.

Andrew Glynn

Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
    Windows 10

    *From: *Thierry Goubier <mailto:thierry.goub...@gmail.com>
*Sent: *Tuesday, November 7, 2017 7:17 AM
*To: *Any question about pharo is welcome
<mailto:pharo-users@lists.pharo.org>
*Subject: *Re: [Pharo-users] Binary Decision Diagram Package in
Smalltalk

Hi Andrew, Steffen,

2017-11-07 13:10 GMT+01:00 Prof. Andrew P. Black mailto:bl...@cs.pdx.edu>>:


 > On 28 Oct 2017, at 17:37 , Steffen Märcker mailto:merk...@web.de>> wrote:
 >
 > Does that mean the sets/bdd would be constructed mainly at
comile time? Anyway, Andrew, feel free to contact me, I might
help you with this.
 >

Thanks for the offer, Steffen!  The problem is that I need to
use SmaCC for my current project, and really do not have a month
to take off and re-design the way that it builds its scanner. 
I’ve talked to Thierry Goubier about, and he doesn’t have time

either!  It would be a fun project, though, and it ought to be
fairly separate from other parts of SmaCC.  I’ve spent a fair
bit of time thinking about how to do it, but don’t think that I
will be able to actually focus on it.

Yes, this is the essence of the issue. There are a few alternatives
about it, but none we have the time to pursue.


An alternative approach, which Thierry has suggested, is to make
SmaCC work on the UTF-8 representation of the Unicode.  Then we
could represent character sets as prefix trees.  But the core
problem would still exist: you can’t run an algorithm that
repeatedly executes

                 for all characters in the alphabet do:

when there are 2^21 characters in the alphabet!

The main issue is that `for all characters`... All the literature on
scanner building uses 'for all characters do'.

Thierry


         Andrew








Re: [Pharo-users] Binary Decision Diagram Package in Smalltalk

2017-11-08 Thread Thierry Goubier
Hi Steffen,

in fact, I considered B) directly, but not up to the point of building onto
C) and D) (with an obvious A, but that one is a given in Pharo
implementation of strings).

Thanks for the explanation, then.

Regards,

Thierry

2017-11-08 14:21 GMT+01:00 Steffen Märcker :

> I see. How about the following (sketched) solution to avoid looping over
> all characters? It might be very well the case that you already considered
> (and dismissed) that path.
>
> A) Assumption
> In order to allow any meaningful matching, the input to the scanner is
> normalized according to the unicode spec.
>
> B) Abstraction
> Treat each character and character group of an regex as a set of intervals
> in the unicode code points. Lets call them "character tests" and lift the
> common set operations union, intersection and difference to them.
>
> C) Construct NFA
> NFA has potentially overlapping character tests at the transitions of each
> state.
>
> D) Construct DFA
> Given a product state s in the DFA and two transitions t1, t2 from the
> original NFA, add three new transitions to the DFA:
> - a transition labeled with the character test of t1 minus the character
> test of t2
> - a transition labeled with the intersection of the character tests of t1
> and t2
> - a transition labeled with the character test of t2 minus the character
> test of t1
>
> E) Extension
> Instead of sets of unicode intervals we could also use test-functions,
> e.g. blocks. Then, in step D), the set operations are translated to boolean
> operations:
> - difference t1 - t2 becomes: t1 && not t2
> - intersection of t1 and t2 becomes: t1 && t2
> This would allow to use optimized test functions, e.g., bdds, instead of
> relying on charcter tests only.
>
>
> Cheers,
> Steffen
>
>
>
>
>
> Am .11.2017, 23:16 Uhr, schrieb Thierry Goubier  >:
>
> Le 07/11/2017 à 23:00, Steffen Märcker a écrit :
>>
>>> I am not familiar with the literature on scanners. May I ask you about
>>> some details on the "for all characters" algorithms you are referring to?
>>>
>>
>> The two main ones available, from the typical Aho/Ullman textbook, are:
>>
>> - NFA to DFA conversion (i.e. build a NFA with your regular expressions,
>> then convert it to a DFA)
>>
>> - Direct regular expression to DFA construction
>>
>> Both of them have loop of the type:
>>
>> for (each input symbol a) {
>> ...
>>
>> Building a (or connecting to) a BDD library would be fun, indeed. But
>>> within that time frame it seems not realistic. Anyway, after finishing my
>>> thesis, I'd like to come back to that idea.
>>>
>>
>> It would certainly be interesting. Please contact us again when you'll
>> have time :)
>>
>> Regards,
>>
>> Thierry
>>
>> Ciao, Steffen
>>>   Am 7. November 2017 16:33:03 MEZ schrieb Andrew Glynn <
>>> aglyn...@gmail.com>:
>>>      A possible way to accomplish it would be to use an object graph with
>>> an incremental query engine, such as EMF/CDO with Viatra or
>>> something similar.  You could then put different character sets in
>>> connected objects and query only as far as you need to.
>>>  Andrew Glynn
>>>  Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
>>> Windows 10
>>>  *From: *Thierry Goubier <mailto:thierry.goub...@gmail.com>
>>> *Sent: *Tuesday, November 7, 2017 7:17 AM
>>> *To: *Any question about pharo is welcome
>>> <mailto:pharo-users@lists.pharo.org>
>>> *Subject: *Re: [Pharo-users] Binary Decision Diagram Package in
>>> Smalltalk
>>>  Hi Andrew, Steffen,
>>>  2017-11-07 13:10 GMT+01:00 Prof. Andrew P. Black >> <mailto:bl...@cs.pdx.edu>>:
>>>> On 28 Oct 2017, at 17:37 , Steffen Märcker >> <mailto:merk...@web.de>> wrote:
>>>  >
>>>  > Does that mean the sets/bdd would be constructed mainly at
>>> comile time? Anyway, Andrew, feel free to contact me, I might
>>> help you with this.
>>>  >
>>>  Thanks for the offer, Steffen!  The problem is that I need to
>>> use SmaCC for my current project, and really do not have a month
>>> to take off and re-design the way that it builds its scanner.
>>>  I’ve talked to Thierry Goubier about, and he doesn’t have time
>>> either!  It would be a f

Re: [Pharo-users] Unable to load SmaCC on pharo6 (or pharo5)

2017-11-09 Thread Thierry Goubier

Hi Frederico,

could you try in a Pharo6.1 image

Metacello new
baseline: 'SmaCC';
repository: 'github://ThierryGoubier/SmaCC';
load

SmaCC has a fairly complex set of dependencies, so loading it via the 
baseline should be the preferred way.


Don't hesitate to ask if you have questions on SmaCC.

Regards,

Thierry



Le 09/11/2017 à 19:06, Federico.Balaguer a écrit :

I would like to check if I need to use SmaCC for a project. I tried to
install it on Pharo 6.1 32bits with iceberg but I was not able to do it.

Then I tried to get SmaCC on an Pharo5 and Pharo6  images with "Catalog
Browser" but I was not able to do it neither. The tool did pop up a message
saying that Smacc was not tested for Pharo6 which was nice.

Then I tried to clone the git repository to my local machine,  I pointed
iceberg to that local repository and then I loaded each package by hand. I
was able to load BaselineOfSmaccBrowser but SmaCC-Rewrite-Engine failed to
load with a debugger with a list of classes and methods that are missing
(they are listed at the end of this message).

Could some give an idea how to fix this?

Thanks. Federico


This package depends on the following classes:
   SmaCCStringInterval
   SmaCCParseNodeVisitor
   SmaCCScanner
   SmaCCParseNode
   SmaCCParser
   SmaCCString
You must resolve these dependencies before you will be able to load these
definitions:
   SmaCCAnnotatedString
   SmaCCAnnotatedString>>#addAnnotationTo:
   SmaCCAnnotatedString>>#intervalClass
   SmaCCAnnotatedString>>#newIntervalFor:
   SmaCCAnnotatedString>>#node
   SmaCCAnnotatedString>>#node:
   SmaCCAnnotatedString>>#removeInterval:
   SmaCCAnnotatedString>>#rule
   SmaCCAnnotatedString>>#rule:
   SmaCCAnnotatedStringInterval
   SmaCCAnnotatedStringInterval>>#addAllAnnotations:
   SmaCCAnnotatedStringInterval>>#addAnnotation:
   SmaCCAnnotatedStringInterval>>#annotations
   SmaCCAnnotatedStringInterval>>#annotations:
   SmaCCAnnotatedStringInterval>>#canBeMergedWith:
   SmaCCAnnotatedStringInterval>>#postCopy
   SmaCCCodeReplaceExpression
   SmaCCCodeReplaceExpression>>#acceptVisitor:
   SmaCCCodeReplaceExpression>>#code
   SmaCCCodeReplaceExpression>>#code:
   SmaCCCodeReplaceExpression>>#evaluateInContext:
   SmaCCCodeReplaceExpression>>#method
   SmaCCCodeReplaceExpression>>#tokenVariables
   SmaCCCompositeReplaceExpression
   SmaCCCompositeReplaceExpression>>#acceptVisitor:
   SmaCCCompositeReplaceExpression>>#compositeNodeVariables
   SmaCCCompositeReplaceExpression>>#evaluateInContext:
   SmaCCCompositeReplaceExpression>>#expressions
   SmaCCCompositeReplaceExpression>>#expressions:
   SmaCCCompositeReplaceExpression>>#initialize
   SmaCCNodeReplaceExpression
   SmaCCNodeReplaceExpression>>#acceptVisitor:
   SmaCCNodeReplaceExpression>>#addPostfixTo:inContext:
   SmaCCNodeReplaceExpression>>#addPrefixTo:inContext:
   SmaCCNodeReplaceExpression>>#afterPostfix
   SmaCCNodeReplaceExpression>>#afterPostfix:
   SmaCCNodeReplaceExpression>>#afterWhitespace
   SmaCCNodeReplaceExpression>>#afterWhitespace:
   SmaCCNodeReplaceExpression>>#beforePrefix
   SmaCCNodeReplaceExpression>>#beforePrefix:
   SmaCCNodeReplaceExpression>>#beforeWhitespace
   SmaCCNodeReplaceExpression>>#beforeWhitespace:
   SmaCCNodeReplaceExpression>>#evaluateInContext:
   SmaCCNodeReplaceExpression>>#name
   SmaCCNodeReplaceExpression>>#name:
   SmaCCNodeReplaceExpression>>#postfix
   SmaCCNodeReplaceExpression>>#postfix:
   SmaCCNodeReplaceExpression>>#prefix
   SmaCCNodeReplaceExpression>>#prefix:
   SmaCCNodeReplaceExpression>>#tokenVariables
   SmaCCReplaceExpression
   SmaCCReplaceExpression>>#acceptVisitor:
   SmaCCReplaceExpression>>#evaluateInContext:
   SmaCCReplaceExpressionParser
   SmaCCReplaceExpressionParser>>#cacheId
   SmaCCReplaceExpressionParser>>#definitionComment
   SmaCCReplaceExpressionParser>>#scannerClass
   SmaCCReplaceExpressionParser>>#startingStateForExpression
   SmaCCReplaceExpressionParser>>#reduceActionForCodeReplace1:
   SmaCCReplaceExpressionParser>>#reduceActionForExpression1:
   SmaCCReplaceExpressionParser>>#reduceActionForNodeReplace1:
   SmaCCReplaceExpressionParser>>#reduceActionForPostfixModifiers1:
   SmaCCReplaceExpressionParser>>#reduceActionForPrefixModifiers1:
   SmaCCReplaceExpressionParser>>#reduceActionForPrefixModifiers2:
   SmaCCReplaceExpressionParser>>#reduceActionForRewriteExpression3:
   SmaCCReplaceExpressionParser>>#reduceActionForRewriteExpressions1:
   SmaCCReplaceExpressionParser>>#reduceActionForRewriteExpressions2:
   SmaCCReplaceExpressionParser>>#reduceActionForStringReplace1:
   SmaCCReplaceExpressionParser>>#reduceActionForSwitchStateToCode1:
   SmaCCReplaceExpressionParser>>#reduceActionForSwitchStateToDefault1:
   SmaCCReplaceExpressionParser>>#reduceActionForSwitchStateToExpression1:
   SmaCCReplaceExpressionParser>>#reduceTable
   SmaCCReplaceExpressionParser>>#symbolNames
   SmaCCReplaceExpressionParser>>#symbolTypes
   SmaCCReplaceExpressionParser>>#transitionTable
   

Re: [Pharo-users] Unable to load SmaCC on pharo6 (or pharo5)

2017-11-09 Thread Thierry Goubier

Le 09/11/2017 à 20:15, Federico.Balaguer a écrit :

I am following this tutorial

http://files.pharo.org/books-pdfs/booklet-Smacc/2017-05-05-Smacc-Spiral.pdf

I typed the first example and when I try to compile either LR(1) or LALR(1)
there is a pop-up saying that both clases where not specified. I also tried
adding the classes for the scanner and parser manually but I got the result.


Yes. I changed the GUI and that means I need to update the booklet.

This part:

• Edit the definition the pane below the compile LR(1) buttons.
• Once you are done:
– Click on the Scanner class and type ExpressionScanner.
– Click on the Parser class and type ExpressionParser.
• press either Compiler LR(1) or Compiled LALR(1) buttons.

Should now be:

• Edit the definition the pane below the compile LR(1) buttons.
• Once you are done:
– Type ExpressionParser and return in the text field left of Parser:.
• press either Compiler LR(1) or Compiled LALR(1) buttons.


There are a couple other things in the tutorial at the very start that
didn't add up. I can send an annotated pdf if that is of any help


Yes, that would be very helpfull!

Thanks,

Thierry



Thanks!!

Federico



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html







Re: [Pharo-users] Unable to load SmaCC on pharo6 (or pharo5)

2017-11-09 Thread Thierry Goubier

Le 09/11/2017 à 21:02, Stephane Ducasse a écrit :

Yes thierry :) your turn now :)


That's will be harder than I expected. I have issues in the LaTeX setup 
used by the booklet.


Thierry



Stef

On Thu, Nov 9, 2017 at 8:41 PM, Thierry Goubier
 wrote:

Le 09/11/2017 à 20:15, Federico.Balaguer a écrit :


I am following this tutorial


http://files.pharo.org/books-pdfs/booklet-Smacc/2017-05-05-Smacc-Spiral.pdf

I typed the first example and when I try to compile either LR(1) or
LALR(1)
there is a pop-up saying that both clases where not specified. I also
tried
adding the classes for the scanner and parser manually but I got the
result.



Yes. I changed the GUI and that means I need to update the booklet.

This part:

• Edit the definition the pane below the compile LR(1) buttons.
• Once you are done:
– Click on the Scanner class and type ExpressionScanner.
– Click on the Parser class and type ExpressionParser.
• press either Compiler LR(1) or Compiled LALR(1) buttons.

Should now be:

• Edit the definition the pane below the compile LR(1) buttons.
• Once you are done:
– Type ExpressionParser and return in the text field left of Parser:.
• press either Compiler LR(1) or Compiled LALR(1) buttons.


There are a couple other things in the tutorial at the very start that
didn't add up. I can send an annotated pdf if that is of any help



Yes, that would be very helpfull!

Thanks,

Thierry




Thanks!!

Federico



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html













Re: [Pharo-users] SmaCC UI Problem solved but only when breakpoint was added

2017-11-10 Thread Thierry Goubier
Hi Frederico,

I think what is happening is one needs to accept (press return) in the
scanner and parser test fields, for the names to be taken into account.
Otherwise, they keep that non-accepted status (the orange triangle
appearing in top-right of the text fields). Can you check if it was the
case?

I will see to add either a warning or a way to trigger an accept (or an
auto-accept) on those text fields.

Regards,

Thierry




2017-11-10 13:09 GMT+01:00 Federico.Balaguer :

> Hello
>
> I am progressing with my use of SmaCC and I think a found the source of the
> problem that makes it impossible to generete the classes for the parser and
> scanner.
>
> Scenario
> 1)  I gave the name for both classes: the parser and the scanner.
> 2) I copy the very simple first part of the tutorial
> 3) I clicked on the Compile LR(1) button and a window popped up with the
> label: "Both classes are not specified"
>
> Problem:
> At the time the method SmaCCDevelopmentUI>>compile: was invoked the
> expression self parserClassString returns an empty string (although I
> entered the name of a class on the UI)
>  I found that the "parserClassMorph" did not hold the name of the class
>
> Then I breakpointed the method SmaCCDevelopmentUI>>addParseClass: and I
> entered a new name for the class of my parser and I follow with the
> debugger
> the execution that follows the invocation of the method. Everything works
> as
> expected.
>
> I changed the name again but the method SmaCCDevelopmentUI>>addParseClass:
> (the one with a breakpoint) was not called again.
>
> I think it is a problem related to Morph . I am a complete ignorant on
> Morph
> (among other things) so it is hard for me to fix the problem.
>
> I hope this message helps fix the issue
>
> Federico
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] Unable to load SmaCC on pharo6 (or pharo5)

2017-11-11 Thread Thierry Goubier

Hi Steff,

Le 10/11/2017 à 19:17, Stephane Ducasse a écrit :

Hi thierry

we are working and soon we will have a much simpler installation and
everything :)


Out of a minimal image? That would be very cool.


Now just commit and I will check and fix :)


I committed, created a pull request and merged. It should be Ok apart from:

- can hyphenating be desactivated in ==sequences==? It is allways 
strange to see a class name or a method name split by a hypen, like in 
SmaCC-Parser


- how does one writes a reference to a section or a chapter?

Thierry



Stef

On Fri, Nov 10, 2017 at 6:47 AM, Thierry Goubier
 wrote:

Le 09/11/2017 à 21:02, Stephane Ducasse a écrit :


Yes thierry :) your turn now :)



That's will be harder than I expected. I have issues in the LaTeX setup used
by the booklet.

Thierry




Stef

On Thu, Nov 9, 2017 at 8:41 PM, Thierry Goubier
 wrote:


Le 09/11/2017 à 20:15, Federico.Balaguer a écrit :



I am following this tutorial



http://files.pharo.org/books-pdfs/booklet-Smacc/2017-05-05-Smacc-Spiral.pdf

I typed the first example and when I try to compile either LR(1) or
LALR(1)
there is a pop-up saying that both clases where not specified. I also
tried
adding the classes for the scanner and parser manually but I got the
result.




Yes. I changed the GUI and that means I need to update the booklet.

This part:

• Edit the definition the pane below the compile LR(1) buttons.
• Once you are done:
– Click on the Scanner class and type ExpressionScanner.
– Click on the Parser class and type ExpressionParser.
• press either Compiler LR(1) or Compiled LALR(1) buttons.

Should now be:

• Edit the definition the pane below the compile LR(1) buttons.
• Once you are done:
– Type ExpressionParser and return in the text field left of Parser:.
• press either Compiler LR(1) or Compiled LALR(1) buttons.


There are a couple other things in the tutorial at the very start that
didn't add up. I can send an annotated pdf if that is of any help




Yes, that would be very helpfull!

Thanks,

Thierry




Thanks!!

Federico



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



















Re: [Pharo-users] RB refactoring rewrite variable to a symbol

2017-11-11 Thread Thierry Goubier

Hi Peter,
Hi Peter,

you should try {:node :dic | ... } to handle that.

Something like:

RBParseTreeRewriter new
replace: '`@var `{:node :dic | dic at: #varName put: node name} := 
`@arg'
with: 'self write: `@arg into: `{:dic |
RBParser parseExpression: ''#'', (dic at: #varName) }'.

You need to adjust, I haven't checked if this is correct ;).

Thierry


Le 11/11/2017 à 17:17, Peter Uhnák a écrit :

Hi,

how can I rewrite a(n instance) variable to a symbol?

E.g.

[IN]
something: aSomething
     something := aSomething

[OUT]
something: aSomething
     self write: aSomething into: #something


I can capute the input just fine... ``@var := ``@arg
but I have no idea how to convert the var into a symbol (or string).

Thanks,
Peter






Re: [Pharo-users] Catching EOF in SmaCC

2017-11-17 Thread Thierry Goubier

Hi Andrew,

there is an 'E O F' token generated by SmaCC; I haven't tried to use it 
in a parser yet.


The second is used in the Python2 parser. See:

https://github.com/ThierryGoubier/SmaCC/blob/master/SmaCC-Python.package/PythonScanner2.class/instance/scannerError.st

Regards,

Thierry

Le 17/11/2017 à 04:11, Prof. Andrew P. Black a écrit :

Is there a way, in SmaCC, or either

- writing a grammar production that involves EOF (end of file)
- or, writing a scanner action that is executed when EOF is read.

Andrew








Re: [Pharo-users] Catching EOF in SmaCC

2017-11-17 Thread Thierry Goubier

Hi Andrew,

Le 17/11/2017 à 12:26, Prof. Andrew P. Black a écrit :



On 17 Nov 2017, at 14:10 , Thierry Goubier  wrote:


there is an 'E O F' token generated by SmaCC; I haven't tried to use it in a 
parser yet.


I tried patching the tokenActions table to trap on this, but the token id for E 
O F is outside of the range of the table.   The Python example that you pointed 
me to is a little different.  It overrides scannerError, and explicitly adds a 
newline token if there is an error at the end of the file.  It doesn’t actually 
use the E O F token, but it is probably a pattern that I can steal.


In all honesty, I wasn't thinking about that, but instead to be able to 
write '' in the grammar itself to terminate statements.


The Python approach is necessary because you may have to emit additional 
dedent tokens at the end of a file (this is a typical issue of those 
meaningfull identation whitespace languages: an idea used in the very 
beginning of programming languages, then considered harmfull, then 
coming back up again...).




In the meantime, I made the final StatementSeparator ( or ";") 
optional in all the productions.  The grammar is a bit ugly, but the parser is cleaner.


Which is the cleanest way to do it (at least, like that, you have a 
documented way around that instead of carrying around a grammar + hacks 
in the scanner)(*)



I also gave up trying to eliminate intermediate parseTree nodes.  Instead, I 
eliminated intermediate productions form the grammar.  This makes the grammar 
more ugly (it has several repetitions where I inlined the intermediate 
productions), but the
tree construction is a lot more straightforward.


Sorry for having been unable to answer your questions on that :( I'm 
happy to learn you've found a way around it.


Thierry

(*) Which is still way better than a hand-written, recursive descent 
parser where any line can hide a hack...



Andrew








Re: [Pharo-users] Metacello with Git

2017-12-20 Thread Thierry Goubier

Hi Pierce,

Le 20/12/2017 à 17:17, Pierce Ng a écrit :

On Tue, Dec 19, 2017 at 07:07:16PM -0800, Dale Henrichs wrote:

I am under the impression that iceberg is able to authenticate with
SSH keys  I am not a pharo/iceberg user myself, but it seems
that iceberg should be able to fill that gap.


Iceberg does, with RSA keys. Iceberg didn't work for me with ED25519 keys.


does command line git work with those ED25519 keys?

Regards,

Thierry



Pierce








Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Thierry Goubier
2018-01-10 14:26 GMT+01:00 Serge Stinckwich :

>
>
> On Wed, Jan 10, 2018 at 2:23 PM, Julien 
> wrote:
>
>> Hello Serge,
>>
>> Do you mean pieces of code you wrote in Python using Numpy that you want
>> to transform to Smalltalk code using PolyMath?
>>
>> It’s kind of the other way around of this project. :-)
>>
>>
> ​yes this is exactly the opposite :-(​
> ​I guess I need a Python parser and after that I can do AST transformation
> ...
>

Hi Serge,

there is a Python2.7 parser with AST that could be used.

Thierry


> Or using regex I can do basic stuff ...​
>
> --
> Serge Stinckwich
> UMI UMMISCO 209 (IRD/UPMC/UY1)
> "Programs must be written for people to read, and only incidentally for
> machines to execute."http://www.doesnotunderstand.org/
>


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-10 Thread Thierry Goubier
2018-01-10 14:41 GMT+01:00 Serge Stinckwich :

>
>
> On Wed, Jan 10, 2018 at 2:35 PM, Thierry Goubier <
> thierry.goub...@gmail.com> wrote:
>
>>
>>
>> 2018-01-10 14:26 GMT+01:00 Serge Stinckwich :
>>
>>>
>>>
>>> On Wed, Jan 10, 2018 at 2:23 PM, Julien 
>>> wrote:
>>>
>>>> Hello Serge,
>>>>
>>>> Do you mean pieces of code you wrote in Python using Numpy that you
>>>> want to transform to Smalltalk code using PolyMath?
>>>>
>>>> It’s kind of the other way around of this project. :-)
>>>>
>>>>
>>> ​yes this is exactly the opposite :-(​
>>> ​I guess I need a Python parser and after that I can do AST
>>> transformation ...
>>>
>>
>> Hi Serge,
>>
>> there is a Python2.7 parser with AST that could be used.
>>
>
>
> ​yes I might have a look ... where is the code ?
>

SmaCC on github. Look for SmaCC-Python and SmaCC-Python-Tests.If you're
using Moose,
you should be able to import just SmaCC-Python from the github repository.
There is even a
BaselineOfPythonParser, but I haven't used it.

Thierry


> ​
>
> --
> Serge Stinckwich
> UMI UMMISCO 209 (IRD/UPMC/UY1)
> "Programs must be written for people to read, and only incidentally for
> machines to execute."http://www.doesnotunderstand.org/
>


Re: [Pharo-users] [ANN] Python3Generator and MatplotLibBridge

2018-01-11 Thread Thierry Goubier
Hi Stef,

it's the one done with Damien, 3 or 4 years ago.

Thierry

2018-01-11 8:23 GMT+01:00 Stephane Ducasse :

> Hi Thierry
>
> One of these days I think that I will have to have a look at it :)
>
> Stef
>
> On Wed, Jan 10, 2018 at 2:35 PM, Thierry Goubier <
> thierry.goub...@gmail.com> wrote:
>
>>
>>
>> 2018-01-10 14:26 GMT+01:00 Serge Stinckwich :
>>
>>>
>>>
>>> On Wed, Jan 10, 2018 at 2:23 PM, Julien 
>>> wrote:
>>>
>>>> Hello Serge,
>>>>
>>>> Do you mean pieces of code you wrote in Python using Numpy that you
>>>> want to transform to Smalltalk code using PolyMath?
>>>>
>>>> It’s kind of the other way around of this project. :-)
>>>>
>>>>
>>> ​yes this is exactly the opposite :-(​
>>> ​I guess I need a Python parser and after that I can do AST
>>> transformation ...
>>>
>>
>> Hi Serge,
>>
>> there is a Python2.7 parser with AST that could be used.
>>
>> Thierry
>>
>>
>>> Or using regex I can do basic stuff ...​
>>>
>>> --
>>> Serge Stinckwich
>>> UMI UMMISCO 209 (IRD/UPMC/UY1)
>>> "Programs must be written for people to read, and only incidentally for
>>> machines to execute."http://www.doesnotunderstand.org/
>>>
>>
>>
>


Re: [Pharo-users] Zoomable & Infinitely scrollable PasteupMorph

2014-09-16 Thread Thierry Goubier
For infinitely zoomable interface, an old body of work and research on the
possibilities is Pad++ [http://www.cs.umd.edu/hcil/pad++/] .

Parcplace did some stuff too. Squeak seemed to have something at one point.

Thierry


2014-09-16 15:09 GMT+02:00 Sean P. DeNigris :

> On Sep 16, 2014, at 7:59 AM, "S Krish [via Smalltalk]" <[hidden email]
> > wrote:
> > I am sure it will be lot more involved beyond a point to make everything
> contained zoomable, text editor: text / image , other compositions ,
> layouts being honored properly..
> Yes I assume that text is where things would get complicated
>
> > I am not aware of Self zoom.. need to check on it.
> Self doesn't zoom, but it scrolls infinitely.
> Cheers,
> Sean
>
> --
> View this message in context: Re: Zoomable & Infinitely scrollable
> PasteupMorph
> 
> Sent from the Pharo Smalltalk Users mailing list archive
>  at Nabble.com.
>


Re: [Pharo-users] i "am" back ...

2014-09-19 Thread Thierry Goubier
Welcome back!

You convinced me to have a look at Self, which I didn't in, what, more than
15 years? They even have multiple host windows :)

Thierry

2014-09-19 14:07 GMT+02:00 Mayuresh Kathe :

> hello all,
>
> i had to do it.
> after listening to everybody's comments about my questions to the list, i
> went out and checked on the current state of squeak and self.
>
> looks like squeak and self definitely need a lot of attention from
> experienced developers and visionaries.
>
> since i don't fall squarely in either category, it would be best to work
> with pharo.
>
> also, as someone had mentioned, almost all smalltalk systems have diverged
> too much from the st-80 specification, so why not go for pharo which is so
> highly polished already and is being constantly improved!
>
> so here i am, back in pharo land.
>
> ~mayuresh
>
>
>


Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Thierry Goubier
Thanks Udo;

I reviewed a few techniques for implementing internal / embeddel DSLs in a
host language and I didn't saw this one :)

Thierry

2014-09-23 1:48 GMT+02:00 Udo Schneider :

> All,
>
> I just finished a blog entry. It shows how to use Smalltalk blocks as
> parsers/translators. E.g. translating a Block
>
> [:customer | (customer joinDate year is: Date today year)]
>
> into an SQL-like String
>
> (YEAR(customers.joinDate) = 2014)
>
> The SQL stuff is just an example - you can create nearly any output.
>
> Check out http://readthesourceluke.blogspot.de/2014/09/block-
> translators-parsing-magic.html
>
> Maybe that's old stuff for some of you - but I hope it's interesting for
> some at least :-)
>
> Comments and feedback appreciated.
>
> CU,
>
> Udo
>
>
>


Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Thierry Goubier
2014-09-23 13:35 GMT+02:00 kilon alios :

> yeap noway I compare Regex with PettitParser. I will probably give a
> PettitParser a try, because I try to parse Pharo syntax to Python, I want
> now to parse Pharo classes to python class and that will be a nightmare
> with regex, so time to give PettitParser a serious try.
>


Kilon, just remember that you have a full Smalltalk parser already in your
image, called RBParser.

For Python parsing, there is probably a PetitParser based parser somewhere
and two implementations of a SmaCC-based Python parser (For Python 2.7.X).

Thierry


>
> On Tue, Sep 23, 2014 at 1:10 PM, Udo Schneider <
> udo.schnei...@homeaddress.de> wrote:
>
>> > I have not used PettitParser yet, looks powerful but I find it a bit
>> > weird in design. On the other hand regex is quite ugly and understanding
>> > complex regex a pain.
>> I normally encounter two issues with RegExps:
>>
>> 1) The syntax between different apps/libs/frameworks differs sligtly.
>> Esp. for character classes or greediness. This drove me crazy more than one
>> time.
>> 2) Often enough I realize (while developing the RegExp) that I need
>> something more capable than a Chomsky Type 3 parser (which RegExps are in a
>> way). So I have to use "a bigger gun" - e.g. PetitParser.
>>
>> CU,
>>
>> Udo
>>
>>
>> On 23.09.14 10:15, kilon alios wrote:
>>
>>> it reminds a lot of Kent's Beck Smalltalk Practice Patterns where it
>>> removes all ifs and replaces them with regular unary messages . It is
>>> definitely an elegant way of coding making the code just flow.
>>>
>>> I have not used PettitParser yet, looks powerful but I find it a bit
>>> weird in design. On the other hand regex is quite ugly and understanding
>>> complex regex a pain.
>>>
>>> On Tue, Sep 23, 2014 at 11:07 AM, Udo Schneider
>>> >> > wrote:
>>>
>>> > just as it is black magic for me now :D
>>> The nice thing about this approach is the fact that it "just"
>>> piggybacks the normal Smalltalk message sending. So you can step
>>> through it using the Debugger - it's Smalltalk all the way down.
>>>
>>> I still remember my first shock when (having no formal background on
>>> parsing theory at that time) I saw the parsing tables generated by
>>> T-Gen. Of course it was Smalltalk ... but understanding those tables
>>> was a nightmare.
>>>
>>> PetitParser is the gold standard here IMHO. It is able to parse
>>> arbitrary input (compared to my block expressions only). And you can
>>> still use the Debugger to step through the parsing process *and
>>> still understand what's going on!*
>>>
>>> CU,
>>>
>>> Udo
>>>
>>> On 23.09.14 09:54, kilon alios wrote:
>>>
>>> just as it is black magic for me now :D
>>>
>>> At least I get the general feeling. I am new to parsing too, so
>>> far I
>>> have only played with regex parsing. Not the most smalltalkish
>>> way but
>>> it works well so far.
>>>
>>> On Tue, Sep 23, 2014 at 9:39 AM, Udo Schneider
>>> >> 
>>> >>
>>> >>
>>> wrote:
>>>
>>>  Hi Estaban,
>>>
>>>  I think the first time I saw this pattern was in ReStore on
>>> Dolphin
>>>  Smalltalk. I didn't understand it's implementation back
>>> then. I
>>>  assume that it's similar to what I described though. But
>>> having a
>>>  Smalltalk block automagically creating the equivalent SQL
>>> SELECT
>>>  expression was like black magic at that time :-)
>>>
>>>  CU,
>>>
>>>  Udo
>>>
>>>
>>>
>>>
>>>  On 23.09.14 04:15, Esteban A. Maringolo wrote:
>>>
>>>  Excellent article.
>>>
>>>  I think GLORP uses a similar technique to setup its
>>> expressions, and
>>>  also have issues with #and:/#or: selectors due to
>>> inlining, so
>>>  it uses
>>>  AND:/#OR: instead.
>>>
>>>  Regards!
>>>
>>>  Esteban A. Maringolo
>>>
>>>  pd: Your blog and it's choosen topic made me remember
>>> http://use-the-index-luke.com/
>>>
>>>  2014-09-22 20:48 GMT-03:00 Udo Schneider
>>>  >> 
>>>  >> >>__:
>>>
>>>
>>>  All,
>>>
>>>  I just finished a blog entry. It shows how to use
>>> Smalltalk
>>>  blocks as parsers/translators. E.g. translating a
>>> Block
>>>
>>>[:customer | (customer joinDate year is:
>>> Date
>>>  today year)]
>>>
>>>  

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Thierry Goubier
2014-09-23 13:57 GMT+02:00 Udo Schneider :

> > yeap noway I compare Regex with PettitParser. I will probably give a
> > PettitParser a try, because I try to parse Pharo syntax to Python, I
> > want now to parse Pharo classes to python class and that will be a
> > nightmare with regex, so time to give PettitParser a serious try.
> Without wanting to go too deep into theory... Parsing Pharo or Python
> would definitely need a Chromsky Type 2 language (Context free grammar). So
> you'd be out of luck parsing Smalltalk or Python code with Regular
> Expressions (Chromsky Type 3) only - except maybe for some very simple
> expressions.
>

Confirmed in even a better way: given how convoluted and hacky is writing a
full Python Parser, it is probably not even a Context Free Grammar.

That is: the Python grammar is LALR which is a subset of Context Free
Grammar (but already more than a type 3 Chomsky grammar), but the Lexer is
a fair bit more than usual (dedent tokens come to mind; special handling of
end of lines as well).

I think you need a fair bit of special magic in PetitParser to parse Python.

Luckily, Python is well documented in that regard.

Thierry


>
> CU,
>
> Udo
>
>
> On 23.09.14 13:35, kilon alios wrote:
>
>> yeap noway I compare Regex with PettitParser. I will probably give a
>> PettitParser a try, because I try to parse Pharo syntax to Python, I
>> want now to parse Pharo classes to python class and that will be a
>> nightmare with regex, so time to give PettitParser a serious try.
>>
>> On Tue, Sep 23, 2014 at 1:10 PM, Udo Schneider
>> > > wrote:
>>
>> > I have not used PettitParser yet, looks powerful but I find it a bit
>> > weird in design. On the other hand regex is quite ugly and
>> understanding
>> > complex regex a pain.
>> I normally encounter two issues with RegExps:
>>
>> 1) The syntax between different apps/libs/frameworks differs
>> sligtly. Esp. for character classes or greediness. This drove me
>> crazy more than one time.
>> 2) Often enough I realize (while developing the RegExp) that I need
>> something more capable than a Chomsky Type 3 parser (which RegExps
>> are in a way). So I have to use "a bigger gun" - e.g. PetitParser.
>>
>> CU,
>>
>> Udo
>>
>>
>> On 23.09.14 10:15, kilon alios wrote:
>>
>> it reminds a lot of Kent's Beck Smalltalk Practice Patterns where
>> it
>> removes all ifs and replaces them with regular unary messages .
>> It is
>> definitely an elegant way of coding making the code just flow.
>>
>> I have not used PettitParser yet, looks powerful but I find it a
>> bit
>> weird in design. On the other hand regex is quite ugly and
>> understanding
>> complex regex a pain.
>>
>> On Tue, Sep 23, 2014 at 11:07 AM, Udo Schneider
>> > 
>> > >>
>> wrote:
>>
>>  > just as it is black magic for me now :D
>>  The nice thing about this approach is the fact that it "just"
>>  piggybacks the normal Smalltalk message sending. So you can
>> step
>>  through it using the Debugger - it's Smalltalk all the way
>> down.
>>
>>  I still remember my first shock when (having no formal
>> background on
>>  parsing theory at that time) I saw the parsing tables
>> generated by
>>  T-Gen. Of course it was Smalltalk ... but understanding
>> those tables
>>  was a nightmare.
>>
>>  PetitParser is the gold standard here IMHO. It is able to
>> parse
>>  arbitrary input (compared to my block expressions only).
>> And you can
>>  still use the Debugger to step through the parsing process
>> *and
>>  still understand what's going on!*
>>
>>  CU,
>>
>>  Udo
>>
>>  On 23.09.14 09:54, kilon alios wrote:
>>
>>  just as it is black magic for me now :D
>>
>>  At least I get the general feeling. I am new to parsing
>> too, so
>>  far I
>>  have only played with regex parsing. Not the most
>> smalltalkish
>>  way but
>>  it works well so far.
>>
>>  On Tue, Sep 23, 2014 at 9:39 AM, Udo Schneider
>>  > 
>>  > >
>>  > __homead__dress.de 
>>
>>
>>  > >  wrote:
>>
>>  

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Thierry Goubier
2014-09-23 15:57 GMT+02:00 Udo Schneider :

> > Confirmed in even a better way: given how convoluted and hacky is
> > writing a full Python Parser, it is probably not even a Context Free
> > Grammar.
> Let's agree on the fact that you'll be able to parse it using Context
> Sensitive Grammar (Type 1) for sure ... and if you're very lucky Context
> Free (Type 2) might be sufficient but PITA to write and maintain. Agreed?
> :-)
>

Agreed :)

Thierry


>
> CU,
>
> Udo
>
>
>
> On 23.09.14 14:20, Thierry Goubier wrote:
>
>>
>>
>> 2014-09-23 13:57 GMT+02:00 Udo Schneider > <mailto:udo.schnei...@homeaddress.de>>:
>>
>>
>> > yeap noway I compare Regex with PettitParser. I will probably give a
>> > PettitParser a try, because I try to parse Pharo syntax to Python, I
>> > want now to parse Pharo classes to python class and that will be a
>> > nightmare with regex, so time to give PettitParser a serious try.
>> Without wanting to go too deep into theory... Parsing Pharo or
>> Python would definitely need a Chromsky Type 2 language (Context
>> free grammar). So you'd be out of luck parsing Smalltalk or Python
>> code with Regular Expressions (Chromsky Type 3) only - except maybe
>> for some very simple expressions.
>>
>>
>> Confirmed in even a better way: given how convoluted and hacky is
>> writing a full Python Parser, it is probably not even a Context Free
>> Grammar.
>>
>> That is: the Python grammar is LALR which is a subset of Context Free
>> Grammar (but already more than a type 3 Chomsky grammar), but the Lexer
>> is a fair bit more than usual (dedent tokens come to mind; special
>> handling of end of lines as well).
>>
>> I think you need a fair bit of special magic in PetitParser to parse
>> Python.
>>
>> Luckily, Python is well documented in that regard.
>>
>> Thierry
>>
>>
>> CU,
>>
>> Udo
>>
>>
>> On 23.09.14 13:35, kilon alios wrote:
>>
>> yeap noway I compare Regex with PettitParser. I will probably
>> give a
>> PettitParser a try, because I try to parse Pharo syntax to
>> Python, I
>> want now to parse Pharo classes to python class and that will be a
>> nightmare with regex, so time to give PettitParser a serious try.
>>
>> On Tue, Sep 23, 2014 at 1:10 PM, Udo Schneider
>> > <mailto:udo.schnei...@homeaddress.de>
>> <mailto:udo.schneider@__homeaddress.de
>> <mailto:udo.schnei...@homeaddress.de>>>
>> wrote:
>>
>>  > I have not used PettitParser yet, looks powerful but I
>> find it a bit
>>  > weird in design. On the other hand regex is quite ugly
>> and understanding
>>  > complex regex a pain.
>>  I normally encounter two issues with RegExps:
>>
>>  1) The syntax between different apps/libs/frameworks differs
>>  sligtly. Esp. for character classes or greediness. This
>> drove me
>>  crazy more than one time.
>>  2) Often enough I realize (while developing the RegExp)
>> that I need
>>  something more capable than a Chomsky Type 3 parser (which
>> RegExps
>>  are in a way). So I have to use "a bigger gun" - e.g.
>> PetitParser.
>>
>>  CU,
>>
>>  Udo
>>
>>
>>  On 23.09.14 10:15, kilon alios wrote:
>>
>>  it reminds a lot of Kent's Beck Smalltalk Practice
>> Patterns where it
>>  removes all ifs and replaces them with regular unary
>> messages .
>>  It is
>>  definitely an elegant way of coding making the code
>> just flow.
>>
>>  I have not used PettitParser yet, looks powerful but I
>> find it a bit
>>  weird in design. On the other hand regex is quite ugly
>> and
>>  understanding
>>  complex regex a pain.
>>
>>  On Tue, Sep 23, 2014 at 11:07 AM, Udo Schneider
>>  > <mailto:udo.schnei...@homeaddress.de>
>>  <mailto:udo.schneider@__homeaddress.de
>> <mailto:udo.schnei...@homeaddress.de>>
>>  <

Re: [Pharo-users] Packaging Pharo for many distributions at once

2014-09-24 Thread Thierry Goubier
 Hi Damien,

I would be interested in a zeroinstall [http://0install.net/] version :) A
cool system because it is user-level (no need to go into system admin mode).

Thierry

2014-09-24 9:48 GMT+02:00 Damien Cassou :

> Hi,
>
> I've packaged Pharo VM for the Nix package manager which can be
> installed on many Unix (e.g., Linux, MacOS X and FreeBSD). This works
> well but requires installing Nix on your Unix.
>
> Another solution is http://openbuildservice.org. Is any of you
> interested in trying to use this service to build Pharo VM packages
> for several Linux distributions automatically? I can help.
>
> Best
>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Success is the ability to go from one failure to another without
> losing enthusiasm."
> Winston Churchill
>
>


Re: [Pharo-users] Packaging Pharo for many distributions at once

2014-09-24 Thread Thierry Goubier
2014-09-24 11:35 GMT+02:00 Christophe Demarey :

>
> Le 24 sept. 2014 à 11:00, Thierry Goubier a écrit :
>
>  Hi Damien,
>
> I would be interested in a zeroinstall [http://0install.net/] version :)
> A cool system because it is user-level (no need to go into system admin
> mode).
>
>
> It looks interesting but requires the user to install 0install before
> being able to install Pharo. A big drawback ...
>

This is because you don't have yet half a dozen things already installed
via 0install ;)

All non-native package managers have that issue.

Thierry


Re: [Pharo-users] Using themes and closing windows

2014-09-25 Thread Thierry Goubier

Le 25/09/2014 18:37, Annick Fron a écrit :

Is there a documentation how to use or write Themes ?

I would like to attach some method when I close a window, how I do that ?


You can register to the announcement sent by the window when closing.

| s |
s := SystemWindow new.
s onAnnouncement: WindowClosed do: [ Transcript show: 'Closing' ].
s openAsIs

Thierry




Re: [Pharo-users] Using a private git repository with Metacello

2014-10-08 Thread Thierry Goubier

Hi Julien,

it should be possible on Linux and Mac OS by loading GitFileTree and 
using an url like: 
'gitfiletree://bitbucket.com/owner/reponame&protocol=git'.


Regards,

Thierry

Le 08/10/2014 10:44, Julien Delplanque a écrit :

Hello,

Is it possible to use Metacello to load a Pharo project from a private
git repository hosted on bitbucket for example? If it is, how?

To load project from github I use:

Metacello new
 baseline: 'Project';
 repository: 'github://owner/reponame/repository';
 load.

Is there a prefix for a git repository that is not hosted on github?

Also, I think Metacello use HTTP to download the project, am I right? Is
it possible to make it use ssh?

Thanks in advance,

Julien








Re: [Pharo-users] Using a private git repository with Metacello

2014-10-11 Thread Thierry Goubier
Hi Julien,

What didn't work?

Thierry

Le 11 oct. 2014 10:44, "Julien Delplanque"  a écrit :
>
> Sorry for the late response, I have been a bit busy these days,
>
> I tried this but it didn't worked
>
> I'll try the Dale's solution soon.
>
> However, thank you for the help ;)
>
> Julien
> On 09/10/14 07:09, Thierry Goubier wrote:
> > Hi Julien,
> >
> > it should be possible on Linux and Mac OS by loading GitFileTree and
> > using an url like:
> > 'gitfiletree://bitbucket.com/owner/reponame&protocol=git'.
> >
> > Regards,
> >
> > Thierry
> >
> > Le 08/10/2014 10:44, Julien Delplanque a écrit :
> >> Hello,
> >>
> >> Is it possible to use Metacello to load a Pharo project from a private
> >> git repository hosted on bitbucket for example? If it is, how?
> >>
> >> To load project from github I use:
> >>
> >> Metacello new
> >>  baseline: 'Project';
> >>  repository: 'github://owner/reponame/repository';
> >>  load.
> >>
> >> Is there a prefix for a git repository that is not hosted on github?
> >>
> >> Also, I think Metacello use HTTP to download the project, am I right?
Is
> >> it possible to make it use ssh?
> >>
> >> Thanks in advance,
> >>
> >> Julien
> >>
> >>
> >>
> >
> >
>
>


Re: [Pharo-users] Using a private git repository with Metacello

2014-10-13 Thread Thierry Goubier
Hi Julien,

for my part, it would probably mean that GitFileTree isn't loaded. Do you
have a package named MonticelloFileTree-Git? I load it with:
 Gofer new
url: '
http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo30/main';
configurationOf: 'GitFileTree';
loadDevelopment

Thierry



2014-10-13 8:19 GMT+02:00 Julien Delplanque :

> Hi Thierry, Dale,
>
> I get a ZnUnknownScheme whatever the solution I choose...
>
> Are you sure it works for private repositories that need your ssh key
> for auth?
>
> Julien
>
>


Re: [Pharo-users] openstreetmap + roassal

2014-10-15 Thread Thierry Goubier
Hi Nicolas,

What are the errors you encountered?

I wrote a kind of tutorial to explain how to understand a bit both the
OpenStreetMap API and how to use it under Pharo. it is at:

http://pillarhub.pharocloud.com/hub/ThierryGoubier/5y08m9uu71o8i7a35ijwr766p

Regards,

Thierry

2014-10-15 15:48 GMT+02:00 Nicolas Lusa :

> Hello pharo-users community,
>
> my name is Nicolas and I am a student of Informatics at USI in Lugano. I
> am currently working on my master thesis and I am getting into pharo,
> playing around a little bit and tasting the potential that is hidden in
> pharo.
> I recently saw a tweet from mr. Serge Stinckwich about how to build 2d
> buildings and rivers with the openstreetmap API and roassal as drawing
> support. I tried to replicate the code since I would like to play with it
> but I got some errors that I didn't menage to fix.
> So I was thinking to ask here if anyone has such code to share.
>
> Thanks in advance.
> Cheers,
> Nicolas
>


Re: [Pharo-users] openstreetmap + roassal

2014-10-16 Thread Thierry Goubier

Hi Nicolas,

Le 16/10/2014 19:02, Nicolas Lusa a écrit :

Hi, sorry for the late response.

I tried to debug it on my own and got to some point where it seems it
works. I had some complains when it was parsing at first and then
some issues with the openstreetmap server I guess.  I'll check the
tutorial to and try to fix it and make it as smooth as possible.


You may encounter two errors which are linked to the openstreetmap 
servers, and I haven't handled them in the script:

- time out in the ZnClient query to the openstreetmap api server.
- request returning no data and a tag 'error' (which also means a 
timeout of the api server).


In such cases, switching to a different openstreetmap api server may be 
a solution. For example, the french openstreetmap association server 
seems to work well:


http://api.openstreetmap.fr/oapi/interpreter


Thanks a lot for the hints.


You're welcome,

Thierry


Cheers, Nicolas

On Oct 15, 2014, at 4:14 PM, Thierry Goubier
mailto:thierry.goub...@gmail.com>> wrote:

Hi Nicolas,

What are the errors you encountered?

I wrote a kind of tutorial to explain how to understand a bit both
the OpenStreetMap API and how to use it under Pharo. it is at:

http://pillarhub.pharocloud.com/hub/ThierryGoubier/5y08m9uu71o8i7a35ijwr766p

 Regards,

Thierry

2014-10-15 15:48 GMT+02:00 Nicolas Lusa
mailto:nicolas.l...@usi.ch>>: Hello pharo-users
community,

my name is Nicolas and I am a student of Informatics at USI in
Lugano. I am currently working on my master thesis and I am getting
into pharo, playing around a little bit and tasting the potential
that is hidden in pharo. I recently saw a tweet from mr. Serge
Stinckwich about how to build 2d buildings and rivers with the
openstreetmap API and roassal as drawing support. I tried to
replicate the code since I would like to play with it but I got some
errors that I didn't menage to fix. So I was thinking to ask here if
anyone has such code to share.

Thanks in advance. Cheers, Nicolas










Re: [Pharo-users] [Pharo-dev] Clickable class side example and initialize methods in Pharo 4.0

2014-10-22 Thread Thierry Goubier

Hi all,

by principle, I'd be against extending so much the pragmas... from a 
design point of view they look like #defines and macros, that is an 
additional language to learn, without a correct support of the tools (no 
debug on pragmas, non-obvious behavior triggers, search for pragma users 
difficult, not documented).


Alexandre, your idea of infering properties from the source code looks a 
lot more interesting (and with a lot more potential).


Thierry

Le 22/10/2014 19:38, Alexandre Bergel a écrit :

Hi!

I have doubt that #example: will be enough in the case of Roassal.
Having a code example browser is indeed important and having a descent way to 
search for the examples is also important. I am thinking to stick to #example 
and infer some categories from the source code (e.g., if the method contains a 
Zinc class, then it may be categorized in network).


Cheers,
Alexandre


Le 22-10-2014 à 7:38, Torsten Bergmann  a écrit :

Hi Tudor,

that should be easy now: look at CompiledMethod>>#isExampleMethod which can be 
adopted as needed.

Checking for the  pragma could be done this way:

   self pragmas anySatisfy: [:pragma | pragma keyword = #example ]

but we should think first if this is enough.

I already proposed to not only annotate with a pragma  but 
additionally give a category.
Like this:

   
   

This way we can easily build an example browser for our users where people can 
go through
their point of interest and browse the examples.

Maybe we should also rethink pragmas (in Pharo 5.0?) in general to be more 
Smalltalk
like:

   

where Example is a real class in the system (!). One can even make it more 
explicit
then

   

with ExampleCategory(class)>>graphics returning a translateable string. People 
can add
own categories and one easily knows about already available ones.


Now that classes can have properties in Pharo 4.0 already I would like to see a 
unification
for methods and classes here (with the general concept of an "Annotation" in 
our metamodel).

In my opinion a method pragma is just a special form of annotating a method.

And annotating classes is usefull as well (for instance you want to annotate a 
class with
the appropriate Table name in an ORM framework, ...)

A comment (in a method or in a class) is also nothing more than a special 
annotation.
A class/method category is also an annotation. If unified a method or a class 
could
be in one or more categories. Even a break point for an expression is IMHO just 
an
annotation.

Bye
T.


Gesendet: Mittwoch, 22. Oktober 2014 um 10:43 Uhr
Von: "Tudor Girba" 
An: "Pharo Development List" 
Cc: "Any question about pharo is welcome" 
Betreff: Re: [Pharo-dev] Clickable class side example and initialize methods in 
Pharo 4.0

Hi Torsten,

Thanks for this. This is indeed the way to go.

Just to let you know, the example infrastructure is also being developed in the 
context of GT, so we have a healthy interest overlap which is great. Only in our 
case, the discovery of the example happens through an  pragma. Would 
it be possible to change your slice to use this pragma instead of the example* 
convention?

Cheers,
Doru



On Wed, Oct 22, 2014 at 9:19 AM, Torsten Bergmann  wrote:One 
addition I implemented for Nautilus is that one can run examples directly
in the browser just by clicking on class side example methods icons.

See 
https://pharo.fogbugz.com/f/cases/13892/Example-methods-should-be-runnable-in-Nautilus[https://pharo.fogbugz.com/f/cases/13892/Example-methods-should-be-runnable-in-Nautilus]
for a picture.


SO PLEASE: WHEN YOU PROVIDE EXAMPLES IN CLASSES PLEASE PUT THEM ON THE CLASS 
SIDE
AND LET THE SELECTOR START WITH "example".

This way people will easily see that it is an example and can run them. 
Additionally it
would help to put them into a category like "examples". So be a good citized and
provide not only class comments but also examples for others to study.


Side note:
==
It is also possible to click on the icon of class side initialize methods so the
class get reinitialized (after a confirmation to avoid false clicking).

https://pharo.fogbugz.com/f/cases/13894/Class-side-initialize-methods-should-be-runnable-in-Nautilus[https://pharo.fogbugz.com/f/cases/13894/Class-side-initialize-methods-should-be-runnable-in-Nautilus]

Both issues are already integrated.

  --
www.tudorgirba.com[http://www.tudorgirba.com]

"Every thing has its own flow"










Re: [Pharo-users] [Pharo-dev] Clickable class side example and initialize methods in Pharo 4.0

2014-10-22 Thread Thierry Goubier

Le 22/10/2014 21:14, stepharo a écrit :

I agree with Thierry but I disagree with Alex :)
What is cool is that when you browse a widget class that you get all the
examples for this class.


I use browse class refs for that. Works on average pretty well; if it 
doesn't I throw away the code and reuse something else ;)


Thierry



Stef

I am also not a big fan of using pragmas. To me, it looks like an ad
hoc approach to have examples close to the class. In the same spirit:
Why not having tests in the same class? Would it not be cool? Of
course not.
In Roassal we have a class for examples (similar to TestCase).

Alexandre


Le 22-10-2014 à 14:51, Thierry Goubier  a
écrit :

Hi all,

by principle, I'd be against extending so much the pragmas... from a
design point of view they look like #defines and macros, that is an
additional language to learn, without a correct support of the tools
(no debug on pragmas, non-obvious behavior triggers, search for
pragma users difficult, not documented).

Alexandre, your idea of infering properties from the source code
looks a lot more interesting (and with a lot more potential).

Thierry

Le 22/10/2014 19:38, Alexandre Bergel a écrit :

Hi!

I have doubt that #example: will be enough in the case of Roassal.
Having a code example browser is indeed important and having a
descent way to search for the examples is also important. I am
thinking to stick to #example and infer some categories from the
source code (e.g., if the method contains a Zinc class, then it may
be categorized in network).


Cheers,
Alexandre


Le 22-10-2014 à 7:38, Torsten Bergmann  a écrit :

Hi Tudor,

that should be easy now: look at CompiledMethod>>#isExampleMethod
which can be adopted as needed.

Checking for the  pragma could be done this way:

   self pragmas anySatisfy: [:pragma | pragma keyword = #example ]

but we should think first if this is enough.

I already proposed to not only annotate with a pragma  but
additionally give a category.
Like this:

   
   

This way we can easily build an example browser for our users where
people can go through
their point of interest and browse the examples.

Maybe we should also rethink pragmas (in Pharo 5.0?) in general to
be more Smalltalk
like:

   

where Example is a real class in the system (!). One can even make
it more explicit
then

   

with ExampleCategory(class)>>graphics returning a translateable
string. People can add
own categories and one easily knows about already available ones.


Now that classes can have properties in Pharo 4.0 already I would
like to see a unification
for methods and classes here (with the general concept of an
"Annotation" in our metamodel).

In my opinion a method pragma is just a special form of annotating
a method.

And annotating classes is usefull as well (for instance you want to
annotate a class with
the appropriate Table name in an ORM framework, ...)

A comment (in a method or in a class) is also nothing more than a
special annotation.
A class/method category is also an annotation. If unified a method
or a class could
be in one or more categories. Even a break point for an expression
is IMHO just an
annotation.

Bye
T.


Gesendet: Mittwoch, 22. Oktober 2014 um 10:43 Uhr
Von: "Tudor Girba" 
An: "Pharo Development List" 
Cc: "Any question about pharo is welcome"

Betreff: Re: [Pharo-dev] Clickable class side example and
initialize methods in Pharo 4.0

Hi Torsten,

Thanks for this. This is indeed the way to go.

Just to let you know, the example infrastructure is also being
developed in the context of GT, so we have a healthy interest
overlap which is great. Only in our case, the discovery of the
example happens through an  pragma. Would it be possible
to change your slice to use this pragma instead of the example*
convention?

Cheers,
Doru



On Wed, Oct 22, 2014 at 9:19 AM, Torsten Bergmann 
wrote:One addition I implemented for Nautilus is that one can run
examples directly
in the browser just by clicking on class side example methods icons.

See
https://pharo.fogbugz.com/f/cases/13892/Example-methods-should-be-runnable-in-Nautilus[https://pharo.fogbugz.com/f/cases/13892/Example-methods-should-be-runnable-in-Nautilus]

for a picture.


SO PLEASE: WHEN YOU PROVIDE EXAMPLES IN CLASSES PLEASE PUT THEM ON
THE CLASS SIDE
AND LET THE SELECTOR START WITH "example".

This way people will easily see that it is an example and can run
them. Additionally it
would help to put them into a category like "examples". So be a
good citized and
provide not only class comments but also examples for others to study.


Side note:
==
It is also possible to click on the icon of class side initialize
methods so the
class get reinitialized (after a confirmation to avoid false
clicking).

https://pharo.fogbugz.com/f/cases/13894/Class-side-initialize-methods-should-be-runnable-in-Nautilus[https://pharo.fogbugz.com/f/cases/13894/Class

Re: [Pharo-users] [Pharo-dev] Clickable class side example and initialize methods in Pharo 4.0

2014-10-22 Thread Thierry Goubier

Hi Doru,

Le 22/10/2014 23:03, Tudor Girba a écrit :

Hi,

As for pragmas, they are a better mechanism for describing intent than a
method naming convention is. If nothing else, it lets us freedom in
naming the method.


And they add another programming language on top of another, and in most 
cases are redundant with the method name and protocol.


i.e.

exampleThis has pragma 
testThat has pragma 

Simply because for the method name to be suitable, it has to convey 
intent one way or another.


I can understand if you come and tell me that the pragma is to annotate 
for stuff that the compiler can't deduce, such as the #openmp pragmas. 
But I can't say that bringing in that kind of stuff would mean progress ;)



It's true that at this point, pragmas are hard to browse, but this will
not remain like this for long :)


Tools may help to overcome limitations of pragmas, yes ;) But this 
sounds like because pragmas may not be that good to start with :)


Thierry



Re: [Pharo-users] Slow at browsing

2014-10-25 Thread Thierry Goubier

Hi Hilaire,

maybe profiling could show something. Nautilus could benefit from some 
love in making it faster :)


I know that my browser, AltBrowser, is a lot faster on a slow machine 
(x7 faster on startup time compared to Nautilus, x3 faster than the old 
system browser). So it could be done.


(and Spur could give us a x2 boost on top of all those times :) :) )

Thierry

Le 25/10/2014 11:55, Hilaire a écrit :

Hello,

In Pharo 3.0 (and with Pharo 2.0), I noted an important slowness when
browsing importantly populated class.

For example, clicking on a method category of the Morph class, it takes
about 3 seconds to reveals its methods. With Pharo 1.4 it is immediate
with the same Morph class.

My computer is a slow dog but it is not a good reason for this slowness.

Hilaire







Re: [Pharo-users] Slow at browsing

2014-10-25 Thread Thierry Goubier

Le 25/10/2014 12:39, Nicolai Hess a écrit :

Maybe this one:

12535  To many updates on
the methods list


You certainly seems to be onto something there. 12535? 12931 as well?

Looks like some have computers that are too fast to notice the slowdown ;)

Thierry



Re: [Pharo-users] AST tokens question

2014-10-28 Thread Thierry Goubier

Le 28/10/2014 11:23, Mark Rizun a écrit :

Thanks. I see that, however RBBlockNode or RBArrayNode doesn't have tokens.
These classes have only methods in accessing-token protocol.
I think it would be better if we have token object for those classes,
because it makes more sense to hold such information in token object.


Well, not really.

Technically, tokens are used to drive a parser from a scanner.

If an AST node knows how to relate itself to its original source code 
chunk and is able to print itself correctly, then tokens are redundant.


In short, if you work with parsers, you'd better know what tokens are. 
If you're only working with the AST, tokens are redundant and noise 
(i.e. they often have a type (or more than one) which is only understood 
by the parser).


Example of how it is done:

RBPragmaNode
	accessing-tokens gives access to left and right, which are positions, 
not tokens.


Thierry



Mark



2014-10-28 11:59 GMT+02:00 Nicolai Hess mailto:nicolaih...@web.de>>:

2014-10-27 19:36 GMT+01:00 Mark Rizun mailto:mri...@gmail.com>>:

Hi all,

Trying to understand here how tokens are used in AST.
So far I can not see any order in usage of tokens.
For instance, why RBValueNode doesn't have token? Is it haow
it's supposed to be?


RBValueNode is an abstract class.


Cheers,
Mark








Re: [Pharo-users] AST tokens question

2014-10-28 Thread Thierry Goubier

Le 28/10/2014 12:12, Mark Rizun a écrit :

Well, not really.

Technically, tokens are used to drive a parser from a scanner.

If an AST node knows how to relate itself to its original source
code chunk and is able to print itself correctly, then tokens are
redundant.

In short, if you work with parsers, you'd better know what tokens
are. If you're only working with the AST, tokens are redundant and
noise (i.e. they often have a type (or more than one) which is only
understood by the parser).


I'm working with ASTs sourceInterval. Trying to calculate it after
method replaceWith:.
You see, my proble was that each node of AST doesn't hold its start and
stop position in same place. So I thought that token is such a place,
however, eventually I understood that RBValueNodes don't have tokens:)


Do you mean you're trying to do a replace and update the positions of 
all the nodes ?


Thierry



Re: [Pharo-users] Pharo program "examples"

2014-10-28 Thread Thierry Goubier

Hi Hans,

have a look at Phratch and DrGeo.

Thierry

Le 28/10/2014 12:23, Hans Schueren a écrit :




Thanks Jan ,


i know that the system itself is the program.

But there must be "Image" programs  out there to download.


I only want to download a program

( Folder with image and exe [Pharo Container] )

Online.


Just to see and start the program and see how it opens.

( like a normal program [ Pharo IDE is shadowed] ).




Guess that i am a  user.

I have heared about Pharo and want to test a real program.



Hans
















Hello again ,

are there any Pharo Program examples online ?

I dont mean normal examples from coding.

What i mean are end-user programs.

Completely ready Online for downloading.


Regards

Hans








Re: [Pharo-users] AST tokens question

2014-10-28 Thread Thierry Goubier

Le 28/10/2014 12:45, Mark Rizun a écrit :

Yes, because they are wrong. Here is an issue:
https://pharo.fogbugz.com/f/cases/14254/AST-method-replaceWith-does-not-change-source-interval


I would say that they are correct.

When I write source to source compilers, I admit that anything that I 
change in the AST (via replaceWith equivalent) has no valid source 
interval (since it does not exist in the original source). However, all 
unmodified nodes should keep their 'non-modified' source interval (since 
I may need it to fetch the relevant text from the source).


If I want my modification to the AST to have valid source intervals, 
then, I need to regenerate the source from the modified AST. And only 
then they are valid.


You may want to update the source interval when you do a replaceWith, 
but the only thing we will get with what you want to do is that, after a 
replaceWith, no source interval can be trusted since it may end up past 
the end of the original source string length.


Thierry



2014-10-28 13:32 GMT+02:00 Thierry Goubier mailto:thierry.goub...@gmail.com>>:

Le 28/10/2014 12:12, Mark Rizun a écrit :

 Well, not really.

 Technically, tokens are used to drive a parser from a scanner.

 If an AST node knows how to relate itself to its original
source
 code chunk and is able to print itself correctly, then
tokens are
 redundant.

 In short, if you work with parsers, you'd better know what
tokens
 are. If you're only working with the AST, tokens are
redundant and
 noise (i.e. they often have a type (or more than one) which
is only
 understood by the parser).


I'm working with ASTs sourceInterval. Trying to calculate it after
method replaceWith:.
You see, my proble was that each node of AST doesn't hold its
start and
stop position in same place. So I thought that token is such a
place,
however, eventually I understood that RBValueNodes don't have
tokens:)


Do you mean you're trying to do a replace and update the positions
of all the nodes ?

Thierry







Re: [Pharo-users] Pratsch

2014-10-28 Thread Thierry Goubier

Hi Hans,

I would not hesitate to state that in the Smalltalk vision, we should 
make no difference between a user and a programmer: a user has the right 
to be a programmer.


Today, in academic circles, we call that "end-user programming" if you 
need more references (:)).


If you take some of the best known examples of Pharo, you'll see that 
they are empowerment tools: they are designed to unleash a maximum 
amount of power by helping you reach complex goals a lot faster than 
usual. Look for Moose, Roassal, Seaside.


Still, you can do sample, autonomous applications. For example, Phratch 
is at http://www.phratch.com/; DrGeo is at http://www.drgeo.eu/.


You can start an application by opening it in a window (i.e. look for an 
open method). With a few more lines, you can open it fullscreen to hide 
the IDE (have to get back to work to give you those lines :)). With a 
bit more work, you can have it running from the command line.


But remember, Pharo / Smalltalk is a live environment, not a compile and 
run my app kind of old stuff (and very old, given that Smalltalk itself 
is already old stuff).


Have fun in your journey in Smalltalk :)

Thierry

Le 28/10/2014 13:36, Hans Schueren a écrit :

Thank you Thierry ,


guess i am an user.


" I have heared there are Pharo programmers"


Can i download such a program to see how good they are ?


I dont want to hear anything about coding and IDE and development.


I am a user and want to start a example program.



Do you have a LINK for me to download ?



Hans


This sounds strange.

However , i have here a huge range of books about smalltalk 80.

All the books describe the syntax and system.

To write a better and better code and more functions.

The only thing that is not describes is to display a running program
inside image.

The keywords and methods to display and save the own code inside the
packages in the

form of "image out" a manipulated smalltalk image to run as a user program.

The first step is a really really simple program like mathematic
calculation etc.

But the procedure of end product must be clear.

Only one good example perhaps with a transcript display can overcome
theese difficulties.

Its all unclear :

show Transcript

openInWorld

class new class


Theese commands are messages to a object.

But the user does not input any program code.  This is automatic running.

Anyway , if the Pharo.exe started the image in the program.
How , and with what keyword is then the program started fullscreen -
which World is invoked to display?

This preparation point is unclear when i want to make my "Allready
written program" ready to start.



However , i make a break with smalltalk now.

A few books are still ordered from USA.

If this point is unclear i cannot learn further at this point.

It makes no sense to write Packages and classes if i cannot invoke the
running arrangements
No matter if they are objects or others.




















Re: [Pharo-users] AST tokens question

2014-10-28 Thread Thierry Goubier

Le 28/10/2014 14:33, Mark Rizun a écrit :

In the first place why I'm doing this. I work on Rewrite Tool and it's
main functionality bases on replacing nodes in AST. Plus it works with
sourceIntervals of nodes. Untill now my solution was:
if I replace node, I reparse tree to get intervals updated


I print the modified tree and parse :)


However this solution brought new problems.


Which ones?


Second reason is, that I think it makes sense to update interval of all
AST if you replace one node.
For example, we have:
obj1 foo + obj2 bar
and we replace obj1 with myObject.
The interval of ast was 1 to: 19, and now it should be 1 to: 23.


No it shouldn't. If the source has not been regenerated from the 
modified AST, then


'source copyFrom: theBarASTNode start to: theBarASTNode stop'

end past the end of it (20 to 23 with source ending at 19).

If you regenerate the source, then you can parse it and you'll have 
correct intervals.


Thierry


Mark

2014-10-28 14:00 GMT+02:00 Thierry Goubier mailto:thierry.goub...@gmail.com>>:

Le 28/10/2014 12:45, Mark Rizun a écrit :

Yes, because they are wrong. Here is an issue:

https://pharo.fogbugz.com/f/__cases/14254/AST-method-__replaceWith-does-not-change-__source-interval

<https://pharo.fogbugz.com/f/cases/14254/AST-method-replaceWith-does-not-change-source-interval>


I would say that they are correct.

When I write source to source compilers, I admit that anything that
I change in the AST (via replaceWith equivalent) has no valid source
interval (since it does not exist in the original source). However,
all unmodified nodes should keep their 'non-modified' source
interval (since I may need it to fetch the relevant text from the
source).

If I want my modification to the AST to have valid source intervals,
then, I need to regenerate the source from the modified AST. And
only then they are valid.

You may want to update the source interval when you do a
replaceWith, but the only thing we will get with what you want to do
is that, after a replaceWith, no source interval can be trusted
since it may end up past the end of the original source string length.

Thierry


2014-10-28 13:32 GMT+02:00 Thierry Goubier
mailto:thierry.goub...@gmail.com>
<mailto:thierry.goubier@gmail.__com
<mailto:thierry.goub...@gmail.com>>>:


 Le 28/10/2014 12:12, Mark Rizun a écrit :

  Well, not really.

  Technically, tokens are used to drive a parser
from a scanner.

  If an AST node knows how to relate itself to its
original
 source
  code chunk and is able to print itself correctly, then
 tokens are
  redundant.

  In short, if you work with parsers, you'd better
know what
 tokens
  are. If you're only working with the AST, tokens are
 redundant and
  noise (i.e. they often have a type (or more than
one) which
 is only
  understood by the parser).


 I'm working with ASTs sourceInterval. Trying to
calculate it after
 method replaceWith:.
 You see, my proble was that each node of AST doesn't
hold its
 start and
 stop position in same place. So I thought that token is
such a
 place,
 however, eventually I understood that RBValueNodes
don't have
 tokens:)


 Do you mean you're trying to do a replace and update the
positions
 of all the nodes ?

 Thierry










Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 8:32 GMT+01:00 Mark Rizun :

>
> Which ones?
>
>
> In my tool each node has property oldNodes, which holds collection of
> obviously AST nodes:)
> When I replace one of node I have to update source interval in some way.
>


> 1)If I update it with reparsing, I loose all data about oldNodes for each
> node of my AST.
> So I have to save old AST with all oldNodes, and somehow detect which
> nodes were not changed and reassign their lost oldNodes.
> But sometimes it's difficult to detect where and what you have to assign,
> as sometimes AST may be changed in dramatic way.
>

Ok; yes, I can relate to that.

But, knowing who has designed the RB ast, I'm sure it has a proper equality
property where:

oldNodeFromAST = sameNodeFromASTreparsed

holds true.

So you can reparse and rematch old node to new node.

But I would only regenerate and reparse when I need to update the source
intervals (or display the modified source).


> 2) But if source interval is updated automatically I don't bother with
> losing data for all AST.
> I just have to update oldNodes for node that was replaced.
>

Well, not really.

If during regeneration of your source, you change the way the code is
formatted (more tabs here, removing a return there, etc...) then
regenerated source intervals are different from modified ast source
intervals. So your 'modify source intervals' is very fragile for me.

The only way I can see a way out for that problem:

Inserted / replaced node have source intervals in a separate source;
unmodified nodes keep their source interval. This is the way I do it in my
source to source compilers when I want to inject code (and tag in the
generated file where that code comes from: usefull for debugging).

Or the match of old node to new node as seen above.


>
> That is way I'd like to have automatically updated source interval.
>

I'm still not entirely sure why. Source intervals are only there to help
relating the ast to the source, not much else, really.

Thierry


>
>
>>
>> No it shouldn't. If the source has not been regenerated from the modified
>> AST, then
>>
>> 'source copyFrom: theBarASTNode start to: theBarASTNode stop'
>>
>> end past the end of it (20 to 23 with source ending at 19).
>>
>> If you regenerate the source, then you can parse it and you'll have
>> correct intervals.
>>
>
> Marcus, do I have to redo everything back, or you can somehow remove that
> slice from newest version?
>
> Mark
>
>
>


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 9:59 GMT+01:00 Mark Rizun :

>
> I use source intervals to detect which node is selected and than in the
> right-click menu user can see only options that are relevanto to selected
> node, as it is also made in SmartSuggestions.
>

I know that use case ;)

Ok, then this means you are regenerating the code (1) (or are you doing
replace a node / insert new source at right place? (2))

Thinking a bit about it, I'd try reparse, get node from selection index,
find equal old node in old (modified) ast, or replace old (modified) ast
with new one.

Thierry


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 10:09 GMT+01:00 Mark Rizun :

> P.S. I have a solution, but don't know if it's appropriate: I remove
> updating of source interval from replaceWith: method, but my tool will do
> all the calculations of interval on it's own.
>

This is a possibility: have a transform; when you get selection intervals,
look if they are inside "replaced areas" or outside of it; increase or
decrease the indexes to compensate for added code / removed code. But this
is more complex than it looks.

But I would try the equality over an AST first. A lot more robust for me.

Thierry


>
> 2014-10-29 10:59 GMT+02:00 Mark Rizun :
>
>> That is way I'd like to have automatically updated source interval.

>>>
>>> I'm still not entirely sure why. Source intervals are only there to help
>>> relating the ast to the source, not much else, really.
>>>
>>
>> I use source intervals to detect which node is selected and than in the
>> right-click menu user can see only options that are relevanto to selected
>> node, as it is also made in SmartSuggestions.
>>
>
>


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 10:22 GMT+01:00 Mark Rizun :

> Second one, I do replace node all the time.
>

You insert new code inside the text view?

For me, if you replace nodes and display that, then you are "slowly"
replacing nodes. Anything which has some display to a user in the loop is
"slow".


> Thinking a bit about it, I'd try reparse, get node from selection index,
>> find equal old node in old (modified) ast, or replace old (modified) ast
>> with new one.
>>
> Can you explain this, sorry I didn't get the point
>

Use either =, equalTo:withMapping:, match:inContext: to find the relevant
new node equal to your old node in the new ast.

Thierry


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 10:44 GMT+01:00 Mark Rizun :

>
>
> 2014-10-29 11:40 GMT+02:00 Thierry Goubier :
>
>>
>>
>> 2014-10-29 10:22 GMT+01:00 Mark Rizun :
>>
>>> Second one, I do replace node all the time.
>>>
>>
>> You insert new code inside the text view?
>>
>
> Yes
>
>
>>
>> For me, if you replace nodes and display that, then you are "slowly"
>> replacing nodes. Anything which has some display to a user in the loop is
>> "slow".
>>
> I'm not doing this in loop. I have AST and text view of it. Than I do one
> replace and update text view.
> When I wrote "all the time", I ment replacing nodes is very important in
> my tool, as it does main functionality.
>

This is well how I understood it.

Are you implementing something around the use of refactoring?


>
>
>>
>>
>>> Thinking a bit about it, I'd try reparse, get node from selection index,
>>>> find equal old node in old (modified) ast, or replace old (modified) ast
>>>> with new one.
>>>>
>>> Can you explain this, sorry I didn't get the point
>>>
>>
>> Use either =, equalTo:withMapping:, match:inContext: to find the relevant
>> new node equal to your old node in the new ast.
>>
> Good, thanks for advice. Firstly, I will check your suggestion with
> equality. If it fails for me, I'll try my suggestion with calculating
> inside tool.
>

Keep us updated on your solution. It is significant because the equality
between ast nodes is part of the SmaCC parser generator toolkit, so any
solution on that may also be used when manipulating non-smalltalk code (C,
Java, C#, Python, R, Ada, etc...).

Thierry


>
> Thanks again,
> Mark
>
>


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 11:11 GMT+01:00 Mark Rizun :

> This is well how I understood it.
>>
>> Are you implementing something around the use of refactoring?
>>
>
> I'm implementing tool for creating rewrite rules.  Here is a blog about
> it: http://myfuncoding.blogspot.com/
> Also I write chapter for PharoForEnterprise:
> https://github.com/SquareBracketAssociates/PharoForTheEnterprise-english/tree/master/RewriteTool
>
>
I had a look at the video, and it looks great. Certainly the way to go.

I had some ideas along those, but I never have time to try them. My
interest would have been to show how many methods (and where:
group-package-tag-class?) the search pattern will impact.

One suggestion. When in the menu, try to auto-select the relevant keyword
or literal; give access to the ast navigation stuff (up select the
enclosing ast node, down the first node inside).

Thierry


>
>
>> Keep us updated on your solution. It is significant because the equality
>> between ast nodes is part of the SmaCC parser generator toolkit, so any
>> solution on that may also be used when manipulating non-smalltalk code (C,
>> Java, C#, Python, R, Ada, etc...).
>>
>
> Sure, I will.
>


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 11:16 GMT+01:00 Mark Rizun :

> I misunderstood you, of course I can find the node in old ast which was
> replaced, using operator =.
> Sure it works, but the problem is I have to pass oldNodes each time from
> old node to new one.
>

I think you can work recreating the ast. I'm not sure there is any reason
to keep track of old nodes, because what you do is: apply a change to ast
under selection; rebuilt RB matching / transform rule; apply RB rule to
sample code. update all four panes.

Thierry


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 11:41 GMT+01:00 Mark Rizun :

> I had a look at the video, and it looks great. Certainly the way to go.
>>
> Well, it's not that great. And it shows pretty old version of what I have
> now. I should make a new better one:)
>
>
>> I had some ideas along those, but I never have time to try them. My
>> interest would have been to show how many methods (and where:
>> group-package-tag-class?) the search pattern will impact.
>>
> In current version you can generate rule(it creates class for your rule),
> and than you can select packages/classes/methods you want to apply this rule
>

This is the one which sounds difficult for me. Patterns are fairly global
in nature, and they may match synonyms (i.e. methods of the same name but
with different meanings), so I'm worried about the mastery of my changes.

For an isNil ifTrue: to ifNil:, it's easy. But for an indexAt: to at:
because I'm changing an internal API, I'd like a better preview of what it
will affect before launching it (or a way to examine the resulting changes,
which is a bit convoluted).


>
>
>> One suggestion. When in the menu, try to auto-select the relevant keyword
>> or literal;
>>
> You mean in all other panes? It would be really cool
>

You're jumping ahead of my mind :) Yes, it would be cool (but not sure it
will be that easy to do in all cases; if you select @var1, would it
highlight myVariable in the other panes... hum, interesting to have).


>
>
>> give access to the ast navigation stuff (up select the enclosing ast
>> node, down the first node inside).
>>
> That's really great!  It'will take time, but I'm going to implement that,
> just have to remember:)
>

I think this is already available, you just have to use it (or trigger it).


>
>
> I think you can work recreating the ast. I'm not sure there is any reason
>> to keep track of old nodes, because what you do is: apply a change to ast
>> under selection; rebuilt RB matching / transform rule; apply RB rule to
>> sample code. update all four panes.
>>
>
> The process on video is: creating your own rule step by step. While doing
> this user may make a mistake.
> I keep oldNodes, because I want to have an "Undo on node" action. It
> returns node into it's previous state.
>

In that case, I would keep the old node, and simply try to find where is
the old node equal in the new ast when undoing (or when building the menu
to show that an undo is possible on that node).

Thierry


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 15:54 GMT+01:00 Mark Rizun :

> This is the one which sounds difficult for me. Patterns are fairly global
>> in nature, and they may match synonyms (i.e. methods of the same name but
>> with different meanings), so I'm worried about the mastery of my changes.
>>
>> For an isNil ifTrue: to ifNil:, it's easy. But for an indexAt: to at:
>> because I'm changing an internal API, I'd like a better preview of what it
>> will affect before launching it (or a way to examine the resulting changes,
>> which is a bit convoluted).
>>
>
> You will see upcoming changes in Changes browser, so you can decide if
> it's what you really want.
>

You mean the changes tool in Monticello ?


> It's like applying refactoring.
>

Hum. Yes.

>
>
>
> I think this is already available, you just have to use it (or trigger it).
>>
>
> I'm not aware of this kind of things, can you specify where it is
> available?
>
>
> In that case, I would keep the old node, and simply try to find where is
>> the old node equal in the new ast when undoing (or when building the menu
>> to show that an undo is possible on that node).
>>
>
> That's pretty much the same what I'm doing.
>

Oh well, then you're done ;)

Thierry


>
> Mark
>


Re: [Pharo-users] AST tokens question

2014-10-29 Thread Thierry Goubier
2014-10-29 16:17 GMT+01:00 Mark Rizun :

> You mean the changes tool in Monticello ?
>>
>
> No I mean, that before your rule is applied you will see the same window,
> when you choose refactoring.
> I mean Changes Browser. Here it is:
>
> [image: Вбудоване зображення 1]
>
> Ok, thanks.

this is a gui I never ended up seeing, apart from dismissing it for obvious
refactorings when I was using OmniBrowser :( I think I got rid of it
somehow ;)

Hum, not convenient.

Certainly doesn't invite me to do refactorings :(

Thierry


Re: [Pharo-users] AST tokens question

2014-10-30 Thread Thierry Goubier
Hi Stef,

this one is in SmaCC. I'll see if I can switch to your solution.

I had a look at Nautilus add protocol for fun. 2303 entries for a subclass
of MorphTreeModel :( I reduce that to 11 entries in AltBrowser add protocol
for the same use case.

Thierry


Re: [Pharo-users] Zoomable & Infinitely scrollable PasteupMorph

2014-11-02 Thread Thierry Goubier

Le 02/11/2014 15:15, stepharo a écrit :



I gave up on zoomability (with the idea to revisit after Athens is
integrated),


Athens is integrated. Now if the community does not help redefining the
drawnOn: methods using athens then it will not happen.


And, speaking of infinite zoomability, you have a few surprises waiting 
for you in Athens :( (some are from Athens design, others may be linked 
to Cairo).


Thierry



Re: [Pharo-users] Zoomable & Infinitely scrollable PasteupMorph

2014-11-02 Thread Thierry Goubier

Le 02/11/2014 16:29, Nicolai Hess a écrit :

2014-11-02 15:22 GMT+01:00 Thierry Goubier mailto:thierry.goub...@gmail.com>>:

Le 02/11/2014 15:15, stepharo a écrit :


I gave up on zoomability (with the idea to revisit after
Athens is
integrated),


Athens is integrated. Now if the community does not help
redefining the
drawnOn: methods using athens then it will not happen.


And, speaking of infinite zoomability, you have a few surprises
waiting for you in Athens :( (some are from Athens design, others
may be linked to Cairo).


?
What exactly?


(1) Precisions issues: Athens/Cairo seems only precise at 0.001 points 
in Roassal space (independently of the scaling of the canvas, i.e. even 
if you camera scaling is 10 pixels for 0.001).


(2) Limits: if your Athens coordinates are over a certain number (around 
1e7, I believe), Athens stop displaying things (independently of the 
scaling, again)


(3) Athens design: the idea of having a stroke width of 1 has strange 
effects (polygons with scaling being 10 pixels wide, but with a border a 
100 pixels wide: certainly not what you expect to see displayed)


(1) means that you can't zoom to a meter/pixel resolution without errors 
on a earth map where your scale is at 1 in roassal / 1km at equator.


(2) means that nothing will be displayed on your map of earth if your 
scale is at 1 in Roassal/1m on Earth (i.e., if you try to solve 1 by 
increasing your scale, then you may end up with nothing displayed).


(3) is just plain annoying, because of (2).

For normal Roassal use, doesn't matter except if your unlucky with your 
scaling. When you start to play with geo-referenced data with a meter 
resolution, you are sure to hit them. I did ;) Luckily, at that stage I 
knew I had proper projections and coordinate transforms, otherwise I 
would have lost a lot of time.


Thierry



Re: [Pharo-users] [Oharo-users] Copy AST

2014-11-05 Thread Thierry Goubier

Le 05/11/2014 18:04, Mark Rizun a écrit :

Hi everyone,

I want to get a deep copy of ast. But deepCopy doesn't work:)
What I mean:

| ast1 ast2 |
ast1 := RBParser parseRewriteExpression: 'self'.
ast2 := ast1 copy."or without copy"
ast1 stop: 99.
ast2 stop

When evaluate this you get 99. I want it to be 4.
So I want to have separate object ast2 with separate data, not depending
on changes made in ast1.
As I said deepCopy doesn't work. Any ideas?


I'd say beware. Deep copying ASTs is hard. You'll need to characterize a 
bit better what has been copied with deepCopy and what hasn't before 
starting to hack it.


Thierry



Thanks,
Mark





Re: [Pharo-users] question on syntax "negate numbers"

2014-11-09 Thread Thierry Goubier
2014-11-10 7:59 GMT+01:00 Henrik Johansen :

>
> IMHO, the old compiler is right, whitespace should not be allowed in
> literals.
>

Whitespace can be \t or \n,\r which makes for strange literals (multilines)
such as:

-

5

And would create ambiguity in some cases

is 4 - 5 two literals, or is it two literals separated by the - operator ?

For instance, 3 @ - 5 reads like gibberish.
>

But is 3 @ -5 a problem or not ? Why is the old compiler accepting -3 @ 5,
and not 3 @ -5 ?

Thierry


>
> Cheers,
> Henry
>


Re: [Pharo-users] question on syntax "negate numbers"

2014-11-10 Thread Thierry Goubier
2014-11-10 8:47 GMT+01:00 Henrik Johansen :

> 3 @ -5 is not a problem, and accepted by both.
> 3 @ -  5 is what I object to (and Opal allows)
>

RBParser allows this one even if old Compiler dissallows it (i.e. in Pharo
2).

I haven't tracked if Opal follows the RBParser on that or if this is the
reverse (Opal pushed changes on RBParser). I suspect all things RB in Pharo
(and Squeak?) are a port from the Dolphin version of RB, which means this
is allowed in quite a few other smalltalks (Dolphin?, VW?).

I haven't checked if the SmaCC Smalltalk parser accept that.

Note: 4 - 5 in RBParser does what you would expect. 4 - - 5 as well.


> 3 @-5 and/or 3 @- 5 is (rightly) disallowed by both.
>

That one is easier and expected.

My position would be twofold:
- RBParser is, IMHO, a good parser and I would follow its interpretation.
That Opal reuses it is a good point for me.
- As a programming language designer (and parser implementor), accepting -
5 is user friendly, but a bit too contextual in the lexer to be nice to
implement.

Thierry


>
> Cheers,
> Henry
>


Re: [Pharo-users] Anyone having a Rserve client?

2014-11-10 Thread Thierry Goubier
Hi Phil,

I'm interested too. I could commit resources to help if needed.

Thierry

2014-11-10 10:28 GMT+01:00 p...@highoctane.be :

> I am doing some R work and wanted to integrate with Pharo.
>
> Is there any support for Rserve around?
>
> http://www.rforge.net/Rserve/dev.html
>
> At this point I am doing OProcess style stuff with littler but Rserve
> would be cooler.
>
> There are binding for Ruby and Python.
>
> e.g.
> http://pythonhosted.org//pyRserve/
> https://github.com/ralhei/pyRserve
>
> Stats are becoming bigger and bigger and the leader of the pack is R.
>
> DHB is fine and I do use some of it but let's face it, it is nowhere near
> the power of R...
>
>
> Phil
>


Re: [Pharo-users] Anyone having a Rserve client?

2014-11-10 Thread Thierry Goubier
2014-11-10 11:10 GMT+01:00 p...@highoctane.be :

> Cool.
>
> I was thinking or reusing pieces of the RFBClient for writing the client.
> I like its design.
>
> I will work on this end of the month and in december so that I can ship my
> code using it in January.
>

I'm very busy until the end of november; after it doesn't look much better
:(, but it fits in a current project.


>
> I have a case on hand, so it is easy to have a user centric focus.
>

My use case is bio-stats. With matrixes which are too large for R on a
server with 768 GB of RAM :(


>
> I created a blank repo for the project:
> https://github.com/philippeback/parsec
>
> Parsec: Pharo RServe Client.
>

Ok.


>
> (I will give a shot at AltBrowser for coding this one :-) )
>

On which pharo will you be? 3 or 4?

As I'm mostly coding for apps and projects at the moment, I tend to be on 3
(and loose sight of eventual bugs on 4).

Thierry


>
> Phil
>
>
> On Mon, Nov 10, 2014 at 10:48 AM, Thierry Goubier <
> thierry.goub...@gmail.com> wrote:
>
>> Hi Phil,
>>
>> I'm interested too. I could commit resources to help if needed.
>>
>> Thierry
>>
>> 2014-11-10 10:28 GMT+01:00 p...@highoctane.be :
>>
>>> I am doing some R work and wanted to integrate with Pharo.
>>>
>>> Is there any support for Rserve around?
>>>
>>> http://www.rforge.net/Rserve/dev.html
>>>
>>> At this point I am doing OProcess style stuff with littler but Rserve
>>> would be cooler.
>>>
>>> There are binding for Ruby and Python.
>>>
>>> e.g.
>>> http://pythonhosted.org//pyRserve/
>>> https://github.com/ralhei/pyRserve
>>>
>>> Stats are becoming bigger and bigger and the leader of the pack is R.
>>>
>>> DHB is fine and I do use some of it but let's face it, it is nowhere
>>> near the power of R...
>>>
>>>
>>> Phil
>>>
>>
>>
>


Re: [Pharo-users] Anyone having a Rserve client?

2014-11-10 Thread Thierry Goubier
2014-11-10 11:46 GMT+01:00 p...@highoctane.be :

> On Mon, Nov 10, 2014 at 11:20 AM, Thierry Goubier <
> thierry.goub...@gmail.com> wrote:
>
>>
>>
>> 2014-11-10 11:10 GMT+01:00 p...@highoctane.be :
>>
>>> Cool.
>>>
>>> I was thinking or reusing pieces of the RFBClient for writing the
>>> client. I like its design.
>>>
>>> I will work on this end of the month and in december so that I can ship
>>> my code using it in January.
>>>
>>
>> I'm very busy until the end of november; after it doesn't look much
>> better :(, but it fits in a current project.
>>
>>
>>>
>>> I have a case on hand, so it is easy to have a user centric focus.
>>>
>>
>> My use case is bio-stats. With matrixes which are too large for R on a
>> server with 768 GB of RAM :(
>>
>
> Nice.
>
> Time for MapR or Revolution?
>
> https://www.mapr.com/
> http://www.revolutionanalytics.com/
>

It seems we're gone a bit further than that. I trust the HPC guys on the
project :)

Thierry


Re: [Pharo-users] Anyone having a Rserve client?

2014-11-10 Thread Thierry Goubier
2014-11-10 12:07 GMT+01:00 p...@highoctane.be :

>
> We are using UCS here. There are nice babies in that lineup:
>
>
> http://www.cisco.com/c/en/us/products/servers-unified-computing/ucs-c420-m3-rack-server/index.html
>

Yes, This is this class of stuff our user has.

Thierry

>
>
> Phil
>
>>
>>
>> Thierry
>>
>>
>


Re: [Pharo-users] question on syntax "negate numbers"

2014-11-10 Thread Thierry Goubier
I believe that x - - y would give you an error.

4 - - 5 in parsing is a different beast, because you consider - 5 as a
single token.

Thierry

2014-11-10 12:36 GMT+01:00 Henrik Johansen :

> In VisualWorks:
> 3 @ *Argument expected ->*- 5
>
> I guess what one expects is a matter of habit, personally I'd expect x - -
> y to yield a parsing error.
>
> Cheers,
> Henry
>
> On 10 Nov 2014, at 12:06 , PBKResearch  wrote:
>
> I have tried this on my latest Dolphin (Pro 6.1 Beta 2):
> 3 @ -5 is accepted and interpreted correctly.
> 3 @ - 5 is rejected with message: 'Error - incorrect expression start';
> the caret is pointing at the - sign.
> So the Opal behaviour does not mirror that of Dolphin.
>
> Hope this helps
>
> Peter Kenny
>
>
> *From:* Pharo-users [mailto:pharo-users-boun...@lists.pharo.org
> ] *On Behalf Of *Thierry Goubier
>
> 2014-11-10 8:47 GMT+01:00 Henrik Johansen :
>
> 3 @ -5 is not a problem, and accepted by both.
> 3 @ -  5 is what I object to (and Opal allows)
>
>
>
> RBParser allows this one even if old Compiler dissallows it (i.e. in Pharo
> 2).
>
> I haven't tracked if Opal follows the RBParser on that or if this is the
> reverse (Opal pushed changes on RBParser). I suspect all things RB in Pharo
> (and Squeak?) are a port from the Dolphin version of RB, which means this
> is allowed in quite a few other smalltalks (Dolphin?, VW?).
>
> I haven't checked if the SmaCC Smalltalk parser accept that.
> Note: 4 - 5 in RBParser does what you would expect. 4 - - 5 as well.
>
>
> 3 @-5 and/or 3 @- 5 is (rightly) disallowed by both.
>
>
>
> That one is easier and expected.
> My position would be twofold:
> - RBParser is, IMHO, a good parser and I would follow its interpretation.
> That Opal reuses it is a good point for me.
> - As a programming language designer (and parser implementor), accepting -
> 5 is user friendly, but a bit too contextual in the lexer to be nice to
> implement.
>
> Thierry
>
>
>
> Cheers,
> Henry
>
>
>


Re: [Pharo-users] AST #copy behavior

2014-11-10 Thread Thierry Goubier
2014-11-10 14:38 GMT+01:00 Mark Rizun :

> Hi guys!
>
> I'm using AST really often, and recently stumbled on problem with copying
> an
> AST.
> It doesn't copy stuff related to computing sourceInterval of AST, and I
> need
> it to copy:)
>
> I know there are #deepCopy and #veryDeepCopy, but they are too heavy
> methods
> for AST, especially in my case, as I need to copy AST all the time.
>
> Earlier, I discussed this problem with Marcus Denker. He suggested to fix
> #copy of AST (to be more accurate #postCopy).
> If I want to copy stuff related to sourceInterval, I would have to
> implement
> #postCopy for each RBNode... differently.
>
> RBProgramNode>>#postCopy
> super postCopy.
> properties := properties copy
>
> So for each RBNode... it will be like:
>
> RBNode...>>#postCopy
> super postCopy.
> "here some different code each time"
>
> I'm just interested: What do you think about it?
>

The AST generated by SmaCC has a postCopy in the same way that you
describe, so I'd say this is OK.

Just be precise about what you copy and what you don't copy. Can you say
what will be copied and what won't?

Thierry


>
> Thanks,
> Mark
>
>
>
> --
> View this message in context:
> http://forum.world.st/AST-copy-behavior-tp4789447.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Re: [Pharo-users] question on syntax "negate numbers"

2014-11-10 Thread Thierry Goubier
2014-11-10 15:57 GMT+01:00 Werner Kassens :

> Let me restate what i meant: if you enter 5--4 in squeak for example, the
> parser asks you whether you meant 5 - -4 or 5 -- 4.


Oh, ok. And what happens if you are not in an interactive mode (like when
you are filing-in code) ?

Thierry


>
> werner
>
>
> On 11/10/2014 03:28 PM, Werner Kassens wrote:
>
>> Of course. i was talking about x -- y not x - - y.
>> werner
>>
>> On 11/10/2014 03:17 PM, Thierry Goubier wrote:
>>
>>> I believe that x - - y would give you an error.
>>>
>>> 4 - - 5 in parsing is a different beast, because you consider - 5 as a
>>> single token.
>>>
>>
>>
>>
>>
>


Re: [Pharo-users] Anyone having a Rserve client?

2014-11-12 Thread Thierry Goubier
2014-11-12 13:41 GMT+01:00 p...@highoctane.be :

> Nice to know.
>
> I'll give it a shot on my Ubuntu 14.04 in the evening. As I may have more
> than one image connecting to the R, I will still need something with RServe
> at one point I guess.
>
>
And the remote capabilities can be interesting if one has to run R on a
server somewhere (or on multiple servers).

But it's cool to have all those options.

Thierry


>
> Phil
>
> On Wed, Nov 12, 2014 at 1:16 PM, Blondeau Vincent <
> vincent.blond...@worldline.com> wrote:
>
>> Hi,
>>
>> Last two weeks, I began to write a binding with nativeboost to call the R
>> functions.
>>
>> It is a proof of concept for now :
>> http://www.smalltalkhub.com/#!/~VincentBlondeau/RProjectConnector
>> if you want to participate, just ask me!
>>
>> You have to download the right libraries to do it work. It is the .dll in
>> the same folder of the R.exe executable. I think that it is the same for
>> Linux and MacOS.
>> And copy them it in the same folder that the pharo executable.
>>
>> I think that nativeboost binding will be faster than RServer and more
>> easy to use that why I started this.
>>
>> Cheers,
>> Vincent
>>
>>
>>
>> > -Message d'origine-
>> > De : Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] De la
>> part de
>> > stepharo
>> > Envoyé : lundi 10 novembre 2014 11:14
>> > À : Any question about pharo is welcome
>> > Objet : Re: [Pharo-users] Anyone having a Rserve client?
>> >
>> > I know that vincent did a binding to connect to R.
>> > On 10/11/14 10:28, p...@highoctane.be wrote:
>> > > I am doing some R work and wanted to integrate with Pharo.
>> > >
>> > > Is there any support for Rserve around?
>> > >
>> > > http://www.rforge.net/Rserve/dev.html
>> > >
>> > > At this point I am doing OProcess style stuff with littler but Rserve
>> > > would be cooler.
>> > >
>> > > There are binding for Ruby and Python.
>> > >
>> > > e.g.
>> > > http://pythonhosted.org//pyRserve/
>> > > https://github.com/ralhei/pyRserve
>> > >
>> > > Stats are becoming bigger and bigger and the leader of the pack is R.
>> > >
>> > > DHB is fine and I do use some of it but let's face it, it is nowhere
>> > > near the power of R...
>> > >
>> > >
>> > > Phil
>> >
>>
>>
>>
>> Ce message et les pièces jointes sont confidentiels et réservés à l'usage
>> exclusif de ses destinataires. Il peut également être protégé par le secret
>> professionnel. Si vous recevez ce message par erreur, merci d'en avertir
>> immédiatement l'expéditeur et de le détruire. L'intégrité du message ne
>> pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra
>> être recherchée quant au contenu de ce message. Bien que les meilleurs
>> efforts soient faits pour maintenir cette transmission exempte de tout
>> virus, l'expéditeur ne donne aucune garantie à cet égard et sa
>> responsabilité ne saurait être recherchée pour tout dommage résultant d'un
>> virus transmis.
>>
>> This e-mail and the documents attached are confidential and intended
>> solely for the addressee; it may also be privileged. If you receive this
>> e-mail in error, please notify the sender immediately and destroy it. As
>> its integrity cannot be secured on the Internet, the Worldline liability
>> cannot be triggered for the message content. Although the sender endeavours
>> to maintain a computer virus-free network, the sender does not warrant that
>> this transmission is virus-free and will not be liable for any damages
>> resulting from any virus transmitted.
>>
>
>


Re: [Pharo-users] Metacello configuration based on subdirectory of Git repo

2014-11-13 Thread Thierry Goubier

Le 13/11/2014 18:21, Rafael Luque a écrit :

Hi all,

I'm starting with Pharo and playing with the ways to integrate it with Git.

I've read the "Git and Pharo" chapter on "Enterprise Pharo" book by
Thierry Goubier and loaded the GitFileTree package.

I'm working on a project with several microservices, one of them will be
based on Pharo and the other ones in other technologies. The project
repository is based in our own Git server and each microservice maps
with one subdirectory in the repo.

My question is if it is possible to define a Metacello configuration to
load my packages from an specific subdirectory of a Git repository. I
have tried with the following baseline method, but it fails because does
not understand repoPath:


Yes, it is possible to fix a specific subdirectory, with a gitfiletree: 
url, via a dir=aRelativePath.


baseline01: spec

spec
for: #common
do: [
 spec blessing: #baseline.
 spec repository: 
'gitfiletree://my-git-server/my-project&dir=my-pharo-subdirectory'.

 spec
   package: 'MyPackage'.
  . . . ]

You can have a look at the ConfigurationOfAltBrowser in the 
configuration browser to see how it triggers downloading the GitFileTree 
support.


Thierry


baseline01: spec

spec
for: #common
do: [
spec blessing: #baseline.
spec repository: 'git@my-git-server:my-project'.
 spec repoPath: 'my-pharo-subdirectory'.
spec
package: 'MyPackage'.
 . . . ]

Thank you in advance.






Re: [Pharo-users] Maps from Wikipedia loaded on Roassal's RTMetricMap

2014-11-22 Thread Thierry Goubier
Hi Vladimir,

2014-11-18 14:30 GMT+01:00 Offray Vladimir Luna Cárdenas 
:

>
> Notice that this tries to be a leaner approach to the one I had already
> asked about importing maps from open street map.
>

Another option which you could look to is:

- use Cirela-OSM (
http://forum.world.st/ANN-NetGen-OSM-Roassal-Demo-tp4791158.html), which
will give you the OpenStreetMap background for any place / any zoom level

- and a combination of FreeBase, GeoJSON in a Roassal view

(See the geometry properties of freebase at:
http://www.freebase.com/location/location/geometry?schema=)

In Cirela-OSM, you will find examples of queries to FreeBase to retrieve
country / cities Lat/Lon coordinates and use them in Roassal. You also have
an example of querying raw OpenStreetMap data as well.

Good luck for your workshop.

Thierry


>
> Thanks,
>
> Offray
>
>


  1   2   3   4   5   6   >