oshun icon indicating copy to clipboard operation
oshun copied to clipboard

Why using attributes?

Open jjn1056 opened this issue 1 year ago • 6 comments

Why my $dog :isa(Dog) and sub foo($dog :of(Dog)) { ... } and not my Dog $dog =... and my sub foo (Dog $dog)?

Perl has allowed my Dog $dog = ... forever (although it does nothing) and neither approach is supported in signatures right now so whatever we do there we have to do from scratch anyway.

I'm just wondering the thinking process that got us to the current spec.

jjn1056 avatar Aug 12 '23 20:08 jjn1056

There is some discussion about that here https://github.com/orgs/Perl-Oshun/discussions/22, but not really so much clear justification for one way or the other IMO.

zmughal avatar Aug 12 '23 20:08 zmughal

Basically what I'd like is for there to be enough metadata that we can fix the Perl Language Server and in my IDE of choice you hover over a method call in Perl and see and signature and return info. Ideally you'd be able to hover over a variable and get its type info, although I realize in a dynamic language that might be very hard. Basically I see types as more useful for debugging large applications. I find with Perl you get to a level of complexity were you end up doing too much debugging code to try and trace back what is what.

jjn1056 avatar Aug 13 '23 13:08 jjn1056

uf, language server, that's huge topic on its own :-( but it's also worth of dedicated issue "Oshun should be supported by PLS" (in this repo)

happy-barney avatar Aug 13 '23 14:08 happy-barney

uf, language server, that's huge topic on its own :-( but it's also worth of dedicated issue "Oshun should be supported by PLS" (in this repo)

I know everyone has a different take on this but we really need to think about language server support. The fact ours sucks so much is a major contributor to losing younger devs who grow up using these tools. Having them not work as expected hurts us.

jjn1056 avatar Aug 13 '23 14:08 jjn1056

don't get me wrong, I fully support any language server related effort (and imho language server support should be built-in into core so it will be able to better handle pluggable grammars).

happy-barney avatar Aug 13 '23 14:08 happy-barney

See also https://github.com/bscan/, including Data-Class.

druud avatar Aug 14 '23 13:08 druud