Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
September 2017
- 80 participants
- 570 messages
Re: [Pharo-users] PlotMorph on Pharo 6.1
by stephan
AxesMorph>drawGridOn: aCanvas
| gridColor right bottom width height lighter darker baseColor |
baseColor := self baseColor.
lighter := baseColor twiceLighter.
darker := baseColor twiceDarker.
gridColor := (lighter diff: baseColor)
> (darker diff: baseColor) ifTrue: [lighter] ifFalse: [darker].
right := self bounds width - margin.
width := self bounds width - (margin * 2).
bottom := self bounds height - margin.
height := self bounds height - (margin * 2).
(margin to: right by: width / 10) do:
[:x |
x := x rounded.
aCanvas
line: x @ margin
to: x @ bottom
color: gridColor].
(margin to: bottom by: height / 10) do:
[:y |
y := y rounded.
aCanvas
line: margin @ y
to: right @ y
color: gridColor]
the assignment to the block parameter
x := x rounded is in red in Pharo 7.
Is that not (/no longer) allowed?
Name: PlotMorph-StephanEggermont.8
Author: StephanEggermont
Time: 11 September 2017, 12:27:45.971839 pm
UUID: f65d521d-4915-0d00-821a-53ce0d9ac81c
Ancestors: PlotMorph-StephaneDucasse.7
Added <example> pragmas to PlotMorph. Opened examples in a window.
Replaced #deprecatedExplanation: by #deprecated:
Fixed PlotPoint constructor
Name: ConfigurationOfPlotMorph-StephanEggermont.5
Author: StephanEggermont
Time: 11 September 2017, 12:29:19.779132 pm
UUID: adbfe922-4915-0d00-821b-1f5a0d9ac81c
Ancestors: ConfigurationOfPlotMorph-StephanEggermont.4
New version for Pharo 6 and 7
Sept. 11, 2017
Re: [Pharo-users] [Pharo-dev] Can Realm (DB) and Pharo play together (or can we have a Pharo Realm Object Server to ROS) ?
by Cédrick Béler
> âCan you move such discussions on pharo-users mailing-list and not pharo-dev ?
Sorry for that !
I transfered...
>
> Iâve spent some time in the summer in what I call my quest to the ultimate and easy and fun architecture to prototype some personal administration apps and have fun :-)
> Iâll share some experience and wonder if there are alternative in Pharo.
>
> I want app that are mobile firsts, then manageable with a computer (for more complex administrative tasks).
> I want them reactive (I especially like reactive data driven application like meteor.js), ubiquitous around my devices and not always connected (offline-first - this is very important if not the first objective).
>
> Ok, so I was lurking around looking for server and mobile distributed databases and I finally found Realm (https://realm.io/products/realm-mobile-platform/ <https://realm.io/products/realm-mobile-platform/>) which is a cool architecture plenty of promises, well documented, lots of tutorials... The architecture is composed of 2 products:
> - Realm DB [1] that runs on mobile device - multiplatform - fully open-source - performant - an object DB with some limitation though
> - Realm Object Server (ROS) [2] - provide two-way data sync simple and easy - BUT proprietary even if free for developers ⦠the entry point for serious developments (in particular access programmatically to the server) is very expensive ! 1500$mo !
>
> The developer edition with is free is already quite outstanding to me. Looks at this demo page on GitHub [3] !
>
> But⦠without any control to the ROS, I find ROS quite limited finally. I may then use the DB part, ROS free for what really need sync reactivity between devices or between group of people (like a black board), but store all less transient information to WhateverNoSQLDB probably in REST.
>
> Anyway I want to share that with you because it rings a smalltalk bell in my head⦠itâs about object data, live feeling, and I want to use Pharo on the server :)
>
> Maybe some people here have thought of an alternative ROS in Pharo or Gemstone ? Any ideas or remarks ?
> I was aware of sebastian Flow living full-stack framework attempt but donât know more.
>
> TIA
> Cédrick
>
> NB: Pharo looks more and more great ! Congratulations guys for you job ! I hope ESUG was nice.
> Iâve just tried Telepharo on Pharo 6 (64 bit). Really great work too... It works like a charm, out of the box on low cost dedicated ubuntu servers [4] => 10â¬mo
> Pharo 64 tinyBenchmarks is 2,75 times slower than on my Mac mini Core i5 2,5GHz from 2012 with SSD (I guess itâs not that bad and usable for personal applications servers). I think itâ about 3 times faster than on a raspberry Pi.
> Mac mini (32 bit version): '1329870129 bytecodes/sec; 108576799 sends/secâ
> Dedibox Low Cost server (64 bit version)â '595695171 bytecodes/sec; 39441333 sends/sec'
>
> NB2: to download/install Pharo from command line, on the web site instructions, it seems it lacks the trailing slash. I had to add it.
> curl get.pharo.org/64 <http://get.pharo.org/64>/ | bash
>
> [1] https://realm.io/products/realm-mobile-database/ <https://realm.io/products/realm-mobile-database/>
> [2] https://realm.io/products/realm-mobile-platform/ <https://realm.io/products/realm-mobile-platform/>
> [3] https://github.com/realm-demos <https://github.com/realm-demos>
> [4] https://www.online.net/fr/serveur-dedie/dedibox-sc <https://www.online.net/fr/serveur-dedie/dedibox-sc>
>
>
>
>
>
> --
> Serge Stinckwich
> UCN & UMI UMMISCO 209 (IRD/UPMC)
> Every DSL ends up being Smalltalk
> http://www.doesnotunderstand.org/ <http://www.doesnotunderstand.org/>
Sept. 11, 2017
Re: [Pharo-users] PlotMorph on Pharo 6.1
by stephan
On 10-09-17 23:04, Mark Bestley wrote:
> I downloaded 64bit Pharo from
> <http://files.pharo.org/platform/Pharo6.1-64-mac.zip>
>
> Started it and first thing opend Catalog Browser.
> I searched for plot
> Chose pLotMorph and chose Install Stable Version
>
> I got an Information window saying There was an error trying to install
> PlotMorph. Installation was cancelled.
To debug this:
Instead of installing the stable version, load the configuration.
Type shift-enter to open Spotter.
Type Plot and enter to find ConfigurationOfPlotMorph and browse it.
First take a look at method #stable to see what is defined there
stable: spec
<symbolicVersion: #'stable'>
spec for: #'pharo3.x' version: '1.0'.
spec for: #'pharo5.x' version: '1.0'.
spec for: #'pharo6.x' version: '1.0'.
That looks good, a stable version is defined for Pharo 6.
A stable version is missing for Pharo 7
Take a look at #version10:
version10: spec
<version: '1.0'>
spec package: 'PlotMorph' with: 'PlotMorph-StephaneDucasse.7'.
Hmm, that doesn't look good. That is not a complete Metacello spec.
It looks like the reference to the baseline is missing.
baseline10: spec
<version: '1.0-baseline'>
spec
for: #pharo
do: [
spec blessing: #baseline.
spec description: 'First Full Configuration'.
spec author: 'StephaneDucasse'.
spec timestamp: '29/12/2013 12:29'.
spec repository:
'http://www.smalltalkhub.com/PharoExtras/PlotMorph/main'.
spec package: 'PlotMorph' ].
Yep, there is the missing information.
So let's fix the version10. We can do it in place, as this can not have
worked. Otherwise we would have had to add a new version, and updated
the #stable.
Name: ConfigurationOfPlotMorph-StephanEggermont.4
Author: StephanEggermont
Time: 11 September 2017, 12:09:08.46706 pm
UUID: d297b6da-4815-0d00-8219-91680d9ac81c
Ancestors: ConfigurationOfPlotMorph-StephaneDucasse.3
Fixed version10, added pharo 7
Stephan
Sept. 11, 2017
Re: [Pharo-users] New chapter for coming book: Messages
by Ricardo Pacheco
Looks Great, congratulations!! I just read it and has a couple of mistakes
in the first figures. The return value of the false (2.3, 2.4).
Regards
Ricardo
El sept. 11, 2017 12:12 AM, "Stephane Ducasse" <stepharo.self(a)gmail.com>
escribió:
Hi
after this crazy esug I took a long bus and I wrote one missing
chapter for the forhtcoming bus.
I plan to have a first full version for 1 of October :)
I reorganised and massively clean the book contents.
Comments are welcome in any form.
Stef
https://github.com/SquareBracketAssociates/LearningOOPWithPharo
Sept. 11, 2017
Re: [Pharo-users] PlotMorph on Pharo 6.1
by H. Hirzel
The message after loading on the Transcript is
Loaded -> Magritte-GT-SeanDeNigris.6 ---
http://smalltalkhub.com/mc/Magritte/Magritte3/main/ --- cache
...finished 3.5.1
Fetched -> ConfigurationOfPlotMorph-StephaneDucasse.3 ---
http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo60/main/ ---
http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo60/main/
Loaded -> ConfigurationOfPlotMorph-StephaneDucasse.3 ---
http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo60/main/ ---
http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo60/main/The version
'1.0' is not defined in ConfigurationOfPlotMorph for the current
platform, because an exception occurred while creating the version:.
MessageNotUnderstood: receiver of "package:with:constructor:" is nil.
Evaluate the following to see the error: '[ConfigurationOfPlotMorph
project ]
on: MetacelloErrorInProjectConstructionNotification
do: [:ex | ex resume: true ].'
Possible versions include: #(#bleedingEdge #development #stable '1.0-baseline')
On 9/11/17, Stephane Ducasse <stepharo.self(a)gmail.com> wrote:
> Thanks for the report since I need PlotMorph too for a project.
> What you see is the consequence of lack of validation of published
> packages. This is years that I'm saying that I need someone to work on
> that.
> We got money from inria for Pavel to work on it but the bootstrap was
> more important :).
>
> Stef
>
> On Mon, Sep 11, 2017 at 5:05 AM, H. Hirzel <hannes.hirzel(a)gmail.com> wrote:
>> Mark,
>>
>> Open a Transcript window before loading PlotMorph.
>> Which error message do you get there?
>>
>> --Hannes
>>
>> On 9/10/17, Mark Bestley <st(a)bestley.co.uk> wrote:
>>>
>>> I downloaded 64bit Pharo from
>>> <http://files.pharo.org/platform/Pharo6.1-64-mac.zip>
>>>
>>> Started it and first thing opend Catalog Browser.
>>> I searched for plot
>>> Chose pLotMorph and chose Install Stable Version
>>>
>>> I got an Information window saying There was an error trying to install
>>> PlotMorph. Installation was cancelled.
>>>
>>> So
>>> 1) Does PlotMorph work as it is in the SystemCatalog I assume so. So how
>>> shoulkd I load it?
>>> 2) How can I see what the error actuially was
>>> 3) How can I actually capure the popup window to cut and paste the
>>> error.
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Mark
>>>
>>>
>>>
>>
>
>
Sept. 11, 2017
Re: [Pharo-users] #parseMethod:onError: isn't as obvious as expected - is it me?
by Marcus Denker
> On 11 Sep 2017, at 02:30, Tim Mackinnon <tim(a)testit.works> wrote:
>
> Hey Marcus - I've kept noodling on this as a little sub interesting thing I can play with in spare moments.
>
> I think I'm getting close to an interesting solution using #parseFaulty (although I wasn't sure how to distinguish between a method and playground without asking the editor for its edittingMode - which maybe is ok?)
>
> I've had to add a new visitor to run through parseErrorNodes (I'm surprised there isn't a visitor for this already) (I also added one for comments too) - as #findBestNode doesn't try hard enough - and I've also had a crack at reparsing an error if it seems simple enough (like when you are working on statement in the middle of code and have just broken that one line).
>
Great!
> I'll try it for a few days and then maybe you might be interested in having a look?
>
Yes!
> Tim
>
> Sent from my iPhone
>
> On 9 Sep 2017, at 12:53, Tim Mackinnon <tim(a)testit.works <mailto:tim@testit.works>> wrote:
>
>> Thanks for the pointer Marcus, I'll have a look - it's a fascinating area that I didn't know much about until now ;)
>>
>> All I wanted was to not have to select specific code to do senders (& refactoring), as well as have better statement selection so I can more easily put brackets around things...
>>
>> But now it dawns on me I'd like better code completion after I've already completed but maybe want the fuller keyword method....
>>
>> Even the refactoring of local method changes shouldn't need you to save your method to rename a local variable or extract a statement to a variable. And I hate having to declare local variables painfully one by one - and I miss the option to detect a simple typo and correct it.
>>
>> These are all things that I love in IntelliJ - and I think we have fantastic infrastructure to do these things too. So I'll keep plugging away at lunch times to see what I can do.
>>
>> I've rewritten it about 3 times already ;)
>>
>> Tim
>>
>> Sent from my iPhone
>>
>> On 9 Sep 2017, at 08:42, Marcus Denker <marcus.denker(a)inria.fr <mailto:marcus.denker@inria.fr>> wrote:
>>
>>> there is #parseFaultyMethod:, too. We use RBParser for syntax highlighting.
>>>
>>> We do already have âsendersâ and âimplementors working in the AST when using Suggestions.
>>>
>>> See SugsMenuBuilder>>#findBestNodeFor:
>>>
>>> in the case of non-accepted code, it uses the compiler chain with #optionParseErrors (which uses parseFaultyMethod: to parse).
>>>
>>> context hasUnacceptedEdits
>>> ifTrue: [
>>> root := Smalltalk compiler
>>> source: context code;
>>> options: #(+ optionParseErrors);
>>> parse.
>>> context selectedClass ifNotNil: [ :theClass | root methodNode methodClass: theClass ].
>>> root doSemanticAnalysis ]
>>>
>>> This works well but fails when you actually are in an error node.. for the same code the âdumbâ way we use
>>> with standard âsenders ofâ just takes line, looks for spaces and feeds that word into the âsenders ofâ..
>>>
>>> So to make this work better we need to combine both approaches and deal better with the Error Node content.
>>> (e.g. trying to fix it and re-parse or just use the dumb âget the work under the cursorâ way as a first step).
>>>
>>> Marcus
>>>
>>>> On 8 Sep 2017, at 03:43, Tim Mackinnon <tim(a)testit.works <mailto:tim@testit.works>> wrote:
>>>>
>>>> Damn you smalltalk⦠you suck me in to little side problemsâ¦.
>>>>
>>>> RBParser is actually a lot more flexible than I had realised - and not so difficult to understand for a mere mortalâ¦
>>>>
>>>> It naively seems that (what I still consider a confusingly named method) is quite simple to extend to handle at least medium sized errors just by doing something like:
>>>>
>>>> ast := [RBParser parseMethod: source onError: [ :msg :pos :parser | |seqNode errorNode|
>>>>
>>>> errorNode := RBParseErrorNode
>>>> errorMessage: msg value: parser currentToken value printString at: pos.
>>>>
>>>> seqNode := parser sequenceNodeClass new.
>>>> parser
>>>> step;
>>>> parseStatements: true into: seqNode.
>>>>
>>>> seqNode
>>>> addNodeFirst: errorNode;
>>>> yourself
>>>>
>>>> ]] onDNU: #body: do: [ nil âHandle non method source fragments"].
>>>>
>>>>
>>>> NOTE: I did have to add >>#currentToken as a method to RBParser as it doesnât expose very much for the onError blocks, which I think it should to make them a bit more useful.
>>>>
>>>> Tim
>>>>
>>>>> On 7 Sep 2017, at 14:39, Tim Mackinnon <tim(a)testit.works <mailto:tim@testit.works>> wrote:
>>>>>
>>>>> Thanks Thierry - Iâve been noodling in the background and next I hit the question of âcommentsâ - which I found RB does handle⦠and then as per your point - how to skip past an error and try further down (which it seems that the scanner might have the info to let me skip simple things). You seem to get sucked in more and more when trying to to this properly - which does make it sound like a very good internship or GSoc project.
>>>>>
>>>>> I think I may have enough to get something polished enough to release to the wider world. I certainly love having better keyboard support when Iâm coding - as we type a lot (even though we have simple syntax) - and having efficient tools takes away the friction.
>>>>>
>>>>> Next on my hit list, it add the same support to the refactoring tools - which while sophisticated are so clunky in use when compared to IntelliJ.
>>>>>
>>>>> Tim
>>>>>
>>>>>> On 7 Sep 2017, at 08:02, Thierry Goubier <thierry.goubier(a)gmail.com <mailto:thierry.goubier@gmail.com>> wrote:
>>>>>>
>>>>>> Hi Tim,
>>>>>>
>>>>>> 2017-09-01 13:39 GMT+02:00 Tim Mackinnon <tim(a)testit.works <mailto:tim@testit.works>>:
>>>>>> 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 <thierry.goubier(a)gmail.com <mailto:thierry.goubier@gmail.com>> 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 <tim(a)testit.works <mailto:tim@testit.works>>:
>>>>>>> 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 <marcus.denker(a)inria.fr <mailto:marcus.denker@inria.fr>> wrote:
>>>>>>> >
>>>>>>> >
>>>>>>> >> On 31 Aug 2017, at 19:07, Stephane Ducasse <stepharo.self(a)gmail.com <mailto:stepharo.self@gmail.com>> wrote:
>>>>>>> >>
>>>>>>> >> On Wed, Aug 30, 2017 at 9:50 PM, Tim Mackinnon <tim(a)testit.works <mailto:tim@testit.works>> 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
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
Sept. 11, 2017
Re: [Pharo-users] PlotMorph on Pharo 6.1
by Stephane Ducasse
Thanks for the report since I need PlotMorph too for a project.
What you see is the consequence of lack of validation of published
packages. This is years that I'm saying that I need someone to work on
that.
We got money from inria for Pavel to work on it but the bootstrap was
more important :).
Stef
On Mon, Sep 11, 2017 at 5:05 AM, H. Hirzel <hannes.hirzel(a)gmail.com> wrote:
> Mark,
>
> Open a Transcript window before loading PlotMorph.
> Which error message do you get there?
>
> --Hannes
>
> On 9/10/17, Mark Bestley <st(a)bestley.co.uk> wrote:
>>
>> I downloaded 64bit Pharo from
>> <http://files.pharo.org/platform/Pharo6.1-64-mac.zip>
>>
>> Started it and first thing opend Catalog Browser.
>> I searched for plot
>> Chose pLotMorph and chose Install Stable Version
>>
>> I got an Information window saying There was an error trying to install
>> PlotMorph. Installation was cancelled.
>>
>> So
>> 1) Does PlotMorph work as it is in the SystemCatalog I assume so. So how
>> shoulkd I load it?
>> 2) How can I see what the error actuially was
>> 3) How can I actually capure the popup window to cut and paste the
>> error.
>>
>>
>>
>>
>>
>>
>> --
>> Mark
>>
>>
>>
>
Sept. 11, 2017
New chapter for coming book: Messages
by Stephane Ducasse
Hi
after this crazy esug I took a long bus and I wrote one missing
chapter for the forhtcoming bus.
I plan to have a first full version for 1 of October :)
I reorganised and massively clean the book contents.
Comments are welcome in any form.
Stef
https://github.com/SquareBracketAssociates/LearningOOPWithPharo
Sept. 11, 2017
Re: [Pharo-users] PlotMorph on Pharo 6.1
by H. Hirzel
Mark,
Open a Transcript window before loading PlotMorph.
Which error message do you get there?
--Hannes
On 9/10/17, Mark Bestley <st(a)bestley.co.uk> wrote:
>
> I downloaded 64bit Pharo from
> <http://files.pharo.org/platform/Pharo6.1-64-mac.zip>
>
> Started it and first thing opend Catalog Browser.
> I searched for plot
> Chose pLotMorph and chose Install Stable Version
>
> I got an Information window saying There was an error trying to install
> PlotMorph. Installation was cancelled.
>
> So
> 1) Does PlotMorph work as it is in the SystemCatalog I assume so. So how
> shoulkd I load it?
> 2) How can I see what the error actuially was
> 3) How can I actually capure the popup window to cut and paste the
> error.
>
>
>
>
>
>
> --
> Mark
>
>
>
Sept. 11, 2017
Re: [Pharo-users] #parseMethod:onError: isn't as obvious as expected - is it me?
by Tim Mackinnon
Hey Marcus - I've kept noodling on this as a little sub interesting thing I can play with in spare moments.
I think I'm getting close to an interesting solution using #parseFaulty (although I wasn't sure how to distinguish between a method and playground without asking the editor for its edittingMode - which maybe is ok?)
I've had to add a new visitor to run through parseErrorNodes (I'm surprised there isn't a visitor for this already) (I also added one for comments too) - as #findBestNode doesn't try hard enough - and I've also had a crack at reparsing an error if it seems simple enough (like when you are working on statement in the middle of code and have just broken that one line).
I'll try it for a few days and then maybe you might be interested in having a look?
Tim
Sent from my iPhone
> On 9 Sep 2017, at 12:53, Tim Mackinnon <tim(a)testit.works> wrote:
>
> Thanks for the pointer Marcus, I'll have a look - it's a fascinating area that I didn't know much about until now ;)
>
> All I wanted was to not have to select specific code to do senders (& refactoring), as well as have better statement selection so I can more easily put brackets around things...
>
> But now it dawns on me I'd like better code completion after I've already completed but maybe want the fuller keyword method....
>
> Even the refactoring of local method changes shouldn't need you to save your method to rename a local variable or extract a statement to a variable. And I hate having to declare local variables painfully one by one - and I miss the option to detect a simple typo and correct it.
>
> These are all things that I love in IntelliJ - and I think we have fantastic infrastructure to do these things too. So I'll keep plugging away at lunch times to see what I can do.
>
> I've rewritten it about 3 times already ;)
>
> Tim
>
> Sent from my iPhone
>
>> On 9 Sep 2017, at 08:42, Marcus Denker <marcus.denker(a)inria.fr> wrote:
>>
>> there is #parseFaultyMethod:, too. We use RBParser for syntax highlighting.
>>
>> We do already have âsendersâ and âimplementors working in the AST when using Suggestions.
>>
>> See SugsMenuBuilder>>#findBestNodeFor:
>>
>> in the case of non-accepted code, it uses the compiler chain with #optionParseErrors (which uses parseFaultyMethod: to parse).
>>
>> context hasUnacceptedEdits
>> ifTrue: [
>> root := Smalltalk compiler
>> source: context code;
>> options: #(+ optionParseErrors);
>> parse.
>> context selectedClass ifNotNil: [ :theClass | root methodNode methodClass: theClass ].
>> root doSemanticAnalysis ]
>>
>> This works well but fails when you actually are in an error node.. for the same code the âdumbâ way we use
>> with standard âsenders ofâ just takes line, looks for spaces and feeds that word into the âsenders ofâ..
>>
>> So to make this work better we need to combine both approaches and deal better with the Error Node content.
>> (e.g. trying to fix it and re-parse or just use the dumb âget the work under the cursorâ way as a first step).
>>
>> Marcus
>>
>>> On 8 Sep 2017, at 03:43, Tim Mackinnon <tim(a)testit.works> wrote:
>>>
>>> Damn you smalltalk⦠you suck me in to little side problemsâ¦.
>>>
>>> RBParser is actually a lot more flexible than I had realised - and not so difficult to understand for a mere mortalâ¦
>>>
>>> It naively seems that (what I still consider a confusingly named method) is quite simple to extend to handle at least medium sized errors just by doing something like:
>>>
>>> ast := [RBParser parseMethod: source onError: [ :msg :pos :parser | |seqNode errorNode|
>>>
>>> errorNode := RBParseErrorNode
>>> errorMessage: msg value: parser currentToken value printString at: pos.
>>>
>>> seqNode := parser sequenceNodeClass new.
>>> parser
>>> step;
>>> parseStatements: true into: seqNode.
>>>
>>> seqNode
>>> addNodeFirst: errorNode;
>>> yourself
>>>
>>> ]] onDNU: #body: do: [ nil âHandle non method source fragments"].
>>>
>>>
>>> NOTE: I did have to add >>#currentToken as a method to RBParser as it doesnât expose very much for the onError blocks, which I think it should to make them a bit more useful.
>>>
>>> Tim
>>>
>>>> On 7 Sep 2017, at 14:39, Tim Mackinnon <tim(a)testit.works> wrote:
>>>>
>>>> Thanks Thierry - Iâve been noodling in the background and next I hit the question of âcommentsâ - which I found RB does handle⦠and then as per your point - how to skip past an error and try further down (which it seems that the scanner might have the info to let me skip simple things). You seem to get sucked in more and more when trying to to this properly - which does make it sound like a very good internship or GSoc project.
>>>>
>>>> I think I may have enough to get something polished enough to release to the wider world. I certainly love having better keyboard support when Iâm coding - as we type a lot (even though we have simple syntax) - and having efficient tools takes away the friction.
>>>>
>>>> Next on my hit list, it add the same support to the refactoring tools - which while sophisticated are so clunky in use when compared to IntelliJ.
>>>>
>>>> Tim
>>>>
>>>>> On 7 Sep 2017, at 08:02, Thierry Goubier <thierry.goubier(a)gmail.com> wrote:
>>>>>
>>>>> Hi Tim,
>>>>>
>>>>> 2017-09-01 13:39 GMT+02:00 Tim Mackinnon <tim(a)testit.works>:
>>>>>> 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 <thierry.goubier(a)gmail.com> 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 <tim(a)testit.works>:
>>>>>>>> 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 <marcus.denker(a)inria.fr> wrote:
>>>>>>>> >
>>>>>>>> >
>>>>>>>> >> On 31 Aug 2017, at 19:07, Stephane Ducasse <stepharo.self(a)gmail.com> wrote:
>>>>>>>> >>
>>>>>>>> >> On Wed, Aug 30, 2017 at 9:50 PM, Tim Mackinnon <tim(a)testit.works> 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
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>
>>>>
>>>
>>
Sept. 11, 2017