Pharo-dev
By thread
pharo-dev@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
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
October 2017
- 715 messages
Re: [Pharo-dev] , for vector creation
by Tudor Girba
Hi,
To make the conversation more interesting, in Bloc we also have BlPoint with subclasses for 2D, 3D and 4D. The reason for this is that we model explicitly the intention of usage even if they share the instance variable names. We did not use Point because we needed 3D and 4D as well and Point has too many meanings that are conflated into one.
This pattern was used everywhere we could. For example, we have BlBounds instead of Rectangle (actually, this is also because of performance reasons of working directly with 4 numbers rather than 2 points).
Of course, these come with an apparent extra maintenance cost. So, if we see a possibility of unifying we should definitely take it, and this is where external reviewers can help to point out possibilities. We should just not unify just for the sake of it.
Cheers,
Doru
> On Oct 26, 2017, at 10:57 AM, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>
> Hi,
>
>> On Oct 26, 2017, at 10:36 AM, Denis Kudriashov <dionisiydk(a)gmail.com> wrote:
>>
>> 2017-10-26 10:20 GMT+02:00 Tudor Girba <tudor(a)tudorgirba.com>:
>> Hi,
>>> On Oct 26, 2017, at 10:10 AM, Denis Kudriashov <dionisiydk(a)gmail.com> wrote:
>>>
>>> Another question.
>>>
>>> Will not these vectors deprecate Point in future ? Imaging that we will completely move to Bloc.
>>
>> No. Point is a perfectly reasonable data structure to describe a position. A Vector is something else and has other contracts. The coincidence is that they share the same variables, but they have different API. For example, a vector has #length. A point does not.
>>
>> Now Point implements most vector operations. The #length is defined as radius by #r message. I imaging that with new vector you will reimplement many of Point methods. Also I doubt that Point plays any role in system which is different than math vector.
>
> I think that over time we have accumulated all sorts of other usages for Point. For example, Rectangle uses origin and corner as a position not as vectors.
>
> Doru
>
>>
>>> And what about Rectangle? (Bloc implements own BlRectangle).
>>
>> These two do not have the same semantics. BlRectangle is a BlGeometry and is used for defining a path within an element. BlRectangle is polymorphic with other paths such as BlEllipse or BlPolygon. Rectangle is a generic data structure that can be used for other purposes.
>>
>> We should definitely try to find commonalities and opportunities for unification. However, we should not confuse state with types which are defined by the purpose they are used for (and associated behavior).
>>
>> Doru
>>
>>
>>
>>> 2017-10-26 9:26 GMT+02:00 phil(a)highoctane.be <phil(a)highoctane.be>:
>>> #(1 3 4 5 7 -2) asVector
>>>
>>> Meh.
>>> Ugly.
>>>
>>> { 1. 3. 4. a. b } asVector
>>>
>>> is the natural consequence.
>>>
>>> v := (1,3,4,5,7,-2) asVector
>>>
>>> keeps the parens. But why do I need to do that?
>>>
>>> Autoformatting messing with my parentheses is just a mistake.
>>> I put them in, leave them where they are, 'kay? I do not need an editor that rewrites what I tell it. AST power or not.
>>>
>>> And frankly, I like the "Feenk way of doing things" most of the time, so I am willing to go that route.
>>>
>>> Phil
>>>
>>>
>>>
>>> On Thu, Oct 26, 2017 at 8:52 AM, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
>>>>
>>>> Automatic formatting will turn it into
>>>>
>>>> vector := 1,3,4,5,7,-2.
>>>>
>>>> Which is not as nice.
>>>>
>>>> And even though it looks ok for literal numbers (#(1 3 4 5 7 -2) asVector would work too), this starts to look quite generic:
>>>>
>>>> vector := width, height, depth.
>>>>
>>>>
>>>> Question: why not extend @ notation?
>>>>
>>>> x @ y @ z?
>>>>
>>>> Peter
>>>>
>>>>
>>>>
>>>> On Thu, Oct 26, 2017 at 8:22 AM, phil(a)highoctane.be <phil(a)highoctane.be> wrote:
>>>>>
>>>>> I also like the , message for those vectors and the concatenation of dimensions makes sense.
>>>>>
>>>>> vector := (1,3,4,5,7,-2).
>>>>>
>>>>> looks how it should be.
>>>>>
>>>>> Readable, easy to translate vector stuff from reference text.
>>>>>
>>>>> Phil
>>>>>
>>>>>
>>>>> On Thu, Oct 26, 2017 at 7:00 AM, Nicolai Hess <nicolaihess(a)gmail.com> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 25.10.2017 10:50 PM schrieb "Torsten Bergmann" <astares(a)gmx.de>:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> there might be reasons for an own 2D vector class (instead of using Point).
>>>>>> But still I dislike the reimplementation of "," because for me so far it
>>>>>> has the meaning of "concatenating things".
>>>>>>
>>>>>>
>>>>>>
>>>>>> Like concatenating coordinates :-)
>>>>>>
>>>>>>
>>>>>>
>>>>>> Here you redefine it to create vector instances and it works only up to three
>>>>>> so far. Right?
>>>>>>
>>>>>> I understand that this gives some similarities with the math notation (1,2)
>>>>>> but I personally would prefer to use:
>>>>>>
>>>>>> 1@2 asVector
>>>>>>
>>>>>> or Vector2D x: 1 y: 2
>>>>>>
>>>>>> Thx
>>>>>> T.
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Gesendet: Mittwoch, 25. Oktober 2017 um 20:06 Uhr
>>>>>>> Von: "Tudor Girba" <tudor(a)tudorgirba.com>
>>>>>>> An: "Pharo Development List" <pharo-dev(a)lists.pharo.org>
>>>>>>> Betreff: [Pharo-dev] , for vector creation
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> As mentioned in the separate thread, we played with introducing the extension:
>>>>>>>
>>>>>>> , aNumber
>>>>>>> ^ BlVector2D x: self y: aNumber
>>>>>>>
>>>>>>> This means that (10,20) will return a 2D vector.
>>>>>>>
>>>>>>> We also have (10,20,30) which returns a 3D vector.
>>>>>>>
>>>>>>> , is used for different meanings already in the image beside the collection concatenation. For example, in FileReference is adds a file extension. And Exceptions create a collection. In other packages, PetitParser uses it as a sequence operator.
>>>>>>>
>>>>>>> Please voice your concerns.
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Doru
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> www.tudorgirba.com
>>>>>>> www.feenk.com
>>>>>>>
>>>>>>> "Every thing should have the right to be different."
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>> --
>> www.tudorgirba.com
>> www.feenk.com
>>
>> "When people care, great things can happen."
>>
>>
>>
>>
>>
>>
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "If you interrupt the barber while he is cutting your hair,
> you will end up with a messy haircut."
--
www.tudorgirba.com
www.feenk.com
"We are all great at making mistakes."
Oct. 26, 2017
[Pharo 7.0-dev] Build #228: 20026-Diff-has-incorrect-positions-red-and-green-colors-of-changed-text
by ci-pharo-ci-jenkins2@inria.fr
There is a new Pharo build available!
The status of the build #228 was: SUCCESS.
The Pull Request #396 was integrated: "20026-Diff-has-incorrect-positions-red-and-green-colors-of-changed-text"
Pull request url: https://github.com/pharo-project/pharo/pull/396
Issue Url: https://pharo.fogbugz.com/f/cases/20026
Build Url: https://ci.inria.fr/pharo-ci-jenkins2/job/Test%20pending%20pull%20request%2…
Oct. 26, 2017
Re: [Pharo-dev] , for vector creation
by Tudor Girba
Hi,
> On Oct 26, 2017, at 10:36 AM, Denis Kudriashov <dionisiydk(a)gmail.com> wrote:
>
> 2017-10-26 10:20 GMT+02:00 Tudor Girba <tudor(a)tudorgirba.com>:
> Hi,
> > On Oct 26, 2017, at 10:10 AM, Denis Kudriashov <dionisiydk(a)gmail.com> wrote:
> >
> > Another question.
> >
> > Will not these vectors deprecate Point in future ? Imaging that we will completely move to Bloc.
>
> No. Point is a perfectly reasonable data structure to describe a position. A Vector is something else and has other contracts. The coincidence is that they share the same variables, but they have different API. For example, a vector has #length. A point does not.
>
> Now Point implements most vector operations. The #length is defined as radius by #r message. I imaging that with new vector you will reimplement many of Point methods. Also I doubt that Point plays any role in system which is different than math vector.
I think that over time we have accumulated all sorts of other usages for Point. For example, Rectangle uses origin and corner as a position not as vectors.
Doru
>
> > And what about Rectangle? (Bloc implements own BlRectangle).
>
> These two do not have the same semantics. BlRectangle is a BlGeometry and is used for defining a path within an element. BlRectangle is polymorphic with other paths such as BlEllipse or BlPolygon. Rectangle is a generic data structure that can be used for other purposes.
>
> We should definitely try to find commonalities and opportunities for unification. However, we should not confuse state with types which are defined by the purpose they are used for (and associated behavior).
>
> Doru
>
>
>
> > 2017-10-26 9:26 GMT+02:00 phil(a)highoctane.be <phil(a)highoctane.be>:
> > #(1 3 4 5 7 -2) asVector
> >
> > Meh.
> > Ugly.
> >
> > { 1. 3. 4. a. b } asVector
> >
> > is the natural consequence.
> >
> > v := (1,3,4,5,7,-2) asVector
> >
> > keeps the parens. But why do I need to do that?
> >
> > Autoformatting messing with my parentheses is just a mistake.
> > I put them in, leave them where they are, 'kay? I do not need an editor that rewrites what I tell it. AST power or not.
> >
> > And frankly, I like the "Feenk way of doing things" most of the time, so I am willing to go that route.
> >
> > Phil
> >
> >
> >
> > On Thu, Oct 26, 2017 at 8:52 AM, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
> > >
> > > Automatic formatting will turn it into
> > >
> > > vector := 1,3,4,5,7,-2.
> > >
> > > Which is not as nice.
> > >
> > > And even though it looks ok for literal numbers (#(1 3 4 5 7 -2) asVector would work too), this starts to look quite generic:
> > >
> > > vector := width, height, depth.
> > >
> > >
> > > Question: why not extend @ notation?
> > >
> > > x @ y @ z?
> > >
> > > Peter
> > >
> > >
> > >
> > > On Thu, Oct 26, 2017 at 8:22 AM, phil(a)highoctane.be <phil(a)highoctane.be> wrote:
> > >>
> > >> I also like the , message for those vectors and the concatenation of dimensions makes sense.
> > >>
> > >> vector := (1,3,4,5,7,-2).
> > >>
> > >> looks how it should be.
> > >>
> > >> Readable, easy to translate vector stuff from reference text.
> > >>
> > >> Phil
> > >>
> > >>
> > >> On Thu, Oct 26, 2017 at 7:00 AM, Nicolai Hess <nicolaihess(a)gmail.com> wrote:
> > >>>
> > >>>
> > >>>
> > >>> Am 25.10.2017 10:50 PM schrieb "Torsten Bergmann" <astares(a)gmx.de>:
> > >>>
> > >>> Hi,
> > >>>
> > >>> there might be reasons for an own 2D vector class (instead of using Point).
> > >>> But still I dislike the reimplementation of "," because for me so far it
> > >>> has the meaning of "concatenating things".
> > >>>
> > >>>
> > >>>
> > >>> Like concatenating coordinates :-)
> > >>>
> > >>>
> > >>>
> > >>> Here you redefine it to create vector instances and it works only up to three
> > >>> so far. Right?
> > >>>
> > >>> I understand that this gives some similarities with the math notation (1,2)
> > >>> but I personally would prefer to use:
> > >>>
> > >>> 1@2 asVector
> > >>>
> > >>> or Vector2D x: 1 y: 2
> > >>>
> > >>> Thx
> > >>> T.
> > >>>
> > >>>
> > >>>
> > >>> > Gesendet: Mittwoch, 25. Oktober 2017 um 20:06 Uhr
> > >>> > Von: "Tudor Girba" <tudor(a)tudorgirba.com>
> > >>> > An: "Pharo Development List" <pharo-dev(a)lists.pharo.org>
> > >>> > Betreff: [Pharo-dev] , for vector creation
> > >>> >
> > >>> > Hi,
> > >>> >
> > >>> > As mentioned in the separate thread, we played with introducing the extension:
> > >>> >
> > >>> > , aNumber
> > >>> > ^ BlVector2D x: self y: aNumber
> > >>> >
> > >>> > This means that (10,20) will return a 2D vector.
> > >>> >
> > >>> > We also have (10,20,30) which returns a 3D vector.
> > >>> >
> > >>> > , is used for different meanings already in the image beside the collection concatenation. For example, in FileReference is adds a file extension. And Exceptions create a collection. In other packages, PetitParser uses it as a sequence operator.
> > >>> >
> > >>> > Please voice your concerns.
> > >>> >
> > >>> > Cheers,
> > >>> > Doru
> > >>> >
> > >>> >
> > >>> > --
> > >>> > www.tudorgirba.com
> > >>> > www.feenk.com
> > >>> >
> > >>> > "Every thing should have the right to be different."
> > >>> >
> > >>> >
> > >>> >
> > >>> >
> > >>> >
> > >>> >
> > >>>
> > >>>
> > >>
> > >
> >
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "When people care, great things can happen."
>
>
>
>
>
>
--
www.tudorgirba.com
www.feenk.com
"If you interrupt the barber while he is cutting your hair,
you will end up with a messy haircut."
Oct. 26, 2017
Re: [Pharo-dev] UnifiedFFI Docs
by Esteban Lorenzano
> On 25 Oct 2017, at 21:39, Todd Blanchard <tblanchard(a)mac.com> wrote:
>
> OK, new question.
>
> How do I file this in? I was able to load tonel from iceberg. I added the repo and it gave me a choice of packages to load and I loaded them using the iceberg browser.
>
> I added this to the iceberg browser and there are no packages listed and I have absolutely no clue how to get this code into my image.
>
> I'm about 80 hours into trying to get my head around FFI and really getting discouraged at how many walls I'm hitting trying to get a foreign library interface done.
in Pharo7, you do nothing, is there by default.
you do not âfile inâ, you add an iceberg project and then you load the baseline, as any other project.
about the walls: you didnât chose a simple library to learn FFI, you chose one of the hardest libraries that exist.
What you are doing is like trying to learn to be a doctor through open-heart operations :)
Esteban
>
>> On Oct 25, 2017, at 7:35 AM, Esteban Lorenzano <estebanlm(a)gmail.com <mailto:estebanlm@gmail.com>> wrote:
>>
>> :)
>>
>> Did you look at this project: https://github.com/estebanlm/libclang-pharo-bindings/ <https://github.com/estebanlm/libclang-pharo-bindings/> ?
>>
>> it was using parseTranslationUnit (no 2)⦠there you can find how is being used (I just converted it to tonel format, but older versions are in filetree)
>>
>> Esteban
>>
>>> On 24 Oct 2017, at 19:17, Todd Blanchard <tblanchard(a)mac.com <mailto:tblanchard@mac.com>> wrote:
>>>
>>> Hey Esteban,
>>>
>>> Now that you have outed yourself as a maintainer of FFI, I have a question. :-)
>>>
>>> I want to call the libclang function:
>>>
>>> /**
>>> * \brief Parse the given source file and the translation unit corresponding
>>> * to that file.
>>> *
>>> * This routine is the main entry point for the Clang C API, providing the
>>> * ability to parse a source file into a translation unit that can then be
>>> * queried by other functions in the API. This routine accepts a set of
>>> * command-line arguments so that the compilation can be configured in the same
>>> * way that the compiler is configured on the command line.
>>> *
>>> * \param CIdx The index object with which the translation unit will be
>>> * associated.
>>> *
>>> * \param source_filename The name of the source file to load, or NULL if the
>>> * source file is included in \c command_line_args.
>>> *
>>> * \param command_line_args The command-line arguments that would be
>>> * passed to the \c clang executable if it were being invoked out-of-process.
>>> * These command-line options will be parsed and will affect how the translation
>>> * unit is parsed. Note that the following options are ignored: '-c',
>>> * '-emit-ast', '-fsyntax-only' (which is the default), and '-o \<output file>'.
>>> *
>>> * \param num_command_line_args The number of command-line arguments in
>>> * \c command_line_args.
>>> *
>>> * \param unsaved_files the files that have not yet been saved to disk
>>> * but may be required for parsing, including the contents of
>>> * those files. The contents and name of these files (as specified by
>>> * CXUnsavedFile) are copied when necessary, so the client only needs to
>>> * guarantee their validity until the call to this function returns.
>>> *
>>> * \param num_unsaved_files the number of unsaved file entries in \p
>>> * unsaved_files.
>>> *
>>> * \param options A bitmask of options that affects how the translation unit
>>> * is managed but not its compilation. This should be a bitwise OR of the
>>> * CXTranslationUnit_XXX flags.
>>> *
>>> * \param[out] out_TU A non-NULL pointer to store the created
>>> * \c CXTranslationUnit, describing the parsed code and containing any
>>> * diagnostics produced by the compiler.
>>> *
>>> * \returns Zero on success, otherwise returns an error code.
>>> */
>>> enum CXErrorCode
>>> clang_parseTranslationUnit2(CXIndex CIdx,
>>> const char *source_filename,
>>> const char *const *command_line_args,
>>> int num_command_line_args,
>>> struct CXUnsavedFile *unsaved_files,
>>> unsigned num_unsaved_files,
>>> unsigned options,
>>> CXTranslationUnit *out_TU);
>>>
>>> The parts I'm not clear on are turning an array or ordered collection of strings into an argv/argc, turning an array of CXUnsavedFile's (FFIExternalStruct) into an array of pointers and count, and getting data back in an output argument as CXTranslationUnit which is an opaque pointer to a C++ object.
>>>
>>> Any tips on these mappings would be great. I've currently guessed it as:
>>>
>>> clang_parseTranslationUnit__cxIndex: cxIndex source: sourceFile arguments: argv unsavedFiles:unsaved options: opts
>>>
>>> | argc unsaved_files num_unsaved_files options error out_TU |
>>> argc := argv size.
>>> unsaved_files := unsaved ifNil: [ #() ] ifNotNil: [ unsaved ].
>>> num_unsaved_files := unsaved_files ifNil: [ 0 ] ifNotNil: [unsaved_files size].
>>> options := opts sum.
>>>
>>> error := self ffiCall: #(CXErrorCode clang_parseTranslationUnit2(CXIndex cxIndex,
>>> String sourceFile,
>>> String *argv,
>>> uint argc,
>>> CXUnsavedFile *unsaved_files,
>>> uint num_unsaved_files,
>>> CXTranslationUnitFlag options,
>>> CXTranslationUnit *out_TU)).
>>>
>>> (error = CXError_Success) ifTrue: [ ^out_TU ].
>>> self error: error
>>>
>>> Thanks.
>>>
>>>
>>>> On Oct 22, 2017, at 2:42 AM, Esteban Lorenzano <estebanlm(a)gmail.com <mailto:estebanlm@gmail.com>> wrote:
>>>>
>>>> Hi,
>>>>
>>>>> On 21 Oct 2017, at 21:15, Stephane Ducasse <stepharo.self(a)gmail.com <mailto:stepharo.self@gmail.com>> wrote:
>>>>>
>>>>> Esteban will probably reply to this thread
>>>>
>>>> yes, I will :)
>>>>
>>>>>
>>>>>
>>>>> On Thu, Oct 19, 2017 at 10:34 PM, Todd Blanchard <tblanchard(a)mac.com <mailto:tblanchard@mac.com>> wrote:
>>>>>> I have found the problem with VoidPointer3 generating accessors.
>>>>
>>>> can you report that on fogbugz ?
>>>> (along with your solution)
>>>>
>>>> thanks!
>>>> Esteban
>>>>
>>>>>>
>>>>>> No idea how to contribute back a fix but this is what I've found.
>>>>>>
>>>>>> FFITypeArrayType>>annonymousClassCreator
>>>>>> ^ String streamContents: [ :stream |
>>>>>> stream
>>>>>> nextPutAll: '(FFITypeArray ofType: ';
>>>>>> print: (self objectClass type isPointer ifTrue: [self externalTypeWithArity
>>>>>> printString] ifFalse: ['#',self objectClass type class]);
>>>>>> nextPutAll: ' size: ';
>>>>>> print: self objectClass numberOfElements;
>>>>>> nextPutAll: ')' ]
>>>>>>
>>>>>> Recalling that we are trying to come up with an accessor that can pull out a
>>>>>> void*[3], this produces
>>>>>>
>>>>>> '(FFITypeArray ofType: #FFIVoid size: 3)'
>>>>>>
>>>>>> which produces an error as FFIVoid's size is undefined. In general, this
>>>>>> will be wrong for any pointer type and will probably get the size
>>>>>> calculation wrong.
>>>>>>
>>>>>> Doing a little digging I find that
>>>>>>
>>>>>> FFITypeArray>>ofType: aType size: aSize
>>>>>>
>>>>>> delegates resolution of aType to FFIExternalType>>resolveType:aType and this
>>>>>> can take all kinds of different things including the native type name.
>>>>>>
>>>>>> It would be better if this generated the native name for pointers.
>>>>>>
>>>>>> (FFITypeArray ofType: 'void*' size: 3)
>>>>>>
>>>>>> So I changed it to:
>>>>>>
>>>>>> FFITypeArrayType>>annonymousClassCreator
>>>>>> ^ String streamContents: [ :stream |
>>>>>> stream
>>>>>> nextPutAll: '(FFITypeArray ofType: ';
>>>>>> print: (self objectClass type isPointer
>>>>>> ifTrue: [self externalTypeWithArity printString]
>>>>>> ifFalse: ['#',self objectClass type class]);
>>>>>> nextPutAll: ' size: ';
>>>>>> print: self objectClass numberOfElements;
>>>>>> nextPutAll: ')' ]
>>>>>>
>>>>>> and this seems to work fine.
>>>>>>
>>>>>> Onwards...
>>>>>>
>>>>>> On Oct 19, 2017, at 7:18 AM, Todd Blanchard <tblanchard(a)mac.com <mailto:tblanchard@mac.com>> wrote:
>>>>>>
>>>>>> Thatâs great - itâs been kind of magical but a couple things have changed
>>>>>> since you wrote it and some bugs have crept into ffi.
>>>>>>
>>>>>> Right now Iâm finding the generated accessor for the VoidPointer3 is
>>>>>> actually generating a void 3 accessor and that doesnât work. I spent all day
>>>>>> yesterday tracking it to the accessor generating code.
>>>>>>
>>>>>> Sent from the road
>>>>>>
>>>>>> On Oct 18, 2017, at 22:29, Ben Coman <btc(a)openinworld.com <mailto:btc@openinworld.com>> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 19, 2017 at 1:05 AM, Todd Blanchard <tblanchard(a)mac.com <mailto:tblanchard@mac.com>> wrote:
>>>>>>>
>>>>>>> I'm working through Ben's great blog post about playing with libclang and
>>>>>>> I am puzzled by something.
>>>>>>
>>>>>>
>>>>>> Thx Todd. Knowing someone is looking at it encourages me to expand it.
>>>>>> I'm interested in looking at your specific questions, but it might not be
>>>>>> until next week after this stint of long work days.
>>>>>>
>>>>>> cheers -ben
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> invalidateSessionData
>>>>>>> handle atAllPut: 0.
>>>>>>>
>>>>>>> zero;s out the handle. Cool. However,
>>>>>>>
>>>>>>> handle isNull
>>>>>>>
>>>>>>> does not return true despite it being used in the getString method as
>>>>>>>
>>>>>>> ^ handle isNull
>>>>>>> ifTrue: ['external memory invalidated by session restart']
>>>>>>> ifFalse:[LibClang clang_getCString__cxString: self].
>>>>>>>
>>>>>>> Looks like there should be an isNull on ByteArray that returns true if all
>>>>>>> bytes are zero but it isn't there. Was it dropped for some reason?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Oct 18, 2017, at 2:58 AM, Dimitris Chloupis <kilon.alios(a)gmail.com <mailto:kilon.alios@gmail.com>>
>>>>>>> wrote:
>>>>>>>
>>>>>>> Sure the documentation could be better, that is definetly important, but
>>>>>>> is already good enough and UFFI is a very technical subject much more suited
>>>>>>> to a mailing list . Its not physical possible to cover the massive potential
>>>>>>> of UFFI.
>>>>>>>
>>>>>>> On Wed, Oct 18, 2017 at 9:32 AM Stephane Ducasse <stepharo.self(a)gmail.com <mailto:stepharo.self@gmail.com>>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Please do not hesitate to do Pull Requests.
>>>>>>>> Luc told me that he wants to do a pass on it and Esteban promises that to
>>>>>>>> me
>>>>>>>> but he is super busy.
>>>>>>>>
>>>>>>>> Stef
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, Oct 18, 2017 at 5:54 AM, Todd Blanchard <tblanchard(a)mac.com <mailto:tblanchard@mac.com>>
>>>>>>>> wrote:
>>>>>>>>> Wonderful! Thanks.
>>>>>>>>>
>>>>>>>>>> On Oct 17, 2017, at 3:45 PM, stephan <stephan(a)stack.nl <mailto:stephan@stack.nl>> wrote:
>>>>>>>>>>
>>>>>>>>>> On 17-10-17 23:06, Todd Blanchard wrote:
>>>>>>>>>>> Anyone know what happened to this?
>>>>>>>>>>>
>>>>>>>>>>> https://ci.inria.fr/pharo-contribution/view/Books/job/PharoBookWorkInProgre… <https://ci.inria.fr/pharo-contribution/view/Books/job/PharoBookWorkInProgre…>
>>>>>>>>>>
>>>>>>>>>> https://github.com/SquareBracketAssociates/Booklet-uFFI <https://github.com/SquareBracketAssociates/Booklet-uFFI>
>>>>>>>>>>
>>>>>>>>>> has a link to a bintray pdf download
>>>>>>>>>>
>>>>>>>>>> Stephan
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>
Oct. 26, 2017
Re: [Pharo-dev] UnifiedFFI Docs
by Esteban Lorenzano
> On 25 Oct 2017, at 19:58, Todd Blanchard <tblanchard(a)mac.com> wrote:
>
> I did not - had no idea it existed.
>
> Is if fair to say that the 32 bit warning in the readme does not apply to Pharo 64 bit?
is not. I never tested it on 64bit :)
in theory, it should work out of the box, but since is not tested, warning remains.
Esteban
>
>> On Oct 25, 2017, at 7:35 AM, Esteban Lorenzano <estebanlm(a)gmail.com <mailto:estebanlm@gmail.com>> wrote:
>>
>> :)
>>
>> Did you look at this project: https://github.com/estebanlm/libclang-pharo-bindings/ <https://github.com/estebanlm/libclang-pharo-bindings/> ?
>>
>> it was using parseTranslationUnit (no 2)⦠there you can find how is being used (I just converted it to tonel format, but older versions are in filetree)
>>
>> Esteban
>>
>>> On 24 Oct 2017, at 19:17, Todd Blanchard <tblanchard(a)mac.com <mailto:tblanchard@mac.com>> wrote:
>>>
>>> Hey Esteban,
>>>
>>> Now that you have outed yourself as a maintainer of FFI, I have a question. :-)
>>>
>>> I want to call the libclang function:
>>>
>>> /**
>>> * \brief Parse the given source file and the translation unit corresponding
>>> * to that file.
>>> *
>>> * This routine is the main entry point for the Clang C API, providing the
>>> * ability to parse a source file into a translation unit that can then be
>>> * queried by other functions in the API. This routine accepts a set of
>>> * command-line arguments so that the compilation can be configured in the same
>>> * way that the compiler is configured on the command line.
>>> *
>>> * \param CIdx The index object with which the translation unit will be
>>> * associated.
>>> *
>>> * \param source_filename The name of the source file to load, or NULL if the
>>> * source file is included in \c command_line_args.
>>> *
>>> * \param command_line_args The command-line arguments that would be
>>> * passed to the \c clang executable if it were being invoked out-of-process.
>>> * These command-line options will be parsed and will affect how the translation
>>> * unit is parsed. Note that the following options are ignored: '-c',
>>> * '-emit-ast', '-fsyntax-only' (which is the default), and '-o \<output file>'.
>>> *
>>> * \param num_command_line_args The number of command-line arguments in
>>> * \c command_line_args.
>>> *
>>> * \param unsaved_files the files that have not yet been saved to disk
>>> * but may be required for parsing, including the contents of
>>> * those files. The contents and name of these files (as specified by
>>> * CXUnsavedFile) are copied when necessary, so the client only needs to
>>> * guarantee their validity until the call to this function returns.
>>> *
>>> * \param num_unsaved_files the number of unsaved file entries in \p
>>> * unsaved_files.
>>> *
>>> * \param options A bitmask of options that affects how the translation unit
>>> * is managed but not its compilation. This should be a bitwise OR of the
>>> * CXTranslationUnit_XXX flags.
>>> *
>>> * \param[out] out_TU A non-NULL pointer to store the created
>>> * \c CXTranslationUnit, describing the parsed code and containing any
>>> * diagnostics produced by the compiler.
>>> *
>>> * \returns Zero on success, otherwise returns an error code.
>>> */
>>> enum CXErrorCode
>>> clang_parseTranslationUnit2(CXIndex CIdx,
>>> const char *source_filename,
>>> const char *const *command_line_args,
>>> int num_command_line_args,
>>> struct CXUnsavedFile *unsaved_files,
>>> unsigned num_unsaved_files,
>>> unsigned options,
>>> CXTranslationUnit *out_TU);
>>>
>>> The parts I'm not clear on are turning an array or ordered collection of strings into an argv/argc, turning an array of CXUnsavedFile's (FFIExternalStruct) into an array of pointers and count, and getting data back in an output argument as CXTranslationUnit which is an opaque pointer to a C++ object.
>>>
>>> Any tips on these mappings would be great. I've currently guessed it as:
>>>
>>> clang_parseTranslationUnit__cxIndex: cxIndex source: sourceFile arguments: argv unsavedFiles:unsaved options: opts
>>>
>>> | argc unsaved_files num_unsaved_files options error out_TU |
>>> argc := argv size.
>>> unsaved_files := unsaved ifNil: [ #() ] ifNotNil: [ unsaved ].
>>> num_unsaved_files := unsaved_files ifNil: [ 0 ] ifNotNil: [unsaved_files size].
>>> options := opts sum.
>>>
>>> error := self ffiCall: #(CXErrorCode clang_parseTranslationUnit2(CXIndex cxIndex,
>>> String sourceFile,
>>> String *argv,
>>> uint argc,
>>> CXUnsavedFile *unsaved_files,
>>> uint num_unsaved_files,
>>> CXTranslationUnitFlag options,
>>> CXTranslationUnit *out_TU)).
>>>
>>> (error = CXError_Success) ifTrue: [ ^out_TU ].
>>> self error: error
>>>
>>> Thanks.
>>>
>>>
>>>> On Oct 22, 2017, at 2:42 AM, Esteban Lorenzano <estebanlm(a)gmail.com <mailto:estebanlm@gmail.com>> wrote:
>>>>
>>>> Hi,
>>>>
>>>>> On 21 Oct 2017, at 21:15, Stephane Ducasse <stepharo.self(a)gmail.com <mailto:stepharo.self@gmail.com>> wrote:
>>>>>
>>>>> Esteban will probably reply to this thread
>>>>
>>>> yes, I will :)
>>>>
>>>>>
>>>>>
>>>>> On Thu, Oct 19, 2017 at 10:34 PM, Todd Blanchard <tblanchard(a)mac.com <mailto:tblanchard@mac.com>> wrote:
>>>>>> I have found the problem with VoidPointer3 generating accessors.
>>>>
>>>> can you report that on fogbugz ?
>>>> (along with your solution)
>>>>
>>>> thanks!
>>>> Esteban
>>>>
>>>>>>
>>>>>> No idea how to contribute back a fix but this is what I've found.
>>>>>>
>>>>>> FFITypeArrayType>>annonymousClassCreator
>>>>>> ^ String streamContents: [ :stream |
>>>>>> stream
>>>>>> nextPutAll: '(FFITypeArray ofType: ';
>>>>>> print: (self objectClass type isPointer ifTrue: [self externalTypeWithArity
>>>>>> printString] ifFalse: ['#',self objectClass type class]);
>>>>>> nextPutAll: ' size: ';
>>>>>> print: self objectClass numberOfElements;
>>>>>> nextPutAll: ')' ]
>>>>>>
>>>>>> Recalling that we are trying to come up with an accessor that can pull out a
>>>>>> void*[3], this produces
>>>>>>
>>>>>> '(FFITypeArray ofType: #FFIVoid size: 3)'
>>>>>>
>>>>>> which produces an error as FFIVoid's size is undefined. In general, this
>>>>>> will be wrong for any pointer type and will probably get the size
>>>>>> calculation wrong.
>>>>>>
>>>>>> Doing a little digging I find that
>>>>>>
>>>>>> FFITypeArray>>ofType: aType size: aSize
>>>>>>
>>>>>> delegates resolution of aType to FFIExternalType>>resolveType:aType and this
>>>>>> can take all kinds of different things including the native type name.
>>>>>>
>>>>>> It would be better if this generated the native name for pointers.
>>>>>>
>>>>>> (FFITypeArray ofType: 'void*' size: 3)
>>>>>>
>>>>>> So I changed it to:
>>>>>>
>>>>>> FFITypeArrayType>>annonymousClassCreator
>>>>>> ^ String streamContents: [ :stream |
>>>>>> stream
>>>>>> nextPutAll: '(FFITypeArray ofType: ';
>>>>>> print: (self objectClass type isPointer
>>>>>> ifTrue: [self externalTypeWithArity printString]
>>>>>> ifFalse: ['#',self objectClass type class]);
>>>>>> nextPutAll: ' size: ';
>>>>>> print: self objectClass numberOfElements;
>>>>>> nextPutAll: ')' ]
>>>>>>
>>>>>> and this seems to work fine.
>>>>>>
>>>>>> Onwards...
>>>>>>
>>>>>> On Oct 19, 2017, at 7:18 AM, Todd Blanchard <tblanchard(a)mac.com <mailto:tblanchard@mac.com>> wrote:
>>>>>>
>>>>>> Thatâs great - itâs been kind of magical but a couple things have changed
>>>>>> since you wrote it and some bugs have crept into ffi.
>>>>>>
>>>>>> Right now Iâm finding the generated accessor for the VoidPointer3 is
>>>>>> actually generating a void 3 accessor and that doesnât work. I spent all day
>>>>>> yesterday tracking it to the accessor generating code.
>>>>>>
>>>>>> Sent from the road
>>>>>>
>>>>>> On Oct 18, 2017, at 22:29, Ben Coman <btc(a)openinworld.com <mailto:btc@openinworld.com>> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 19, 2017 at 1:05 AM, Todd Blanchard <tblanchard(a)mac.com <mailto:tblanchard@mac.com>> wrote:
>>>>>>>
>>>>>>> I'm working through Ben's great blog post about playing with libclang and
>>>>>>> I am puzzled by something.
>>>>>>
>>>>>>
>>>>>> Thx Todd. Knowing someone is looking at it encourages me to expand it.
>>>>>> I'm interested in looking at your specific questions, but it might not be
>>>>>> until next week after this stint of long work days.
>>>>>>
>>>>>> cheers -ben
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> invalidateSessionData
>>>>>>> handle atAllPut: 0.
>>>>>>>
>>>>>>> zero;s out the handle. Cool. However,
>>>>>>>
>>>>>>> handle isNull
>>>>>>>
>>>>>>> does not return true despite it being used in the getString method as
>>>>>>>
>>>>>>> ^ handle isNull
>>>>>>> ifTrue: ['external memory invalidated by session restart']
>>>>>>> ifFalse:[LibClang clang_getCString__cxString: self].
>>>>>>>
>>>>>>> Looks like there should be an isNull on ByteArray that returns true if all
>>>>>>> bytes are zero but it isn't there. Was it dropped for some reason?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Oct 18, 2017, at 2:58 AM, Dimitris Chloupis <kilon.alios(a)gmail.com <mailto:kilon.alios@gmail.com>>
>>>>>>> wrote:
>>>>>>>
>>>>>>> Sure the documentation could be better, that is definetly important, but
>>>>>>> is already good enough and UFFI is a very technical subject much more suited
>>>>>>> to a mailing list . Its not physical possible to cover the massive potential
>>>>>>> of UFFI.
>>>>>>>
>>>>>>> On Wed, Oct 18, 2017 at 9:32 AM Stephane Ducasse <stepharo.self(a)gmail.com <mailto:stepharo.self@gmail.com>>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Please do not hesitate to do Pull Requests.
>>>>>>>> Luc told me that he wants to do a pass on it and Esteban promises that to
>>>>>>>> me
>>>>>>>> but he is super busy.
>>>>>>>>
>>>>>>>> Stef
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, Oct 18, 2017 at 5:54 AM, Todd Blanchard <tblanchard(a)mac.com <mailto:tblanchard@mac.com>>
>>>>>>>> wrote:
>>>>>>>>> Wonderful! Thanks.
>>>>>>>>>
>>>>>>>>>> On Oct 17, 2017, at 3:45 PM, stephan <stephan(a)stack.nl <mailto:stephan@stack.nl>> wrote:
>>>>>>>>>>
>>>>>>>>>> On 17-10-17 23:06, Todd Blanchard wrote:
>>>>>>>>>>> Anyone know what happened to this?
>>>>>>>>>>>
>>>>>>>>>>> https://ci.inria.fr/pharo-contribution/view/Books/job/PharoBookWorkInProgre… <https://ci.inria.fr/pharo-contribution/view/Books/job/PharoBookWorkInProgre…>
>>>>>>>>>>
>>>>>>>>>> https://github.com/SquareBracketAssociates/Booklet-uFFI <https://github.com/SquareBracketAssociates/Booklet-uFFI>
>>>>>>>>>>
>>>>>>>>>> has a link to a bintray pdf download
>>>>>>>>>>
>>>>>>>>>> Stephan
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>
Oct. 26, 2017
Re: [Pharo-dev] , for vector creation
by Denis Kudriashov
2017-10-26 10:20 GMT+02:00 Tudor Girba <tudor(a)tudorgirba.com>:
> Hi,
> > On Oct 26, 2017, at 10:10 AM, Denis Kudriashov <dionisiydk(a)gmail.com>
> wrote:
> >
> > Another question.
> >
> > Will not these vectors deprecate Point in future ? Imaging that we will
> completely move to Bloc.
>
> No. Point is a perfectly reasonable data structure to describe a position.
> A Vector is something else and has other contracts. The coincidence is that
> they share the same variables, but they have different API. For example, a
> vector has #length. A point does not.
>
Now Point implements most vector operations. The #length is defined as
radius by #r message. I imaging that with new vector you will reimplement
many of Point methods. Also I doubt that Point plays any role in system
which is different than math vector.
>
> > And what about Rectangle? (Bloc implements own BlRectangle).
>
> These two do not have the same semantics. BlRectangle is a BlGeometry and
> is used for defining a path within an element. BlRectangle is polymorphic
> with other paths such as BlEllipse or BlPolygon. Rectangle is a generic
> data structure that can be used for other purposes.
>
> We should definitely try to find commonalities and opportunities for
> unification. However, we should not confuse state with types which are
> defined by the purpose they are used for (and associated behavior).
>
> Doru
>
>
>
> > 2017-10-26 9:26 GMT+02:00 phil(a)highoctane.be <phil(a)highoctane.be>:
> > #(1 3 4 5 7 -2) asVector
> >
> > Meh.
> > Ugly.
> >
> > { 1. 3. 4. a. b } asVector
> >
> > is the natural consequence.
> >
> > v := (1,3,4,5,7,-2) asVector
> >
> > keeps the parens. But why do I need to do that?
> >
> > Autoformatting messing with my parentheses is just a mistake.
> > I put them in, leave them where they are, 'kay? I do not need an editor
> that rewrites what I tell it. AST power or not.
> >
> > And frankly, I like the "Feenk way of doing things" most of the time, so
> I am willing to go that route.
> >
> > Phil
> >
> >
> >
> > On Thu, Oct 26, 2017 at 8:52 AM, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
> > >
> > > Automatic formatting will turn it into
> > >
> > > vector := 1,3,4,5,7,-2.
> > >
> > > Which is not as nice.
> > >
> > > And even though it looks ok for literal numbers (#(1 3 4 5 7 -2)
> asVector would work too), this starts to look quite generic:
> > >
> > > vector := width, height, depth.
> > >
> > >
> > > Question: why not extend @ notation?
> > >
> > > x @ y @ z?
> > >
> > > Peter
> > >
> > >
> > >
> > > On Thu, Oct 26, 2017 at 8:22 AM, phil(a)highoctane.be <
> phil(a)highoctane.be> wrote:
> > >>
> > >> I also like the , message for those vectors and the concatenation of
> dimensions makes sense.
> > >>
> > >> vector := (1,3,4,5,7,-2).
> > >>
> > >> looks how it should be.
> > >>
> > >> Readable, easy to translate vector stuff from reference text.
> > >>
> > >> Phil
> > >>
> > >>
> > >> On Thu, Oct 26, 2017 at 7:00 AM, Nicolai Hess <nicolaihess(a)gmail.com>
> wrote:
> > >>>
> > >>>
> > >>>
> > >>> Am 25.10.2017 10:50 PM schrieb "Torsten Bergmann" <astares(a)gmx.de>:
> > >>>
> > >>> Hi,
> > >>>
> > >>> there might be reasons for an own 2D vector class (instead of using
> Point).
> > >>> But still I dislike the reimplementation of "," because for me so
> far it
> > >>> has the meaning of "concatenating things".
> > >>>
> > >>>
> > >>>
> > >>> Like concatenating coordinates :-)
> > >>>
> > >>>
> > >>>
> > >>> Here you redefine it to create vector instances and it works only up
> to three
> > >>> so far. Right?
> > >>>
> > >>> I understand that this gives some similarities with the math
> notation (1,2)
> > >>> but I personally would prefer to use:
> > >>>
> > >>> 1@2 asVector
> > >>>
> > >>> or Vector2D x: 1 y: 2
> > >>>
> > >>> Thx
> > >>> T.
> > >>>
> > >>>
> > >>>
> > >>> > Gesendet: Mittwoch, 25. Oktober 2017 um 20:06 Uhr
> > >>> > Von: "Tudor Girba" <tudor(a)tudorgirba.com>
> > >>> > An: "Pharo Development List" <pharo-dev(a)lists.pharo.org>
> > >>> > Betreff: [Pharo-dev] , for vector creation
> > >>> >
> > >>> > Hi,
> > >>> >
> > >>> > As mentioned in the separate thread, we played with introducing
> the extension:
> > >>> >
> > >>> > , aNumber
> > >>> > ^ BlVector2D x: self y: aNumber
> > >>> >
> > >>> > This means that (10,20) will return a 2D vector.
> > >>> >
> > >>> > We also have (10,20,30) which returns a 3D vector.
> > >>> >
> > >>> > , is used for different meanings already in the image beside the
> collection concatenation. For example, in FileReference is adds a file
> extension. And Exceptions create a collection. In other packages,
> PetitParser uses it as a sequence operator.
> > >>> >
> > >>> > Please voice your concerns.
> > >>> >
> > >>> > Cheers,
> > >>> > Doru
> > >>> >
> > >>> >
> > >>> > --
> > >>> > www.tudorgirba.com
> > >>> > www.feenk.com
> > >>> >
> > >>> > "Every thing should have the right to be different."
> > >>> >
> > >>> >
> > >>> >
> > >>> >
> > >>> >
> > >>> >
> > >>>
> > >>>
> > >>
> > >
> >
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "When people care, great things can happen."
>
>
>
>
>
>
Oct. 26, 2017
Re: [Pharo-dev] feenk log
by Tudor Girba
Hi Clément,
I did not know that you had an interest in optimizing vector and matrix operations. Awesome!
We definitely want to take a look at synergies. These low level things are needed for Bloc, but they definitely do not have to be in Bloc.
Doru
> On Oct 26, 2017, at 8:15 AM, Clément Bera <bera.clement(a)gmail.com> wrote:
>
> Hi,
>
> Good work,
>
> In PolyMaths/SciSmalltalk vectors and matrix are already implemented efficiently. I would recommend to share the same implementation. In the next few years, I think we will improve the performance of those vectors/matrix library using the processor vector instructions, and it would be nice if we have to improve one but not two libraries of vectors and matrix (This is the polie way of saying I am going to improve one library and the others will have to do it themselves).
>
> Regards,
>
> On Wed, Oct 25, 2017 at 5:53 PM, Tudor Girba <tudor(a)tudorgirba.com> wrote:
> Hi,
>
> Our team is working on a couple of projects that are relevant for the core of Pharo, namely GT and Bloc/Brick. At ESUG we were asked by several people, and Stef in particular, to make the progress on these projects more transparent. To this end, we will start two streams of signals:
> - fine grained info bits on out Twitter account (several times a week): https://twitter.com/feenkcom
> - a less often but regular (probably every 2 weeks) activity log message sent to this mailing list
>
> Please let us know if you see an issue with this.
>
> In the meantime, letâs start.
>
> Bloc:
> - Over the past couple of weeks Alex worked on transformations and measurements in the core system. It turns out that there was room for quite a number of performance optimizations and for making the system more debuggable.
> - At the low level, this involved adding matrix and vector support.
> https://twitter.com/feenkcom/status/923123870537863168
> https://twitter.com/feenkcom/status/916300180848349185
> - At a higher level, it implies keeping track of measurements
> https://twitter.com/AliakseiSyrel/status/915203525931622400
> - And of transformations:
> https://twitter.com/feenkcom/status/919603739656417281
> https://twitter.com/feenkcom/status/917116164484096001
> - The BlScalableElement is now working properly
>
> GT Examples:
> - The current repository with unary-based examples is at: https://github.com/feenkcom/gtoolkit-examples
> - We now have a runner in the inspector that allows us to both see the source code and run and play with the resulting object:
> https://twitter.com/feenkcom/status/923210686204989442
> - Andrei made the âafterâ behavior to work with unary examples.
>
> Cheers,
> The feenk team
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "Being happy is a matter of choice."
>
>
>
>
>
>
>
>
> --
> Clément Béra
> Pharo consortium engineer
> https://clementbera.wordpress.com/
> Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
--
www.tudorgirba.com
www.feenk.com
"To lead is not to demand things, it is to make them happen."
Oct. 26, 2017
Re: [Pharo-dev] , for vector creation
by Tudor Girba
Hi,
> On Oct 26, 2017, at 7:00 AM, Nicolai Hess <nicolaihess(a)gmail.com> wrote:
>
>
>
> Am 25.10.2017 10:50 PM schrieb "Torsten Bergmann" <astares(a)gmx.de>:
> Hi,
>
> there might be reasons for an own 2D vector class (instead of using Point).
> But still I dislike the reimplementation of "," because for me so far it
> has the meaning of "concatenating things".
>
>
> Like concatenating coordinates :-)
Indeed, this is what we see it as well.
Doru
>
>
>
> Here you redefine it to create vector instances and it works only up to three
> so far. Right?
>
> I understand that this gives some similarities with the math notation (1,2)
> but I personally would prefer to use:
>
> 1@2 asVector
>
> or Vector2D x: 1 y: 2
>
> Thx
> T.
>
>
>
> > Gesendet: Mittwoch, 25. Oktober 2017 um 20:06 Uhr
> > Von: "Tudor Girba" <tudor(a)tudorgirba.com>
> > An: "Pharo Development List" <pharo-dev(a)lists.pharo.org>
> > Betreff: [Pharo-dev] , for vector creation
> >
> > Hi,
> >
> > As mentioned in the separate thread, we played with introducing the extension:
> >
> > , aNumber
> > ^ BlVector2D x: self y: aNumber
> >
> > This means that (10,20) will return a 2D vector.
> >
> > We also have (10,20,30) which returns a 3D vector.
> >
> > , is used for different meanings already in the image beside the collection concatenation. For example, in FileReference is adds a file extension. And Exceptions create a collection. In other packages, PetitParser uses it as a sequence operator.
> >
> > Please voice your concerns.
> >
> > Cheers,
> > Doru
> >
> >
> > --
> > www.tudorgirba.com
> > www.feenk.com
> >
> > "Every thing should have the right to be different."
> >
> >
> >
> >
> >
> >
>
>
--
www.tudorgirba.com
www.feenk.com
"Obvious things are difficult to teach."
Oct. 26, 2017
Re: [Pharo-dev] , for vector creation
by Tudor Girba
> On Oct 26, 2017, at 8:52 AM, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
>
> Automatic formatting will turn it into
>
> vector := 1,3,4,5,7,-2.
>
> Which is not as nice.
While this can be an issue, I see it as secondary, because formatting should help recognize intention, not force us to comply with a standard created by someone else.
> And even though it looks ok for literal numbers (#(1 3 4 5 7 -2) asVector would work too), this starts to look quite generic:
>
> vector := width, height, depth.
I am not sure I understand this point. Could you explain?
>
> Question: why not extend @ notation?
>
> x @ y @ z?
We do not want that specific one because Vectors are not Points. At least not in our context.
Doru
> Peter
>
>
>
> On Thu, Oct 26, 2017 at 8:22 AM, phil(a)highoctane.be <phil(a)highoctane.be> wrote:
> I also like the , message for those vectors and the concatenation of dimensions makes sense.
>
> vector := (1,3,4,5,7,-2).
>
> looks how it should be.
>
> Readable, easy to translate vector stuff from reference text.
>
> Phil
>
>
> On Thu, Oct 26, 2017 at 7:00 AM, Nicolai Hess <nicolaihess(a)gmail.com> wrote:
>
>
> Am 25.10.2017 10:50 PM schrieb "Torsten Bergmann" <astares(a)gmx.de>:
> Hi,
>
> there might be reasons for an own 2D vector class (instead of using Point).
> But still I dislike the reimplementation of "," because for me so far it
> has the meaning of "concatenating things".
>
>
> Like concatenating coordinates :-)
>
>
>
> Here you redefine it to create vector instances and it works only up to three
> so far. Right?
>
> I understand that this gives some similarities with the math notation (1,2)
> but I personally would prefer to use:
>
> 1@2 asVector
>
> or Vector2D x: 1 y: 2
>
> Thx
> T.
>
>
>
> > Gesendet: Mittwoch, 25. Oktober 2017 um 20:06 Uhr
> > Von: "Tudor Girba" <tudor(a)tudorgirba.com>
> > An: "Pharo Development List" <pharo-dev(a)lists.pharo.org>
> > Betreff: [Pharo-dev] , for vector creation
> >
> > Hi,
> >
> > As mentioned in the separate thread, we played with introducing the extension:
> >
> > , aNumber
> > ^ BlVector2D x: self y: aNumber
> >
> > This means that (10,20) will return a 2D vector.
> >
> > We also have (10,20,30) which returns a 3D vector.
> >
> > , is used for different meanings already in the image beside the collection concatenation. For example, in FileReference is adds a file extension. And Exceptions create a collection. In other packages, PetitParser uses it as a sequence operator.
> >
> > Please voice your concerns.
> >
> > Cheers,
> > Doru
> >
> >
> > --
> > www.tudorgirba.com
> > www.feenk.com
> >
> > "Every thing should have the right to be different."
> >
> >
> >
> >
> >
> >
>
>
>
>
--
www.tudorgirba.com
www.feenk.com
"Reasonable is what we are accustomed with."
Oct. 26, 2017
Re: [Pharo-dev] , for vector creation
by Tudor Girba
Hi,
> On Oct 26, 2017, at 10:10 AM, Denis Kudriashov <dionisiydk(a)gmail.com> wrote:
>
> Another question.
>
> Will not these vectors deprecate Point in future ? Imaging that we will completely move to Bloc.
No. Point is a perfectly reasonable data structure to describe a position. A Vector is something else and has other contracts. The coincidence is that they share the same variables, but they have different API. For example, a vector has #length. A point does not.
> And what about Rectangle? (Bloc implements own BlRectangle).
These two do not have the same semantics. BlRectangle is a BlGeometry and is used for defining a path within an element. BlRectangle is polymorphic with other paths such as BlEllipse or BlPolygon. Rectangle is a generic data structure that can be used for other purposes.
We should definitely try to find commonalities and opportunities for unification. However, we should not confuse state with types which are defined by the purpose they are used for (and associated behavior).
Doru
> 2017-10-26 9:26 GMT+02:00 phil(a)highoctane.be <phil(a)highoctane.be>:
> #(1 3 4 5 7 -2) asVector
>
> Meh.
> Ugly.
>
> { 1. 3. 4. a. b } asVector
>
> is the natural consequence.
>
> v := (1,3,4,5,7,-2) asVector
>
> keeps the parens. But why do I need to do that?
>
> Autoformatting messing with my parentheses is just a mistake.
> I put them in, leave them where they are, 'kay? I do not need an editor that rewrites what I tell it. AST power or not.
>
> And frankly, I like the "Feenk way of doing things" most of the time, so I am willing to go that route.
>
> Phil
>
>
>
> On Thu, Oct 26, 2017 at 8:52 AM, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
> >
> > Automatic formatting will turn it into
> >
> > vector := 1,3,4,5,7,-2.
> >
> > Which is not as nice.
> >
> > And even though it looks ok for literal numbers (#(1 3 4 5 7 -2) asVector would work too), this starts to look quite generic:
> >
> > vector := width, height, depth.
> >
> >
> > Question: why not extend @ notation?
> >
> > x @ y @ z?
> >
> > Peter
> >
> >
> >
> > On Thu, Oct 26, 2017 at 8:22 AM, phil(a)highoctane.be <phil(a)highoctane.be> wrote:
> >>
> >> I also like the , message for those vectors and the concatenation of dimensions makes sense.
> >>
> >> vector := (1,3,4,5,7,-2).
> >>
> >> looks how it should be.
> >>
> >> Readable, easy to translate vector stuff from reference text.
> >>
> >> Phil
> >>
> >>
> >> On Thu, Oct 26, 2017 at 7:00 AM, Nicolai Hess <nicolaihess(a)gmail.com> wrote:
> >>>
> >>>
> >>>
> >>> Am 25.10.2017 10:50 PM schrieb "Torsten Bergmann" <astares(a)gmx.de>:
> >>>
> >>> Hi,
> >>>
> >>> there might be reasons for an own 2D vector class (instead of using Point).
> >>> But still I dislike the reimplementation of "," because for me so far it
> >>> has the meaning of "concatenating things".
> >>>
> >>>
> >>>
> >>> Like concatenating coordinates :-)
> >>>
> >>>
> >>>
> >>> Here you redefine it to create vector instances and it works only up to three
> >>> so far. Right?
> >>>
> >>> I understand that this gives some similarities with the math notation (1,2)
> >>> but I personally would prefer to use:
> >>>
> >>> 1@2 asVector
> >>>
> >>> or Vector2D x: 1 y: 2
> >>>
> >>> Thx
> >>> T.
> >>>
> >>>
> >>>
> >>> > Gesendet: Mittwoch, 25. Oktober 2017 um 20:06 Uhr
> >>> > Von: "Tudor Girba" <tudor(a)tudorgirba.com>
> >>> > An: "Pharo Development List" <pharo-dev(a)lists.pharo.org>
> >>> > Betreff: [Pharo-dev] , for vector creation
> >>> >
> >>> > Hi,
> >>> >
> >>> > As mentioned in the separate thread, we played with introducing the extension:
> >>> >
> >>> > , aNumber
> >>> > ^ BlVector2D x: self y: aNumber
> >>> >
> >>> > This means that (10,20) will return a 2D vector.
> >>> >
> >>> > We also have (10,20,30) which returns a 3D vector.
> >>> >
> >>> > , is used for different meanings already in the image beside the collection concatenation. For example, in FileReference is adds a file extension. And Exceptions create a collection. In other packages, PetitParser uses it as a sequence operator.
> >>> >
> >>> > Please voice your concerns.
> >>> >
> >>> > Cheers,
> >>> > Doru
> >>> >
> >>> >
> >>> > --
> >>> > www.tudorgirba.com
> >>> > www.feenk.com
> >>> >
> >>> > "Every thing should have the right to be different."
> >>> >
> >>> >
> >>> >
> >>> >
> >>> >
> >>> >
> >>>
> >>>
> >>
> >
>
--
www.tudorgirba.com
www.feenk.com
"When people care, great things can happen."
Oct. 26, 2017