Hi -
I wanted to mention that last week I changed the compiler
to treat `new SomeClass()` as the same as `new borrowed SomeClass()`
which is the same as `(new owned SomeClass()).borrow()`. In other
words, the default `new SomeClass()` creates a class instance that
the compiler manages.
If the lifetime-checking change described below doesn't cause
problems for older Chapel codes, this one probably will. You
can temporarily turn it off with the --legacy-new flag.
The longer-term strategy to get your code working with
the master branch and the upcoming Chapel release is to:
* first, convert any constructors to initializers
* next, compile with --warn-unstable and fix any
issues there. In particular, the relevant part
is that this flag will ask you to annotate your
class types with unmanaged, borrowed, shared, or owned.
The compiler will interpret an un-decorated class type as a borrow.
Additionally since I emailed last, the classes primer
now discusses owned/shared/borrowed/unmanaged:
https://chapel-lang.org/docs/master/primers/classes.html
The 1.17 release notes discussing the Delete-Free ongoing effort are
still a good introduction as well:
https://www.chapel-lang.org/releaseNotes/1.17/09-ongoing.pdf
and I'm hoping to create other documentation before the release.
Thanks for your patience,
-michael
Hi -
For those of you working with the master branch of Chapel,
I wanted to point out that I recently enabled the lifetime checker
by default.
If it causes problems for you, you can turn it off with the
chpl compiler flag --no-lifetime-checking
Additionally, if you get confusing errors from the lifetime
checker, I recommend the following strategy for
migrating your code:
* first, convert any constructors to initializers
(expect a deprecation warning for this next week)
* next, compile with --warn-unstable and fix any
issues there. In particular, the relevant part for
lifetime checking is that this flag will ask you to annotate your
class types with unmanaged, borrowed, shared, or owned.
The compiler will interpret an un-decorated class type as a borrow.
I'll be working on creating more documentation about
this for the 1.18 release. For now, the 1.17 release notes discussing
the Delete-Free ongoing effort are the best introduction:
https://www.chapel-lang.org/releaseNotes/1.17/09-ongoing.pdf
Thanks,
-michael
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users