Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt StdLib to new typeclass features #343

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Adapt StdLib to new typeclass features #343

wants to merge 7 commits into from

Conversation

peq
Copy link
Contributor

@peq peq commented Feb 12, 2020

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
Copy link
Member

Frotty commented Feb 14, 2020

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?

@rhazarian
Copy link
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
Copy link
Contributor Author

peq commented Feb 21, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants