uh hi everyone first of all thank you so
much for coming
this is a project I've been thinking
about and working on for a couple years
and this is the first time I'm
presenting it at a conference and I'm
excited and nervous and I really
appreciate your interest um if you're
watching this at home thank you so much
for watching this video I watched tons
of these NDC videos myself
um
so before I start
there is if this wouldn't work oh I got
it there we go you've seen this
uh disclaimer on Twitter and whatever
else like I need to kind of double down
on it before I start because yes I work
for GitHub and yes I'm talking about
Source control but this is a side
project this is a personal project I'm
not announcing anything on behalf of
GitHub today at all don't get me in
trouble
and uh
my friend here is watching you so don't
don't get it wrong
uh here's what we're going to talk about
you know a lot of these uh kind of tech
presentations they're either product
presentations where it's about here's
what the product does and then there's
philosophy
presentations and there's code
presentation that gives you a little bit
of all three and talk about why it's
important to be working on Source
control right now
I'm going to talk about of course Grace
and what I've done with it and talk
about the architecture of it do a little
demo and then I'm going to talk there's
a product for it then I'm going to talk
philosophy about why I chose F sharp and
why I love it it's my favorite language
and then we're going to look at some
code at the end and and hopefully it all
makes sense
so why on Earth am I doing a source
control system I mean
git has won right
like what's wrong with me uh like with
all due respect to get to honorable
competitors like git has wiped the floor
with everyone and you know we all use it
by default it handles almost every
Source control scenario like large files
are a problem as you probably know
um I think get one because it's
branching mechanics or really brilliant
compared to the the old the older other
source control systems in the past the
lightweight branches are great I love
the ephemeral working directory and git
of course GitHub is a big part of why
get one and you know Linus Torvalds I've
heard he's famous so that clearly had
part of it and and
you know in in terms of doing a new
source control system I I have to
uh I have to talk about some of the
things I don't like about git
um so I have to say some mean things
about git
on the next slide but before I do
um I just want to really clearly say how
much I respect get and how much I
respect its maintainers I'm privileged
to be at GitHub and to know some of the
some of the core maintainers of git and
they are brilliant Engineers like I you
know one day I hope to grow up and be
half as good as they are they do world
changing engineering they're super
professional there I mean they're just
amazing their blog posts if you ever
want to read the stuff from Taylor Blau
and Derek Stoli on the GitHub blog
they're like mandatory reading they're
great I I really deeply respect git
um
however
git has terrible ux just absolutely
terrible terrible no good horrible yeah
it's designed by a kernel developer
like I don't want my ux designed by a
kernel developer ever
I mean like my my second programming
language when I was 11 was 6502 assembly
like I've done three kinds of assembler
like I get it I love being down to the
metal it's super interesting but
I don't want them designing my ux and
really get was designed for 2005's
Computing conditions which was you know
much lower bandwidth on networks smaller
computers smaller disks smaller networks
and like
we don't have those constraints anymore
we all have if you're here at NDC if
you're watching this video odds are you
have abundant bandwidth abundant disk
space you have connection to the cloud a
lot of us can't even do our jobs without
an internet connection anymore
so you know things have moved on I also
I mean there's tons of research on how
confusing git is but what I Really Wanna
I kind of pound the table on is that we
need to stop blaming users for not
understanding it git is really hard to
understand
there's this really interesting quote
from this research paper from Google
from I don't know 10 years ago or
something
even one of the more experienced git
users requested that someone else
perform an operation because quote it
scares the out of me so like that's
it it's not just me saying this by the
way Mark racinovich is a pretty smart
guy
git is the bane of my development
process
so so being smart is not the ticket out
of understanding it right
um an incantation known only to the git
Wizards who share their spells
um you know who else knows git is hard
GitHub
this is what you see when you go to
download GitHub desktop focus on what
matters instead of fighting with get
so we know
um here's some interesting questions
from quora this is like from a year ago
I was doing this research and some of
these questions are kind of funny like
why is it so hard to learn
what makes you hate git
is get poorly designed
uh
uh kid is awful that's plain enough but
you know things are funny and there's
pain in these questions
two which I really feel but this one
this one broke my heart
if I think it is too hard to learn
does it mean that I don't have the
potential to be a developer
and and I just like imagine some young
person who's just getting started
messing around with some JavaScript or
python or something and they're and
they're thinking wow like I think I
could do this like this seems fun and
then someone hands them git
and and they go what what am I what is
this you know and and like like
we deserve better
like we need to do better and
um and instead of complaining about it
I've decided to devote pretty much all
my free time for the last couple years
to doing something I also just want to
point out that we're in an industry
where everything changes like nothing
lasts forever and git right now is so
dominant that it's hard to imagine
something new coming along and replacing
it but if we don't imagine it we can't
get there
um I just want to say that we're driven
by Trends just as much as we are by good
technology and
um
I've had a little bit of an education on
Trend analysis I'm I'm very lucky my um
my my partner was a fashion designer was
a clothing designer and
um and her job for 15 years was to think
about what women would want to wear a
year and a half two years from now have
really to think about what women would
want to feel like a year and a half two
years from now and then design clothes
for it and she was very successful she's
very good at it and just in like the
conversations over all the years we've
been together I've
I've picked up a few things I picked up
that perspective she sold way better
Earth than I'll ever be
um and you know some of our Trends have
shorter Cycles like web UI Frameworks
right they come and go every six months
or whatever I mean it's stabilized now
but
um and some are longer like you know for
20 years I think when you said the word
database what you meant was relational
database
and now there's key value there's
document there's you know I mean really
with Hadoop we got mapreduce so like
things things do change
um most importantly no product that's
ever gotten to 90 has just like gotten
there and stayed there forever
um
it is currently according to the stack
Overflow developer survey there should
be a new developer survey coming out in
about a month or so
um gets it 93.9 percent and something
with ux that bad is not going to be the
thing that breaks the trend like git is
going to go
so
there will be Source control after git
like there will be
um and what I want to say about it is
that it won't be like git plus plus I've
had this discussion a lot over the last
couple years well can't you put another
layer on top of git can't you maybe use
git as a back end and put a new front
end on it like that's been tried a
number of times over the last many years
and none of them have gotten any market
share so I feel like people once you go
through the um
challenge of learning Git You Don't Want
To re-challenge Yourself by learning
something else just to use the thing you
already know and I want to say adding
features to git won't prevent git from
being replaced it's not about well if
git make some changes it'll extend its
lifespan it just it won't it's too late
for that
um I do think that whatever replaces get
will have to be Cloud native because
oh look it's 2023.
um
and I think the thing that that will
attract users to use the new thing is
that it has to have features that git
doesn't have or git can't have and I've
tried to build some
um okay
let's talk about Grace
um
Source control is easy and helpful
imagine that
that's really what I've tried to do my
north star from the first
evening that I was sitting on my porch
dreaming during pandemic during lockdown
just sitting on my front porch thinking
about it I thought how can I make
something super easy
something that actually my inspiration
believe it or not was the OneDrive sync
client and if you like the OneDrive
syncline used to be problematic a few
years ago it's like really starting
about three four years ago it's been
great it's like Rock Solid it just works
I really like it and you substitute
Dropbox iCloud whatever you want but
like those things just work they're easy
they sync I was thinking about like how
do I get stuff off my machine onto into
the cloud so anyway Grace has features
that make being a developer easier
not just Source control but try things
that try to make your life easier every
day and it feels lightweight and
automatic that's what I'm mostly going
for
it hopefully reduces merge conflicts
which in Grace you'll see here called
promotion conflicts
and yes of course it's Cloud native
thanks to dapper
so let's just talk about the basic usage
real quick I'm going to show you lots of
pictures and demos I'll show you a short
demo so the first thing is Grace watch
and Grace watch you can think of that as
like the thing that runs in the system
tray and windows in the lower right hand
corner on a Mac it runs with that with
that little icon near the clock so just
a background process that watches your
working directory for any changes and
every time you save a file it uploads
that file to the cloud to the repo and
marks it as a save so that you get a
full new version of the repo like in a
new root directory version with a new
computed shawl every single time you see
the file and it's just automatic it just
works in the background I'll show you
some detailed examples of that aside
from that background process the sort of
main commands you're going to see here
Grace save save is that thing that Grace
watch is going to run to upload after
every save on disk
checkpoint and commit so in git commit
is an overloaded concept right commit
means I'm partially done like git commit
minus M I'm done with part one of the pr
I'm done with part two and then you do a
final git commit I'm ready for the pr
and then we have this debate about do we
squash right there's no squashing in
grease you don't need to checkpoint is
the is that intermediate step and that's
just for you
it's for you to mark your own time uh it
doesn't matter you know it doesn't
affect anyone else but you can mark this
version as this this version is that and
because of that we can do some cool
things I'll talk about later
um there is a Grace commit of course
commit is a candidate for merge or what
I call Promotion and eventually when
you're ready to promote you do a Grace
promote I'm going to show you how the
branching Works in a little bit
there's also of course a Grace tag which
is the label if you want to label a
particular version like this is version
three of our production code so those
five things save checkpoint commit
promote and tag or what I call a
reference and a reference in Greece is
something that just points to you a
specific root version of the repo and
those root versions just come and come
and go of course there's other commands
you need a status Grace switch to switch
branches Grace refs to list the
references that you've been working on
all your saves and checkpoints and
commits you can list just your
checkpoints and gesture commands and
whatever there's of course a diff
there's a rebase there's going to be a
gray share command gray share is kind of
interesting because it'll I haven't
written it yet some of this stuff I'm
talking about I haven't written yet this
is an early Alpha just to be clear I
should have said that it's an early
Alpha
it it kind of works um
um but gray shares this idea where like
I'm working on my code I have a problem
and I might want to you know get in chat
with a team member and go hey could you
look at this code for me and you said
gray share and it'll spit out a command
line that you can just copy and paste
and give to that person and because with
Grace everything's automatically
uploaded and the status of your repo is
always saved you don't ever need to
stash
and you can just literally take that
command paste it hit enter and now your
version of the repo is exactly the one
that your teammate was working on and
when you're ready you just do great
switch back to your own branch
so that's the kind of workflow I'm
trying to enable
um
a quick like General overview so locally
with Grace Grace watch I said you know
is this background is file system
launcher that watches your directory
switching branches is really fast and
lightweight I love that about git I kept
it
um of course like I have a doc Grace
Grace directory like a DOT get directory
and I have objects in it and config and
stuff so that's the local side your
working directory is still totally
ephemeral
um gray server is actually just a web
API there's nothing fancy there's no
special tightly packed binary protocols
it's just a web API you can code against
it too I use Dapper if you're familiar
with Dapper to enable it to run on any
cloud or any infrastructure
um and because if you're everyone's
running Grace watch and you don't have
to run gracewatch but you really want to
um the server kind of has a real-time
view of what everyone's up to and that
enables some really interesting features
to be built
um
there is because everything that happens
in Grace is an event
that gets saved
um
it immediately gives you an Eventing
model that you can automate from and I
just want to say the system is written
almost entirely in F sharp and I'll talk
about that of course
now some of you might be thinking wait
just a damn minute
you're uploading every save that seems
like a lot and the answer is yeah but we
don't keep them for very long unless you
specifically checkpoint or commit or
promote your saves after
like by default I'm starting with seven
days I don't know if that's the right
number maybe it's three maybe it's 30
whatever it is we'll figure it out and
it's going to be settable in the repo
but I didn't like to say seven days we
just delete the saves
so they're there for you to look back on
when you want to and then they just go
away commits and promotions are kept
forever and that sort of like gets me to
thinking what features can we build well
one thing I wanted to build was if
you've used like mac backup the time
machine and that that interface that was
sort of an inspiration I had in my head
I'm not going to quite do design it like
that but this idea where you can just go
back and look at the the diffs of the
changes that you've made and hopefully
do some cool stuff like reload stayed in
your mind faster you know that is that
they're often quoted number of it takes
18 minutes to reload state in your head
after an interruption well like what if
we could use Source control to get that
down to two minutes where you could just
quickly just Leaf through the one leaf
through them and go oh I see I see I see
what I was doing
um
you can also do cool stuff like if the
server can see what everyone's doing and
it sees that Alice is working in a
particular file and Bob is working in
the same file right now well that's a
possible conflict
so we can notify both of them in real
time and go hey your teammate is working
in the same file maybe you want to
here's here's a link to look at the
version that your teammates changing
maybe it's in a totally different part
of the file you don't care about maybe
it's in the same part and now you get on
chat and talk about it before before you
get to a conflict when you think you're
done with your work like I hate merge
conflicts I hate them so much right I'm
sure I'm alone in that
um another thing we can do is when there
is a promotion domain
I can Auto rebase everyone in the repo
immediately on that new version
so and you'll see that that's super
important in the way Grace's branching
is designed but it happens within
seconds
um so what is the branching model I call
it single step branching and the idea is
that like git I mean there's these
versions of the repo and they have a
particular Shaw value and and all of the
you know commits and labels and get just
point to a particular version well
that's what I do with Grace a promotion
is just a new reference a database
record in other words it's a new
database record that points to the same
root directory that your commit pointed
to so I do Grace commit minus M I'm
ready to promote then I do Grace promote
to Main
and all all that I do when when you do
Grace promote all it does is it creates
a database record that's all it does
because the files are already uploaded
you already did it come in
a child Branch cannot promote to the
parent branch unless it's based on the
latest promotion
so that prevents a lot of conflict
so let me just show you a little bit
about what that looks like
here is a diagram that I have oops no
not that
this
here's my repo by the way I want Stars I
want lots of stars
I want all the stars if you're watching
this home I want all the stars
star of the repo
it's the only way I can let people know
so here's a here's a little document I
have on my branching strategy
um I'm going to show you four quick
pictures just to walk you through really
quick here's Alice and Bob when they're
not busy if you're into physics you know
you see Alice and Bob a lot when they're
not busy holding two entangled particles
that improbably large distances they're
working on a repo together
and here's uh here's like they're
starting it's in good shape Maine is
this particular Shaw value right it's
this EDF 3F whatever and ed3f and Alice
and Bob are both based on that version
everything's cool now their Shaw values
are different because they're they're
updating different files Alice is
updating her files Bob is updating his
files but they're both doing their thing
okay now Alice makes one more change
runs some tests and goes cool I'm ready
to promote so she types Grace commit
minus M I'm done with my PR and then she
types Grace promote minus M I'm
promoting and that now of course her
files are already uploaded because she
did the commit that creates a new
database record on the main branch that
points to that particular version of the
repo
um
so now after she does that let's assume
that it's successful
we now are in this state where Alice is
based on the version that she just
promoted because in fact in fact she's
identical to the version she just
promoted because she just promoted it
but Bob is still based on the previous
version of Maine
so that means that for the moment Bob
can't promote
poor Bob
however
heroically craze watch comes to the
rescue
um that's so hacky I'm sorry
um
but Grace watch gets a notification that
a promotion has happened and immediately
Auto rebases Bob within seconds
so if as long as there are no conflicts
if you know the files that are changed
that have changed aren't the ones that
he's changed within seconds those new
versions get downloaded Bob Bob's branch
is marked as now being rebased on the
latest version in Maine and a new save
is created because now on Bob's Branch
he has the files that he was changing
plus whatever ones just came down from
the promotion so now after that's done
Bob has a new shot value
which indicates the file T's change plus
the ones that were in the promotion
Alice at this point of course has the
same exact Shaw value as mean because
literally she just committed and
promoted so that's branching and Grace
it's really simple
it's as simple as I could possibly make
it mostly because like
I'm not that bright I mean why make it
hard on myself right
um uh but really it's simple to
understand
so that is a little bit about branching
let's go back to the deck
so let's talk about I'm going to show
you some some pictures of how how this
works and from the server's point of
view so in the server let's just say
that I I'm working on my branch and I
these dots are directories in a
structure right in a repo and let's say
I save a file on this uh
thing over here yeah so let's say I save
a file in this
bottom one
um Grace watch sees it it uploads that
version of the file to object storage
and it creates two new it has to compute
new Shaw values for those two
directories
so I create what I call directory
version
I upload those to the server the server
double checks them and now we have a
save reference that's pointing to this
brand new version of the repo that
doesn't exist in anyone else's branch
cool at the same time my teammate Mia is
working and she saves a file in that
directory that bottom directory and that
file gets uploaded those three now
versions three directory versions are
computed all the way up to the root they
got uploaded to the server and double
checked now she runs some tests and goes
cool I like this version I'm going to
checkpoint it so at this time she does
checkpoint all it does is it creates a
database record because there's nothing
to upload it's already uploaded so that
takes about a second I've really tried
to make a lot of the gestures despite
the fact that there is always a network
hop involved in Grace I've tried to make
them as fast as I possibly could and
I've aimed for that sort of one second
timing there are things that get because
when git does local stuff there's things
that get is just going to be super fast
at that I kind of can't compete at if
there's a network hop but there's things
that I can be faster than get that
involve the network so anyway so here's
me again I save a file down there this
time it's four directory versions to get
recomputed did and get uploaded cool now
uh teammate Lorenzo saves the file in
that directory
file gets uploaded there's three
directory versions and he likes it he's
going to commit it and is thinking about
promoting it
meanwhile Mia is working she saves that
file in this bottom orange directory she
likes it she commits it she runs tests
everything's cool and she actually does
it for Grace promotes if she does Grace
commit now she does Grace promote now
there's a reference pointing to that
same exact root jaw now we have three
references pointing at the same exact
directory version
one of them is on Main two of them are
on Mia's branch and in fact we like it
so much we're gonna put a label on it
and say this is our new production
version 4.2
cool so what do we have from that we
have five different versions of the repo
and 10 references pointing at those five
versions
cool okay seven days later right I said
we keep saves for seven days or so and
then we get rid of them well let's see
how that works
so here's my save that I did these are
the same five five things that we just
saw
well let's say it gets deleted
okay well now the root directory says do
I don't have anything pointing at me
anymore it checks and it starts a
recursive process to go down and check
if there's anything that was unique to
that version that doesn't appear
anywhere else
and deletes it so that version is now
gone now remember Mia did a save and a
checkpoint well we delete the save
reference but the checkpoint's still
there so this version of the repo stays
cool here's me again I did that save I
didn't do anything else with it
save gets deleted that version goes away
uh here's Lorenzo again save goes away
but the commit's still there so this
version of the repo is still there
now we have this one
again the save gets deleted but we still
have three references pointing at that
version of the directory but like let's
imagine that that the branch gets
deleted Mia's Branch gets deleted no
problem we still have references
pointing to that from the main branch
so
now after seven days
we now have three versions the repo and
five references pointing at it and and
really like the thing is saves are
really going to be like 25 to one right
I don't know I'm making up a number it
depends on your workflow but you're
gonna have like 25 to 1 saves or 50 to 1
saves and they'll come and they'll go
and it's not a big deal
so
congratulations you now understand Grace
like really that's as simple as it is
um obviously there's a tiny bit more but
like fundamentally
like in 10 minutes I just explained
grace to you and if you recall your
experience learning get
I'm gonna guess it took more than 10
minutes you know it's one of the
questions I like to ask people is like
would you rather teach somebody
get or would you rather teach them what
a monad is
and you got to think about that
I'd rather teach them what a monad is to
be honest
um
okay
demo gods
I'm going to do a very a very short
light demo
just to show you what a little bit of
what it feels like
so
um I'm just going to show you in for one
user um here is uh
here is my friend Alexi
I just pick uh I'm a New York Rangers
Fan I pick players from the Rangers to
for names so here is um here's Alexi
with the file now on the bottom here I'm
running gracewatch in fact I'm just
gonna oops
and here's Grace watch now right now
Grace watch is a command line thing with
a lot of debugs for you early Alpha
but here it is running
and
here is right now I'm going to run um
gray status
and here's the status of Alexi's
um
of Alexis uh oh it's funny now that the
font got got changed I'm going to switch
to
doing this give me just a moment
oops okay
so we can see the full screen
um
so here's the status of the Lexi's
Branch right now so
um obviously I was doing a little bit of
testing earlier today there was a save a
checkpoint see I checkpointed the same
save so they have the same Shaw value it
is based on this particular promotion
that Alexi in fact did and here was the
message from that in Maine here's the
main right the parent branch that I'm
based on so you can see the status of
your branch and the status of the branch
that you're based on
um
back to Grace watch here now here's
Grace watch I'm just going to upload I'm
going to update uh
I don't know I'm going to update this
file and I'm going to add a comment
somewhere
uh
cool new version of the file
I'm going to hit save
there you go files uploaded new
directory version computed
server has all the information This
Server by the way
um
I'm calling it a server now that was a
that was strangely slow I guess because
I haven't done it let's do another one
just to see in fact let's update this
comment thank you GitHub thank you
Copilot
I'm going to hit save again
and there you go files uploaded new
directory that's how fast it should be
this server I'm talking to by the way is
my desktop computer in Seattle
so um so it's 4 500 miles from here to 7
300 kilometers and you know it's pretty
quick it's not bad so so that feeling of
how quick it is in the background like
that's what I'm trying to do with Grace
it's like automatic so so like I'm
showing you what Grace watch is doing
but the truth is
you're just in here doing stuff and
you're just hitting save and Magic
stuff's happening in the background so
that version that we just did let's say
I like it and I want to
um I like it and I want to checkpoint it
so by the way let's do great status
again you'll notice that previously the
save was the ca21 version now I hit gray
status I've done a couple of saves and
now I have this new cd79 version in fact
if I do Grace refs
I can see
all the references on my branch
and again like 1.7 seconds everything's
debug mode and we're a few miles from
the server but like
it's fast that I'm aiming for everything
to be fast enough to keep you in flow so
um so there's all the things that's cool
you can see everything you've been doing
I'm going to do a Grace commit I like
this version I did some tests
um
NDC
[Music]
uh
oh slow yay
right cool
there's my commit now the commit again
everything's uploaded so the
commissioner screening database record
so it's pretty quick I like it I'm going
to do a promote
and this time I'm going to do for motion
4 from Alexi
again all I'm doing is creating a
database record really I'm creating a
database record and then I'm rebasing My
Own Branch because
well I am and now if I do gray status
what we'll see is
I'm my the save I did was that cd79 the
commit I did was that same version the
checkpoint was something I did four
hours ago whatever
I'm the main is now that same version
I'm based on it
and like this flow is what I'm aiming
for it's just this quick like most of it
happens in the background most of it's
automatic when you take an action I'm
aiming for that one to two second
window for all the commands
um that's the quick demo that's really
what it feels like and like I said you
already understand it I hope right cool
um
well I'm sorry I thank you I wasn't I
wasn't really begging for Applause but
thank you so much I really do appreciate
after two years thank you so much
um
I'll totally take it
[Laughter]
oh my all right
let's keep going
but wait there's so much more I wish I
had time to tell you about I'm going to
go through some of this really quick I'm
using signalr for two-way communication
with Grace watch so I have that live
two-way communication from the server to
everyone I mean right now you know I'm
showing you that example of Allison Bob
what if it's Alice and 20 other
contributors in the repo and those
contributors and what if it's 100 repo
people and what if they're all over the
world
well now I can do cool stuff like all
over the world I can Auto rebase people
in fact you can sort of like like I
don't even know all the features that I
want to build on this Eventing model
that I have I can't I'm not the one
who's going to think of them all but I
know that I have the architecture to do
it and I know that we can do some really
cool things in real time especially now
I mean I know that there's like people
who are going back to the office and
whatever they're still a we're still
going to be partially to mostly remote
and I feel like there's a there are some
interesting ways we can connect with our
teammates at the source control level
that have never been done before and
again can't be done in a distributed
Version Control System
like like I don't know what's happening
in your distribution I don't know what's
happening in your version to get until
you do a push but here I always know
what you're doing
um
uh with Grace in an open source capacity
there's no you don't have to Fork
anything I don't need to Fork the entire
repo you just create a personal Branch
you own the branch it could be like
imagine you know asp.net core
and all you do is walk off to it and
create a branch you own the branch they
don't have any control over it you do
whatever you want um you could keep that
you could keep your branch private or
public up to you visible or not you can
do work in it and do a PR off of it
um which is not a pull request in Grace
it's a promotion request
um
there there is no poll gesture in Grace
there's no push gesture and Grace
um
um
uh there I have tested Grace so far on
repositories as large as a hundred
thousand files and fifteen thousand
directories as long as you're running
Grace watch you still get that one to
two second
timing like it just works if you're not
running gracewatch then there's a lot of
other checks that I have to do when you
do a checkpoint or a commit or whatever
I have to if you if you're not running
gracewatch then I have to check that all
the things are uploaded and if I'm
walking through fifteen thousand
directories to do it it'll take a few
seconds with Grace watches I know that
it's up to date I've also tested it on
10 gigabyte files
um because like I'm back because Grace
is backed by object storage like in my
testing case I'm I'm an Azure and.net
guy so I've been running it on Azure
object on Azure storage
it just works 10 I mean I don't think a
10 gig file should be in Source control
to be clear but I've tested it it
totally works
um uh I want to build I have not built
apples down to the file level but or I
have an idea for how to how I'm going to
do it I want to do it I think it's super
important git can't do that customize
Branch permission so that's when we're
like let's say on Main I want to enable
promotions and tags but I want to
disable
saves and checkpoints and commits on me
and you should never do a checkpoint or
commit on Main okay cool that's already
there
um like on your branch maybe you want to
never enable it promote because why
would you promote on your own Branch
um you can delete version so obviously
like I'm deleting saves so we have the
Mechanics for deleting versions
unfortunately we do occasionally all
check in a secret and like I can speak
for GitHub GitHub has worked extensively
to create secret scanning so that when
you do a push we see that oh you're
checking in a connection string or
whatever still people are going to do
that and deleting that out of git is a
nightmare
um
uh in Greece I'll have a gesture I don't
have it yet but I'll have a gesture that
keeps the audit trail that will say okay
you promoted something with a secret we
want to get we have to get rid of that
version but here's the thing that says
this version was this Shaw value it was
deleted by this person at this time for
exactly this reason so there's permanent
auditability I've really had to think
about
Enterprise features of course like
Enterprises are going to be a big user
of any Version Control System I'm aiming
for that for sure
file locking is another one so if per
force one of the main reasons users
still use perforce is
scheming like gaming is a big where
there's big binary files I had a
conversation with somebody who does
Source control at Xbox
and he gave the example of let's say
that somebody's working on Forza and
what they're doing right now is they're
editing a track file like the graphical
definition of a track and their job
their task is to add 10 trees at around
turn three on some track well
like they have to lock that file because
there's no way to merge a binary file if
someone else edits that file they've
just thrown away hours of work so we
have to have optional file locking I
don't want like by default it won't be
on but I but I want to provide it in
Grace as I said they're just oops as I
said there's a simple web API
um and of course yes it's super fast
and like yes it's it's consistently fast
my my goal for performance I'm a big
believer in
um in perceived performance and
perceived performance for me consisted
of two things number one is it fast and
number two is it consistent so like your
muscle memory becomes if I type Grace
checkpoint and hit enter
I know that that command I know that my
command line is going to come back in a
second a second and a half every single
time that's what I'm trying that's
perceived performance to me that's what
I'm going for
um I very much want to build all the
interfaces of course I'm building a CLI
um I want to build a I will build a
Blazer web API but I'm going to go on
record and say
I hate electron
I hate electrons so much
I hate webview
we all have these first class pieces of
hardware
and we're running these second-rate apps
on them I just it drives me nuts I
believe in Native apps I'm going to try
doing with avalonia I haven't started
that yet I hope avalonia will work well
it's I expect it to if not I'll do Donna
Maui but I will have native apps to
include code browsing to include some of
these gestures to include that time
machine like history view if we have
time at the end I'll show you a little
sketch of that I did
what are we doing 20 minutes oh my God I
have to hurry up
of course I'm borrowing stuff from git
again like I respect get enormously
um
I'm trying I'm really trying
let's talk the architecture really quick
in case it's not obvious Grace is the
centralized Version Control System
um decentralized Version Control to me
is why we have a hard time understanding
it doing being centralized simplifies
everything there's been lots of attempts
at making a simple git or a simple
distributed one by the way there's a
couple of great other projects going on
right now like if you're interested in
Source control you should really check
out
um p huel p i j u l is a really
interesting distributed version control
system based on category theoretic
mathematical it's patch based it's in
fact actually a couple days ago the
stack Overflow podcast did an interview
with the creator of it it's a really
nice project another one that I really
like is JJ
um and that is comes from Google Martin
Von Z slash JJ on GitHub
um that's a uh I actually know that team
I speak to them a little bit they're
great people they're trying to do
something really interesting and move
Google's internal source control forward
um really like it more friendly
competition I'm I'm in this to win
um
but I just want to point out like if
you'd like distributed
um you're not doing distributed today
anyway like you're you're using GitHub
or gitlab or atlassian or whoever you're
doing Hub and spoke you're doing
centralized Version Control like you
never push from your machine to
production
you always push to the center and then
the center runs some CI CD stuff and
that's how it gets to promote to
production like you're doing centralized
Version Control you're just using a
distributed Version Control System to do
a dance around it
why
and git'll be around for 15 or 20 years
if you still want to use it as I
mentioned you know Grace is all about
events event sourced fundamentally
um
I really like cqrs event sourcing goes
really well with functional code in a
reactive perspective on code
and I do a lot of projections off those
I'll show you a little thing about that
in a second I use the actor pattern
actors are based on or built into Dapper
I really like the actor pattern it makes
it super easy to reason about everything
that's happening actors that each
individual actor is single threaded but
you can have thousands of them running
and they scale up
to Infinity
I like I use them for event processing I
use them for an in-member networked in
memory cache they're really great and
you can have multiple State
representations for them that last for
however long you want
um now Grace is cloud native thanks to
Dapper I'm going to show you a picture
of dapper Dapper we're currently uh
supports 110 different platforms as
service products and growing all the
time the community's growing usage
adapter is growing I'm really happy
about the bet I made on Dapper like in
down in like 0.9 or something I started
using dapper at Azure AWS gcp
on-premises open source and containers
whatever you want to use under it and
here's a little picture of it it does
service mesh it does State Management
Pub sub it has the actors it has
monitoring and observability pieces you
can talk to it from any language there's
sdks of course I'm using.net it
communicates with any infrastructure
here's a little example if you were
going to distribute Grace
using Open Source Products well here's
my grace containers gray server with the
Dapper sidecar and they're running in
some kubernetes cluster wherever and
let's say for object storage I'm using
Min i o
something compatible with an i o I'm
using Cassandra as a document database I
might be using Radisson Kafka for Pub
sub I'd be using open Telemetry with
Zipkin for for monitoring and hashicor
fault for secrets cool that's great
that's my open source one now if I'm
deploying Grace to azure
same exact race container same code same
everything but now the at runtime I
configure copper differently I put
Cosmos DB under it I put service bus and
event hubs for Pub sub I put Azure
Monitor and Azure key Vault and again
like fill out your picture because I'm
an Azure guy I did this fill out your
AWS picture your gcp picture whatever
you want but that's a Dapper it works
very well I'm happy with it
um
projections
imagine that I have all these update
streaming in saves checkpoints commits
whatever and they hit the server as soon
as they hit the server what I do is I'm
going to trade some CPU and some disk
space for your performance and your ux
so I'm going to do stuff like if when
you do commit I might do a test
promotion see can I promote if I find a
problem with the promotion I might let
you know in fact what I can do today
thanks to large language models is they
might detect a promotion conflict and
actually send that code off to a
language model to give me a suggestion
to give back to you right away so I
don't just tell you that there's a
problem I tell you and give you a
suggestion
as to how you might think about change
dealing with it I might do temp branches
I might generate diffs right away so
that when you ask for the diff they just
show up you know under a second uh cic
that generates if I can do whatever I
can do all these projections off the
data I have and just keep the events
well again seven days later
until the end of time
right I'm keeping check I'm keeping
commits and promotions checkpoints by
the way like you don't need to keep
checkpoints forever maybe you keep them
for six months keep them for a year I
don't think you need to go look back on
your checkpoints from three years ago
whatever okay
that's Grace that's the architecture of
Grace
um I want to talk a little philosophy
and
Talk programming language I'm going to
talk about why F sharp is not that
radical but like
program language set on the Spectrum
from from imperative to declarative
right
um there's like the hardware there's
like tell the hardware exactly what to
do step by step and you know it's like I
like Assembly Language it's really
interesting
um but then there's the mathematical
category theoretic and more declarative
and here's like just a smattering of
languages and roughly where they fit on
this line you might agree or disagree
with where one of whatever just close
your eyes at it but there's this idea
that um
programming languages can be translated
in either direction
in fact we do that it's called compiling
when you move from the right side of
this to the toward the left side that's
called compiling
um when you move the other way it's
called decompiling but all I can say is
like from age 11 to age 45 I spend my
entire life on the left side of this
um and I finally got curious about the
mathematical side
so why F sharp well you know C sharp
compiles to Il
so does F sharp it's the same dot net
run time it's the same everything that
you love about c-sharp it just happens
to be there and then it gets compiled to
assembly and it runs just as fast so so
I'm not like an ivory Tower PhD I'm not
I'm really not that's not the statement
I'm trying to make using F sharp I'm
trying to say that it makes my code
better and and all I'm doing is I'm like
here and I'm just
doing that
really and like being over here just
gives me access to some cool stuff I
still have all the stuff over here I'm
not going over to Haskell you know
um which is cool if you do but that's
not what that's not what I'm doing
um so why F sharp
um you know Don Simon describes it as
succinct robust in performance 10 times
the creator of F sharp and Don it is
very fast on that's like unbelievably
fast that's why
um it's functional first but objects are
part of the language and especially if
you're integral interfacing with nuget
everything in nuget C sharp it's all
based on classes and methods and and
inheriting stuff and well fsharp has all
that it's got a great Community any F
sharp people here
yay
um
um and I just want like here's my
philosophical statement I think the
industry has just hit a ceiling on
quality and comprehensibility with
object oriented-ish
code and I mean like you know C sharp
Java but Ruby you know typescript like
there's a point like for small code base
it's fine medium code base it's fine
when you get to a large code base with
object oriented if you don't make a
serious investment in keeping that code
clean
you're going to run into major problems
and functional code lasts longer it
really does it stays clean longer
um
I mean assuming you don't do stupid
things
um uh I want to very quickly about this
I'm going to tell you my story but I
wrote three versions of Grace like like
for my learning curve the first version
I wrote as I was like getting
deeper into F sharp and functional
thinking first I wrote a version of
Grace where I ended up accidentally
writing writing C sharp and F sharp
because I hadn't made the mental leap to
functional thinking yet into
composability and so um
um so I did that and then I was like
this is not this doesn't smell good like
this is not what I was hoping to get out
of it so I threw that version Away
um and I and then I was like all right
I'm gonna get into category theorem I'm
gonna relearn my category Theory and I'm
going to moan at all the things
and that didn't work
um that made some really awkward code
um but I kept I learned stuff from it
through that version away and now the
version you're seeing is actually the
third version which is which is stock
which is it's more balanced it's more
practical and I use objects I use
classes but I use them very functionally
I think about them functionally so why F
sharp
this is why and like like my field
report as someone who spent his whole
life on the object oriented you know
assembly side
my field report is thinking functionally
gives you better safer more beautiful
code
like it really really does it is worth
the journey
to learn and it's going to be painful
it's going to take a little bit but but
it's so worth doing and it's made like
I'm very happy with the code are there
challenges with F sharp sure like
serializing deserializing records is
painful
um if you add a field to the to a record
now you can't deserialize anything you
ever saved before
um
so I I'm thinking
I still have this I'm probably going to
switch them all to objects in other
words classes but I'm going to treat
them functionally I'm gonna I'm gonna
I'm not gonna like
I'm not going to object Orient them I'm
just going to use objects and treat them
as immutable there's an interesting one
that I would never have imagined two
years ago kodaks is the open API model
that's underneath GitHub Copilot
um
codex is trained on c-sharp it's not
trained on F sharp turns out that the
suggestions I get out of copilot aren't
that great
on F sharp so I use fuse shot prompting
you know I actually go to chat EPT and
use few shop prompting to to get better
things
um in F sharp let's be honest there's
fewer samples there's fewer there's less
example code so what's the solution
work harder peasant
um but it's not that bad you know taking
once you learn it doesn't take it
doesn't take much
um so
um I want to close with a little bit of
code
and what I'm going to do is I'm just
going to pull up sharp lab really quick
and walk you through a little bit of
I have to
do that and then
I can go to Sharp lab
so um
so if you ever use sharp lab it's a
really cool site it lets you just type
code it compiles it in memory and then
shows you the decompilation on the other
side so I have F sharp code on one side
and C sharp code on the other
um in fact oh whatever I'm just gonna do
this so so here's here's some F sharp
code here's some very basic F-sharp code
now if you've never seen F sharp before
it's going to feel a little weird
because like wait a minute where's the
class you have these let statements what
are what are they just floating in space
like what are they hanging off of it
feels weird and what I want to show you
is like what that compiles to you well
so there's so a module so there's a
namespace there's a module and there's
these lets which are you know
definitions of fields or or functions or
whatever what does that compile to in C
sharp well here's my name space
cool
that module is a static class
static classes are awesome for
composition I'm going to talk about that
in a bit
the end value well that becomes just a
property with a get
again like net is fundamentally object
oriented the runtime knows classes and
properties and methods like that's what
it knows so when F-sharp compiles to Il
it has to compile to that so F-sharp
translates again we translate from the
right side of that diagram to the left
side of that diagram
so it translates it into properties and
this function well it's just a static
function
cool
let's add something to that let's add a
regular class we've seen this is like
class from from C sharp it's got two
properties it's got a great time and a
name
no big deal this is how you say
this is how you say
class public class and F sharp this is
how you declare property and if you look
at them well they compile two here's
your backing Fields here's your property
with a getter and a Setter here's your
property you've seen this in C sharp
it's no big deal
let's add a little more to this let's
add a method in that class and this
method
um
oh what is it what is it compile to well
here it compiles to a void so it's a
public this is a method you might have
on a class in your code base where it
returns a void and it just takes in a
value and changes something in the on
the object very common use for
object-oriented code
lovely but not composable like that's
the problem this is what I kind of want
to highlight
let's add
a couple of functions to this now we're
out of the class we're back in that
module which means that we're in static
we're in static class and I'm going to
add a functional change name
I wish I could move this but I can I'll
just move this over a little I'm going
to add two two classes two functions so
there's a change name and a change time
and you can see what they do they just
sort of assign this you pass in a name
and a time and you take in an instance
of that class
and you return an instance of the class
so that Pro that pattern where I take in
the thing that I want to Output I take
in a type and I'm going to Output that
type and I'm going to do something to
that type that is where you start to get
composable code it's a monad
don't tell anyone
um
so what does that compile to in C sharp
terms well guess what it compiles to a
static function on a static class static
method on a static class
and that's how you get composable code
my number one tip for for anyone is if
you want to use C sharp or Java or
whatever and create more composable
functional code start thinking stop
thinking in terms of methods on classes
and start thinking of creating static
classes with static methods that you use
to manipulate your code
and that will get you so far down the
road of being composable and testable
like these functions are super testable
they're pure functions if you give me
the same class and the same name every
time I will give you the same exact
result over and over and over these are
pure functions so what what now that I
have these pure functions in
in functional code what can I do well I
can compose them
right I have this new function called
updated my class and it updated my class
I take in an instance of class and I've
give it Scott and then to the current
time and look
composition
um
and I know this might look weird if
you've never seen F sharp or some of the
functional languages before but this
style of coding gets you much more
repeatable testable beautiful
easy to understand code and I've really
tried hard not just to make the ux of
Grace beautiful but I've tried as hard
as I can to make the code beautiful I
want maintainers to like it too
I have an entirely succeeded but I've
mostly succeeded I'm mostly happy with
it
um I have a few minutes left I want to
show you a little bit of Grace's code
itself
let's see what I want to show Let's do
let's do a little bit of validation so
this is kind of interesting
um so this is the CLI part so I want to
validate stuff that's on the CLI before
I even send it to the server you can't
rely on that validation the server's got
to check also but I just want to like
not let you send stupid stuff to the
server so here's a bunch of things like
when you have an owner ID and an owner
name and by the way this if you look at
the status here I have an owner an organ
a repository so Grace is multi-tenant
from the start and that's because I'm
from GitHub and I've seen some of the
pain of trying to retrofit
multi-tenancy
so I just built it in from the start of
some light multi-tenancy so here's
here's for here's part of my code from
when I was in step two of moan adding
all the things
I moan added all the things here I have
these functions and these functions
which are validation functions take in
this thing called a partial result which
is the which is the parameters on the
command line and those commit those
parameters broken into a structure that
understands what they are and what does
it return it returns a result type a
result is a successor or failure type
and for when it succeeds it Returns the
same exact two parameters I passed in
which means again just like I just
showed it's composable
um and when it fails it returns this
thing called a Grace error which is
which is a special error type I have now
all of these functions do the same thing
they all take in a parse result into
parameters and they return a result of a
parse result in parameters or an error
so what can I do with that
oh my God I can do bind
monadic bind magic but like I know like
this is new and if you've never seen it
before it looks a little weird but just
isn't it beautiful
just like looking at that code
it's kind of nice it's just like all
these things flow and I gave these
really nice verbose names to my
validations just like you would for a
test case
and like if they fail at any point the
whole thing kicks out the error of the
failed and stops processing that's how
that's monadic bind
it's really nice now four reasons that
are that take a few minutes to explain
and I won't I couldn't quite do it this
way on the server side but I want to
show you the same stuff I did on the
server side that's inspired by
what I did here
here is uh let's see which function is
this here's Commit This is this is Grace
commit on the server
and I want to validate all the things I
want to validate the owner ID and owner
name you might pass in I want to
validate the org ID the repository ID
the branch ID these are actually
parameters that get passed in by the
command line in the background that you
didn't see but like it does it for you I
want to check uh or you've given me
validines or does the organization and
owner and repository in the branch do
they even exist
I want to check all these things so what
do I have here I have a list of
validations and if you actually look at
all of my endpoint these are web
endpoints
this is like the equivalent of
controllers and actions this is a web
endpoint
and I just have this pattern over and
over again where I have these
validations and what do these
validations do they take in
um
what is validation validation is the
thing that takes in parameters and
returns a list of results really a list
of task of results but and because of
that I can start doing so so like I
couldn't do the inputs the same as the
output here for reasons but the outputs
the same on every single one of these
validations which then lets me which
gets me back into functional land where
I can apply functional code to say just
spin through these and if there's a
problem stop
so like I just like I I've really I'm
really proud of this one I really like
this code
um
anyway
um there's so much more I could show you
um I want to like here's here's some
cool stuff with types like I know C
sharp is finally getting this but this
idea of domain nouns or I can rename
it's not just a good or a string it's a
branch ID and a branch name and a
container name and a reference ID and
all that kind of stuff so like when I'm
looking at the code it's very clear to
me what's going on
um
there's so much more I'd love to show
you so but time to wrap up
as I said number one tip for c-sharp
programmers static classes and static
methods like just do it go home pick any
pick any uh a class from any code base
you want just for fun
and try to rewrite it where all the
methods that mod that modify State all
the methods that mutate State pull them
out write them as data classes with
static methods and you'll love what you
see
so
this is my like I believe Elegance
matters like correctness conciseness
maintainability and code matters more
than getting everything else that kind
of performance
it really does and I get most of the
millsockets don't get I don't leave many
on the floor but
um anyway thank you so much again thank
you so much for coming thank you so much
for watching this video
um I'd love your feedback I want the
stars star the repo if you have not
started the repo I want to do it
no excuses
um I'm in this to win this is real this
is not an experiment like I'm
git will be replaced like I'm in this
a hundred percent like I want to win
this
um and you know programming is art and
craft don't ever forget that it's all
about art and craft and thank you thank
you thank you
[Applause]
[Music]