TODO 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. TODO list for Sidef
  2. New built-in classes:
  3. * Add the `Seq()` class for representing a sequence.
  4. - Take a block for computing the terms, based on the previous terms of the sequence.
  5. - Maybe allow array-like indexing.
  6. - Internal caching of terms.
  7. - See: https://docs.raku.org/type/Seq.html
  8. - Not sure if it's worth it. We already have the `Math.seq()` function.
  9. Classes:
  10. * Implement roles (from Raku) and add the `does` trait for classes.
  11. - See: https://docs.raku.org/language/objects#Roles
  12. Methods / functions:
  13. * Implement the `is exported` trait for functions and classes (maybe)
  14. Internal:
  15. * Switch to subroutine `signatures` (as soon as this feature becomes stable). (maybe)
  16. Performance:
  17. * Add dynamic cache inside all the immutable built-in objects (except IO-related) that take only one argument (the self-object), such that calling the same method again on
  18. the same object, will return the previous result from cache. When the object is destroyed, the cache is also destroyed with the object itself. This requires making all built-in
  19. objects blessed HASH references. Currently, the String class blesses a scalar string, which do not allow any other fields inside the object to be stored. The Number class blsesses
  20. a REF, etc... This change would require quite a lot of work, but the performance improvements may pay off in the end.
  21. Speculations:
  22. * Make all built-in objects immutable, allowing dynamic cache to be applied to all built-in objects.
  23. * Make all core methods (including user-defined methods) real multimethods, using Class::Multimethods.
  24. * Bootstrap Sidef by writing a code generator in Sidef that generates Perl code.
  25. * Rewrite all core libraries in Sidef.
  26. Incompatible changes (maybe):
  27. * Change the ternary operator `bool ? (true) : (false)` to `bool ?? (true) !! (false)`.
  28. * Allow `?` at the end of (boolean) methods and rename `.is_PROPERTY` to `.PROPERTY?`. (e.g.: `n.is_prime` would become `n.prime?`)
  29. * Allow `:` at the end of a method call, followed by an argument. (e.g.: `a.push: 42` would be equivalent with `a.push(42)`)
  30. * Rename the conversion methods `.to_n`, `.to_s`, `.to_a` to `.Num`, `.Str`, `.Arr`.