Re: [Pharo-users] [ANN] JRMPC Poll

2020-03-25 Thread Richard O'Keefe
I am a little confused here.  I originally learned Smalltalk from the
coloured books and
then Inside Smalltalk.  When I got the chance to use Squeak, pretty
much everything
from those books carried over well enough for me to hit the ground
running.  There are
lots of free e-books about Smalltalk, not least Pharo By Example.  Had
these people
who were polled read PBE?

On Thu, 26 Mar 2020 at 04:49, horrido  wrote:
>
> This is what I provided the JRMPC participants: https://jrmpc.ca/ (see "How
> to learn Smalltalk programming"). I'm not sure how I could've done better,
> though.
>
> You make an excellent point about duplication and keeping documentation
> up-to-date. However, there has to be some middle ground that makes it easier
> and more convenient for new developers to find the tools they need. Perhaps
> a synoptical reference showing the more common classes used, such as
> collections, web-related classes, time-related classes, exception and error
> classes, file system-related classes, process-related classes, and so on.
> These classes ought not to change much, if at all.
>
>
>
> Tim Mackinnon wrote
> > Or we teach people to fish…? What’s the point of duplicating everything
> > that’s already in the image anyway - we just need to be cleverer or ensure
> > that people know to look there and have the right onboarding experience to
> > do that? Otherwise its just another thing that gets out of date very
> > rapidly and we already have enough problems with that.
> >
> > I’d be interested in what intro material Richard gave the students to
> > start with (after all - he has quite a few tutorials of his own, some of
> > which I had followed - but I suspect they are out of date now themselves).
> > When you launch pharo there is the helpful welcome screen - did the
> > student’s actually use it and follow what it says?
> >
> > And did we see any of them in this forum (or was that against the rules?)
> >
> > Tim
> >
> >> On 24 Mar 2020, at 17:28, Ben Coman 
>
> > btc@
>
> >  wrote:
> >>
> >> Pharo has some good documentation, but its more lesson-based than a
> >> library reference.
> >> Those of us familiar with Pharo know the tricks to use the system itself
> >> as that reference, but I'd imagine this is an unfamiliar workflow for
> >> newcomers.
> >>
> >> I have seen before a class library reference generated from the image,
> >> but I couldn't put my hands on it right now.
> >> @all, is it still being generated?. This might provide newcomers
> >> something more familiar to work with.
> >>
> >> cheers -ben
> >>
> >> On Tue, 24 Mar 2020 at 03:00, Richard Kenneth Eng 
>
> > horrido.hobbies@
>
> >  mailto:
>
> > horrido.hobbies@
>
> > > wrote:
> >> https://jrmpc.ca/2020/03/20/what-makes-learning-smalltalk-challenging/
> >> https://jrmpc.ca/2020/03/20/what-makes-learning-smalltalk-challenging/;
> >>
> >> FWIW, 95% of respondents pointed to the lack of reference documentation
> >> for the class library as the major obstacle to learning Smalltalk/Pharo.
> >>
> >> Richard
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>



Re: [Pharo-users] Do we have a simple markdown parser?

2020-03-25 Thread Kasper Osterbye
I do not think the PP2 is used in the github parser actually. The github
parser was just a addon to the rest of the stuff, and the pillar markdown
parser used PP2.

Anyways, if you have any questions, feel free to ask.

Best,

Kasper


Re: [Pharo-users] Do we have a simple markdown parser?

2020-03-25 Thread Tim Mackinnon
Hey thanks - I took another fresh image and this one seemed to work, so not 
sure what happened in the other image that causes that issue (I’ve seen it 
before with other projects too - something seems to cause a stall, and then 
things don’t seem to work …).

Anyway - thanks for putting it forward - I saw it load PP2, so it seems like 
something in the write direction for me (although my use case might be possible 
with a regex, but that is just so nasty).

Tim

> On 25 Mar 2020, at 17:03, Kasper Osterbye  wrote:
> 
> @Tim. I just verified that it load on a fresh P8. I am on a mac, but that 
> should not make any difference.
> 
> 
> 
> Best,
> 
> Kasper




Re: [Pharo-users] Do we have a simple markdown parser?

2020-03-25 Thread Kasper Osterbye
@Tim. I just verified that it load on a fresh P8. I am on a mac, but that
should not make any difference.

[image: image.png]

Best,

Kasper


Re: [Pharo-users] [ANN] JRMPC Poll

2020-03-25 Thread Richard Sargent
On Wed, Mar 25, 2020, 08:49 horrido  wrote:

> This is what I provided the JRMPC participants: https://jrmpc.ca/ (see
> "How
> to learn Smalltalk programming"). I'm not sure how I could've done better,
> though.
>
> You make an excellent point about duplication and keeping documentation
> up-to-date. However, there has to be some middle ground that makes it
> easier
> and more convenient for new developers to find the tools they need. Perhaps
> a synoptical reference showing the more common classes used, such as
> collections, web-related classes, time-related classes, exception and error
> classes, file system-related classes, process-related classes, and so on.
> These classes ought not to change much, if at all.
>


I agree with this. So many times I have seen documentation that could be
compared to what results from throwing a plate of spaghetti (Bolognese!) at
a wall.

Usually what's lacking is the kind of information that might be called a
road map. Not so much in the sense of a set of directions, but like a real
road map or a transit system map, lays out the routes and shows the
connections between important places.

Pulling numbers out of thin air, it might be that as little as 1% of the
system details would suffice to show a novice how things fit together and
how to easily navigate the detailed information.

Like you suggest, this small fraction would be at a high enough level or of
such importance that it would be unlikely to become stale.



>
>
> Tim Mackinnon wrote
> > Or we teach people to fish…? What’s the point of duplicating everything
> > that’s already in the image anyway - we just need to be cleverer or
> ensure
> > that people know to look there and have the right onboarding experience
> to
> > do that? Otherwise its just another thing that gets out of date very
> > rapidly and we already have enough problems with that.
> >
> > I’d be interested in what intro material Richard gave the students to
> > start with (after all - he has quite a few tutorials of his own, some of
> > which I had followed - but I suspect they are out of date now
> themselves).
> > When you launch pharo there is the helpful welcome screen - did the
> > student’s actually use it and follow what it says?
> >
> > And did we see any of them in this forum (or was that against the rules?)
> >
> > Tim
> >
> >> On 24 Mar 2020, at 17:28, Ben Coman 
>
> > btc@
>
> >  wrote:
> >>
> >> Pharo has some good documentation, but its more lesson-based than a
> >> library reference.
> >> Those of us familiar with Pharo know the tricks to use the system itself
> >> as that reference, but I'd imagine this is an unfamiliar workflow for
> >> newcomers.
> >>
> >> I have seen before a class library reference generated from the image,
> >> but I couldn't put my hands on it right now.
> >> @all, is it still being generated?. This might provide newcomers
> >> something more familiar to work with.
> >>
> >> cheers -ben
> >>
> >> On Tue, 24 Mar 2020 at 03:00, Richard Kenneth Eng 
>
> > horrido.hobbies@
>
> >  mailto:
>
> > horrido.hobbies@
>
> > > wrote:
> >> https://jrmpc.ca/2020/03/20/what-makes-learning-smalltalk-challenging/
> >> 
> https://jrmpc.ca/2020/03/20/what-makes-learning-smalltalk-challenging/;
>
> >>
> >> FWIW, 95% of respondents pointed to the lack of reference documentation
> >> for the class library as the major obstacle to learning Smalltalk/Pharo.
> >>
> >> Richard
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>


Re: [Pharo-users] Do we have a simple markdown parser?

2020-03-25 Thread Tim Mackinnon
Kaspar - I can’t get it to load in a P8 image - it seems to stall half way 
through (I’ve seen that a few times with Metacello to be honest - I think there 
is some escaping timeout that causes issues).

Does it load for you?



> On 24 Mar 2020, at 22:38, Kasper Osterbye  > wrote:
> 
> I have a github-markdown which translates into pillar - and from pillar you 
> can get many things.
> 
> It is lacking several aspects, as I personally was most interested in 
> rendering it inside pharo. The major thing missing (because I could not 
> figure out how to render them) is tables. But take a look at: 
> https://github.com/kasperosterbye/PillarRichTextRender 
> 
> 
> But perhaps it is better than nothing - your usage scenario is not quite 
> clear to me.
> 
> Best,
> 
> Kasper
> 
> On Tue, Mar 24, 2020 at 10:12 PM Tim Mackinnon  > wrote:
> Hmm I hadn’t even thought of Xstreams… I always thought it sounded cool, 
> perhaps its a place to start - but as you mention, I’m not sure it really 
> gained traction in the Pharo world. My use case is quite simple as the 
> markdown files are simple configuration (and maybe don’t even need a parser - 
> e.g. 
> https://github.com/servirtium/demo-java-climate-tck/blob/master/src/test/mocks/averageRainfallForEgyptFrom1980to1999Exists.md
>  
> ).
>  I was hoping there might be something simple I could run with to help 
> explore how best to use the config in those files.
> 
> Lets see if anyone else mentions something that’s a no-brainer.
> 
> Tim
> 
>> On 24 Mar 2020, at 18:40, gettimothy via Pharo-users 
>> mailto:pharo-users@lists.pharo.org>> wrote:
>> 
>> 
>> From: gettimothy mailto:gettimo...@zoho.com>>
>> Subject: Re: [Pharo-users] Do we have a simple markdown parser?
>> Date: 24 March 2020 at 18:40:42 GMT
>> To: "Any question about pharo is welcome" > >
>> Cc: "Pharo Users Newsgroup" > >
>> 
>> 
>> I do not know if it works on Pharo, but XTreams has a XTreams-Parsing 
>> section that I am currently working with. The existing Wikitext grammar was 
>> my starting point .
>> 
>> https://github.com/squeak-smalltalk/squeak-ci/blob/master/package-load-scripts/Xtreams.st
>>  
>> 
>> 
>> the existing Grammar is under:
>> 
>> XTreams-Parsing -> PEGParser > grammars->grammarWiki
>> 
>> 
>> Use case is:
>> 
>> 
>> | wikiGrammar wikiParser output|
>> Transcript clear.
>> wikiGrammar := PEGParser grammarWiki reading positioning.
>> wikiParser := PEGParser parserPEG parse: 'Grammar' stream: wikiGrammar 
>> actor: PEGParserParser new.
>> input := (your string input goes here)
>> output := wikiParser parse: 'Page' stream: input actor: PEGWikiGenerator new.
>> output inspect.
>> 
>> hth
>> 
>>  On Tue, 24 Mar 2020 13:51:31 -0400 Tim Mackinnon > > wrote 
>> 
>> Hi guys - do we have a simple markdown parser that is reasonably up to date? 
>> I did a quick GitHub scan and a few popped out, but I wasn’t convinced I had 
>> found one the “everyone” uses (albeit, everyone might be a small sample). 
>> 
>> Ideally I don’t want to get sucked into writing another one (a project for a 
>> future time). 
>> 
>> Tim 
>> 
>> 
>> 
>> 
> 



Re: [Pharo-users] [ANN] JRMPC Poll

2020-03-25 Thread Cyril Ferlicot
On Mon, Mar 23, 2020 at 7:29 PM Richard Kenneth Eng
 wrote:
>
> https://jrmpc.ca/2020/03/20/what-makes-learning-smalltalk-challenging/
>
> FWIW, 95% of respondents pointed to the lack of reference documentation for 
> the class library as the major obstacle to learning Smalltalk/Pharo.
>

Hi!

If you discovered part of the system that are not documented enough
and that blocked the participants, do not hesitate to open issues on
Pharo-wiki so that we can think about documenting them in it!

https://github.com/pharo-open-documentation/pharo-wiki

Have a nice day.

> Richard



-- 
Cyril Ferlicot
https://ferlicot.fr



Re: [Pharo-users] [ANN] JRMPC Poll

2020-03-25 Thread horrido
Exactly! The JRMPC participants were more used to looking things up quickly
and easily, rather than exploring. It's not easy to teach people how to
explore a system for needed information, and more importantly, it's a
time-consuming process. People are impatient.

Smalltalk is not for impatient people, and that's the major problem.



Ben Coman wrote
> Pharo has some good documentation, but its more lesson-based than a
> library
> reference.
> Those of us familiar with Pharo know the tricks to use the system itself
> as
> that reference, but I'd imagine this is an unfamiliar workflow for
> newcomers.
> 
> I have seen before a class library reference generated from the image, but
> I couldn't put my hands on it right now.
> @all, is it still being generated?. This might provide newcomers
> something more familiar to work with.
> 
> cheers -ben
> 
> On Tue, 24 Mar 2020 at 03:00, Richard Kenneth Eng 

> horrido.hobbies@

> 
> wrote:
> 
>> https://jrmpc.ca/2020/03/20/what-makes-learning-smalltalk-challenging/
>>
>> FWIW, 95% of respondents pointed to the lack of reference documentation
>> for the class library as the major obstacle to learning Smalltalk/Pharo.
>>
>> Richard
>>





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



Re: [Pharo-users] [ANN] JRMPC Poll

2020-03-25 Thread horrido
This is what I provided the JRMPC participants: https://jrmpc.ca/ (see "How
to learn Smalltalk programming"). I'm not sure how I could've done better,
though.

You make an excellent point about duplication and keeping documentation
up-to-date. However, there has to be some middle ground that makes it easier
and more convenient for new developers to find the tools they need. Perhaps
a synoptical reference showing the more common classes used, such as
collections, web-related classes, time-related classes, exception and error
classes, file system-related classes, process-related classes, and so on.
These classes ought not to change much, if at all.



Tim Mackinnon wrote
> Or we teach people to fish…? What’s the point of duplicating everything
> that’s already in the image anyway - we just need to be cleverer or ensure
> that people know to look there and have the right onboarding experience to
> do that? Otherwise its just another thing that gets out of date very
> rapidly and we already have enough problems with that.
> 
> I’d be interested in what intro material Richard gave the students to
> start with (after all - he has quite a few tutorials of his own, some of
> which I had followed - but I suspect they are out of date now themselves).
> When you launch pharo there is the helpful welcome screen - did the
> student’s actually use it and follow what it says?
> 
> And did we see any of them in this forum (or was that against the rules?)
> 
> Tim
> 
>> On 24 Mar 2020, at 17:28, Ben Coman 

> btc@

>  wrote:
>> 
>> Pharo has some good documentation, but its more lesson-based than a
>> library reference.
>> Those of us familiar with Pharo know the tricks to use the system itself
>> as that reference, but I'd imagine this is an unfamiliar workflow for
>> newcomers.
>> 
>> I have seen before a class library reference generated from the image,
>> but I couldn't put my hands on it right now.
>> @all, is it still being generated?. This might provide newcomers
>> something more familiar to work with.
>> 
>> cheers -ben
>> 
>> On Tue, 24 Mar 2020 at 03:00, Richard Kenneth Eng 

> horrido.hobbies@

>  mailto:

> horrido.hobbies@

> > wrote:
>> https://jrmpc.ca/2020/03/20/what-makes-learning-smalltalk-challenging/
>> https://jrmpc.ca/2020/03/20/what-makes-learning-smalltalk-challenging/;
>>  
>> 
>> FWIW, 95% of respondents pointed to the lack of reference documentation
>> for the class library as the major obstacle to learning Smalltalk/Pharo.
>> 
>> Richard





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



Re: [Pharo-users] Pharo #sum vs #sumNumbers and the consequence of #average

2020-03-25 Thread Richard O'Keefe
Yes, #(0 0 0) is the additive identity in *that* case.
But in #((1 2) (3 4) (5 6)) sum it is #(0 0).
And in #(((1 2 3) (4 5 6)) ((9 8 7) (6 5 4))) sum
==> #(#(10 10 10) #(10 10 10)) it is #((0 0 0) (0 0 0)).
I suppose you could have
SequenceableCollection>>zero
  ^self collect: [:each | each zero]
The point is that it cannot in general be based on the *class* of some
element of the receiver but depends on the *value*.
But then we run into the amusing cases like
{ 1 hour. DateAndTime now} sum
where an additive identity for Durations makes sense but an
additive identity for DateAndTimes does not, and similarly
{Date today. 1} sum
In my case, an additional problem is that I have
Object
  Enumerable (#sum  and #product go here)
Collection
where Enumerable holds everything that can be defined just using #do:
without assuming that you can do it more than once, so it was necessary
to come up with a streaming definition for #sum that examines each
element once and only once.  When you do that, you discover that you
don't *need* a zero except when the collection is empty, and in that case
you can't *tell* what sort of zero would be appropriate.

On Thu, 26 Mar 2020 at 01:00, Sven Van Caekenberghe  wrote:
>
> #(0 0 0) is the additive identity in that case
>
> > On 25 Mar 2020, at 12:38, Richard O'Keefe  wrote:
> >
> > There are situations where #+ and #sum make sense but there is no additive
> > identity.  Here is an example:
> > #((1 2 3) (4 5 6) (7 8 9)) sum
> >
> > On Tue, 24 Mar 2020 at 02:46, James Foster  wrote:
> >>
> >>
> >>> On Mar 23, 2020, at 6:06 AM, Sven Van Caekenberghe  wrote:
> >>>
> >>> What you found out now is that the clever trick used to avoid picking an 
> >>> additive identity (picking an element, counting it twice and then 
> >>> subtracting it) leads to a loss of precision when floating point numbers 
> >>> are involved. This is an important issue.
> >>
> >> If this approach is to be preserved, then each class should have an 
> >> additive identity so instead of adding and subtracting an object, we let 
> >> the object tell us its zero.
> >>
> >> James
> >
>
>



Re: [Pharo-users] Do we have a simple markdown parser?

2020-03-25 Thread Richard O'Keefe
Much depends on what you mean by "Markdown".
The current version of the CommonMark spec https://spec.commonmark.org/0.29/
comes to 124 printed pages.  Mind you, some of that is background, some of it is
advice about how to parse Markdown, and a lot of it is 500 examples.
If I wanted to
process Markdown in Smalltalk, I'd probably use the CommonMark reference
implementation in C (cmark) to convert Markdown to XML and parse the XML.
Alternatively, call libcmark through the foreign function interface.

On Wed, 25 Mar 2020 at 06:52, Tim Mackinnon  wrote:
>
> Hi guys - do we have a simple markdown parser that is reasonably up to date? 
> I did a quick GitHub scan and a few popped out, but I wasn’t convinced I had 
> found one the “everyone” uses (albeit, everyone might be a small sample).
>
> Ideally I don’t want to get sucked into writing another one (a project for a 
> future time).
>
> Tim



Re: [Pharo-users] Pharo #sum vs #sumNumbers and the consequence of #average

2020-03-25 Thread Sven Van Caekenberghe
#(0 0 0) is the additive identity in that case

> On 25 Mar 2020, at 12:38, Richard O'Keefe  wrote:
> 
> There are situations where #+ and #sum make sense but there is no additive
> identity.  Here is an example:
> #((1 2 3) (4 5 6) (7 8 9)) sum
> 
> On Tue, 24 Mar 2020 at 02:46, James Foster  wrote:
>> 
>> 
>>> On Mar 23, 2020, at 6:06 AM, Sven Van Caekenberghe  wrote:
>>> 
>>> What you found out now is that the clever trick used to avoid picking an 
>>> additive identity (picking an element, counting it twice and then 
>>> subtracting it) leads to a loss of precision when floating point numbers 
>>> are involved. This is an important issue.
>> 
>> If this approach is to be preserved, then each class should have an additive 
>> identity so instead of adding and subtracting an object, we let the object 
>> tell us its zero.
>> 
>> James
> 




Re: [Pharo-users] Pharo #sum vs #sumNumbers and the consequence of #average

2020-03-25 Thread Richard O'Keefe
There are situations where #+ and #sum make sense but there is no additive
identity.  Here is an example:
#((1 2 3) (4 5 6) (7 8 9)) sum

On Tue, 24 Mar 2020 at 02:46, James Foster  wrote:
>
>
> > On Mar 23, 2020, at 6:06 AM, Sven Van Caekenberghe  wrote:
> >
> > What you found out now is that the clever trick used to avoid picking an 
> > additive identity (picking an element, counting it twice and then 
> > subtracting it) leads to a loss of precision when floating point numbers 
> > are involved. This is an important issue.
>
> If this approach is to be preserved, then each class should have an additive 
> identity so instead of adding and subtracting an object, we let the object 
> tell us its zero.
>
> James



Re: [Pharo-users] Pharo #sum vs #sumNumbers and the consequence of #average

2020-03-25 Thread Richard O'Keefe
What's wrong with this definition?
sum
  "(1) This used to use #runsDo:, which can lead to big savings
   on bags and runarrays, but we almost never use this method
   on them, so it didn't pay off.
   (2) The obvious initialisation to 0 doesn't work with a
   collection of Money, Quantities, Durations, and so on.
   (3) Since the receiver is almost always a collection of
   numbers, it would be very bad if #() sum did not answer 0.
   So we should not use #anyOne.
   (4) Using #anyOne to select between algorithms required being
   able to traverse the Enumerable twice, but Enumerable is
   for things you can only traverse once.  Oops.  Good thing
   we want to avoid #anyOne anyway.
   (5) nil does not and should not respondTo: #+ so we can use a
   single variable.  Watch out for this in other summaries."
  |s|
  s := nil.
  self do: [:each |
s := s ifNil: [each] ifNotNil: [each + s]].
  ^s ifNil: [0] ifNotNil: [s]

On Tue, 24 Mar 2020 at 02:46, James Foster  wrote:
>
>
> > On Mar 23, 2020, at 6:06 AM, Sven Van Caekenberghe  wrote:
> >
> > What you found out now is that the clever trick used to avoid picking an 
> > additive identity (picking an element, counting it twice and then 
> > subtracting it) leads to a loss of precision when floating point numbers 
> > are involved. This is an important issue.
>
> If this approach is to be preserved, then each class should have an additive 
> identity so instead of adding and subtracting an object, we let the object 
> tell us its zero.
>
> James