-
mort
... we have a successful gram build, which launches and everything, with no protobuf in it
-
mort
Preliminary stats: * Debug build time: 4m 41s, down from 5m 38s (1 minute saving from 1 dependency!!!) * Debug binary size: pretty much unchanged, 279M * Crates built: 1293, down from 1312 I'll test out release builds etc tomorrow or something but the code is at https://codeberg.org/GramEditor/gram/pulls/608 if anyone wants to play
-
ashleytg
YAYY
-
ashleytg
what is protobuf? :3
-
mort
Protobuf is a serialization format, think json except more efficient. Gram uses it for remote editing. It's also a huge unwieldy over engineered Google library which means it takes a whole minute to compile
-
mort
Postcard is a different serialization format, it has advantages and disadvantages which mostly don't matter to Gram's use case but the one big advantage is that it's not Google slop and therefore doesn't add a minute to the compile times
-
mort
Release build time: 5m 09s with postcard, 6m 18s with protobuf. So still >1 minute. Binary size seems down about 0.6MB, so still not significant
-
krig
Awesome! I’ll try to find time to test it today. But sounds very promising!
-
krig
and a minute of build time is a huge win for sure
-
mort
Feel free to test, but know that I haven't even tried starting a remote session with it yet. I just got it to compile last night and haven't had time to work on it today. It might be completely broken
-
mort
I also wanna add a magic header or something to make sure old gram versions cleanly error out if they try to connect to a version which uses Postcard, and consider whether to add a protocol version or something since Postcard is more dependent on the schema matching exactly. Ideally we'd add a hash of the schema definition to the hello message or something
-
krig
Right, yeah.. that makes sense
-
CubeOfShame
Hello. I was wondering how you feel in general about pulling in individual features from Zed. I want to e.g. have this feature: https://github.com/zed-industries/zed/pull/56396/changes in Gram. I would be happy to try and implement it myself as a way to learn rust and gram development as it seems small enough to port manually. But before I do that, i wanted to see how you feel about porting individual features in general. Thanks
-
mort
I'm not the authority but my read is: if the feature is useful and worth whatever added complexity it brings, it's welcome (at least conceptually) whether or not it comes from Zed. Backports from Zed aren't banned either, tho this is a bit contentious due to their heavy use of AI and might change in the future. In any case the diff can't be horrible slop even if it's a backport
👍 1 -
mort
As for that feature specifically, it looks useful enough; I don't like VSCode's full-blown icons but the single character icons look tasteful enough. I recognise the problem it solves, I've wanted to auto complete a struct member before and accidentally expanded a snippet. Wouldn't surprise me if it gets merged if you send an MR but I can't say
-
CubeOfShame
Thanks. My personal motivation is mainly UI polish things, which absolutely requires a human touch. I also generally share the anti ai sentiment (otherwise i wouldn't be here in the first place)
-
ashleytg
Yesterday at 10:14 PM: > Release build time: 5m 09s with postcard, 6m 18s with protobuf. So still >1 minute. Binary size seems down about 0.6MB, so still not significant i think that's pretty significant!
-
ashleytg
every megabyte counts :3
-
krig
@CubeOfShame Yeah I am happy to consider any patch originating from upstream, but I'm a bit more careful about pulling in features than bug fixes. I also want to try to make sure that we don't lose attribution so make sure to keep track of the authors of the code that you want to submit.
-
mort
Okay I've spent a bunch of time trying to make something which hashes the protocol types at compile time so that we can send a schema hash as a hello message, but I think I've concluded that this would be almost impossible with current Rust (specifically its lack of const functions in traits and inability to construct dynamic strings in const functions). So I'm probably gonna drop that and we'll just keep relying on version numbers like we've always done
-
mort
We could have a thing which computes a hash at runtime, probably wouldn't be an actual performance issue, but'll have code size, compile time, runtime and code complexity costs which don't *really* feel worth it
-
mort
Still, learned a lot about proc macros and derive macros and syn, so it was worth it
-
krig
I think a version number is fine. Just have to be careful and try not to break compatibility as much as possible. Had time to run a test build with your branch just now and it definitely is a huge improvement in build time, very promising
-
mort
I've just started a series of builds on a few machines to get some better numbers, will post the results to the MR and then actually try it out
-
krig
Nice! Well, I just tried running your branch and connecting to a remote server and it seems to work.
-
mort
Awesome! One of the things I like about Rust is that when the code compiles, it's probably gonna Just Work, if this was C++ I'm sure I'd have left a null pointer/option dereference in there after this kind of refactor
-
krig
Oh yeah it's really nice, for sure.