00:00 Json is not the best thing in the world
00:01 it works but it doesn't work great what
00:03 if I told you there's yet another
00:05 alternative and no it's not yaml what if
00:07 I told you that alternative was by Apple
00:09 and they open sourced it for some reason
00:11 all of that by itself sounds really
00:12 interesting but what if I told you on
00:14 top of all that it's actually really
00:16 cool so much so that I kind of want to
00:18 start using it as soon as I can I did
00:19 not expect this release to be as
00:21 interesting as it was so I can't wait to
00:22 show you what I've learned as I dug in
00:24 so let's take a look at pickle Apple's
00:26 new configuration focused programming
00:28 language I like how they open with a
00:30 configuration that is programmable
00:31 scalable and safe configuration is the
00:34 key here this is focused on being good
00:36 for configuring things the first example
00:39 here bird. pickle we have a name and a
00:41 job which is a nested thing so this is a
00:43 pickle file the interesting thing about
00:45 pickle is you're not actually expected
00:46 to like use this exactly as is you're
00:48 expected to run this and Export out the
00:50 different things you might want like
00:52 Json or a yaml file or a pist or a do
00:56 properties which I didn't even know was
00:57 still a thing but if you need one of
00:58 these specific formats now you have a
01:00 standard that will export all the
01:02 different formats gets weirder though
01:04 because as I mentioned can do a bit of
01:06 programming in here first off they have
01:07 integrated application config so that
01:09 you can embed pickle into other
01:11 programming languages like Java cotland
01:12 Swift and even go you can see what the
01:15 resulting output looks like when you run
01:17 pickle to configure these types of
01:19 things absolutely fascinating that they
01:21 are generating code for these different
01:23 languages based on a pickle module and
01:25 if we keep going you'll see they've
01:27 built IDE integration including Visual
01:29 Studio code which is crazy to think that
01:31 apple is building plugins for vs code as
01:33 far as I know that's unprecedented I
01:35 never would have expected Apple to be
01:37 building things for Microsoft's open
01:38 source code editors apple and open
01:40 source generally aren't things I
01:41 associate much but here we are and as
01:44 someone just pointed out in chat they
01:45 don't even support xcode what that's
01:47 hilarious they support all these other
01:49 things and not their own cursed Madness
01:51 I I hate xcode so much that I've
01:53 consider making a video about it for a
01:54 while cuz it is such a show but
01:56 we'll talk about that another time
01:57 because I want to show off more of the
01:59 cool things go going on here like in
02:00 this example where you can actually do
02:02 logic you can enforce that this int has
02:05 to be greater than a th and then when
02:06 you assign it you'll get an error yes
02:08 this is a config language that lets you
02:10 encode logic to guard things that's like
02:13 Zod just built in to the config language
02:16 very very interesting it's clear Apple
02:18 had like specific problems they were
02:19 trying to solve here introducing pickle
02:21 a programming language for configuration
02:23 we are delighted to announce the open
02:25 source first release of pickle a
02:27 programming language for producing
02:28 configuration when thinking about
02:29 configuration it's common to think of
02:31 static languages like Json yaml or
02:33 property lists while these languages
02:34 have their own merits they tend to fall
02:36 short when configuration grows in
02:37 complexity for example their lack of
02:39 expressivity means that the code often
02:41 gets repeated additionally it can be
02:42 easy to make configuration errors
02:44 because these formats do not provide any
02:45 validation of their own someone who's
02:47 been working a bit more in terraform
02:48 lately yes absolutely the case to
02:50 address these shortcomings sometimes
02:52 formats get enhanced by in ciliary tools
02:54 that add specific Logic for example
02:56 perhaps there's a need to make code more
02:58 dry so a special property introduced
02:59 that understands how to resolve
03:00 references and merge objects together
03:02 alternatively there's a need to guard
03:04 against validation errors so some new
03:06 way is created to validate these
03:07 configuration values against an expected
03:09 type before long these formats almost
03:11 become programming languages but ones
03:12 that are hard to understand and hard to
03:14 write on the other end of the spectrum a
03:16 general purpose language might be used
03:18 instead languages like cotlin Ruby or
03:20 JavaScript become the basis for dsls
03:23 that generate configuration data while
03:24 these languages are tremendously
03:25 powerful they can be awkward to use for
03:27 describing configuration because they
03:29 are not oriented around defining and
03:30 validating data additionally these dsls
03:32 tend to be tied to their own ecosystems
03:34 it's a hard cell to use a cotlin DSL is
03:36 the configuration layer for an
03:38 application written in go it's a very
03:39 fair point because you don't want to use
03:41 cotlin to define your configs in go we
03:43 should invent a new standard obviously
03:45 if you don't want to write your go
03:46 configs and cotlin clearly what we need
03:50 standard this XKCD gets more and more
03:52 relevant every day I swear anyways we
03:55 create a pickle because we think that
03:56 configuration is best expressed as a
03:58 blend between a static Lang language and
04:00 a general purpose programming language
04:01 this is a bold statement to make to say
04:03 a blend of static languages and general
04:05 purpose programming languages is the
04:06 right thing for a config and honestly
04:08 the more I think about it I'm starting
04:09 to agree we want to take the Best of
04:11 Both Worlds providing a language that is
04:13 declarative and simple to read and write
04:14 but enhanced with the capabilities
04:16 borrowed from general purpose languages
04:18 when writing pickle you're able to use
04:19 the language features you'd expect like
04:21 classes functions conditionals and Loops
04:23 you can build abstraction layers and
04:24 share code by creating packages and
04:26 Publishing them more most importantly
04:28 you can use pickle to meet many
04:29 different types of configuration needs
04:31 it can be used to produce static
04:32 configuration files in any format or be
04:35 embedded as a library into another
04:37 runtime we designed pickle with three
04:39 overarching goals one to provide safety
04:42 by catching validation errors before
04:43 deployment two to scale from simple to
04:45 complex use cases and three to be a joy
04:47 to write with our best-in-class ID
04:49 Integrations this is actually an
04:50 interesting set of goals very very
04:53 interesting more and more I like this
04:54 idea of validating in the config that
04:56 just saves so much trouble so let's do
04:59 their quick quick tour of pickle we
05:00 create a pickle to have a familiar
05:01 Syntax for depths and to be easy to
05:03 learn that's why we've included features
05:04 like classes functions loops and type
05:06 annotations for example here's a pickle
05:07 file a module that defines the
05:09 configuration schema for an imaginary
05:10 web app they want us to know that this
05:12 file defines types not data which is a
05:14 common pattern in pickle interesting to
05:15 have the concept of a template in
05:17 something meant to compete with Json
05:19 application dep pickle it's a module
05:21 named application it's a host name
05:22 that's a string Port which is an INT
05:24 16bit environment which is an
05:26 environment so this has to be coming
05:27 from something else would be my guess
05:29 data a database also probably coming
05:30 from something else oh look at that they
05:32 Define them right below database is a
05:33 class that has all of these properties
05:35 the environment is a type Alias for one
05:37 of these values this is so interesting
05:40 it's a blend of a bunch of different
05:41 things but the results actually really
05:43 simple I'm liking where this is going
05:45 let's keep digging someone asked isn't
05:46 this kind of the same idea like T3
05:48 environment yes and no T3 and V is very
05:50 much tied to typescript environments and
05:53 is only for validating environment
05:55 variables this is for validating things
05:57 inside of outside of and around the idea
05:59 of config like this would go much better
06:01 with something like terraform than T3
06:02 environment would and here's how the
06:04 configuration data might be defined now
06:06 we have local host. pickle it amends the
06:08 application file and then it sets all of
06:10 these things really nice and there's
06:13 built-in read expressions for reading
06:14 external resour actually that's really
06:16 nice too that you can read from the
06:17 environment like that huh really
06:20 interesting it's easy to create
06:22 variations of the same Base by amending
06:24 for example let's imagine we want to run
06:25 four databases locally as sidecars this
06:27 uses a four generator to produce four
06:30 variations Each of which amends the base
06:31 DB and specifies a different port so
06:34 here is the for Loop example that I was
06:36 looking for import application. pickle
06:38 hidden DB application. database is a new
06:40 database with these properties and we
06:42 create the side cars which uses a for
06:44 Loop where we select all of the values
06:47 in this list a lazy way to do a for Loop
06:49 where you guarantee it's just these
06:51 values but we have 0 1 2 and three so
06:53 for each of these it's going to create a
06:55 config for a database that is 6,000 plus
06:57 the offset so you'll have Port 6,000 61
07:00 2 and 3 all is valid
07:02 configs if you want to understand this
07:04 code we can take a look at the Json that
07:06 gets exported so if we export database
07:08 password Center this is setting the
07:09 password for the environment then we run
07:11 the pickle evaluation code tell it that
07:13 we want Json out and now here's the Json
07:16 that we get it's actually really nice as
07:18 a a language that does this and only
07:20 this like this code is solid this makes
07:23 sense to me and having this be a thing
07:25 that can spit out whatever different
07:26 format you need inv validate in whatever
07:28 language that you use
07:31 I'm digging it I want to learn more
07:33 about this validation it's one of the
07:34 most interesting Parts configuration is
07:36 about data and data needs to be valid in
07:38 pickle validation is achieved by using
07:40 type annotations and type annotations
07:42 can optionally have constraints defined
07:43 on them here's an example that defines
07:45 the following constraints age must be
07:47 between 0 and 130 name must not be empty
07:49 and zip code must be a string with five
07:51 digits hey somebody will be older than
07:53 130 someday you don't want this you
07:55 don't want your code to break because
07:56 Brian Johnson was right let's be real so
07:59 let's take a look at the person pickle
08:00 module name String not is empty is this
08:03 a helper that they have built
08:05 in interesting age is an INT which is
08:08 between 0 and 130 seems like this is
08:10 syntax is there like core validation
08:12 stuff I'm sure there's a doc somewhere
08:13 that lists all of these so age is an INT
08:16 that is between these values and zip
08:17 code is a string that matches this Rex
08:20 of course Rex is involved I was
08:22 wondering when we'd see the word Rex the
08:24 only way you could possibly make yam
08:26 more curse is adding Rex to it and they
08:30 anyways a failing constraint causes an
08:32 evaluation error so if we make this
08:33 Alexandra file where age is negative
08:36 we'll get an error when we try to
08:37 evaluate it that says that there's a
08:39 type constraint failing is between 030
08:42 violated by this value and it calls up a
08:43 specific line it happened on
08:46 nice good stuff constraints are
08:49 arbitrary Expressions this allows you to
08:50 author types that can express any type
08:52 of check that can be expressed in pickle
08:54 here's a sample type that must be a
08:55 string with an odd length and whose
08:57 first letter matches the last letter
09:00 interesting at least they got equals
09:02 right sharing packages pickle provides
09:04 the ability to publish packages and to
09:06 import them as dependencies in a project
09:08 so this going to be PPM pickle package
09:10 manager this is nuts this provides an
09:13 easy way to share pickle code that can
09:14 be used in other projects it's easy to
09:16 create your own package and publish them
09:17 as GitHub releases or to upload them
09:19 anywhere you wish they could be imported
09:20 from the absolute URL look at that
09:22 they're learning all the right lessons
09:23 from the things we got wrong in
09:24 JavaScript and node this is actually
09:26 really cool this is like I feel like
09:27 they watched that one talk that Ryan D
09:30 did about the regrets he had from node
09:31 and they applied all of those lessons
09:33 really well here I'm impressed this is
09:35 cool alternatively they could be managed
09:37 as dependencies of a project using a
09:38 project allows pickle to resolve version
09:40 conflicts between different versions of
09:42 the same dependency within a dependency
09:43 graph it also means that you can import
09:45 packages by a simpler name huh you can
09:48 Define dependencies like that H well it
09:50 is a Json replacement so they have to
09:52 replace package Json seems like they
09:53 found a way to do that version conflicts
09:55 in my config files is a a meme I'm
09:58 seeing in chat now that yeah funny
10:00 enough not a lot of people know this the
10:02 package system for iOS is a thing called
10:04 pods that were created by the community
10:06 not by Apple and the creator of PODS
10:08 orta actually kind of moved on from IOS
10:11 and became one of the lead contributors
10:12 for typescript at Microsoft which was
10:15 very interesting to see somebody who
10:16 made packages possible in the iOS world
10:19 ha it so much he moved over to
10:20 JavaScript and typescript they don't
10:22 call the pickle package manager the
10:23 pickle jar they're doing it wrong that's
10:25 fair looks like they even have their own
10:27 set of packages that they're managing
10:28 which is interesting because this means
10:30 Apple's probably using these
10:31 Technologies in order to justify the
10:32 time they're putting in which means
10:34 Apple's officially almost certainly
10:35 using kubernetes because they built the
10:36 kubernetes binding very interesting they
10:38 also called the monor repo for
10:40 publishing many of them the pantry the
10:42 pickle Pantry I'll give that a star it's
10:44 28 stars for those wondering and the
10:46 actual pickle language it's a 3K and
10:48 give that a start too this is
10:49 fascinating it's also just crazy the
10:51 rare times you see apple popping up in
10:52 the open source world one of my favorite
10:54 examples of this there's this weird
10:56 Apple account and we've confirmed this
10:57 is officially Apple the developer
10:59 ecosystem engineering account on GitHub
11:01 previously it had a really ominous
11:03 profile picture tell me that's not one
11:05 of the most ominous profile pictures
11:07 you've seen on a GitHub account that
11:08 turned out to actually be Apple's GitHub
11:10 account it seems like apple doesn't want
11:12 the engineers who are contributing these
11:14 things to be like using their usernames
11:17 on their own accounts it's very Apple to
11:19 do this from like the Shadows so to
11:21 speak it's Eerie almost also it wasn't
11:23 originally this poorly Alias this is
11:25 just the very lowquality backup that uh
11:28 archive.org has huge shout out to them
11:29 for keeping most of the internet alive
11:31 so I remember when I first saw this
11:33 account file a poll request on OBS
11:36 rewriting the layer for window capture
11:38 on Mac this was really cool the reason
11:40 they did this seemed to be that they
11:41 were testing their new capture Solutions
11:43 and they used OBS as like a standard for
11:46 capture so having Apple out of nowhere
11:47 show up and contribute really nice
11:49 changes to OBS was really unexpected and
11:52 cool and they did a huge breakdown cuz
11:55 it's Apple here's where they call out
11:56 the language bindings which is really
11:58 interesting because they want it to be
12:00 embeddable in other languages Apple
12:02 generally doesn't like JavaScript and I
12:04 am certain they don't like typescript
12:05 much so I'm not surprised we don't see
12:06 those here but of course they had to
12:08 support Swift because it's Apple but
12:10 it's interesting they also support go
12:11 Java and cotlin especially cotlin when I
12:14 think about it Apple does have quite a
12:15 few Android apps now like the Android
12:17 Apple music apps one of the best apps on
12:19 Android makes sense they have to think
12:21 about cin a bit more especially if
12:23 they're already using Java for their
12:24 stuff it that makes
12:26 sense using Code generation is just one
12:28 of the ways to embed pickle within an
12:30 application our language bindings also
12:32 provide evaluator apis to control pickle
12:34 evaluation at low level and users are
12:36 free to interact with pickle at the
12:37 abstraction level that makes the most
12:40 application now the last big piece is
12:42 the editor support we believe that a
12:44 programming language is only as good as
12:45 the experience of writing it that's why
12:47 we aim to provide best-in-class editor
12:49 support when writing pickle and an
12:50 editor users are guided through the
12:52 process of filling in configuration data
12:54 from a given template additionally the
12:56 editors provide instant feedback if any
12:58 values are in valid documentation is
13:00 immediately available when called upon
13:02 we're also releasing the intell plugin
13:03 which provides Rich support for jet
13:04 brains editors including intell webstorm
13:07 goand and pycharm these plugins are able
13:08 to analyze a pickle program and provide
13:10 features like autocomplete go to
13:11 definition and refactoring support
13:13 that's really cool that they're doing
13:14 language servers properly that's nuts to
13:16 have like a config file like imagine if
13:18 your Json autocom completed and gave you
13:20 errors when you were editing it this is
13:22 actually one of my favorite Parts okay
13:24 when are we replacing package Json with
13:25 package pickle because I need this type
13:27 of safety in everything I do this is
13:29 great seriously though imagine like an
13:30 alternative to something like next where
13:32 the next config Json wasn't a Json it
13:34 was a pickle file and when you went to
13:36 your editor and started typing out the
13:37 config it would error if you got things
13:39 wrong that sounds awesome this seems
13:41 genuinely really cool right now when we
13:43 want to do stuff like this we end up
13:44 doing crazy hacks like putting our
13:46 config files in the language we're using
13:48 like typescript so that we can get type
13:49 errors and now we have to compile that
13:51 in order to use it this skirts so much
13:53 of that it's actually really
13:57 cool Sly the vs Cod C PL doesn't seem to
13:59 have the erroring yet just the syntax
14:00 highlighting and cold folding but they
14:02 are planning on doing that in the future
14:04 see they have examples here for a bunch
14:07 of different things from kubernetes to
14:09 Swift to the jvm and go really good
14:12 stuff this is both further along and
14:14 better than I would have expected I did
14:16 not expect this to be this cool honestly
14:17 and I'm genuinely really hyped I
14:19 certainly didn't expect Apple to make
14:20 something like this much less open
14:22 source it so I'm really hyped to see the
14:23 results what about you are you excited
14:25 too let me know in the comments anyways
14:27 thank you again for watching peace NS