Traitor.jl icon indicating copy to clipboard operation
Traitor.jl copied to clipboard

I will bet one beer...

Open timholy opened this issue 7 years ago • 11 comments

...that this can be implemented now. While memory is hazy, I think the missing ingredient before was the ability to redefine the "trait dispatch depot" function and its recipients with new signatures when you extend this list of traits. But now we have Base.delete_method :smile:.

timholy avatar Aug 08 '18 14:08 timholy

Yes - I was thinking the same. :)

andyferris avatar Aug 08 '18 15:08 andyferris

Glad to know you're as evil as I am. :imp:

Wanna talk about this a bit at the hackathon? CC @mauro3.

timholy avatar Aug 08 '18 15:08 timholy

Hello,

What is current status of Traitor and Julia 0.7/1.0? I need to port a C++ code with multiple inheritance and traits may be a way to do it (I'm also considering composition over inheritance but it will probably force me to duplicate some functions

Kind regards

s-celles avatar Aug 17 '18 06:08 s-celles

Right now it's a playground for ambitious developers who want to make a major contribution to Julia by implementing it :smile:. Feel free to help out!

timholy avatar Aug 17 '18 07:08 timholy

To expand on that, it hasn’t been updated for the recent versions of Julia, and even on older versions it was incomplete in terms of reaching its goals. We would love to make it so but as a playground project it gets a lower priority on development time.

You can always perform trait based dispatch with your own dispatch pattern in order to port your code. We use such patterns throughout Julia and it’s ecosystem.

andyferris avatar Aug 17 '18 14:08 andyferris

You can use the registered https://github.com/mauro3/SimpleTraits.jl, if you don't want to hand-code your trait-dispatch (with the added bonus of clearly marking traits for future refactors). Note though that the supported feature-set is less than what you can hand-code.

mauro3 avatar Aug 19 '18 14:08 mauro3

Agreed, SimpleTraits is a much better package to look at if you're trying to get "real work" done right now, as opposed to having fun playing compiler/language developer :-P

c42f avatar Aug 20 '18 00:08 c42f

...that this can be implemented now.

Sorry could someone clarify what "this" refers to here?

MasonProtter avatar Feb 18 '21 21:02 MasonProtter

Sorry could someone clarify what "this" refers to here?

This package, or else the idea that this package represents? I haven't read it yet, but I'm supposing your #10?

andyferris avatar Feb 18 '21 23:02 andyferris

Oh, I see now. I didn't realize the issue was opened after this package stopped working. I thought Tim was talking about some specific feature :facepalm:

MasonProtter avatar Feb 19 '21 02:02 MasonProtter

It was, in fact, born stillborn - around the same time as the version of Julia that “broke” it.

It’s not really functional without add_backedge! which I only learned about this week.

andyferris avatar Feb 19 '21 02:02 andyferris