Originally created by @blacktop on GitHub (Jul 17, 2024).
It would be awesome if you could add binary serialization to compact the pkl files.
I started using it in a NEW feature for one of my projects and it is creating very large files ;)
Thanks!
Originally created by @blacktop on GitHub (Jul 17, 2024).
It would be awesome if you could add binary serialization to compact the pkl files.
I started using it in a NEW feature for one of my projects and it is creating very large files ;)
Thanks!
@blacktop commented on GitHub (Jul 17, 2024):
I might be using `pkl`s not for their intended purpose, but I've enjoying the format so far.
Here is an example:
- https://github.com/blacktop/symbolicator/blob/main/kernel/24/xnu.pkl
I prob can .tar.gz etc the files to make them smaller when sending around, but thought; since this is kinda the NEW plist, maybe there'd be a official way to create "bpkl"s similar to bplists to make them as small as possible etc
@blacktop commented on GitHub (Jul 17, 2024):
I prob can .tar.gz etc the files to make them smaller when sending around, but thought; since this is kinda the NEW plist, maybe there'd be a official way to create "bpkl"s similar to bplists to make them as small as possible etc
Gotcha. If you're using the pkl-go bindings (seems like you are), you can "bake" Pkl config into their binary representation using EvaluateExpressionRaw.
These bytes can then saved to a file or whatnot, and then be unmarshall'd into the codegen'd structs via Unmarshal.
@bioball commented on GitHub (Jul 18, 2024):
Gotcha. If you're using the pkl-go bindings (seems like you are), you can "bake" Pkl config into their binary representation using [EvaluateExpressionRaw](https://pkg.go.dev/github.com/apple/pkl-go/pkl#Evaluator.EvaluateExpressionRaw).
These bytes can then saved to a file or whatnot, and then be unmarshall'd into the codegen'd structs via [Unmarshal](https://pkg.go.dev/github.com/apple/pkl-go/pkl#Unmarshal).
@blacktop commented on GitHub (Jul 18, 2024):
Awesome! thank you
I don't really understand what the `expr` arg is for here?
https://github.com/apple/pkl-go/blob/4e6500ec73b5cd7665b7f697e4027760302af0c2/cmd/internal/gen-fixtures/gen-fixtures.go#L41
Hm, that makes sense I guess. We store information in our binary format that isn't present in source code. You'll probably see a lot of gains by compressing it with gzip or something similar, because there's a lot of repetition in there.
expr is the expression to evaluate within the module. If empty, it defaults to the whole module itself (equivalent to "module").
@bioball commented on GitHub (Jul 18, 2024):
Hm, that makes sense I guess. We store information in our binary format that isn't present in source code. You'll probably see a lot of gains by compressing it with gzip or something similar, because there's a lot of repetition in there.
`expr` is the expression to evaluate within the module. If empty, it defaults to the whole module itself (equivalent to `"module"`).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @blacktop on GitHub (Jul 17, 2024).
It would be awesome if you could add binary serialization to compact the pkl files.
I started using it in a NEW feature for one of my projects and it is creating very large files ;)
Thanks!
@bioball commented on GitHub (Jul 17, 2024):
WRT large files: are you referring to Pkl source files, or something else?
@blacktop commented on GitHub (Jul 17, 2024):
I might be using
pkls not for their intended purpose, but I've enjoying the format so far.Here is an example:
@blacktop commented on GitHub (Jul 17, 2024):
I prob can .tar.gz etc the files to make them smaller when sending around, but thought; since this is kinda the NEW plist, maybe there'd be a official way to create "bpkl"s similar to bplists to make them as small as possible etc
@bioball commented on GitHub (Jul 18, 2024):
Gotcha. If you're using the pkl-go bindings (seems like you are), you can "bake" Pkl config into their binary representation using EvaluateExpressionRaw.
These bytes can then saved to a file or whatnot, and then be unmarshall'd into the codegen'd structs via Unmarshal.
@blacktop commented on GitHub (Jul 18, 2024):
Awesome! thank you
I don't really understand what the
exprarg is for here?https://github.com/apple/pkl-go/blob/4e6500ec73b5cd7665b7f697e4027760302af0c2/cmd/internal/gen-fixtures/gen-fixtures.go#L41
@blacktop commented on GitHub (Jul 18, 2024):
I tried running this:
and this happened 😳
@bioball commented on GitHub (Jul 18, 2024):
Hm, that makes sense I guess. We store information in our binary format that isn't present in source code. You'll probably see a lot of gains by compressing it with gzip or something similar, because there's a lot of repetition in there.
expris the expression to evaluate within the module. If empty, it defaults to the whole module itself (equivalent to"module").@blacktop commented on GitHub (Jul 19, 2024):
thank you