ElixirConf 2021 - Isaac Yonemoto - Zig (heart) Elixir

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] thank you guys all for coming i feel really honored to be here and to give this talk uh um hope you guys are having a good time i guess this is like basically the next the last talk of the of the conference so uh thanks for coming to my to my room all right so um my talk is titled zig loves elixir uh and so uh let's get to it so i'll give you a little bit of background about me this is what i look like on the internet i've been programming since the 80s i am a former biochemist so i spent about a decade doing that sort of stuff you can find me on twitter at dnatics that's probably the easiest way to find me and occasionally i make these really strange elixir deep dive videos um going into deep deeply about how things like you know uh testing works in in ecto when you have async true which i think is really awesome by the way uh so if you don't know how that works uh you should look into it and maybe check out some of my videos um so how did i get to elixir so like i said i've been coding since the mid-80s uh but nothing real you know just educational learning how to code stuff uh my first real programs were in c and c plus plus in the early 2000s and then as the web started taking off i learned i learned some ruby which i stuck with for quite a while but none of this was professional probably the closest thing to professional that i did in ruby was uh when i was a biochemist there was a chinese research institute that like had published the genome of something and they claimed it was open source they made it really hard to to get the data off of their website and so i wrote a ruby script that scraped it and then they took it down the next day so i think they were just doing it in in name only open source and name only i started to learn julia and then i got a real programming language a real programming language job off of julia doing some theoretical um theoretical computer science and like numerical computational performance experiments and then i got a job where doing more web devi stuff was necessary and i love the functional programming aspect of julia and i loved the uh love the sort of uh good stuff about ruby and i found elixir and i've kind of stuck with it up till now um i currently work for a company called vic.ai which takes invoices and does machine learning processing on it and makes the lives of accountants a lot easier we are hiring so if you're interested in working in that field we are definitely looking for elixir developers right now and for the near term for future so um but i've also found more recently a new programming language called zig probably somewhere around 2019 is where i found it and so you know why do i choose the programming languages that i choose and this is kind of you know actually i've got a pretty good pretty good track record you know at the risk of labeling myself as a hipster you know i was into julia before it was cool and you know not like super early on elixir but pretty early and and you know and and then zig is for sure like an early stage programming it's really started taking off in the last few months um well i think it boils down to this question does your programming language spark joy and like you know this is like what was a big thing with ruby in the early days uh you know with maths like you know what does does it does you know can we make a joyful programming experience and what do i mean by that and why is it important well look you know one of the things that i do is connecting to third party sasses and that's like many times just really thankless and completely mind-blowingly uh tedious job like one time i connected to the graphql system and for some reason my generalized graphql queries weren't working and then it turned out that they'd misspelled their query route as transacton instead of transaction you know like you know you got to put up with this sort of stuff and at least if your programming language has uh very few foot guns um it's very clear what's going on you can it's easy to write clear code declarative is helpful but not you know not necessarily like you know something you absolutely need but they're just things that you know in a soft sense makes it so that your experience as a developer is not that stressful and it can be in a lot of languages with like a ton of boilerplate in all the wrong places and i find that elixir and julia and ruby uh and as you'll see zig fit like all of those characteristics that i mean you know just to be crude make it less of a pain in the ass to program in that programming language and get the stuff that you want to do done and um so yeah so here are some commonalities between zig and elixir the design of both languages is heavily pragmatic so uh elixir is actually in my opinion built on two levels of pragmatism so erlang itself is not like when joe armstrong and co and uh robert verding and company built erlang they didn't build it to fulfill some sort of like theoretical idea of what a programming language should be they started from what do people need and like and and how do we get them there with like with with as little friction as possible and elixir is kind of a modern take on that there's a lot of stuff in elixir that's just there i mean io.inspect right income let's let's you know we all know that we're println debugging not using the debugger like you know just make it easy and make it make it useful right and zig kind of feels that way in in many ways for me um the design of both languages is modern there are no lexical macros in either language so if you remember c and erlang actually um they both have this thing where you can just inject lines of code as text into into your program and that doesn't exist in either these two languages first class documentation first class tests um both languages have a compile time aspect that is this uh way to run the one that run the language that is the same as the runtime way to run the language and both have like a build system that is in the language itself so it if you know c there's um there's uh there's like make right and you that's like a whole other language you got to learn and actually in fact for erlang you know you got to use make right many times people i mean things have gotten a little bit better over time but um a lot of erlang erlang projects are compiled and are built the build is orchestrated using make um and so by contrast in elixir we have mixed idxs which is itself an elixir file an elixir script and and so you it's easy to comprehend what's going on because you don't have to learn another language to to figure out what's going on and similarly zigg has this build.zig and i forgot to mention the reason why i keep referencing c is because zig is a low-level programming language at this aims to be a competitor to c and possibly even a replacement for c um and so you know i'm not like trying to proselytize people over to uh zig away from elixir here i think that the two languages can really like uh can really mesh together so now that i've described a little bit in qual and qualitative terms what zig looks like i'm gonna show you give you a quick tour of what zig looks like by comparison to c and c plus or c plus plus on the left so these are two programs that more or less do the same thing um i stole this uh this from https hackaday.com um and and they if you go to this site um they talk about actually the major foot gun that's in the c code so um if you have already seen this uh it's a challenge to like uh figure out what the foot gun is in the c that the zig doesn't have but um but yeah so if you're familiar with what zig is you do that as an exercise for everybody else i'll go through a few points here so um on the left c has these weird include statements that bring things in into your namespace and also those are macros right because they have the hashtag sign or pound sign or octathorp whatever you want to call it um by contrast zig has this these at import which are built in functions and what's going on there is it's bringing the standard library in as a struct so it's so that that name uh standard std is bound to basically a struct object that you can access in the rest of your comp uh in the rest of your code and you can see it getting uh dereferenced uh elsewhere in the code okay so um c has this like is super well known for having this and c and c plus plus are super well known for having this like weird spiral typing so how do you read the type of that buffer you start with buffer and then you go to the right and then okay it's an array of buff of something and then you go to the left and you see it's an array of cars okay and then also that means that car on the that car character the car identifier on the left is context sensitive that could be anything it could be any variable type that you've created elsewhere so it makes it really hard to parse and understand what's going on um for both humans and for for uh for computers by contrast zig on the right is kind of more long lines of modern languages like rust where you've got the character you've got the name of the identifier and then you can see immediately to the right oh it's an array in the case of zig the size of the array is a compile time known value and then it's an array of u8 which is which is car um uh another nice cd that zig has that i'll show you in in use like further down is this defer statement if you're familiar with go that should be a thing that you're familiar with but basically what it says is at the end of when you leave the scope of this of this uh of this block do this thing and what that means is for zig you don't have to have like weird uh uh control flow when you need to uh clear out a resource that you have asked for so in this case we're asking for the um for for a file handle and at the end you close it and this protects you from the case where if you have some sort of like weird early returns now you might not see any early returns because there's no explicit return statements here but there are three of them and what this try is is it's a it's a shorthand for saying if what is to the right of try errors just quit early and return that error and you can see the function signature of main here has a has a bang in front of it which means that i can return an error so this is a very convenient way of like quitting early and you know that at the even though it quits early it will do that file.close okay so this will all come important in one of the demos okay so i said that see a zig is a low level language and how are we going to uh how is this going to relate to lexiconf well let's use zig to write nifs and there are three like key points that i want to like uh cover in here the first is that it should be possible to write nifs with the same level of joy as writing elixir code um the nifs should have good integration with elixir and the nif should be a good citizen of the beam alright so what is a nif and why would you use one it's a way to access the low level c abi from the beam and you might use it because if you need operating system features that are not provided by beam so uh in my previous job i was writing uh orchestration code for virtual machines in a custom cloud basically and uh giving those out to renting those out to customers and i wanted a way to check in on the virtual machines and the hosts that were that were running the virtual machines and so i needed icmp ping and at the time it was not possible to run icmp ping from the beam and so i wanted to hook into ziggs uh socket library or socket part of the standard library and use that to access a raw socket and get icmp ping okay because before that point i was shelling out using os.cmd to fping and that's really bad and you can call zombie processes it's no fun uh we had downtime because of that at one point as well um however so i actually did finish that but then like two weeks after uh otp 22 came out with uh with uh icmp ping support in their new socket module so this whole thing is just really a big uh yak shaving operation to get icmp ping into into the beam um but you know you guys get to see this talk as a result and there's some cool tech that got got built as a result okay another reason is you might want to use the library written in c plus or shared library with the cabi i will show that in one of the demos and if you just want to go fast you know the beam is not exactly known to be a computational speed demon so uh one way to deal with that is to run a nif but all this comes with this like huge caveat that like that you know um nips break the sec the safety guarantees that the uh beam virtual machine gives you and also to some degree uh uh the the failure domain isolation so if you start running a nif and it does something bad uh common ones are seg faults panics you're gonna bring the whole system down with you and that means everything in all the other processes that are running on your virtual machine at that time so that's why people often uh look towards rust to do it but i'm going to show you a sort of a sort of one of the secure and not security um safety problems that can happen even if you are uh if you're not if you're not careful about how you how you write your nifs in general and it has nothing to do with like memory safety okay um so are you using nifs well there are actually built-in nifs in the beam i think it was maybe about two or three otp versions ago they started moving a lot of what were known as biffs built-in functions two nifs so whether you realize it or not you're probably using some nifs in the beam they're written and maintained by the erlang or by the erlang team at ericsson there are also some pretty common libraries that use nifs so come on in uses a nif for its decrypt stuff appsignal famously used enif to in rust to uh to get os profiling stuff like how much memory is your vm using and porcelain is a i think it's a pretty common library to run processes in a way that protects you from zombie processes and it uses a gonif okay so one of my goals is a good integration between elixir and zig and the design choice that i made here was to make niff's inline code so i'm going to show you an example of that and so this is my first demo can everybody see this i hope it's not too small basically here's how it works to use ziggler you want to just have this use zig macro and it can take a bunch of options in this case we're going to use this lib loss library by the way does anybody know what language lib loss is written in that's right it's written in fortran i mean there's the c there's a c version as well but uh but this is this one is written in fortran and so we're calling a for we're calling fortron code from from from uh elixir with zig as an intermediary um the lib the the uh lib laws fortran code does however expose a cabi which you can think of as sort of like the common denominator for how you know binary executable codes can talk between each other across most operating systems and then we're going to include a ch dot h file so what this will show you is a little bit of c integration alongside alongside uh just running pure pure zig okay so you take your zig code and you put it in the sigil z block and for any function that you want to export into your module you label it with these triple slash which is a doc comment in zig niff colon and the identity of the neck so in this case i'm doing this ax py function if you are familiar with blas that is an ax plus y linear algebra operation and you just write your function as if it were a a zig function in this case it's going to take a float 64 and two array two slices of float64 and it's going to return a turn a beam term and we're going to call the c blast dax plus d a x p y function uh that zig just knows exists by reading and parsing the cbos.h file and it's here we see that you know taking that import or import and assigning it to a struct and we call it as if it were struct and then we just do this stuff and we're going to get to this in a bit and then we're going to make an f64 list which will then output the res the solution vector okay so i do want to show you one quick thing so suppose i wrote something crazy like uh um so that foo identifier doesn't exist anywhere and so what we should see is we should see this underline and what happened is that it identified that there is a zig compiler error going on there and it tells you what it is and it highlights the correct line okay so let's go ahead and do this okay oops all right and then let's say three and then we're gonna do one because i would do the array one or the vector one two with the vector two three and so 3 times 3 times 1 is 3 plus 2 is 5. 3 times 2 is 6 plus 3 is 9. so got the right answer so we just called loss all right so here are some of the specific features that i chose to integrate between elixir and zig so one thing is type specs are inferred from the zig function headers i'm going to show you that in a second help documentation is generated from zig doc strings uh the line numbers for compiler errors are translated that's how we got that read underline um error return codes are merged for into into stack traces which i'm going to show you in a second and in the second demo i'm going to show you that zig unit tests can be run from exiting it okay so let's look at the the type of this so demo1 dot axpy so first of all you can see that the help is the docs string from uh from zig and you can see that this is correctly typed so float array of a list of float lists afloat and it outputs nil and if i were to for example put something that doesn't make sense it's going to give function clause error which is exactly what you would expect okay so i did show you that we have this first of all this function returns can return an error it's got that bang in front of the result type and i have this weird if a should probably if a equals 13.0 return error.unlucky number so let's go ahead and try and trigger that let's put this back and then we'll make the first 113 and you see that it forwards that error as a elixir exception and it even gives you a trace of where that error came from line 21 which is right here okay thank you so obviously there's a lot of like glue code that has to happen i'm going to show you a little peek under the hood of how this works so this is the this is the file that gets assembled by ziggler that gets turned into the nif and so you can see right here is the directly copied content from uh from what was inside that sigil z and you can have multiple sigils these in your code if you want and this is how it can remap what file and what line number it came from it injects these comments there it builds these shim functions which are the functions that are actually exported using the cabi and you can see that there's a bunch of like utility functions here raise function clause error so that's where these function does the type checking on ingress and make sure that you're doing the right thing um and uh and yep so that's that's kind of what i want to show here and then here's some kind of general boilerplate that you have to do for for nifs in general and this is like this part i think is some stuff that you can well both the this auto-generated stuff and this uh uh sort of look up table at the end are things that you can really mess up if you're not careful in in c and so the more modern uh nif uh libraries like rustler and and ziggler of course take care of this for you and auto generate it you don't have to think about it okay uh let's do unit tests i gotta get out of here okay so here we have a quick zig uh code block it's labeled the nif here is labeled 42 and um and you can see that all it does is outputs the number 42 and we're gonna this is exactly what you would expect for a standard uh zig test as i said tesla first class citizens in zig but you know you can't necessarily run zig tests to run these to run to execute these tests because you might need the backing of the beam virtual machine to run some of the functions that you're writing right we might do some more integration e tests that need a lot of machinery that doesn't exist if you just run the zig as it is so um what i have is a module called zig.unit and a directive zig test which looks a lot like doctest and was inspired by doctest and you know you just drop this into exeunt.case and so what happens if we run mixtest it'll recompile the nif and run your tests there we go so the test what is life failed with error test unexpected result and it tells you what line it was and there's maybe a few places where i should probably like fix um some of these line numbers but you know upcoming upcoming uh upcoming uh versions now what happens if and so it says one zig test one failure so this is what you would expect out of something that looks like a dock test right so if we change the error on that we should expect for it to say one zig test no failures or one zig test in green there we go right there okay the second goal that this the third goal that i talked about was that nif should be a good should be good citizens of the beam and there are two ways in which i like i'm gonna talk about this uh uh in the context of this talk the first is that allocating memory should be visible to the virtual machine um so erlang virtual machine keeps track of how much memory it's using if you use c standard library malloc or je mallock which most nif programming languages or nif or nif systems use it's going to be completely invisible to the to the beam virtual machine it can't track it um by contrast erlang does provide you with a special function that will allocate memory and is tracked by the virtual machine now the fantastic thing about zig is that it is completely agnostic about allocators there are a handful of allocators that are supplied by the standard library but most of the standard library functions do not call them directly and ask for you to provide an allocator so if you want to make you know if you want to make a hash map or if you want to make some sort of linked list you you are typically passing an allocator in which means that you can optimize your allocator for whatever purpose you want if you just want to do a shoot and throw away later you can do an arena allocator if you want a more sophisticated memory managed system you can use the standard standard library general purpose allocator you can even shim malloc and use malloc and there's one case where i just was like i need to see malloc because it does this really super fast zeroing out of your memory space so you do that and then boom you've got like memory that's zeroed out real fast so um so because zig is agnostic it makes a good pairing with the beam virtual machine because you can hook in uh the beam allocators to the to the existing system and it should just work across the standard library i also want to support all forms of nif concurrency there are four forms for five forms of nif concurrency one is not concurrent at all one is dirty cpu dirty io which i think nif which i think rustler pushes you towards there's threaded which will spawn a operating system thread and then run your nif inside the operating system thread and then there's yielding which yielding which which i'll describe uh in a bit so let's take a look at that demo so basically the components of this is just a simple function loop yielding we're gonna do something crazy and allocate like 10 megabytes of memory and then we're gonna free it um then we're gonna loop forever and uh and that's it this is what the function does now you'll notice that i have this try beam.yield and that's super important and i will describe how that works in a bit but let's just do the demo first okay so uh spawn so we're going to spawn this uh spawn this nif in its own process and i forgot to check that the memory what the memory was but that is erlang.memory and then so we can see that we've used uh 39 something something mem 39 megs of memory or 3.9 no 39 megs of memory okay so uh now we have that process that we created is 204 right so uh process.kill one or actually exit and then let's look at how much memory we have and you can see that it has gone down by 10 megs so went from 39 to 29 okay so what happened here so clearly we wound up freeing that memory at some point so let's describe how this works so this is the yielding threat yielding nif like life cycle so you spawn your your beam process executes the nif um ziggler create has this function that's a nif harness and the harness takes out something called a resource and what a resource is is a garbage collect uh tracked item inside of the erlang virtual machine then it runs the then it allocates the memory in the heap and run and creates something called a frame which is which is a context for the function to run like in in general it then starts running the function asynchrony asynchronously inside of that frame and then you saw in the while loop we had a bunch of yield uh the yield statement so the yield statement does is it takes this async function temporarily suspends the function and drops back to the event loop after so many amounts of these yields it says i'm consuming about one millisecond of time and that's how much the beam is like willing to let me go let me use and then um and then after that many yields have happened it yanks it yanks uh control away it doesn't restart the restart the nif and then it goes into the c tail call now this is super annoying to code and see and this is why most people don't use yielding nifs when they write nifs in in uh for the beam because you've got to like do this annoying see tail sea tail call where you like where you where you um where you uh pickle your the state of your your your your function and then you stash it somewhere and then you gotta unpickle it at the end and uh too much stuff to do but because zig has this like super awesome async function call system we don't have to do that we can just like pickle the reference to this to this uh to this async run frame right so then you know maybe the beam processes the beam virtual machine is doing something else and giving some time to some other process and it comes back and then the event loop gets some time back because it re-enters from the tail call and unpickles everything for you at which time it goes jumps back into this async function yield jump back and forth and another millisecond happens and then it gives its time back so this is like just a very cooperative system where the nif is running cooperatively with the beam with the beam virtual machine at some point i called process.exit and that terminated the beam process internally the resource then gets triggered for a gc but what the cleanup step does is it jumps one last time into that resources um into that resources frame calls beam.yield raises an error in the zig system that triggers the defer and so that's how all that stuff got cleaned up okay does that make sense yeah it's i think you know it's it's not not the simplest thing to understand i guess um but the other thing that is i think important is that um so let me do this so i said that there were different uh different execution modes so i can run the same program and so note this loop threaded simply calls the loop yielding function right and instead if i can do the exact same thing and run it in threading mode and it will it will have the exact same behaviors even though the beam.yield function is configured in such a way that it can run successfully whether or not it's in yield yielding or threaded mode so let's go ahead and do that so so we are now consuming 30 megs of memory and then we're going to do okay so 41 megs right so that's a little bit more than 10 megs and then if i uh process exit uh v2 with instruction kill and then we do memory 31 mix so this is running in threaded mode which means that it's running uh inside of inside of an operating inside of an operating system thread instead of using this crazy like you know tail call blah blah blah but note that it's calling this loop yielding which is actually an asynchronous function so zig has something called colorless async functions even though which means that you can run an asynchronous function in synchronous mode and you don't have to make any changes to your code and you don't have to do weird things like write your own event loop last thing is this is one of the reasons why nifths are dangerous so i'm going to run this loop sync and what has happened i've like like i'm typing and you can't nothing's going on uh so that so that this is why nips are dangerous so here we are just doing something synchronous and basically it's just hogging so much of the cpu time that that that nothing can happen nothing more can happen and so we've we don't have any memory leaks or we we do have a memory leak but we don't have any uh you know uh process um we don't have any seg faults and we don't have any panics and yet we did something really dangerous with with nif so um do be careful but i do think that i've tried to put in enough conveniences that it's easy to write good good programs and you can easily test between yielding and threaded and see do an a b test do i need to do threaded that's really how that's a really heavy-handed process i'm creating a new operating system process or operating system thread you know maybe yielding's better okay so i think i have time to do a quick another quick demo so i would like to show you alex kudmos's ray tracer so a couple of weeks ago alex built this and so this is you know you can't do a talk without some sort of live view live view demo and what this is is this is a live view that has in its live view running zig code through ziggler and you know this is kind of you know it might look like it's just moving this bitmap left and forth so you kind of have to trust me and or look at the code but uh but it is it is doing a ray tracing of the scene under the hood uh every time via phoenix live view and um so i was like really i was really flattered that somebody's like hey like you know this is a useful one let's try it try something crazy with it so so there you go um you can you can play with this i think he's a kutmos on twitter k-o-u-t-m-o-s and uh see for yourself okay um all right this is this is just a browser all right so what's in the future so core ziggler is almost done i'm expecting maybe one or two more breaking api changes uh i want to redo some of the way that i i translate between the statically type zig stuff back into beam with like even more like easy interface um i'm going to start working on supporting multiple zig versions which will happen which will be more important as zig kind of becomes a 1.0 uh project want to integrate the zig package manager that is supposed to be a pre 1.0 development currently doesn't exist and i have a personal commitment to support ziggler through zig 1.1 um but i would love to have some help like maintaining this uh once zig becomes like a real thing well i mean it's not like it's not a real thing now but you know okay so in conclusion um zig solves these three problems it should be possible to write nifs with the same level of joy as writing elixir code i've got a high level of integration with elixir and writing nifs that uh writing this that work really well with the virtual machine so here's my call to help um i do everything on linux so it's really hard for me to get i think mac os works but there might be some issues i don't know windows is definitely something that needs some needs i think i might have solved it um so that nice code inner code highlighting that i have i have this vs code ziggler extension i just need some help somebody just needs to put on that on azure because they don't have an azure account and it's literally ready to go uh so that's the easiest one if you want to help directly with the project and there's one more thing i don't understand how um so if you notice that if i make a code change i have to exit out of the vm and then go back in there is some way for you to do module reloads and i'm not quite doing it right so if somebody is an expert on that or know somebody who's an expert at that at me on twitter um and i have a call for apps um so one thing that i kind of started the framework for but didn't like wasn't really able to put any time into is a project i call xla which is a cpu-only back-end for nx that calls ziggler so if somebody would love to work on that and knows how to do that stuff that would be awesome but it's it's gotten started it's on my github slash exla and then a porcelain replacement would be cool because i don't like having to download the go binary it would be nice for it to be built into the library i think i mean that's just me um okay special thanks jose for building obviously for building like such a crazy awesome language that this is even possible in andy kelly for building zig which um uh you know this i mean it's not like it's crazy easy but it was not there were no parts of doing this where i was um where i felt like i was stymied by what was what was possible and alex for for building the the um live view uh little demo if you're interested in zig i recommend this this video called the road to zig 1.0 which is really what sold it on me um ziglang has its own website and there's a great place to learn zig called ziglearn and the library that i talked about is ziggler um and uh nerfskov talk i gave a talk about nervesconf and there's a uh a really crazy demo there um supposedly that there's a good chance that'll wind up being on on youtube so keep your eye out for that and thank you guys all for coming to listen to me [Applause] yes uh well i've actually never deployed anything with nifs i should have mentioned that none of this is in production so i can't sorry ask ask app signal how about that yes right so it's a little bit of a lie that is an error return trace that i have turned into a stack trace so yes great question uh you caught me out on fudging the truth a little bit yes um yeah probably that's a good idea [Laughter] that is the beam garbage collection event so the the process death triggers triggers garbage collection that red line was the resource so that resource and then you can put a hook into the a c a c a b i hook into the resource that gets triggered when that resource gets destroyed so i'm basically tying the nif into a garbage collection tracked item in the vm yes is it going to show up back in elixir land at the time spec right so i only allow something like 20 different types to be go back and forth um but that's a so i mentioned that i want to overhaul how tights are converted or how some of the staticy type things are converted and that is like i think that there might be a way to get tuples in from zig into into orlang land and i think there might be a way to get structs in for elixir folk [Laughter] treat it as like a database transaction like that's that's beautiful or process library yeah oh actually you know what's that's a great question i don't fully know exactly what zig is doing i think it's doing i think zig is doing a static linking into the dot so the zig emits a dot so file or dilib or dll depending on which operating system you're in and i think what zig is doing is it's statically linking that blast in you could have passed the dot a file the dot a static library and it would work just just the same because i think that i've deployed this on a system which taken just you know as an experiment taken that artifact that like made a release excuse me and then released it to something that didn't have lip loss and it worked i think it doesn't it does not yeah um you know it's it's it's it's it's it's you saw what the convolution that was i mean i don't know how to say about that i mean like you know uh it's not so much that so the the tests the test suite for ziggler is like all just sigil z's up and down a bunch of i guess integration tests and it's like maybe 20 seconds on this not so great laptop so um ziggs are pretty good at compiling fast um and it's getting better um because that's something that the team really cares about and they're also gonna start i think maybe in the next version they'll start having like incremental compilation solutions so that'll kick the compilation time even faster and then um ziggler has a way for you to say do this in release mode so so you know you don't do you don't have incremental compilation release you have a nicely polished binary that comes out at the end that's like doesn't have all this like scar tissue from previous compilations yeah um the entry point has to be sigil z but if you wanted to you could do an at include path to some other zig file that you keep in your tree um so like you know uh you can you can reference other you can reference other and and the system will hunt down where those are using the parser and say oh it looks like you're in trying to include this other zig file it'll drop that into the temporary directory where it does all of its you know scheming and then and and so it'll make its way in there um and of course package manager stuff not yet but like soon yes all right the the ping but i seem peeping the icmp ping thing i i don't know if you were here for that oh yeah yeah so originally i wanted to have icmp ping for the beam virtual machine and uh and so that's how like this is a two year yak shaving project anything else i think we're just about out of time too so thank you very much for coming [Applause]
Info
Channel: ElixirConf
Views: 2,391
Rating: undefined out of 5
Keywords: elixir
Id: lDfjdGva3NE
Channel Id: undefined
Length: 48min 10sec (2890 seconds)
Published: Sat Oct 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.