forked from qitab/cl-protobufs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTODO
121 lines (100 loc) · 5.75 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
TO DO
- Address the remaining "---" issues
- Use the package system for look-up instead of the find-foo insanity.
- Get rid of any find-foo lookup at schema expansion/compilation time.
- Get "namespaces" (i.e., nested classes) fully working
[ - Printers need to print qualified names, as needed ]
[ - 'find-message-descriptor' and 'find-enum-descriptor' need to search ]
[ namespaces if the quick compare against the name/class fails ]
- Lose 'proto-class', replace it with 'proto-type';
its type is (or null symbol)
'proto-type' should always be the name from the Lisp side
[ All 'define-xxx' macros should have, as their first argument, ]
[ a type (not a "name") ]
[ In .proto files, there should be an 'option lisp_name="pkg:name"' ]
[ which can be used to override the 'proto->class-name' default ]
[ for messages and enums ]
- Refactor 'field-descriptor' so the names are clearer:
- Lose the existing 'proto-type' slot,
then rename the 'proto-class' slot to 'proto-type';
this will hold the Lisp name of the slot type
- 'proto-name' will hold the Protobufs name of the field type
(this used to hold the Protobufs name of the field)
[ - &key name should give the Protobufs name for the field ]
[ - 'option lisp_name="pkg:name"' should give the Lisp name for the slot ]
- Refactor 'define-message' and 'define-extend' to avoid so much
duplicated code
[- Need search paths in the ASDF .proto module ]
[- Make 'import' really work ]
[ - *all-protobufs* should record keyed by pathname, too ]
[ - 'import' should not bother loading if the import is present, ]
[ and should record the imported schema when it's done ]
[ - 'find-message-descriptor' and 'find-enum-descriptor' should search ]
[ imports, too ]
[- 'package'/'lisp_package' should create the package, if necessary. ]
[- Don't generate 'import "net/proto2/proto/descriptor.proto"' and ]
[ 'extend proto2.MessageOptions { ..}' lines unless we need to include ]
[ one of the lisp_* options in the generated model ]
[- Handle 'import' ]
[ It should probably just compile/load the file when the import ]
[ is seen ]
[ - The Lisp macros should be able to import both .lisp and .proto files ]
[ - The .proto parser should only be able to import .proto files ]
[- Handle 'extension' and 'extends' ]
[ - 'define-extension' just declares the extension within a message ]
[ and adds it to 'proto-extensions' for the message ]
[ - Easiest is to add an "extension-p" flag to 'message-descriptor' ]
[ - Define new 'define-extends' macro ]
[ which *copies* all slots from the message being extended, ]
[ then just adds the extension fields as (flagged) ordinary fields ]
[ with reader/writer function (see below) ]
[ - Factor out field-processing code from 'define-message' ]
[ - If we do it this way, no other special magic is needed ]
[ Serialization, e.g., should just work ]
[ Scoping should also just work ]
[ - Get deserialization working; ]
[ Need to call the 'proto-writer' function if its around ]
[ instead of just using (setf (slot-value ...) ...) ]
[ - Don't forget to check that the "extends" indexes match ]
[ what was declared by 'define-extension' ]
[ - And don't allow overlapping extension indexes ]
[ - Generate new getter and setter methods for each extended slot: ]
[ (let ((an-int 10)) ]
[ (declare (type (or integer null) an-int)) ]
[ (defmethod an-int ((object extendable-foo)) ]
[ an-int) ]
[ (defmethod (setf an-int) (val (object extendable-foo)) ]
[ (declare (type (or integer null) val) ]
[ (setq an-int val)))) ]
[ - Handle "extends" in the parser, too ]
[- Speed up 'list-of' by shadowing the Quux version, ]
[ and don't do any type-checking (!) ]
[ Having done this, we can probably remove the hack of using map:map, ]
[ which should make deserialization much faster ]
[- 'proto-name' should always be the name from the Protobufs side; ]
[ its type is (or null string) ]
[ All 'define-xxx' macros should have '&key name' which gives the Protobufs ]
[ name, which can be used to override the 'class-name->proto' default ]
[- 'deserialize-object' uses the alias when it calls 'make-instance', ]
[ or if there is no alias, 'proto-type' ]
[- 'serialize-object' and 'object-size' never use the alias; ]
[ instead all the "dispatching" should be done of off 'proto-type', ]
[ Ditto, 'print-text-format' ]
[- The "name" of a protobuf should be the camel-cased file name ]
[ The "type" of a protobuf should just be the file name as a keyword symbol ]
[- RPCs should have 'input-name', 'input-type', 'output-name' and 'output-type' ]
[ The "name" ones are for the Protobufs side ]
[ The "types" ones are for the Lisp side; we look up on "type" only ]
[ In the Lisp, the RPC types can be either 'type' or '(type :name <name>)' ]
[ In .proto files, there should be an 'option lisp_name="pkg:name"' ]
[ which can be used to override the 'proto->class-name' default ]
[ for the name of the RPC function ]
[- Finishing eliminating 'protobuf' argument from the API ]
[ - Lose it in 'serialize-object-to-stream' and 'deserialize-object-from-stream']
[ - Rename it to 'trace' in '(de)serialize-object' and 'object-size', ]
[ make it be the last supplied argument ]
[ - Fix up the '(de)serialize-object' and 'object-size' generators, too ]
[ - Apply the same fix to 'print-text-format' ]
[ - Then make the compatibility API actuallty work ]
[- Implement 'parse-text-format' ]
[- Write documentation ]