Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adapt StdLib to new typeclass features#343

Closed
peq wants to merge 7 commits into
master from
new-generics
Closed

Adapt StdLib to new typeclass features #343
peq wants to merge 7 commits into
master from
new-generics

Conversation

@peq

@peq peq commented Feb 12, 2020

Copy link
Copy Markdown
Contributor

Trying out how rewrite of StdLib with new generics and type classes would look like (see wurstscript/WurstScript#931).

Feedback and tests with users of the library are very welcome.

@peq peq requested a review from Frotty February 12, 2020 22:25

Frotty commented Feb 14, 2020
edited
Loading

Copy link
Copy Markdown
Member

As mentioned I'm not too big of a fan of public implements as it sounds wrong.
implementation or trait are probably more suited.
Regarding ConvertIndex since it's more a property/trait shouldn't it be Indexable?

Copy link
Copy Markdown
Contributor

Probably it's performance-wise better to introduce a typeclass with methods to write and read the type to/from the native hashtable, so it would be possible to use HashMap with native types and strings without any overhead, as they would use their own methods, like saveString, loadString, etc.

peq commented Feb 21, 2020

Copy link
Copy Markdown
Contributor Author

Yes, that's a good idea. Just have to figure out how to do this so that it's not necessary to implement two type classes for every type that does not have a hasmap native.

Frotty commented Mar 3, 2026

Copy link
Copy Markdown
Member

I don't think this is gonna happen anymore, closing! New generics have been updated to support common usage patterns - but type classes have been deemed overkill and will not be implemented for now.

@Frotty Frotty closed this Mar 3, 2026
@Frotty Frotty deleted the new-generics branch May 17, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Frotty Frotty Awaiting requested review from Frotty

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /