Devreal

SF Scala: Denys Shabalin, Scala Native

SF Scala: Denys Shabalin, Scala Native

Recording: SF Scala: Denys Shabalin, Scala Native

[Music] hello everyone I'm Dennis I'm technical on vacation I didn't just randomly got dragged into giving this talk so I so this talk is going to be a bit more kind of like overview of what's going on more than kind of in-depth explanation of things then we can go in-depth and whatever you're interested in so I'm currently doing I'm a research assistant at EPFL and I'm working on this project called colony so what is it so the core idea of Scala native is to compel Scala ahead of time header time compilers are not amusing they've been a while for a long time and languages like C and C++ are primarily compiled this way so the project is actually quite recent like the very first prototype verso announced a bit more than a year ago and we've seen the first release in March this year and and in a few words but cognitive is native code compiler it is based on LLVM compiler infrastructure and it's primarily interested in you know advanced in state of the art of ahead of time and like whole program up to optimizing compilation in this talk I would like to highlight kind of the four interesting parts of colonies which are considered to be our like main selling points so first selling point which is different from any from the main reference foundation double JVM is ahead of time aspect our second salient point is that it still skylights on the new language so you don't have to learn anything really and we also have great interoperability with native code I like C and we also have a new feature which was introduced just recently in 0-3 is predictable garbage collection so first thing is ahead of time so what does it even mean so typically the way you do Scala it's like that typically the way you use color on JVM is that you have a front-end compiler which is either color C or dirty but it doesn't matter like skeletal 11 for example use Callaghan powder to compile skala files to class files and those class files around on JVM diem is a very elaborate complicated Beast so it actually has not one but two compilers it has bicycle interpreter and has this very elaborate scheme of slowly getting your code to be compiled faster and faster as it goes from interpreter to C 1 to C 2 and of course the code is compiled it doesn't mean it's going to stay compiled because of the thing called the optimizations so the code compiled by JVM can sometimes be optimized back to interpreter if one of the conditions that JVM expected to happen didn't quite happen and all this of course happens during runtime so it means that your application has to compete with on system resources at first few seconds and sometimes minutes until the VM warms up so not only does it have to do your workload you're actually doing it also has a compiler code and of course this has a performance overhead and this has a well-known problem of very slow and very unpleasant JVM startup time and warmup time so now this is free of course one few your VM is warmed up which can vary from seconds to minutes based on the size of your codebase like for ample first color see it takes minutes to reach peak performance code is pretty much stable and stays native code but this kind of like syrup aspect is really expensive for some apps that only run for a short period of time so it's culinary if we don't do any completion at runtime so all the completion is done before your app is actually run - hence the ahead of time explanation so the whole pipeline is a bit more elaborate because we kind of need to do to move some of the functionality which you previously sell on JVM to compile time stage first of all imagine a high level bytecode wouldn't work because high level bicycle is not a machine understandable saying so you need to go all the way from high level bytecode which in our case is called NIR and transform it all the way to native code and this involves going from NIR to Loa Mir and LOV mi are going to machine-dependent ir and from machine-dependent I are going native code so it's really a very elaborate very long chain and quite a few things happen so apart from this front-end compiler part which is more or less the same we use Scala see unchanged - all of your high-level language features stay have the same semantics like for example macros are expanded the same way in places are inferred in same way type inference is done in the same way because it's essentially the same compiler to start with and then in the end we add this NIR thing we just flip the switch from amazing class files to omit NIR files apart from that and then the interesting part happens basically the main added value of our project is the stuff it happens afterwards so it's currently if we do quite a bit of transformation before we hand up the code LLVM so first of all we do whole program tree shaking so what it means is that we only given the entry point and your whole class path we only keep parts which you actually need and this can make a dramatic impact on a binary size and it can also make a dramatic impact on how much we can do later in terms of optimizations because the last codes you have the more limited closed worlds you have the better you can diverge realized virtual calls the better you can shrink down your code the smaller size the more you can inline reserving the same output binary size for example and so on the force so it's actually very important for us to pre optimize code before we hand it off to LLVM and next step is LLVM so LLVM is a very pluggable interchangeable compiler tool chain so the main value of LLVM is that it has a Velda find intermediate representation called LLVM ir and it has ll file extension and essentially the main value of LLVM of the project is that it has assured infrastructure for all the standard things you would typically want to most compilers like it has all of the well-known standard - mutations like global numbering and whatnot it has excellent loop optimizer and Auto vectorizer which seems to be quite a bit better than the one we have a JVM actually and also does all of the going from IR to native code parts like instruction selection register location and actual code generation and that's basically an excellent choice for Scotty because it means we don't have to do any of this so we only have to make sure we emit code which is friendly for LLVM to optimize and like Justin up ahead of time has a few benefits the first of all it's setup time because all of this heavy machinery you've seen for DVM doesn't exist it has very predictable performance because your code is compiled once there is no deep temptation ever so it's good and bad it's very good in terms of its ability because whatever performance you get it's going to stay there and it's going to be consistent with rules you later and lastly those are breezes small self-contained binaries because we invest heavily in doing stuff like tree shaking which brings down your class bus to the smallest reasonable subset would improve to be necessary so our second selling point is the fact that we are highly compatible with Scala JVM and we are very proud to say we are the same language at the core and what does this mean is that we had the same semantics minor direct exists some minor semantic differences on the edge cases like what happens if you'd reference a null pointer but those typically are like stuff where JVM would crash anyway it just we crashed differently all of the language features are supported because we use the same front-end compiler to start with and even obscure part like structural types which took us some time to get right because it's a virtual dispatch to make virtual dispatch for this to work efficiently is not trivial and we also care a lot about libraries so we don't just provide a small language subset without a kind of library support story in terms of libraries we invest heavily in provided a reasonable environment which you would which are already used to so this includes Scala library of course like things like collections and whatnot and most of it modulus and minor parts like parallel collections work out of the box you don't have to do anything you can just use your favorite collections and just don't even think about it we also provide a reimplementation of things like java.lang util io and io a net built-in so you can do stuff like Java style files and not even worry if it's JVM or native it's highly important for reading compatible code across different platforms so we don't implement all this package is completely we only implement parts which people typically use so for complete list please go to the link to see what we actually have so some of the parts are still missing like for example net is net support is very very rough and we're working on that at the moment and apart from that we also provide bindings for Lipsy and plastics api's so if you wanted to go lower level JVM and but couldn't do it before you can now for build system we use SBT and there are very few things you need to know to use as the Tiwi Scala native is that you have to enable one plugin which is just to online and your project builds SBT and there is a nice easy to use template called culinary's collective g8 and you can make an instance of it with s between you and apart from that we also have something called SBT cross project which is another plugin which lets you easily cross compile against JavaScript JVM and native and it's based on previous work by Scala GL guys to do a cross project against JVM and GS but now it's extended to support all platforms this infrastructure will also be used in Scala GS as official way to the cross project started from Scala GS 1.0 which is in development right now so next point is is interoperability and what I mean interoperability I mean drop with native code and so has anyone here used Jenai before can you raise your hand keep your hand if you liked it okay no hands good so you know it's like it takes out of ceremony to call a seagull from JVM and when I say a lot I mean a lot so here's just a rough comparison of what you would need to do to call method foo and see which takes the pointer and doesn't and does something faithful it basically this simple so you need to import our magic impersonally which provides stuff like a text earn em but R and n pointer of T but otherwise it's just a simple scholar object which just have a single message signature and it designers extern and it's all you need to do the call method foo and it should not be more difficult than that you should not be obliged to write 10 layers of wrappers to call a simple function that's basically it and then took the code you just say you allocate memory through C malloc and then you call it with this sound very straightforward scholars index there is no C code there is no like wrappers which know not to need to speak with it and you can call it this basic as simple that to make it work we provide a bit of like low-level types and kind of like language extensions I would say almost because it's ecology a VM doesn't support any of this sensory interrupt stuff this part of API is a bit of like in experimentation and development we're constantly trying to refine make it even simpler than that I think we're quite happy with extern semantics but I struggle the way structs and race works might be changed a bit but the main kind of core idea is we want to expose low-level a parts of your machine language unchanged with same semantics than C we don't want you to have to go through hoops to write low-level code because sometimes you have to sometimes GC performance just doesn't scale like on giant Apes it just a few well-known problems which are just not solved right now advanced languages like garbage collection unlike on very complicated is a very open question right now and of course sometimes you just need to use that library which is really good from Siad it should be easy it shouldn't require you to write horrible genetic code and of course all of this has like no performance all right so the calls to see have the same cost as calls in T ok um and I I think last a bullet point for today is predictable garbage collection so when I mean predictable I don't mean necessarily like Steggles Artest I mean you should understand when it happens and it should be predictable and very easy to reason about so right now we have three different strategies for garbage collection so the first one is called boy MCC and that's what we've been having for all all of the time this is a standard garbage collection at will dependent as library then we have something called no DC or like native GC noun and it's basically an option to completely turn off the garbage collector if you have enough memory for your app and you don't want to worry about performance of garbage collector and then we have a new sensor thing which is called a mix and I'm going to talk about it soon so when DC was our first garbage collector we didn't develop it it was there from before and was originally designed as garbage collections to be plugged into C C++ environments so that's a very simple API very easy to use a language implementer but it it's performance is a bit lacking so we put it quite a bit of benchmarks discs on it so every single bar here is a benchmark so right now all of them are like one it means like Jerusalem a line because you know which other baseline how to compare two things so what do you can parry with so the thing we did to understand the cost of GC is called no GC so no GC is a setting to completely turn up garbage collection and what it does it basically provides dummy GC implementation we just allocate some and never freeze so if you have enough memory or if your app is just doesn't delegate much or if you haven't Ain living requirements I've seen some people do that actually on JVM proper to basically forked JVM and do a GC doesn't have any overhead so for some kind of like super sensitive super latency sensitive apps you want that and of course it has zero overhead because there is no garbage collection in just only allocation and this is cool story from 1995 so there is this language called other have you ever heard of other it was like the system's language good the systems language before us like the safe systems language and you know there was a story by but this guy I can Mitchell and he was doing some consulting for for a company which was doing and like rocket missiles and you know she was trying to like he saw this app and like for rocket and it was actually leaking memory a lot and he was trying to figure out how would they even like support that you know doesn't make any sense and when he asked like the main guy like what was going on like this part looks memory and she answered yeah it looks memory it's fine we exactly as rate of memory leakage and by the time it explodes it's like it has enough female yeah and when yes ultimately is getting a garbage collection exactly it's like ultimate form of garbage collection and the main reason why we did is to have a baseline for our kind of like to understand codes of GC and this basically kind of the performance we saw it would our distant receives very slow and when I say very slow I mean sometimes it gets to up to five times floors no GC which is very bad I mean it was like we knew it with that approximate average across all the benchmark throughout two explorers in LG C which is also what we expected before on empirical evaluation of objects high performance based on profiles and we you know obviously it was not good so this kind of performance like five times no disease like not good so we had to do something better right so we developed our own artisanal crafted garbage collector based on prior work by Stephen Blackburn and Katherine McKinley throughout this paper called a mix and Mark kruzan garbage collector Lola and it's like actually an excellent paper it's like one of the best papers on garbage detection ever in years and it presented a very simple idea of Mark region garbage collector which is not something anyone else has because it's like from 2008 most of production rated DC's are based on research from late 90s and like early 2000 approximately since kind of you buy GC a standards like thousand eight is new and we basically just implement that idea we didn't do anything super insanely veterans of this we just took whatever the head and based on under finance we did something very similar and the performance we got was very nice so this work was done by Lucas kallenberger so all of the credits for amazing performance of our new collector go to him so as you see like blue one is a new collector and red one is a old one it's typically like very fast it's like around 20% slower than no GC on average and we probably can do better still without like doing something completely crazy like generational GC so it makes it as a concept and we managed to have a reasonable implantation that one of the main benefits where it works so much better is because the previous one was conservative it has less information to work with this one is precise and it also has a better underlined digit strategy we also tried implementing a single generation marketing trip and it was quite a bit slower than that all this like an experimentation work work was done by Lucas and he did a great job and now the predictable part is right I had not just like fastest garbage - predictable so now here to charge the set it has on X Y you have iteration number and basically you can imagine this as an HTTP app taking requests right so it's like takes HTTP requested is great some garbage and the new one and you and anyone and here we have like a performance which is like y-axis is basically number of cycles it took to perform a perform the action so as you can see once you go past initial like hips eyes growing induced slow down it gets very very stable performance with minor hiccup but overall it's like it's very very stable this very predictable post time so ramble if you were really scared of post times you could have like given enough memory and made sure you it only triggers when you're not actually responding to GC which is kind of nice because the performance without GT is basically the same as no GC as you can see so now GC is not lowest one which is basically as good as it can be without garbage collector and when it doesn't DC basically is at that point and on top you have boi-ing C which is our previous one and it C it's very noisy it's like all over the place there's quite a bit of variation you never know when it's going to hit here is one more where the operation of from Boehm is quite a bit worse and you see like GC cost can be quite big for boy and well on MX the Green Line it's very very stable and one more so needless to say like Green Line is always much faster than blue one right it just barely any higher than no GC which is typically like 10 to 20% overhead so why it's number of cycles it's basically less is better and X is iteration number cool yeah so this was like a very brief introduction unto like wide area stuff we have to learn a bit more about Interop resistant iceberg from Scala days called hands-on scala native by Guillaume and Martin it basically walks through creating a very simple app which use Interop and just does some simple term you eye thing and then we have a very detailed talk on garbage collection by me and Lucas and it basically gives you a bit more story towards a mix and how we arrived upon MX I think both of those should be available on YouTube now and yeah I think they are then you have our official website and Docs which is color a bit or this is a place to see what the current release book weathers later ducks then yeah we have a Twitter account where we announce every single release and some other stuff like lights up going on around and that's about it thanks oh yeah stressful time so I know in-game initially reflection so identity for reflection the very good question so you can think of it as every single type basically every single object in memory has a type pointer does it make sense the type pointer is something like a place that has we tables like class ID class name and all these other stuff basically things we used to support different types of virtual dispatch and for every class which implements least one structural type which was observed during whole completion we have a something called perfect hash map this is like pre computed pre specialized hash map which does a lookup given a message ID what kind of result I would get and essentially it just basically a hash map so it's a hash map look up and it's quite a bit faster than reflection because it's very specialized for a list of known supporter structural types and what's the possible implementation so it's kind of small in memory and in terms of binary size and it's kind of fast it's probably like around like up to six times slower than the normal virtual calls Ruby table because it has quite a bit of interaction to make hash table thing work we have an idea how to make sanctuary up to par on speed with normal virtual codes which we don't see on JVM actually but it's not done yet so I could just research stuff yeah yeah what does it work yeah reflection has basically you can do get class get name you can do some other like very simple queries on process you cannot do get field you cannot do get method call it you cannot do constructor make an instance so this doesn't work sometimes it might work some of this stuff with blender support and the only thing we cannot support by design it class loading so essentially all of the like the list of available classes is fixed statically and this kind of like constrained by the ahead of time part because we do tree shaking we get a list of all possible ripple classes and that's basically it right if your classes outside of this list you will not be able to find it effectively but everything else is possible to support probably is going to be like obtained if we ever support it because it will introduce more cost for binary sites because for every class you will need to store all this metadata like a place of every field like in memory and like offsets and I know list of all fields list of all methods names types and so on so forth so it will take more binary sites so I don't think we'll ever have it enabled by default but it's likely that we're going to have some kind of obtained for people who really need it but again it has to be like no class logging basically so you have to statically know what you want so what else doesn't work is that developer is pretty much like working for us so lots of stuff works that section is very cool like they just basing with good marriages highly oh so we have like almost complete implementation of Java IO file IO and Java and IO file file IO which was a giant piece of work by Martin to him from Scala Center and it was very impressive some things are just not available at all at the moment like sockets are still basically in development branch we haven't shaped them yet otherwise language basically I don't think we have any like Scala language problems we typically have library problems basically main area like reflection results basically library problem even though it does need some compiler support language wise I think we're pretty well covered and like I mean zero point one which was enlarged its blocker was to support every single language feature so it's basically kind of fun and we are at the Roasterie now so yeah yeah right i-94 recap the libraries we try like all the time it's basically our main driver towards implementing more Java library we don't just randomly implement stuff because we have other stuff to do right so we need to find parts which actually people are used by libraries so we try to compile stuff it always goes all the way to IR it's basically like a given but going past linker means we have to have all the libraries it depends on right and sometimes some parts of Java libraries are not there so we file issues like linking errors for library X and we try this all the time basically pure functional libraries like Scala that just work so time post-college and all of its like tests which don't depend on parts of Java we don't have which is like all the core parts are already published Tucson type for native so you can just use them some other libraries like starting to slowly publish stuff for native we are working towards better files like all the school library for nicer file IO to work it's based on an IO file the quite a few libraries we're actively trying to basically basically or work on their libraries biased towards existing libraries I think latest one we did was to test and flash bars from like Hawaii so it's gone pretty well if there is there any interest in using something like rats for a soda so to rust so why don't you the basic question was why don't we use ownership so ownership is cooling if you build language around it it's almost impossible data to garbage collect language later I mean I'm not saying it's not possible it just how it's already a big language it might be cool research project to try this but I would I would probably think that the result would be so complicated you don't we you won't want to use it and I'm pretty confident that for most apps garbage collection is really not a bottleneck with a mix definitely not true for all for all apps like on giant hips we have the same problems at JVM so the post times will get so it's a trace in garbage collector you will get post time or proportional to the hip size so if you have giant hips you'll have proportional post time so we haven't solved it yet zero not completely well-known but like there is active research on basic conduit puzzlers GC we are following that and if there's something reasonable we can implement we'll probably do that the garbage collection is not perfect but at the same time rust approach is not perfect either because of the complexity in language so I hope this answers your question yep do you see something like movie very I'm cheating difficult generalities garbage collection integration like interaction with thread this very well studied so we know how it works how it supposed to work we don't have it implemented because we don't have tried so it wasn't a person concern yet but it's a very standard technique you do save points you wait also I like to stop at a point many GC then you read them so it's it's extremely like well studied approach so it's not like low policies that exert some solutions but nobody has officially sold it yet I mean a zoo claims to have a Fisher's orbit but their solution costs like thousands of dollars per CPU so so basically there are no open to open open solutions they know which are like reasonable to implement a particular basically what one of the hot areas in in research right now is trying to do a very low position on very giant hips so we're interested in that thing but monitoring is easy so it's like that's not good so it's a well side problem as soon as we have threads our GC will work with it hello world is two megabytes if you don't strip debug info like if you want stack traitors and like 1.4 1.5 if you strip debug info so if you don't want base if you are fine without stack traces it will babies yeah so basic with tree shaking part is it's doing quite a lot so it would have been way bigger otherwise so like way bigger like slam libraries in megabytes so it's it's the way like in 10 2 megabyte so very slowly very slowly because start like standard status 4,000 methods and 100 classes so if you add 4,000 methods more it will be 4 megabytes basically approximately so it's like it's like very slow growth I think the biggest a binary I've seen was around 10 megabytes and had like 20,000 methods something like so basically approximate numbers so it's all proportional to the size of the whole world kind of view and we can save a lot from that and it hasn't been a person issue nobody really complained you can also use stuff like binary compressors and they're very good and they shrink our binaries to like hundreds of kilobytes if you really care about that about the size for some reason it will hurt you a business in start time or if you want to just distribute you can zip it will also shrink it quite a bit that has appeared to Simon I'm sorry I'm wrong so performance measure okay so how does this compare to C++ so we have this low-level language we have have high low level language if you are happy to write low level code like in C++ you would get a level performance if you're not to carefully use high level features you can shoot yourself in the foot performance wise so there are few places which where we can easily explode in terms of performance slow down like for example boxing is quite disproportionately slower compared to JVM right now we have a solution in the works it's not solved yet it's really slow right now in the boxing part using this guy's EE here so that is a new front-end it's basically not really I mean so that linker is basically so if we go to this original picture that linker is basically a fork of front-end compiler to do some optimizations before anything happens but as far as I can tell we have a prototype for doggy but it's not officially supported yet because it's a bit hard like both cognitive and dodgy are kind of like very fast moving so it was a bit hard to kind of keep them and think we had a prototype it's just not update with either Scala native or dotty so this will probably change once alive and low destabilize a bit but essentially that linker is like a fork here and just do a bit of more optimization before we go to colonize how it's going to look like as far as I know there have been some attempts to do specialization which might solve boxing but it's like working for us so it's yeah so our solution like the prolong this specialization is that it double cave code so you will explode in terms of code size if you are not careful just like in C++ and you will explode in terms of compile time so it's not ultimate solution as far as I can tell there is no solution which we can do but you cannot do on JVM which is called smile which is a small integer optimization and basically means for small integers and when I say small I mean less than it fits and service tree bits you can pack it into pointers and then it just you don't allocate you just mask it into a pointer and then you unmask it back so basically box and box is free I think that's probably what we're going to do like medium term because that you don't have to duplicate code with mice you have to duplicate codes with specialization so we're kind of scared of specialization I think force kind of because exponential blow-up of code size means exponential blow-up and come in couple times and we've seen how this worked out in C++ right not well yeah well the big probably should have actually very mysterious person search is platforms of general slightly different versions so you have a lot of differences between systems right so you generally I assume that so far that hasn't been a major house dealership it is mostly things like seeing sausage is very common and so they're actually people reported to work on different plastics compatible systems we haven't had problems yet we might get problems because of that beer is super careful and always talking about editor problem that a temple plastics is defined in terms of syntactical compatibility it's not defined in terms of binary symbols in the final binary so we go a long way to make carefully sure it doesn't break for if you're for example if you're I know STD out it's not actually called the city out but it's something else already hood hidden by macro right we can have account to that so it's like it's been tried on - we had CI for Linux Mac which have very different POSIX implementations for like trusting like very different and and people try it on free/busy we haven't we don't have C on previously I cannot guarantee it works but I think like no one complained so far we have one very brave person trying I hope he keeps struggling a doing a port for Windows and it's been a I'm going to get that PR like super suit because like I really want Windows to happen their stuff gets to very tricky it's like plastics is not a good sign on Windows right so it's it's like that's really hard yeah a little like all change effects or yes and when if you earlier what about the community and you have you go so for in terms of like uterus we don't know for sure we track the downloads counts and we get like 100 downloads in a bad day and like do the 300 on bed on a good day so a release date is like opens up mm so I don't really know how much ears we get but it's like hot Hannah download to the plug-in jar I cried petite which we used to track basically probably more than hundred people I would assume I mean I really don't know so I we don't have like you know a form to track and we don't track yourself I just in terms of downloads basically those are the numbers and you can follow those I think I've been try and our organization you can just open a plug-in and so quite a few people are trying to publish stuff in terms of community like all this existing projects the number is slowly growing it's like you know one project at a time you know it's like it only takes like 10 projects to exponentially grow you know at the state but I think we have like around like 15 ish kind of Flyboys published at smelly things slowly going growing our time and we implement more and more java library so download library blocker here for goodson projects but yep we seen you a new stuff publish every day and we have lots of activity on our official guitar touch room which is the official place to hang out if you're interested in the project I hope this answer your question because I have no idea like a proper answer any idea and you mark yeah that you showed like that you have any recommendations for a bridge to a nice olive oil try to wrap pointers in top as quickly as possible and not expose them as your official API the pointers and stuff is only meant for a drop it's not meant to be used everywhere all across your codebase you can I mean we're not going to stop you so we're all adults here so if you want to have like point or heavy api's and like very level API you can do that I would advise to drop stuff into managed objects such as possibly basically the first layer of your interaction should just drop everything to manage object which carefully freeze everything as you need it we also have something called zones which automatically free memory without you having to worry about it so you say zone curly brace block and then you can allocate there and then freeze automatically this super convenient for dealing with use cases when you need to allocate themself or C called C and then you don't use anymore kind of a temporary scratchpad memory area and you will not have to free manually unlike with malloc and free and I would I would advise the basically that's what we are doing in Java library just quickly wrap stuff and to manage objects as fast as possible unless you really have to keep on - sure friends laughing this is also possible yeah here's heavy duty in real with collaborations do very much get me started in Scala collection secession is calculations are hard like it takes sort of a lot of effort to compile them efficiently and some in some pathological cases around books and virtual dispatch we're slower on collections like quite a bit slower because if you have like just twice slow jump in quadratic loop you get like ways we hire them twice slow down over all right so in some cases we've seen I can't slow down in very pathological cases but it's basically just a performance box we are working on right now those calculations are very very original and very high-level style Scala like extremely high level without all different direction it's a very awesome challenge to fight this interaction to make it like well tonight's in the final code you gave it an interesting day I think we should just optimize them better I think we don't want people to write code differently it's like people write very high level code it's our at our job to optimize it well sociology is has shown us it is doable it just takes all that effort basically with you know was heavy enough in line in with heavy enough optimizations it's perfectly doable so I don't think we should tell people how to write code at basically our job I'm going about 2015 a strange rule that a saying that was talking about like Latin America and also Elvir was mentioned and so say general like complete with it well it's so much effort we could compile to LLVM but there's all the library elements like youth development is in any way related to the like okay I'm not exactly sure what you mean but there was a previous attempt at Scala LLVM compiler which was called skull Olivia and that one didn't go very far so it had a bit simpler architecture it will emit a lot of files right from a front-end and you cannot do that much if you do that because for example in Scala most mess is a virtual if you compile everything is virtual cause it's going to be very slow we kind of fix this like more or less an out and you really like LLVM doesn't like if if if there is a high level feature in your language which lbm doesn't have which mode like going to college are plenty of those it means lv n roll' optimize it so like virtual dispatch is not lv Eames business it's your business like boxing is not VMs business a few other things basically and it's our job like to make sure we we produce code a similar not to C++ for it works fast because you cannot just leave we omit LVM this is not gonna work basically previous approach just didn't go far enough and it just takes way more effort to do it to go this way so yeah it's like out of effort so but right now it's like the compiler work is like very stable and we were just working on evolutionary improvements there is really nothing super magically completely different we need to do anymore so just basically evolutionary improvements of intro evolutionary improvements on performance and so on so forth I think the design we picked and the design we stole from Scala GS works just perfectly for this yeah you hear where you will see one goes cool question and what they want to see 100 zero so I want to see in networking threads for sure which is probably waste nor is one with the zero but don't don't take my word lines I want to see Windows support I really want like this struggle you know this struggle can have a persevere to make summative work in Windows I want to see a major apps and frameworks working on colonize essentially I'm not sure if people will be interested into Porthos but a gif community's ever interested in poor in times like akka just as soon as we have enough July birds to be really cool if someone does it I mean it's not up it's not within the scope of our project support everyone code because typically you don't who even do need to do much to change the builds once we implemented after library so this is kind of like our mindset there really hope most of the major kind of like successful projects the skylark system would work on holidays probably like oh eight eight is it's going to be a very good one to zero all this happens during my leisure I know it's like three months old in terms of like first release maybe not maybe yes I know this is like three or four months also again cool then you could very easily fall into some good for mind it's like more jello libraries a more general library story like better can more compatible innovation of Java libraries and talents of course so if it's like in one of the packages I mentioned our it's kind of like our responsibility to call it square with it so language ill IO and IO net like I'm not saying we're going to implement all of it but the parts which people use we're open to objective clad in them and some of the parts are just probably not going to happen like HTTP client on collider it's not going to happen for example so sounds like açaí HTTP Weser does it on the third party site I'd probably be a better idea but basically if it's a reasonable thing with those packages it's our job and once it's done the language is fully supported so it's it's actually question of language anymore it's not the question of having enough environment for a library that you want to build to work yeah you actually implement a library it doesn't cause so there are some in some cases when C stuff has macros we define like a wrapper function in C which is like one line of code just rub a macro and expose it at a constant or expose it as a helper method so it just see code we have it's very simple the only non-trivial C code we have is a mxv see like the our new one apart from that like ninety more than 90 percent of code base is color I would probably maybe even more than 90 percent maybe more like 95 percent and all of the Java libraries almost purest color so it's like very very reasonable code you would probably write just so all the Java libraries just cost caustic bindings most of the times basically that's how we do it just normal code yep very everyone ecology has when you're reading I'm gonna review okay so the question was can we share code with kircheis in fact our Java library information started this way so we started basically for ecology as Terran library the problems culture is that we have very different environments we kind of based on so stuff like files and sockets doesn't exist in a JavaScript like L so like we can now share those and also some things we don't exist in Scala if like trample regular expressions we implemented ourselves and ecology I just rubbed a JavaScript regular expression this kinda stuff right so it's not always you can share and actually if you just remove all of this like various parts it's going to be very complicated built to make it alter like kind of only parts which make sense to share but a lot of our initial Java library was basic with colleges Java library and it's probably one of the reasons we could pull up 0.1 chosen because it's basically one is it like library stories probably the hardest part of this project not a compiler yeah very tired at library about or penalize you so right now it can only emit particles so we cannot emit native libraries we have a feature request and so many people requested that it's actually happening so it's basically compiling Scala native code to like SL or dial upon max it is what you mean yep it happening so it's like probably zero for happening like next week happening so so I will say we have a program that the candle and travel under my name okay and soon as we have all the Jawa and I will walk around it's a work PDF working this colony is essentially to transfer any into yeah so Nettie is one of the things which are like giant blockers for a lot of projects because Nettie is a giant IO library which doesn't use any oh by the way it's a as insane amount of j'ni code and then 10 ml the facility code which actually like wraps underlying system low-level IO api's so the question is heck can you pour it to just life we probably can but I would say it would make sense for someone to come up with our own equivalent of Nettie because you can call all the soul level api's directly I would hope like aqua HTTP is one thing kind of I've been having in mind for a long time like once we have enough to our library okay should be seems to be so contained enough for us to just work and maybe building on like HTTP it's better idea then we implement everything from scratch likely like doing like native from scratch yeah yes in writing Java Scala research like we can do this totally we're like very scared of Oracle we don't want to implement ah we don't implement Java we only implement scarlet language we only compile Scala files we don't support anything apart from composite color files yeah cool I think that's about it thanks for coming [Applause] [Music]