Commit Graph

414 Commits

Author SHA1 Message Date
Rafael Weinstein 4389605e47 Struct diff (#1548)
StructDiff
2016-05-19 11:09:26 -07:00
Ben Kalman 34449f0b2a Delete sequence_chunker_test.go 2016-05-18 17:39:45 -07:00
Ben Kalman 65f4ae358c Make sequence chunker function return (meta tuple, collection) pair (#1540)
Both Go and JS. Currently they return (any, value), but it's useful to
have the more specific return type.
2016-05-18 16:01:13 -07:00
Ben Kalman 0585010274 Return io.Writer errors from WriteEncodedValueWithTags instead of panic (#1526)
A common case for io.Writer errors is during noms-log or noms-show when
piped through head, i.e. "noms log ldb:/path/to:noms | head".

noms-log handles this itself by recovering from the panic, but rather
than porting this logic to noms-show, just make it so that you don't
need to recover in the first place.

This is similar to how errors from fmt.Println etc don't panic.
Non-write errors (like crashes) will continue to panic.
2016-05-18 10:37:35 -07:00
Erik Arvidsson 17a78061c0 Struct subtype (#1524)
* Subtype checking for structs

Towards #1491
2016-05-18 09:06:53 -07:00
cmasone-attic cefb014d15 Go: In httpBatchStore, order outgoing Chunks by ref-height (#1519)
* Go: In httpBatchStore, order outgoing Chunks by ref-height

Rather than sending chunks to the server in the order that callers put
them into an httpBatchStore, instead order them by ref-height at the
time that Flush() is called.  Making this change requires that
ref-height for a given chunk be passed in through the SchedulePut()
API, because Chunks (by design) don't carry much metadata about
themselves.

Toward #1510
2016-05-18 08:33:49 -07:00
Erik Arvidsson df1c91843d JS: No need to compute the union type in decode (#1523)
* JS: No need to compute the union type in decode

Instead trust that the serialization is correct

Towards #1491
2016-05-17 15:39:18 -07:00
Erik Arvidsson 653aa41776 Go: Dynamic types for Data structure API (#1516) 2016-05-17 15:02:53 -07:00
Mike Gray 54e4c18806 primitives.go split into bool.go and number.go (#1503)
* primitives.go split into bool.go and number.go, interfaces implemented marked, a few .gitignore files updated
* removing old binary names
2016-05-13 19:13:19 -04:00
Erik Arvidsson 2883609860 Update makeUnionType type to flatten and remove duplicates (#1492)
makeUnionType now flattens and removes duplicate types. With this
change makeUnionType might no longer actually create a union
type in the case there is only one type in the union.

Towards #1491
2016-05-13 09:21:03 -07:00
Erik Arvidsson 58464baef9 Total ordering of values (#1475)
This allows having a set/map of heterogenous elements/keys. To support
this we have to be able to have a total ordering for all noms values.

The ordering is false < true < -999 < 0 < 999 < "" < "a" < "z" < Hash
In other words, Bool < Number < String < * and for comparing non
primitives we compare the hash of the object.

Fixes #1104
Fixes #1312
2016-05-12 10:35:56 -07:00
Ben Kalman 7ebc0f2feb Rename NewTypedRefFromValue to NewRef and old NewRef to constructRef (#1427)
This is because:
* All type.Ref are now typed, so Typed was a tautology.
* The only way to construct a type.Ref is with a Value, so FromValue was
  a tautology (with a small amount of work to remove callers of NewRef).
2016-05-11 18:06:17 -07:00
Rafael Weinstein a3b18b3f62 Clean up go collection mutation (#1485) 2016-05-11 17:46:17 -07:00
Erik Arvidsson e832dbbdb1 Revert "Limit struct field names to ascii identifiers" (#1483) 2016-05-11 16:19:57 -07:00
Erik Arvidsson 5e09379d57 Limit struct field names to ascii identifiers (#1469)
[a-zA-Z][a-zA-Z0-9_]*

Towards #1402
2016-05-11 15:49:03 -07:00
Rafael Weinstein 9db78e9a66 Refactor Go prolly-trees (#1474) 2016-05-11 14:27:39 -07:00
Mike Gray 3f7561a7ac using collection tests for map/set (#1441)
also adding a cross platform/language test
2016-05-11 09:02:40 -04:00
Rafael Weinstein 08d306a1dc refactor go ordered sequence operations (#1461) 2016-05-09 15:31:35 -07:00
Rafael Weinstein fea517be33 refactor go indexed sequence operations (#1457) 2016-05-09 13:48:19 -07:00
Rafael Weinstein 1c08476934 Fix searching for inlined non-primitives in js (#1458) 2016-05-09 10:57:33 -07:00
Erik Arvidsson e2f7776614 noms show should stream to stdout (#1456) 2016-05-06 18:15:52 -07:00
Erik Arvidsson 014e330315 Rename DataStore to Database (#1448) 2016-05-06 17:37:19 -07:00
Erik Arvidsson c8ce81d6ba Serialize meta tuple with ref value (#1443)
When we serialize a meta tuple we should serialize it with the Ref value (which includes the type). This is because in the future the sub tree might be of a different type than the current tree.

Towards #1312
2016-05-06 13:25:23 -07:00
Rafael Weinstein d5495c64ef Align go & js sequence cursor (#1435)
Align go & js sequence cursor
2016-05-05 19:17:09 -07:00
Erik Arvidsson bcd8d7e172 Add union types (#1417)
A union type is a compound type with 0 or more types.

Its noms serialization is UnionKind, <number-of-types>, T0, ..., TN

Its HRS is T0 | T1 | ... | TN

Towards #1311
2016-05-05 15:43:11 -07:00
Ben Kalman e7219f3603 Add height to every RefValue (#1415)
This is to support efficient chunk diff. Most of the churn in this patch
comes from updating test expectations, and updating every Ref construction
to include a height and every MetaTuple to include a Ref.
2016-05-05 10:11:05 -07:00
Mike Gray cd22583bac removing leaf references from map/set tests, using only map/set public api for tests (#1421) 2016-05-05 08:39:56 -04:00
Rafael Weinstein 043a2374da Remove parallel collection functions (#1420) 2016-05-04 17:27:16 -07:00
Rafael Weinstein 5da29dc1f1 Remove test dependencies of private list api (#1416) 2016-05-04 15:00:18 -07:00
Erik Arvidsson c9d176cb28 Cleanup serialization of types (#1410)
We used to serialize types in two different ways, depending on whether
the type was used as a tag or as a value. Now we serialize it the same
way.

Also, remove makeCompoundType completely.

And remove some dead code.
2016-05-04 11:35:33 -07:00
Chris Masone 202596169f Guard EncodedHumanReadable() call in checkChunksInCache
Turns out this can crash sometimes and is always
very expensive. Remove it.
2016-05-04 11:10:32 -07:00
Erik Arvidsson 963fbdaad6 Write type with value (#1406)
Write type for all values

Fixes #1308
2016-05-03 16:52:22 -07:00
Chris Masone 9684881b5f Go: Maintain validation cache on DataStore across Commit
While this causes the cache to potentially grow infinitely,
having a DataStore keep track of every value it's read or written
makes it simpler to program with. Once types.Ref can only come to
be by being read out of a DataStore, we can do away with this
altogether.
2016-05-03 10:19:24 -07:00
Dan Willhite c2c6ee037c Merge pull request #1393 from willhite/work
Implement noms-show. Fixes #1148.
2016-05-02 16:04:29 -07:00
Dan Willhite ab3ebf52d3 Implement noms-show. Fixes #1148. 2016-05-02 15:56:41 -07:00
Erik Arvidsson 3032c76a39 Use a map for the struct fields
Fixes #1368
2016-05-02 15:35:27 -07:00
Chris Masone 5eda7e8243 Align Go and JS implementations of ValueStore.WriteValue()
Fixes #1377
2016-05-02 11:54:23 -07:00
Rafael Weinstein 93f9941b9f Abstract & unify blob tests 2016-05-02 10:34:41 -07:00
Chris Masone 8eba180782 Revert "renaming datastore to database (#1374) - fixes bug #1290"
This reverts commit d77902b323.
2016-05-02 09:01:44 -07:00
Mike Gray d77902b323 renaming datastore to database (#1374) - fixes bug #1290
* datastore -> database
* fixing bug 1290, renaming datastore to database
2016-05-01 22:02:16 -04:00
Erik Arvidsson 6f972c9d7c Make the order of struct fields insignificant (#1367)
The fields are now sorted upon creation

Fixes #814
2016-04-29 21:16:13 -07:00
Erik Arvidsson d4d6de6a76 Rename Field t to type (#1366)
* Rename Field t to type

* Fix clients/csv too
2016-04-29 13:47:52 -07:00
Erik Arvidsson 0dec930bca Remove ParentDesc (#1364)
The Parent type pointer is only internally used in encoding/decoding
2016-04-29 13:47:40 -07:00
Erik Arvidsson 6730227136 Rename BackRef to Parent (#1357)
Fixes #1340
2016-04-29 09:50:35 -07:00
Erik Arvidsson cfc51e2e9d Remove optional fields (#1354)
Remove optional fields

Fixes #1310
2016-04-28 17:12:15 -07:00
Erik Arvidsson fa742aecb1 Remove unions from structs (#1345)
Fixes #1344
2016-04-28 11:13:59 -07:00
Erik Arvidsson 3ff6ee6add Inline struct type declaration into chunk (#1324)
Struct type definition is now inlined into the chunk. To break
cycles we use back references.

- Removes unresolved type refs
- Removes packages

Fixes #1164
Fixes #1165
2016-04-27 20:39:51 -07:00
Erik Arvidsson a5ebffe076 Fix failing js codegen tests (#1332)
* Fix failing js codegen tests

- Need to pick up version 13
- Fixes spurious import

* Remove left over Int64/Uint64 and fix ordering tests
2016-04-27 16:15:47 -07:00
Erik Arvidsson 6779a60a39 Merge branch 'floating' of https://github.com/mikegray/noms into mikegray-floating 2016-04-27 15:18:10 -07:00
Mike Gray 47794ca754 Removing [U]Int[8|16|32|64] and Float[32|64] in favor of Number 2016-04-27 16:24:13 -04:00