Commit Graph

35 Commits

Author SHA1 Message Date
Erik Arvidsson 8c4bc79fcd NomDL: Remove $type from struct impl
The implementation of structs is a Map and we used to reserve a key
with the name "$type" for the TypeRef. This is no longer needed since
the TypeRef is a constant per struct and needs no storage.

Fixes #450
2015-10-22 12:33:39 -04:00
Erik Arvidsson 16353f38f8 NomDL: Make the new serialization default
This makes the new typed serialization the default (the old
serialization is not used but the code has not been cleaned up yet).

Some things are no working in the new world:

Chunking -  The compound list is not working correctly any more. The
Chunks method is having issues because it assumed things based on the
old implicit chunking.

Commit - uses a `Set(Commit)` which means that the parent commit is
embedded. We need to change that to be `Set(Ref(Commit))` so that the
parent commit is referenced instead.
2015-10-21 19:04:22 -04:00
Erik Arvidsson 8565f175ee Make sure Chunks includes type.Refs and the TypeRef
Chunks shold return the futures for types.Ref values.

For typed values that have a TypeRef which has a package ref, also
include that.
2015-10-13 11:00:51 -04:00
Erik Arvidsson 2dec53453e NomDL: Add new serialization format
The new serialization format use "t " as in typed. The rest of the
message is a JSON array describing the typed data. The type is
described by types.TypeRef

Fixes #384
Issues #281, #304
2015-10-06 15:56:10 -07:00
Erik Arvidsson ede5f43204 Value should also have a TypeRef
This is so that we can get the runtime type of a value
2015-09-30 16:15:13 -04:00
Erik Arvidsson c254a1391a Codegen for optional fields in structs 2015-09-25 17:08:57 -04:00
Erik Arvidsson 1a4bdae624 Make types.Ref explicit
No more implicit Get or Equals
2015-09-18 14:03:19 -04:00
Erik Arvidsson f64f6ae81c NomDL: CodeGen for Map extras
This adds Iter, IterAll and Filter to Maps

Issue #303
2015-09-17 17:20:49 -04:00
Erik Arvidsson 5a83b23f29 NomDL: Codegen for List extras
Adds Iter, IterAll and Filter to the List(T) types

Depends on PR #298

Issue #303
2015-09-17 14:24:36 -04:00
Aaron Boodman 91df15a12a nomgen: stabilize the order types are generated in 2015-09-16 17:26:31 -07:00
Rafael Weinstein 0555d7a3c1 Remove errors from read/write/encode/decode 2015-08-18 16:37:04 -07:00
Aaron Boodman 214b37eccf Remove global imports of dbg package
Fixes #179
2015-08-08 23:57:37 -07:00
Aaron Boodman 7944c1b3af Revert "Make WriteValue return a "skinny" copy of input value" 2015-07-30 09:23:35 -07:00
Aaron Boodman a84893c0d8 Make WriteValue return a "skinny" copy of input value
Fixes #141
2015-07-29 16:06:54 -07:00
Chris Masone 4fe00d4f81 Address aa's comments
- Return factory methods to privacy
- use tighter syntax inside Chunks() methods
- Rename Futures() -> Chunks()
2015-07-23 15:32:38 -07:00
Chris Masone a560139d73 Make types.future public
This will enable us to walk the chunk graph without having to go
through weird contortions to figure out which values don't have
chunks in any chunkstore (because they were inlined).

Towards issue #82
2015-07-23 15:32:26 -07:00
cmasone-attic f229396931 Merge pull request #117 from cmasone-attic/revert
Revert Walk() and GetReachabilitySetDiff()
2015-07-23 12:40:53 -07:00
Chris Masone d12dde500d Revert Walk() and GetReachabilitySetDiff()
It turns out these functions aren't actually generally useful,
because they deal in Values and Refs, while what we actually
want is to deal in chunks. So...

Revert "Settle big/small vs to/from ONCE AND FOR ALL"

This reverts commit f51c575cd2.

Revert "Add a naive Diff() function between two Values."

This reverts commit 662bc5e3c4.
2015-07-23 11:49:55 -07:00
Aaron Boodman df1263e5d2 Merge pull request #107 from arv/codegen-map
Add Map codegen
2015-07-22 16:19:32 -07:00
Erik Arvidsson a3b3bb1090 Add Map codegen 2015-07-22 14:36:34 -07:00
Chris Masone 662bc5e3c4 Add a naive Diff() function between two Values.
Given two refs, we need to be able to determine the set of chunks
reachable from one that cannot be reached from the other. This patch
adds a naive implementation of this functionality that essentially walks
the value tree down from the values pointed to by two refs and compares them.

It also has a little command-line driver, but this may be removed.

Fixes issue #82
2015-07-22 14:35:36 -07:00
Erik Arvidsson 3fdc008f5c Codegen: Add support for noms types
This makes it possible to do a List of Bool or Map of Int32 etc
2015-07-22 12:24:27 -07:00
Aaron Boodman 470d5bb4cd Fix duplicate map inserts.
Also happened to uncover a nasty bug with Map.Remove() O_o.
2015-07-21 13:45:27 -07:00
Aaron Boodman 409fd1b076 Map and Set: Compare using future.Val() when possible.
This can be more efficient than comparing by ref for primitives.
2015-07-21 09:26:38 -07:00
Aaron Boodman 2bd7cd2781 Map: Optimize adding multiple values at once. 2015-07-20 11:01:48 -07:00
Aaron Boodman 69cef43527 Switch Map from using a hashtable to a sorted list internally. 2015-07-20 09:28:38 -07:00
Chris Masone 4632a73bc2 Performance improvements, given the xml_importer workload
1) Get rid of temp file usage in FileStore. Instead, write to a buffer and then
   dump to disk on Close().
2) Chk.Equals() uses reflection even if you call it on primitive types, which
   can be surprisingly costly. Switch to a Chk.True() in a couple of hot paths.
2015-07-17 14:14:42 -07:00
Rafael Weinstein d6819cb2ee Forward existing ChunkSource when new map is created on Set 2015-07-15 15:49:59 -07:00
Rafael Weinstein 8297baea11 Incremental loading of Map 2015-07-13 10:36:17 -07:00
Rafael Weinstein 50029d1380 Removing cachedRef inferior of func ensureRef() 2015-07-10 16:16:13 -07:00
Aaron Boodman 96f21c4a60 Remove the Foo/flatFoo abstraction in the types package.
Fixes #24.
2015-07-10 11:29:03 -07:00
Aaron Boodman 129798c006 Support any type of Value for keys of maps 2015-06-15 15:57:33 -07:00
Aaron Boodman 08a53bb48f add types.Set 2015-06-13 23:25:48 -07:00
Aaron Boodman 53003f23f2 Add Value::Ref() 2015-06-12 15:22:27 -07:00
Aaron Boodman cdfbcb4e69 Add initial Map implementation 2015-06-04 22:10:27 -07:00