JSON, TOML, YML? No! Apples New Config Lang!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
we are going to look at this right here introducing pickle I think is how you call her pacle or I'm sure there's maybe there's some other cool one we haven't thought of yet a programming language for configuration now here hold on you're probably thinking right now at this exact moment your first thought must be great we were only one programming language away from society being perfect and guess what we got it boys and girls we are official we're we've reached Perfection now the reason why I was very excited about this is I heard that they also Apple just sit down for a second made support and specifically called out neovim is Apple okay hold on is Apple is Apple changing their ways are we about to see like a a neovim Arc coming out of apple tell me that would not be just the coolest thing ever tell me that would not be the greatest day of your life I know it'd be my it'd be it'd be a great day for me because I just love Apple okay I don't love Apple I'm just kidding I love I love neovim anyways apple is neovim aligned everyone knows that I know it'd be it' be exciting well I don't well I didn't know that I didn't know that neovim will be default in apple Vision Pro no way really dude I didn't even know these things this is fantastic we are delighted to announce that open source first release of pickle pronounced pickle a programming language for production configuration I'm very curious why we need to okay so what's also very confusing is they use the term programming configuration can I just make I'm going to you know I know people always tell me that I react too early and I give my opinion without reading we're going to do it again anyways is pickle going to be more closely aligned with NYX right is this just Apple NYX is that what we're about to learn uh when thinking about configuration it is common to think of static languages like a jesson well it's not really I mean yeah I guess is it a language do you even call it a language a yaml or property lists with uh while these languages have their own merits I guess you technically isn't a programming language because Json literally does not have an if statement right and so until it has an if statement or a branching logic I believe it does not is not considered a programming language I believe that's like like that's the technical definition um anyways um that's like the easiest technical definition or the Layman's technical definition shall I say it's not touring complete would be the technical definition so the the Layman's one is does it contain an if statement uh while these languages have their own merits they all uh they tend to fall short when configuration grows in complexity for example their lack of Express expressivity means that code often gets repeated a have you seen any jasan additionally it can uh be easy to make configuration errors because these formats do not provide any validation on their own hey thank you zaro I appreciate that uh to address these shortcomings sometimes formats get enhanced by anary tools that add special Logic for example perhaps there's a need to make code more dry okay hey yo let's be careful about just tossing out the dryw around here okay I don't I don't I I it I I don't okay I don't need I don't need people abstracting here I'm actually pretty unsure that I like this idea already if if your goal is to make things more dry in configuration I I don't know how I feel about it yet right I'm feeling pretty hesitant right now so a special property is introd uh introduced that understands how to resolve references and merge objects together oh falor nice they wrote falor uh alternatively there's a need to guard against validation errors uh so some new way is created to validate a configuration value against an expected type yeah usually you do this with like a typed uh uh like a typed value right you have some sort of like type number value this validation that or some sort of you know you pretty much put your configuration as uh or you put your validation as configuration and there a scheme of some sort yeah uh before long these formats uh almost become programming languages yeah they're pretty much a programming language because everybody wants to add one it needs to be larger than this other field like the moment you have that use a programming language right uh but ones that are hard to understand and hard to write the other let's see on the other end of the spectrum general purpose programming languages might be used instead like cotlin Ruby or JavaScript become the basis for a DSL that generate configuration data I would have chosen go but okay while these languages are tremendously powerful they can be awkward to use for describing configuration because they are not oriented around defining and validating data additionally these dsls tend to be tied to their own ecosystems it is hard to sell it it is a hard cell to use cotland DSL as a configuration layer for an application written in go I think we can all agree with that go mentioned let's go go mentioned I think we can all I I think we can all agree with that it would also be a hard cell to have a go DSL for configuring application written in JavaScript right you're going to have a bunch of JavaScript andies that don't want no go you got a bunch of go andies that don't want no Colin right you could reverse a you could just put two programming languages together and people don't like it so the only solution is to create a third programming language this where we landed uh we created pickle because we think configuration is best expressed as a blend between a static language and a general purpose of programming language we want to take the Best of Both Worlds to provide a language that uh that is declarative and simple to read and write but enhanced with capabilities borrowed from general purpose uh languages when writing pickle you are able to use a language features you'd expect like classes functions conditionals and Loops starting off with classes we just lost all of the functional Bros like all of them it's terraform is is this I've literally never written terraform therefore I'm out I am so out y I know dude dude we're in shamp right now uh you can let's see you can build abstraction layers and share code by creating packages and Publishing them most importantly you can use pickle to meet many different types of configuration needs it can be used to produce static configuration files in any format or embedded as a library into another application runtime okay interesting interesting I mean that sounds useful I I am you know I'm CU I am curious about this stuff I've never really been in the in in this Arena of programming I've never been around this type of stuff I don't even know really know what to look like it's well Lua would be more akin to JavaScript right because Lua is I mean yeah I guess you could Lua is more akin to JavaScript than it would be to be declarative right because it's a very imperative language uh we designed pickle with three overarching goals uh to provide safety by catching validation errors before deployment to scale from simple to complex use cases to be a joy to write with the best-in-class IDE Integrations okay so this obviously this makes things extremely like this right here that's that's the best that will always be a w if if you're I mean it's why I'm completely convinced that typescript won the JavaScript battle honestly I'm completely convinced of it because they strove for great editor integration right off the bat and I think that's honestly what made them win yeah typescript such a joy or right I'm not saying it's a joy or right I'm just saying to win the hearts and minds of developers if you don't have good tools you're it sucks strove is that not a word am I am I making up am I making up words here yeah strove past tense yeah why how do you not know strove no I'm not looking at that XKCD comment I already know which one it is we have 14 we have for we have 14 ones what we need is one more now we have 15 all right so let's look at this we created pickle uh to have familiar syntax developers be easy to learn o this is a good move this is a good move this is a very good move uh that is why we included features like classes functions loops and type annotations type annotations let's go for example here is a pickle file module that defines a configuration schema for an IM for an imaginary web application this file defines types not data this is a common pattern in pickle we can call this a template okay module application host string name port uint 16 environment environment I don't know what an environment database okay database is just a class that has oh okay so when they say classes it looks like they're not really saying class as in the oop style they're literally just meaning object uh username password host Port DB name okay okay environment is just a type Alias for Dev QA prod okay okay okay yeah more like strict object yeah yeah yeah yeah yeah yeah and here's the configuration uh data that might be defined amends okay strange word don't even know what that means host equals this this this okay so you define a template oh that's kind of interesting oh that's actually pretty interesting that you first Define like a a a the template as they say or really you're defining the you're defining the type if you will of what you must fulfill and then here's the fulfilling of said type it's like a DTS file yeah yeah yeah yeah exactly it's it's it's it's it wouldn't be like an abstract class it would be it it's it's more like it's more like DTS I give it a strong maybe I'm giving it a strong maybe right now because there's things I really like about this this must be like effectively inherits or uh you know implements this thing and then here's the implementation of said thing built-in read expression by the way this is super cool can we all just take a moment and say that that is super cool the reason why I say it's super cool is uh is that I assume that read could be overridable and so you have the type of operation you want to do the reading and the key you want to provide meaning that you don't have get environment variable instead you have read type and this yeah I I do I I I do really wish that you know I do really wish that amends probably is better well I guess amends might be different if it if strictly these are for implementing they should have used implements but if you can add to a specification without implementing it then amends is really the correct one but this is more of an implements than an amends I really like the idea to put secret uh secrets and environment variables where every subprocess can spy on it yeah it's great huh uh okay it's easy to uh let's see it is easy to create variations of the same uh base data by amending for example let's imagine that we want to run four databases locally aside cars this uh this uses a a four generator to produce four variations Each of which amends the base DB and specific uh uh and specifies on different ports sorry I I had I had a stroke okay so we have this thing we import this guy okay so we're not amending we're importing hidden DB equals a new one of these oh interesting we create okay whoa this is pretty this is it's pretty interesting sidecars four offset en list zero through this if DB port equals that plus offset huh and then you could just yamel that here let's look at it and and then you get a sidecars key interesting oh that was a great Point yo yo yo low-level learning that was a great Point lowlevel learning said that the password gets exposed in the Exel generation of the thing I mean I guess at some point the password has to get exposed by I mean at some point the password is written in text but this is actually kind of interesting in the sense that it's a language to produce Json or yaml not toml or XML everybody's favorite Hunter 2 as a meme is so perfect they this this is a very well-written thing they they they why not just use write typescript the problem about why not okay why not just write typescript the problem with typescript is that typescript is too expressive and I do mean that the moment you allow somebody to write typescript you get to write typescript and therefore you now get to make an HTP request you now get to do anything you want to do now get to write all the classes all the functions all the functions producing functions you get to do all the things that you would do with typescript now into this now you have to have a build step for your for this I mean the this one already has a build step but at least it's going to be One Singular tool that actually has a well-defined build step unlike the cmake life of typescript like there's something better about having having specific languages for specific tasks almost always tend to be a really like a pleasurable experience writing in you know what I mean like JavaScript for manipulating the Dom is not a bad experience it really truly isn't Lua for manipulating Vim UI is not a bad experience using a language for why it shouldn't be used usually tends to be kind of like a it feels more trudging often and that's why using typescript for everything you can find that sometimes when you write typescript it's like really enjoyable to use that's because you're probably using it for its a good purpose and if it when it's like not enjoyable to use you find that you're Now using it for its non-intended purpose but you're just kind of shoehorning it to make it work that's kind of like how I always how I look at things you know I mean all right uh configuration is about data and data needs to be valid in pickle validation is uh is achieved by using type annotations and type okay I like this I like this I'm liking what I'm hearing everybody can we all agree what features make JavaScript enjoyable to manipulate the Dom oh it's completely Loosey Goosey and untyped like real talk when you're when you're when you're merging a bunch of crap like that that is a really great thing now you use typescript to give it some level of sanity which is nice but have you ever worked with uh like a a heterogeneous type something that has like multiple potentials either you have to have really strong boilerplate code that has these enums and you have to do lift operations you have to do a whole bunch of stuff or you just simply just like type booing do the booing thing right and that's really nice for UI and which are pretty Loosey Goosey second thing that makes JavaScript really a delight for using with the UI is that you don't need to have a compiled version that someone has to download and install instead your engine that's already compiled and running goes and requests the next updated version meaning you can do live patches extremely easy and that only really works with interpreted languages right yeah the Dom is super flexible and doesn't crash into Oblivion it they're like meant to they're meant to like work well you know what I mean it's just like Lua Lu is not a great like I wouldn't want to do I wouldn't want to do a serious server in Lua it's just I think it's the wrong language even though I'm great at Lua I I feel completely capable of writing a good server in Lua I wouldn't want to do it in Lua if that makes sense in uh pickle validation is achieved using type annotations and type annotations can optionally have constraints defined on them very cool here's an example that defines a constraints age must be between 0 and 130 damn damn methusa out just can't even be defined in this schema it should have been 969 people nice uh name am I right on that one methusa age 969 got it I'm smart man on the universe uh name to not be empty zip code must be a string with five digits oh damn you dude dude you f that one up you f that zip code up just just right up it could be a five digit or it could be a it could be a nine digigit with the dash at the at between the fifth and sixth you know what I mean all right unless if you live in the UK then you're effed as well yeah anyways uh person pickle module person name String is not empty oh this is cool this is cool oh very list very oam uh int is between string matches reject you got a production problem huh I mean besides for the fact that we got a redx in here and I feel like we got a production problems just just everywhere this is this is it is actually super cool this is super cool your age will never be a long int it dude it will never even be a short what's wrong with that um Rex is this is a perfectly fine Rex and I would never have a problem with that but can we all be real for a second this ain't the redx you're writing okay it's never been the redx you're writing in fact if you even go over to uh what's it called uh Rex uh Rex license uh licensing. org I believe I got that correct I always have to remember how to spell licensing I can't remember if it's an s or an S dude I how come I can never spell it one of the typical disasters is enforcing zip code globally using a redx like this is a disaster to do so despite this being a simple for example and we all agree this redx is well understood and easy to to get a zip code globally redx would be a nightmare it is a true nightmare country codes and phone numbers yeah uh simple yet useless yeah exactly simple yet completely not even useful uh failing let's see a failing constraint caused uh an evaluation error age negative five modules constraint person is in between this file person age age is this o great air oh great error oh oh that is a good one this is nice damn this is nice this is nice I like it constraints are arbitrary Expressions this allows you the uh to author types that can express any type of check that can be expressed in pickle here's a uh sample type that must be a string with an odd length and whose uh first character matches the last character string length is odd wow that's such a specific function someone had to make character first equals or charge first equals charge last nice who here by the way calls it cars versus chars I should call it cars I should npm install is odd well yet the install is even I should call it cars cares yeah cares would be like the correct way to say it I should call it cares here's the reason why I should call it cares just like you should call it a regex here's the reason why it's short for characters care characters regular expression regex who cares Jay Jay that was that was a pretty that was a pretty funny one Jay hey Jay hey j a j ayj AJ AJ pretty funny I'll I'll give it to you the first time Chad are coming in coming in Chad Chad like that pretty good that's pretty good uh sharing packages pickle provides the ability to publish packages let's see and to import them as dependencies into project this provides an easy way to share pickle code okay that's this is this is pretty cool as well I actually really do like this feature if you had uh you know a specification you need to be able to launch say as an internal service on this you can just say hey here's the minimum requirements that you must meet I like it the this one's including toml which is I'm a little bit confused oh a toml renderer oh my goodness you can provide your own renderers you can provide your own renderers or they just simply didn't give us the option of toml up here because toml why you got it why did you why why do you got to have a fourth why do you got to have a fourth okay toml mentioned alternatively they can manage as dependencies of a project using a project allows pickle to resolve version conflicts between different versions of the same dependency within the dependency graph it also means that you can import packages by simpler names uh am men's package project dependencies toml equals U this thing right here oh you can you can manage your pickle dependencies with pickle kind of feels like you're in a pickle when you do that sorry I'm just just genuinely confused sweet okay I mean this is cool I see sorry chat's chat's wild chat's wild a set of packages that are maintained by us the pickle team these include pickle uh pantry and pickle kubernets language bindings pickle can also introduce configuration as textual objects okay I like it I like it I absolutely do like that uh uh flip take this out take it out flip slack mentioned take it out take it out take it out take it out take it out yeah I know I forgot to Peak kill slack uh shut up let's see for example the application pickle example from above generated into Swift go Java and Colin pickle even includes documentation uh uh comments in the Target languages oh wait hold on what import pickle Swift okay so this must be we must be looking we must be looking at some uh what are we looking at here what what am I looking at here the problem is I don't know Swift so I can't tell if I'm looking at Swift or what the hell am I looking at oh pickled register type [Music] oh okay so this would be something like akin to like a Ser macro with pickle is that fair to say oh go yes okay type application struct okay so we have all oh okay so you have your pickle configuration in a struct and then you have your uh database pickle go package application here's all of this stuff okay oh look at that oh nice I like this by the way this is such I feel like I like this better than sday not performance- wise I just feel like I like it more anyways uh environments go pickle okay we have this package environment encoding Dev we have this nice environment string okay beautiful beautiful interesting and so then how how do all these values come in like using Code generation is just oh this just generates the code oh interesting so you can actually just straight up generate it okay is one of the many ways to embed pickle within an application our language bindings also provide uh evaluator apis to control pickle evaluation at a low level and users are free to act with pickle at the abstraction level that makes most sense for their application huh I obviously I have never used these things and so I I'm I'm I'm by far at best a Layman when it comes to any of this stuff um I'll say bonus is that it looks like it makes it really easy to interact with the language of your choice and your configuration it also looks like it it makes it easier to manage configuration because you generate your configuration off of a what appears to be a fairly sane language the thing I don't like is that it's yet one more level of abstraction yeah exactly generated code always makes it simpler and the thing that I worry about anytime I see these things is that more abstraction levels almost unequivocally makes things harder but no abstraction oh gosh oh oh oh what what just happen oh my oh oh what the what the [ __ ] just happened my eyes dark readers there's some timer dude how much do you want to bet there's a timer on this website there's a timer on this website that like red does or fetches something or does something and it breaks dark readers I dude I honestly don't even remember what I was talking about we'll talk about this in a second we'll talk about this in a second Theo we'll talk about that in a second editor support we believe that a programming language is only as good as the experience of writing it dude by the way this is an incredible statement I I I love this uh that is why we aim to provide best-in-class editor support when writing pickle in an editor users are guided through process uh the process of filling in configuration data for a given template Additionally the editors provide instant feedback if any let's see if any of the values are invalid documentation is immediately available when called upon by the way let's go let's go let's go I like this I mean this all looks really good this is great by the way this is really great can we all agree okay so I actually I may take back how I feel about wrapping like more abstraction in the sense that if this provides the ability to be able to write configuration with this level of like with instant autocomplete no matter which configuration you're writing in the accepted value list that could make a bigger difference it could be good change my mind uh vs code is better language than rust I'm not going to change your mind it's a perfect opinion uh in addition we are also planning on support let's see planning on supporting the language server protocol call which provides similar level of integration with other editors note we are also releasing two uh other plugins our vs code plugin and our neovin plugin let's go let's go let's go crazy look at this crazy they're using plug still crazy dude this plugin requires neovim 5 oh man crazy can we just all take a moment to remember that TJ used to get pinged 400 times a day asking when Neo 5 was coming out remember that remember those days dude crazy dude this is crazy this is some old ass neovim configuration going on here I used to write this kind of code in my neovim dude neovim has gotten so easy so much easier in the recent versions holy cow okay um first off this is awesome I'm I'm not going to lie to you this is great I love that they they they're going all in I I also think that it's better we're I I I will do one word of caution here though that planning on supporting the language server protocol and not just doing it I highly recommend doing it as soon as possible because this drops most of the need in fact you don't even need need a NE neovin plugin you just don't even have a neovin plugin because you have a language server protocol you need some Thin wrapper for vs code if I'm not mistaken um intellig I think you need almost nothing right uh LSP makes or breaks a language popularity it does it truly does because they're fantastic next steps we hope uh you like what we've shown so far actually if I the problem is is I don't I don't do this type of work right I'm not an infrastructure person so I don't even know how valuable this stuff really truly is right it's just my perception of could I find this uh valuable the LSP and the uh validation a validation language with some basic extensiveness and configuration SL uh language bindings I could see this being really cool right I it it seems like it's really cool but again something seeming like it's really cool and looking at something that is very uh very awesome in an example does not mean it's actually awesome overall and what I mean by that is pick any popular front end framework okay let's just go with react because you know that's the one I like to make fun of even though react does plenty of things that are very good uh react counter example right when you look at something as simple as this you're just going to go look at it and you're going to go okay we do a little we do a little app okay we have a little bit of this okay this all looks like HTML okay this is really really easy okay we're going to do a little counter a little increasing okay it's it's it's pretty simple that's that it it looks pretty simple right but the reality is is that when your program expands beyond what they show you it gets very very difficult right this is all completely reasonable code completely reasonable code I would expect this pretty much no matter what you're doing you're having it somewhere right and so whenever I see anything that just shows me some basic examples these all look great it's until I see it in a larger environment I feel like this pickle Apple copy of Nyx that's what I said at the very very beginning I said that is this just going to be NYX but Apple uh this has been tried before there are many other language conf or config languages the problem is that you're delegating app logic to the config which eventually breaks well I don't know if that's true okay so I I actually I'm not sure if what you're saying is is true in the sense that you're defining what the config is bound to I think you're right though like NYX is great until it isn't I've seen some things where once it crosses a certain line it becomes like holy cow what is happening here um like real real talk you're like you know like what the what is this the right way to go I don't think this is the right way to go I feel like you've jumped the shark once you hit a certain level it's interesting I really would love to do a a look into this you know if I once the moment I have a use case for this I'm using it you know that right you know I'm using it the moment I have a use case though anyways this is cool awesome great job on neovin by the way I love to see that that really also just shows how big Vim is actually getting it's shockingly getting large the name is vim could not have been big if neovim didn't exist that's the thing is that until neovim existed I don't think I think Vim would have always been relegated to a pretty select group of people it's actually neovim that has made it so that it's it's big picol aen
Info
Channel: ThePrimeTime
Views: 138,833
Rating: undefined out of 5
Keywords: programming, software engineer, software engineering, developer, web design, web development, programmer humor
Id: ckbqhf8P_cg
Channel Id: undefined
Length: 29min 19sec (1759 seconds)
Published: Sun Feb 11 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.