Replies: 19 comments 16 replies
-
Hi,
On Tue, Sep 5, 2023 at 8:20 PM errael ***@***.***> wrote:
(Short term discussion)
Over a week ago, there was a one week estimate to take bug fixes. Some
notable missing features were discovered:
1. access control was not implemented (could write to privates)
2. reading/writing statics outside of a class not implemented
Basic access control was fixed, *reading* statics outside of a class
fixed.
Variety of other fixes, for example garbage collection of class/interface.
I don't think there are any open issues regarding specification of
syntax/semantics.
Issues I'm aware of and/or I'm not sure about
1. writing statics in s :def outside of a class
2. more access control situations
3. script level access issues, maybe only statics
Thanks for summarizing the outstanding issues.
Still not feature complete because of 1.
The second could be considered bugs, the third hasn't been triaged
(AFAIK), could be missing feature or bugs.
Putting together tests for 2. over the last day. Some bugs found/fixed;
Good/Bad news, it's still pretty easy to find bugs (though I can be brutal,
so maybe it's not that bad). I've add some fails below, depending can open
them as bugs (certainly will if they are not fixed for 9.1)
@yegappan <https://github.com/yegappan> @chrisbra
<https://github.com/chrisbra> Those at a higher pay grade than I will
have to contemplate, meditate, and otherwise look at the situation, and
make a scheduling update. I put TODO in the tile, but things change...
Following run with 9.0.1872 and PR #13032
<#13032>
*script level static access example*
line 8:
E1326: Member not found on object "A": svar1
vim9script
class A
public static svar1: number
endclass
var oa = A.new()
echo oa.svar1
*weird name duplication error*
I have opened PR #13042 with a fix for this
issue.
Regards,
Yegappan
… line 5:
E1369: Duplicate member: s_var
Flip the order of the declarations, and there is no error. Probably off by
1 for duplicate name check
vim9script
class C
public static s_var2: number
public static s_var: number
endclass
|
Beta Was this translation helpful? Give feedback.
-
On Tue, Sep 5, 2023 at 9:56 PM Yegappan Lakshmanan ***@***.***> wrote:
Hi,
On Tue, Sep 5, 2023 at 8:20 PM errael ***@***.***> wrote:
>
> (Short term discussion)
>
> Over a week ago, there was a one week estimate to take bug fixes. Some notable missing features were discovered:
>
> access control was not implemented (could write to privates)
> reading/writing statics outside of a class not implemented
>
> Basic access control was fixed, reading statics outside of a class fixed.
> Variety of other fixes, for example garbage collection of class/interface.
> I don't think there are any open issues regarding specification of syntax/semantics.
>
> Issues I'm aware of and/or I'm not sure about
>
> writing statics in s :def outside of a class
> more access control situations
> script level access issues, maybe only statics
Thanks for summarizing the outstanding issues.
>
> Still not feature complete because of 1.
> The second could be considered bugs, the third hasn't been triaged (AFAIK), could be missing feature or bugs.
>
> Putting together tests for 2. over the last day. Some bugs found/fixed; Good/Bad news, it's still pretty easy to find bugs (though I can be brutal, so maybe it's not that bad). I've add some fails below, depending can open them as bugs (certainly will if they are not fixed for 9.1)
>
> @yegappan @chrisbra Those at a higher pay grade than I will have to contemplate, meditate, and otherwise look at the situation, and make a scheduling update. I put TODO in the tile, but things change...
>
> Following run with 9.0.1872 and PR #13032
>
> script level static access example
>
> line 8:
> E1326: Member not found on object "A": svar1
>
> vim9script
>
> class A
> public static svar1: number
> endclass
>
> var oa = A.new()
> echo oa.svar1
>
> weird name duplication error
I have opened PR #13042 with a fix for this issue.
Both of these issues are now addressed in the PR.
Regards,
Yegappan
…
>
> line 5:
> E1369: Duplicate member: s_var
>
> Flip the order of the declarations, and there is no error. Probably off by 1 for duplicate name check
>
> vim9script
>
> class C
> public static s_var2: number
> public static s_var: number
> endclass
>
>
|
Beta Was this translation helpful? Give feedback.
-
Oops, I was wrong. See #13004 . Vim's inheritance model of statics is unlike any known language and offers no performance advantage. |
Beta Was this translation helpful? Give feedback.
-
I see
The re-work/rewrite is not strictly need, since it is an implementation issue and not user visible, except through disassemble, but doing it the "right way" now, while it's fresh in mind is probably a good idea; it can be deferred until after the second one. The second is primarily a parsing issue I think, assuming load/store classmember can be used. The third needs some @yegappan Following is a detailed look at the first and second items. (TLDR (but I can refer to it); but if you notice a conceptual flaw, LMK)
There might be a better fix. While wondering about #13004 and looking at code I got a better understanding of the vim9script
For reading, even though I looked, I couldn't find an instruction that handled statics (I even thought about adding some). But I think the following is exactly what I was looking for
and
My fundamental error was that I assumed that the object was needed, as well as the index, as with object members. For example
But that's not true. And the |
Beta Was this translation helpful? Give feedback.
-
This doesn't look like a bug to me, though the error message could be clearer. Accessing static members through object references has been considered a bad idea for a long time. E.g., the C# compiler will report something like
and most linters/style guides will flag it. More importantly, it's inconsistent with the other design decisions made for Vim9 that are intended to reduce call-site bafflement. There's already two ways to access the static member (bare and type-qualified) a third seems unnecessary when one is considered enough in other contexts. Refs: |
Beta Was this translation helpful? Give feedback.
-
@yegappan @dkearns @chrisbra Updated intitial post of this discussion. Two open spec syntax/semantic issues. |
Beta Was this translation helpful? Give feedback.
-
Updated initial post, only one thing left unresolved in the spec syntax/semantics. |
Beta Was this translation helpful? Give feedback.
-
Currently, accessing a static on an instance var gives obscure error messages.
If there no one working on it, I'll put together a PR that uses a more targeted message. The specific message can be tuner after the PR is opened, but some questions to consider: The vim9class doc uses "object" and not "instance"; the word instance does not appear at all. "object reference" doesn't appear in vim9class.txt, there's talk of "access an object member". |
Beta Was this translation helpful? Give feedback.
-
I deleted comment about interface inheritance and opened #13085 instead. |
Beta Was this translation helpful? Give feedback.
-
Updated initial post, there's a consensus around the spec syntax/semantics for statics/inheritance. That leaves only one open item #13069. But there a new discussion #13085 which may reveal 9.1 issues. |
Beta Was this translation helpful? Give feedback.
-
I was watching a YoutTube about OOP from a SmallTalk perspective and something they mentioned was that the difference from most OO languages and the OO from SmallTalk and Ruby is their stance that all Objects can be sent any message and it is up to the receiving object to choose how to manage that or accept it. The example they mentioned was instead of say an interface does not handle that method call instead it defaults to message unhandled with a way for objects to either declare which messages they respond to or have a catch all missingMethod() I think the idea was in the shifting from interface mechanics to message passing. Curious of thoughts about this distinction especially with its applicability to Vim9Script. |
Beta Was this translation helpful? Give feedback.
-
After patch 9.0.1906, 92d9ee5, there are no known major issues (that I know of anyway) for the vim9.1script spec. I'm assuming the spec is now frozen for vim9.1 (which may also not be true). Maybe there will be a little breathing space before more discussions with proposals are opened to extend vim9class syntax/semantics. No, there won't be; there is already discussion about things mentioned in the vim9script spec which are for the future. Maybe the discussion won't feel quite so urgent. And there are bugs, which may mean that vim9script that compiles and runs under vim9.1 will not compile if some random bug is fixed. At least I hope that's the case, I'd like it to be OK to fix bugs. I won't close this until vim9.1 is released. |
Beta Was this translation helpful? Give feedback.
-
#12965 and related typing issues need to be fixed if backward compatibility is required. |
Beta Was this translation helpful? Give feedback.
-
Vim9 syntax highlighting needs quite a bit of work. I'll make an issue for this once I've investigated further. |
Beta Was this translation helpful? Give feedback.
-
This is probably an implicit task but as I've started playing with these features the help tags need some improvement. E.g., the last four I just tried didn't turn up anything I'll add a PR when I have more. |
Beta Was this translation helpful? Give feedback.
-
Update intro post. Feels so close... |
Beta Was this translation helpful? Give feedback.
-
What about Lines 2083 to 2099 in e379e21 Lines 739 to 764 in e379e21 I actually didn't even know I haven't been paying too much attention to vim9script and vim9.1 release so not sure if these have been discussed. If they aren't done by vim9.1, maybe the documentation should be cleaned up for now to avoid giving the wrong impression that the feature works? |
Beta Was this translation helpful? Give feedback.
-
I have now added the support for dunder methods in #13238. |
Beta Was this translation helpful? Give feedback.
-
Final update (Plus ça change, plus c’est la même chose) |
Beta Was this translation helpful? Give feedback.
-
(Short term discussion)
No open vim9.1script syntax/semantics! (but been there before)
There are bugs.
Open issue regarding backward source compatibility
__
, prefix in any vim9class related name for future features. Give error if used.[vim9class] dunder methods and system integration #13287
Draft: Support for using len(), empty() and string() with an object #13238
Prevent assigning class name to variable. #13404
(maybe/probably more)
Other issues
vim9script
syntax highlighting. vim9class work/bugs TODO for vim9.1 #13041 (comment)runtime(vim): Improve :let-heredoc syntax highlighting #12923
runtime(vim): Improve Vim9 and legacy-script comment highlighting #13104 (not vim-9.1 milestone)
Docs
@yegappan @chrisbra Those at a higher pay grade than I will have to contemplate, meditate, and otherwise look at the situation, and make a scheduling update. I put TODO in the tile, but that's just my opinion and things change...
Beta Was this translation helpful? Give feedback.
All reactions