Things we did:
- Request API
- Turns out there is a Request struct already written in Servo. But the names it uses are different from what the codegen generates from the webidl. So I have to write
Into
implementation to allow translation between the two. - Completed writing
Into
implementation.
- Turns out there is a Request struct already written in Servo. But the names it uses are different from what the codegen generates from the webidl. So I have to write
- Headers API
- Worked on filling in the constructor for the Headers API, following the spec.
Things we learned:
Into
allows Rust to “translate” between two different objects.- We learned about the very basics of trace garbage collection.
Trace Garbage Collection
In a garbage collected language (such as JavaScript and Python, but not Rust), GC manages the memory by freeing it when the memory occupant is no longer in use. Whenever a new object is created, it is done so through GC and GC will add to its set of objects created.
Once in a while, GC will be triggered, probably through the danger of memory running out. GC is expensive, and therefore, it should not be triggered too often. When GC is triggered, it traces memory, checking which objects are referenced, in other words, still in use. Tri-color marking is the one we learned about, and its wikipedia page provides an excellent summary.
Long story short, GC has the ability to compare the sets of objects created and objects that are still used. GC will free the memory occupied by whatever is in the difference.
TODO:
- Headers:
- constructor
- introspective methods, such as
get
andhas
- Request:
- readonly attributes should be re-implemented
- continue writing constructor