-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
TODO
37 lines (30 loc) · 2.21 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
TODO list for Sidef
New built-in classes:
* Add the `Seq()` class for representing a sequence.
- Take a block for computing the terms, based on the previous terms of the sequence.
- Maybe allow array-like indexing.
- Internal caching of terms.
- See: https://docs.raku.org/type/Seq.html
- Not sure if it's worth it. We already have the `Math.seq()` function.
Classes:
* Implement roles (from Raku) and add the `does` trait for classes.
- See: https://docs.raku.org/language/objects#Roles
Methods / functions:
* Implement the `is exported` trait for functions and classes (maybe)
Internal:
* Switch to subroutine `signatures` (as soon as this feature becomes stable). (maybe)
Performance:
* 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
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
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
a REF, etc... This change would require quite a lot of work, but the performance improvements may pay off in the end.
Speculations:
* Make all built-in objects immutable, allowing dynamic cache to be applied to all built-in objects.
* Make all core methods (including user-defined methods) real multimethods, using Class::Multimethods.
* Bootstrap Sidef by writing a code generator in Sidef that generates Perl code.
* Rewrite all core libraries in Sidef.
Incompatible changes (maybe):
* Change the ternary operator `bool ? (true) : (false)` to `bool ?? (true) !! (false)`.
* Allow `?` at the end of (boolean) methods and rename `.is_PROPERTY` to `.PROPERTY?`. (e.g.: `n.is_prime` would become `n.prime?`)
* Allow `:` at the end of a method call, followed by an argument. (e.g.: `a.push: 42` would be equivalent with `a.push(42)`)
* Rename the conversion methods `.to_n`, `.to_s`, `.to_a` to `.Num`, `.Str`, `.Arr`.