Are there any native golang tools simar to this which work on Windows/Linux/OSX?
On Thursday, November 2, 2017 at 9:42:27 PM UTC-4, Ben Hoyt wrote:I'm very curious how the performance of Skylark in Go compares to Skylark in Java (and CPython 3.6 for that matter) -- any benchmarks on that?
On Thursday, November 2, 2017 at 9:42:27 PM UTC-4, Ben Hoyt wrote:I'm very curious how the performance of Skylark in Go compares to Skylark in Java (and CPython 3.6 for that matter) -- any benchmarks on that?I don't have any rigorous comparisons, but my informal testing on a number of small benchmarks suggests that CPython is about 2x faster than Skylark in Go (in a single thread), and that Skylark in Go is about 10x faster than Skylark in Java
2x as fast as CPython sounds pretty good to me -- nice!
I'm curious why you wrote the dict implementation from scratch (hashtable.go) instead of using Go maps as a base, and adding a secondary data structure (slice of keys?) to keep track of insertion order? I'm presuming there's a good technical reason, but at first glance it seems like it would be faster and simpler to use Go maps to start with.
On 7 November 2017 at 15:06, Ben Hoyt <ben...@gmail.com> wrote:2x as fast as CPython sounds pretty good to me -- nice!No, CPython is 2x as fast as Skylark in Go. It's implemented in C, so it can do things that are sadly impossible in Go, like implement a threaded bytecode interpreter.
I'm curious why you wrote the dict implementation from scratch (hashtable.go) instead of using Go maps as a base, and adding a secondary data structure (slice of keys?) to keep track of insertion order? I'm presuming there's a good technical reason, but at first glance it seems like it would be faster and simpler to use Go maps to start with.There are many reasons Go maps would not work. First, they do not allow you to define the hash function and equivalence relation for keys. Skylark considers 1.0 == 1, for instance, whereas Go does not; also. Second, Go maps require that keys be comparable, but Skylark tuples are represented as slices, for example. Third, Go maps have non-deterministic iteration order whereas Skylark maps are ordered by insertion. You could maintain a separate slice of keys for the iteration order, but at that point you're halfway to building you're own hash table.Why should Go maps be faster? Go's map is implemented in Go. There's no reason a different implementation should be equally fast, or perhaps even faster. The basic design of the Skylark-in-Go hash table is actually very similar to Go's map.
An only-2x-slower than CPython interpreter is pretty cool. Just very curious what y'all are doing with it.
Oh neat. So is it a sort of competitor to jsonnet? I guess jsonnet is usually used to generate actual config files, not live-interpret executable config.