-
Notifications
You must be signed in to change notification settings - Fork 4
future
= Introduction =
There are many things to improve.
== date/datetime type ==
date can be encoded in a 16-bit integer, as number of days since some epoch. datetime can be encoded in a 32-bit integer, as number of seconds since some epoch.
There is already code which does the necessary conversion. It has been tested to be equivalent to the corresponding Python datetime module.
== a second unicode-type ==
The current unicode type is UCS-4, which for most strings is an overkill. UTF-8 and UCS-2 are very relevant alternatives, or additions.
Additionally, we can pack 0-3 letter ASCII strings inside a pointless_value_t.
== sets/maps ==
Add an empty set/map type. Then there is no need to create 2/3 empty vectors.
Support comparison.
== Python ==
Support serialization of array module vectors.
== larger integers ==
Since only 5 bits of the first 4 bytes in a pointless_value_t are used, we can use 27 more bits for integers, allowing us to support 59-bit signed/unsigned integers.
== serialization ==
Allow serialization of pointless types, both from the C and Python APIs. This would enable us to efficiently "merge" pointless files. The implementation might be tricky, especially since the hash/comparison implementations for Python native types and pointless Python types are different.
Also, supports serialization through callbacks. If, e.g. someone would be interested in creating a vector of integers, 0..2^32-1, instead of creating all that data, just provide a callback which would return those, but not all at once, of course.
== Semantic validation ==
Create a mini-language to validate data inside a pointless file. The library itself does basic validation, s.t. the file conforms to the specs. This would add the option of making sure the data has the necessary invariants. If, e.g. a list needs to have only integers of a certain range, the following expression would suffice:
{{{ is_vector(v) and all(is_integer(i) and 0 <= i and i < N for i in v) }}}
The could be extended to an eval() function. Note that these would be more useful for the C API, since Python does a very good job of this already (albeit slowly).
{{{ // idea for C api
// compile expression
e = eval_compile("is_vector(v) and all(is_integer(i) and 0 <= i < N for i in v)");
// figure out where to bind unbound variables
v_i = eval_bind_i(e, "v");
N_i = eval_bind_i(e, "N");
// bind the variables
eval_bind_pointless(e, v_i, vector);
eval_bind_int(e, N_i, 10);
// run it
eval_eval(e);
// cleanup
eval_destroy(e);
// NOTE: if the expression is generic, it is cheap to re-bind many times and do an eval, since (hopefully) eval_compile() and eval_bind_i() do most of the expensive work
}}} Hide details Change log r1 by arnimarj on Dec 26, 2009 Diff initial check-in Go to: Older revisions All revisions of this file File info Size: 2756 bytes, 69 lines View raw file