Ten Things You Can Do With GraalVM - Oleg Šelajev

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
good morning I'm really happy to see all of you here and we're gonna talk today about granham a high performance polyglot virtual machine and this will be a very practical session so we gonna just cover a very basic information about architecture and components and things just to get you all sorted to understand what it is and what it can offer and then we'll dive straight into actual demos which I hope they all will work my name is Alex life and I come from Estonia from a small town of Tartu and I'm a developer advocate for the gravi em team working for or collapse or collapse is the research and development facility department with an oracle and its goal its mission is to research and produce academic research about what's possible in in computer science and software engineering and then convert those findings into hopefully successful products for the whole community well incidentally for Oracle so Graham is one of those products that was in the research for at least seven years now and lately it's becoming making its move from purely academic thing towards being an industrial project if you have any questions but you are not ready to ask them where you come up with questions later you can find me on Twitter and you can ping me and I will be happy to answer all their questions before we start doing any technical discussions please do not make any fort on business decisions on the contents of this presentation thank you so growl VM growl iam as I said is a high-performance polyglot embeddable virtual machine it seems a little bit that there is just a bunch of keywords slapped together to make something as interesting as possible I just lacks machine learning and blockchain but this is true and on a series of examples today we're going to go through and see how growl vm and you code in different languages very efficiently how it can allow you to interrupt between different programming languages and so on so everything that we gonna cover here most of that is based on the blog post by Chris Eaton he's a elite of Ruby project foreground am so gravy I'm currently can run a number of languages JVM based languages genre included Scala included cotton include and so on but it also can run other languages like JavaScript Ruby so Chris is the lead of the Ruby team and well he's also an excellent writer so he wrote that blog post and we gonna go through most of that if you want to follow you or if you want to try it at home you can find that you can find all the examples there and move on so without further ado let's let's see what groveling can offer you and let's be very practical about that so what you can do you can first you can download that you can obtain that graph Veeam it's a package right it's a distribution of the virtual machine kind of like Java you can download that you obtain that on your machine and then you can experiment with it so I downloaded mine into this directory here you can see that it is released candidate 2 and of wonder though which signals the world that grow VM is ready to be released very soon into the actual production use with wonder though and what we would like as a team currently for the community tried out to figure out how you would like to use it and if you find any features that are lacking or if you find any issues to report to us that's why we left ourselves a little bit room to to figure out things before one at all so you download that you unzip this package what do you get you get a very sensible thing that kind of looks Cyril - JDK you can see that you have your Java executable and your JavaScript executable and you know the executable your interpreter for LLVM why witcher's and a bunch of things so what it can do it's gaudium is based on the JVM on the normal open JDK built currently supporting version 1.8 you can also build certain components of draw them for other things but it's just normal Java so if you do Java version you can see that dravyam can run simple Java programs you can also run more comprehensive Java program so I have this random demo of cotton interactive web application and yeah I can run that with my grow em so let me just Gradle it I will build it and then we'll run it and there are often confusion but growl diem is a fully featured JVM implementation based on the open JDK builds so everything that your normal Java can run gravia will be able to run as well one of the most interesting components with Indra VM running in the JVM mode is the compiler so the main difference from the normal JDK is for running Java programs is that wrothian features the gnu compiler called growl uh-uh and that compiler is really great for optimizing your code so you can see my application started here let's see what what it offers me so if I just open this application whoa it serves me a picture of of the architecture what gravan can do I just didn't want to do that as a slide so growl damn what it can offer you currently it can offer you running multiple languages Java jvm languages scholar cutting JavaScript how many of you write JavaScript more or less every week not many so I assume you're all back and engineers just doing distributed systems and hard core things excellent you can also run Ruby our we have a python implementation coming up and shaping nicely very interesting that it can also run native languages so all your C C++ or libraries that you always wanted to use through Java but can I didn't want to mess with J and I you can run that different and in the middle there is Grove VM and it what it does it transforms the interpreters from those languages into very efficient compilers for the machine code so you take those languages and it can run them very fast the program's written them very fast because it compiles them to machine code very efficiently on top of that it can run in multiple environments so it can run in the JVM mode on the open JDK it can run as a node application if you are writing node applications and you can leverage all those languages it can run and is embedded into vertical database so you can run your JavaScript code inside the database for example if you don't want to write sort procedures as PL sequel you can do that the my sequel integration is coming up I don't think it's public yet but it will be public in the upcoming weeks months depending on certain conditions and it can also compile your Java programs some of them not all the Java programs but it compile them into native executables you can run grow them and you can obtain from your Java program you can obtain an executable blob that you can put into your container and run as a standalone native image making Java very much more interesting for for example cloud deployments or microservices where you would like to reduce the size and memory overhead and everything so it's very versatile how does how does traveling achieve that well it's a layered cake less everything in computer science and software engineering there are layers of things the more layers you get the more functionality you get so if you look at that architecture of ground VM and there is a different picture served by the same content web application running on ground M there are a number of layers so at the bottom as the platform dravyam employs normal java hotspot virtual machine the Grove VM team provides certain binaries that he can download and you can run easily on your machine ever also the best part of this project because I see a couple of Concerned people here it's fully open sourced all the components foreground VM open source the source code available on guitar the license for the core components is GPL two plus class pass exception the same as open JDK the license for the language implementations is even more permissive typically we will be universal permissive license or some of them are under eclipse public license something that so those components you can touch you can download you can stir the code if you want you can build them and you can improve them and we certainly hope that the community will at least consider contributing so at the bottom of browse iam its hotspot VM the most important part of this whole gravettian project as I said is the compiler so the compiler integrates with the JVM using the JVM CI gobhi stands for Java Virtual Machine compiler interface right it was a feature added in Java 9 to allow developers specify a third-party compiler implementation to integrate with the JVM so for our JDK 8 bit based builds we backwards JVM CI and through this JVM site through the official channel how to integrate with the JVM as a compiler ground compiler sits there and JVM passes it the bytecode till to optimize and drown compiler looks at that bytecode and produces machine code how successfully it produces the machine code we'll see in a minute so through that machinery through being able to just take the bytecode and output the machine code grah VM can run jvm languages right everything that compiles to JVM a bytecode can t run Java Scala : etc now for other languages it's a little bit more harder to implement so typically an approach would be to take the language and to produce a compiler from the language to the Java bytecode this is the way how previously we've implemented JVM based languages but it is hurting today you need to know the semantics of the language you need to figure out how to compile specific statements to the bytecode if your language features constructs which are not really directly translatable to the bytecode if you want which is not similar to Java it's kind of hard to do and hard to maintain especially if your language runs forward so what growl VM offers it offers you a framework for implementing managed languages called truffle makes me hungry a little bit every time I hear truffle it's a framework that offers you a jar file with a certain API with a certain number of annotations and what you as language implementer have to do is you need to create an interpreter for your language right you need to figure out how to parse the program into the abstract syntax tree so just the normal tree of operations where you would go through that tree in the valid the children knows first and then the parent node kind of like the first step when you implement a language you would do that and with gravia this is all you have to do the growl Jam with truffle will take that tree will take your interpreter look at that gather the information and run it and compile that into very efficient machine code so through that machinery we've implemented javascript our Ruby and Python JavaScript compatibility is currently at 99% with ACMA script 2017 which is a fairly recent standard I think they have the 2018 coming up and we will support that reusing so what else on top of that truffle framework for the interpreters we've implemented the interpreter for LLVM bit code LLVM is the compiler tool chain right it is a project that was created to you to take you were native programs in C C++ and so on transform them into this intro intermediate representation the bit code can is similar to Java bytecode to then have the compiler that can optimize that and compiled to native code right so this is the C project or C++ native programming languages project so what we've done we've implemented the interpreter for the bit code so with that interpreter we can run 11 bit code on top of the JVM surprisingly it's really fast our measurement I think last year's summer were the following we could run Java programs based on the benchmarks a couple percent faster than a hot spot we could run Skylab programs approximately 20 25 % faster and I think it's improved recently even more Ruby are the performance boost of the charts because the default implementations are not really optimized for performance in general if you want a platform q2 to be very performant to run fast you need to invest very many effort and money and hours in to make it as fast so javascript implementation currently we are approximately at like 85 90 % of speed of v8 and for example I think that is five to maybe six eight times faster than Nass word depending on benchmark but we are challenging the actual default implementations for the virtual machines for those languages this is not yet one that hope so it will improve the team is committed to make ground MD fastest virtual machine for all the languages it supports and I think we will get there then speed of native interpreter is approximately at 85 90 % of native code as well which is mind-blowing so let's stop looking at this freak picture and let's go and see how that code operates in action so what I have for you here I have a benchmark right when you want to see how fast the certain virtual machine is what you do you create benchmarks and this is by any means not a very the most scientific benchmark that you can come up with right it uses jmh so it kind of doesn't fall into certain traps for implementing micro benchmarks but what it does what it does essentially it takes in an array of integers and it streams it and it applies some operations on top of that so how many of you run Java 8 how many of run Java 9 and above in production that's a real hands dropped so this is a fairly typical code that you would write as a developer working with Java 8 right you will have your objects you will stream them you will use the stream API API implementations you will map things around and this is something that you can find in the user code what I will do now I will stop this application not to hog my resources and I will go into this different application different windows so if we look at the run no drowning because I would first want to run it without ground what you can see that I will use my normal Java and I will disable the gvi compiler so if you want to run your normal Java but you want to run it on JVM without any graph compilation happening you can disable the compiler the same way on modern more modern Java's for example jdk 10 you can type unlock experimental options - xx + use the Java compiler and you will be running a version of draw import it into open JDK sources like a snapshot of growl compiler with the stock JDK it's available in JDK 10 it's not the bleeding edge of the ground compiler that we are currently be gonna be running but it is a version of that so if we would like to experiment for your Java code it's literally a new running Java 10 not in production but somewhere don't experiment on your production this is not a wise thing to do but on your development machine it's one optionally so let me just run this while we are talking so it's a benchmark it will run currently it will run just with the normal hotspot C 1 C T compilers right the benchmark harness the micro benchmark harness will warm up our code so it will have to take a couple of seconds to run iterations of those methods and it will give numbers to us so currently we are measuring the time it takes for operation to finish so you can see that it it it runs for I think this benchmark runs for approximately 40 seconds and it runs a couple of iterations it uses jmh 1.21 which is the version where jmh developers added support for ground vm and kind of tested that it doesn't break the jamish assumptions at least in a very obvious ways so we use that support we run this benchmark you can see that to run one one instance of this operation it takes city approximately 185 nanoseconds per operation run so now I will run this with with just quality M so I will not use the disabling JVM share a compiler so if I run this with gram if you'll do the same thing but just with Grove veeam I will not show you the numbers let's look at the benchmark who thinks they can could have written code like that somewhere in their application okay yeah yeah decent code maybe not exactly manipulating integers but similar so now who thinks the best this bench work will run faster on Brown Veeam okay not many people I write I agree with that opinion JVM is a state-of-the-art virtual machine it's really fast a lot of effort to put into optimizing the compiler so who thinks it will be slower why would I show you benchmarks which are slower on Gran vía so it would be faster the question is now how much who thinks it'll be faster like 5% okay who thinks it will be faster 20% two times faster I mean you're optimists it's a JVM right it's really not that easy to be that much faster 1/2 percent is considered a significant improvement in the JVM performance right so let's look at the numbers so with this on this benchmark running with brow VM we can see that one iteration of that operation takes approximately 10 nanoseconds for operation 185 without brow 10 this is what 18 times faster this is not a scientific benchmark right it's running on my Mac which is overloaded with other random things running it's also a Mac it's not like unless you run your production environments on the Mac don't take this number super seriously at the same time you have seen that 18 times performance boost is possible on the code that you could have written for your day-to-day projects so if this doesn't pick your interest I should work hard but it should pick your interest like we can run Java code significantly faster snippets of those right on some code the improvement will not be that much but on some code it could be significant if you get like 30% improvement and you're running your production on in a cloud environment that is 30% of your cloud bill right it is 30% of throughput that you can not care about when you implement additional features to add value to your users right this is free stuff for for your performance things let me show you another example of this magnificent magnificent performer things why why it is so so great so we'll look at this look at this snippet of code I will not run this against the normal JDK but I would want to show you what grow VM can do for you and I talked about how it can implement those things a little bit so let me just run this and so if I run this blender blender yeah I on this with gravy em everything is good right it just what it does what the code does here is it just initializes a color plane and cube and it manipulates and crunches numbers and you can see the results okay make it larger yeah you can see the results and it runs approximately 500 milliseconds for an iteration of of the loops which goes through the color plane and does some color manipulation right so one of the things that dois compiler excels at is high level optimizations right so it necessarily looks at the low level bytecode patterns and and and says oh I see string buffer append up and append and I will optimize that into machine code here's the the thing but it also has a number of high level optimizations one of them is the practical escape analysis what growl is excellent at is at looking at the code and saying you know what this object cannot escape to the main memory this is my local object and thus it doesn't have to initialize the full objects and it doesn't have to produce garbage on on the memory so it lowers the prep memory pressure what I will do now I will introduce a condition here if x equals y and y equals that word z as some people put it all save it right so now what we did we just do the same work with the color so we do the same thing but we only assign that color back to our memory right back to our plain of colors in this certain situation where we are on the main diagonal right so for the most part we don't do anything with that color but for some some objects we do need to put it memory so this will not lead to significant improvement of performance on on the normal CT compiler because it still needs to do all the operations so we only skip one assignment right if we run this with growl remember 500 milliseconds and the result is that with this small change of code which albeit then this is a functional different program right but it optimizes it into almost nothing so what happens is that draw compiler looks at this code and produces code like this it puts the heavy computation under the conditional and it can do that much better than the normal hotspot compiler so this is one of the optimizations which gives such a performance boost to the programs running on the JVM if you are running programs written in other jvm languages not Java you will probably enjoy a much better boost on average the reason for that is because CTD and Java programs they intimately know each other right they were created through 20 years of history side by side and they know how to optimize each other Java code heavily optimized knows about si tu CT knows about the pattern and Java code other jvm languages not so much they produce different patterns of bytecode and sometimes they're hard to optimize using the conventional Java compiler so if you're running Java code this should be enough to make you at least tried download look at that subscribe to our mailing list maybe at least the least amount of her freaky that you can put into now this is not everything it can do let's see that you can take what you can do you can take certain programs and you can compile them into the native executables let me show you this fascinating java class this directory what it does it's a normal class it's a Java class what it does it manipulates some file system so it takes an argument and it walks the file tree and it collects some information about files and it trains that information back to you right so what drive am can do for you it can create a native image off of your program so there is a native image utility inside the growl vm distribution and you just feed your java program to it you package a self-contained fat jar of your application or you provide the class pass what it does let me run it what it does it does the the whole analysis of which classes are accessible from your program it looks which classes are initialized who refers to who and then it compiles that into an executable executable thing it takes a little bit of time especially on the poor macbook it can compile things on on linux it can compile into a statically linked executable so you just have one blob that includes everything so you can use it in a empty docker container for example but the best part of this so the startup of the application compile to foreign to a native image will be much faster the memory over half of the runtime will be much lower right so now we have this native this list dear native executable so it walks the current file path and inference the information if I time this hundred time this if I time this you can see that it starts in absolutely no time I can also run it using the normal Java and it will it will take some time to initialize the JVM and it might be not such such a such a large time for this small program but it can be a significant piece of time with the native image it is much faster so currently how it works there is a thing called substrate vm a special vm implemented in Java so you can look at the source code and if you read Java you will understand it so the VM is implemented it produces its it has its own implementation of the garbage collection which is a generational Challenger it has its own implementation of the code Cassius and and a thread shuttling and every everything that JVM has to provide as a virtual machine to this thing and it can leverage the growl compiler to compile into native executable what it also can do since it compiles into native executable it can be used to be embedded into your in your native applications or if you just talk about Java to be embedded in your java applications so you can enhance your java applications with a very fast JavaScript or Python or R where you can embed it in a native application so the current implementation has some limitations so not all Java programs can be compiled this way into native executables so why I'm saying is this because if you will be super excited about that and then you find out that your favorite string application currency doesn't built into native executable you get kind of sad but we are working on that so currently the things that compiled the biggest obstacle is dynamic class loading because when you are native executable it's not so easy to find in dynamic load classes unless you re implement the whole JVM which is not good the goal here so dynamic class loading is currently not working at runtime everything else is supported to a certain extent so reflection you need some configuration gni you need some configuration but you can overcome that we've compiled native applications to static images we've compiled some I know that some Spring Framework applications can be compiled to native images I'll bite note the default one once from kickstart your skull a C compiler who writes Scala I have great news for you first draw-game can run your Scala code approximately 30% faster it can also run your Scala C faster so you won't be waiting for your code to compile so much and then you can also compile the Scala see into native image which will be starting up faster you can also compile your Java C into negative image so the right of nontrivial Java programs that can be compiled to native image like that and then you can expect great speed up for for your startup and don't never ever had think about the possibilities it offers for your cloud deployments let's not talk about that anymore native executables who are hungry let's talk about polyglot so I will run my application application here it's a node application I will show you the code in a minute so you can see that I'm starting my node executable and I say that I want to run on the JVM and in the polyglot setting and my server what the server application offers you what server yes like that right here server application what is this this is a normal JavaScript application it requires some node modules it creates the web application it also uses some Java types so if you are if you would like to use your Java types in a dynamic program and if you're writing Java for living probably you have libraries that you want to use then he can do that so and then it binds on a certain port and it does text manipulation it uses normal JavaScript then it adds some Java computation to the to the thing using Java strands library classes for example here a big integer and then it does evaluation of our code our is the code for machine learning food data science for data visualization so if you need to visualize something and you don't want to figure out how to do that from Java you can use our from your program and it produces some SVG image and it prints it back into your into your things so now if I open this let me open this I hope it's for three thousand oh my god this is so bad I need to talk to you about this magnificent thing called weight which note I will do this and I will run this different command here - why is JVM - my less polyglot server GS huh sorry pass excellent so when you download the ground distribution right what's built in inside you have Java by default you have JavaScript by default you have LLVM interviewer by default right so you can run those things out of the box with just downloading one distribution for other languages which currently have a little bit less refined support and compatibility right so for example our compatibility is not 99% so we didn't put that into the main distribution that you download you have to install support through the languages it is one common line command away there is a utility called GU draw updater if you can see here where is this GU and you can do GU install Ruby or R and it will download the files from the internet and install them into your grand-am distribution so for some reason I didn't do that for our C to build but I know that it it's supposed to work on our salon where I did this so sorry about this confusion see you can have native reg acts just strip the LLVM Ruby unfold Ruby but not R so on the first time when you download this growl we'll need to compile the runtime library for your language support and and it will take a little bit of time like seconds running on the JVM but after that you can see that it is gonna run faster and faster and faster the same way it can optimize your Java code it can optimize the code in other languages so it will compile Java Script interactive it will compile your our code you can see that it redraws the plot of this fascinating SVG image here and it runs a single program so now you can have the power of the whole ecosystem of that software developers created not just Java so we are not talking about maven central which has everything a person could mean something like two hundred thousand libraries but also the whole power of npm node package manager is at your service they have half a million libraries there it could be a good thing it could be not the greatest thing ever but they have code there that does useful things so now what with draw them you can just use that code and glue it together to provide your business with additional value who are code or Python for machine learning the possibilities are endless if you are a little bit concerned that this code is not something that you would like to write in production because it's true writing code inside strings is not the best idea ever have no fear so what growl offers you it offers you a thing called growl SDK which comes with the API for polyglot programs so it gives you API and classes to work across the language boundaries in the consistent framework across old languages so for example this is my spring application right normal spring boot application what it does here it does fascinating things so it builds the context here as a basa as a beam it builds a context growl context which is the ground class from the or drive a polyglot package it builds it and it provides this context for evaluating languages as a beam so far so good then it uses that beam or wired into different beam function to get the plot function what it does it goes into the a certain resource plot dot our file and it evaluates that resource and it binds the result to the function don't just expose your functions as beans because give them names and things but this is a normal Deane and auto wires that into this function let's look at the plot that are this is a normal our code just defines the function it does some SVG implementation and and and and spring will automatic function and then inside your Java code you can just use that as normal you would just apply that you will pass Java object there you can call from our and JavaScript and Ruby in back into Java if you're interesting this application if it runs let me run this don't run blender run spring our application no this will not work if there is no art currently for ersity but it will work the same way it will print SVG to your browser screen so and this code looks much more manageable that's writing code inside strings who likes this code more than writing code inside strings excellent who didn't raise their hand are probably asleep because this is way better so valium brings the power of polyglot planes TT you one more thing one more thing one more thing very exciting thing not so much time but you can see it loads packages it also can load packages installed from normal things so from NPM and from your package repository what else it can do it's it's imagine dravyam sits between the languages and your runtime right so it's in the middle of the things it knows about the implementation of your language because you provide that with the interpreter for that so what it is the perfect opportunity to do it is a perfect opportunity to integrate tools that you want to use as a developer with draw them and automatically give support for all the supported languages so let me see if I can do this correctly this is a very complex operation I need to pass the double - inspect option here fantastic so now we're going to run the same node application with the debugger so we're going to use the chrome debugger you can also use the profiler and other things keep your memory consumption and you can see that it integrates with chrome debugger and you can do you can put breakpoints let me put a couple of breakpoints here let me also put a breakpoint here and then will trigger this this should be fascinating so we hit the breakpoint you can see we are in the JavaScript code currently right we have our call stack we have our local variables what we can do next we can step into the next function call here where where are we wait I what's happening yeah okay yeah it loads it was loading slowly so now we are debugging our code with the JavaScript debugger which is fascinating and we step out of the current function we step over and we can debug this will be more interesting because here we have our our code we have our our stack and variables and we can step over here and we can see come on you can do this machine we can see the values and everything you can debug your our program with the tool designed for your JavaScript program and you can also use profiler for the polyglot apps there is other thing that I really hope will work but I'm not sure if it will work or not Jay visual VM who loves Jay visual VM it's a who uses that once in awhile so growl VM distribution comes with the bundled version of Jay visual VM which knows about growl applications and things so what it can do what it can do what it can do it can you can find your it can find your applications and it can work I'll show you later I have some onions I want a different thing to show but Jay visual VM bundled with drum VM will work for polyglot applications and you can see the heat values and reliquary the heap using our console and you can see that which javascript objects take your you were memory and everything and in the word for those polyglot applications the same way it works for you with normal Java applications it's fascinating so you can what bravia offers it offers you and capability of introducing tools that are language agnostic right you don't have to think about what language you are trying to support you can support all of them at once so without further ado let's go into the very interesting thing and that ability right so the same way valium can be embedded into this native executable right it was designed to be embedded in different kinds of Java program Java programs and native programs so one very important to Oracle native program is an Oracle database who uses a database in their day-to-day life not necessarily Oracle on any database right so you write queries you store data there the current reality is that the amount of data that you get and historic groves much larger than your network and the your computational capabilities right so what is necessary at some point is to move your computation towards your data so you would like to run some competition inside the database not to stress network back and forth not to load the infinite amount of data so typically how you do that you would write sort procedures using language called PLC pool who knows PLC Poe oh wow that is a better response that I typically get who doesn't know PL sequel or doesn't feel comfortable writing till sequel see much more many more people so if you are comfortable writing pou Co good to you like you should continue using that it's a great language it's heavily optimized over the last 40 years to be very efficient if you know how to use that use that if you don't feel comfortable using that but you would rather write say Java Script because there is much more code available in JavaScript readily for you than in PL sequel then you can do that with currently strong experimental builds of the Oracle database and my my sequel database support incoming it's actually done and I've seen that in the works but it's not public yet but since I can talk about that so it's on the way to be public so what I did here I download download the experimental build of the workout database with the multi language engine embedded so there is a docker download you can download the docker container and run it if you would like to try that so I did that so we are running here in the docker container so what I did here in this other tab I created a SSH connection to that docker container right and I'm writing running this bash right so we are in this docker container this will take a little bit of time so I will just copy snippets right what I can do now I can run SQL plus into this database but what I can also do I can do crazy awesome things with running JavaScript inside database so I will create a directory normal directory and I will I can do CD just normally right and I will I will I will do I haven't sure why I'm copying this but I'm nervous this is an exciting moment so we'll create an NPM application right we would like to get some JavaScript from the internet there with certain functionality and put that in to date ways to work as the stored procedure for us so what I will do I will do NPM install validator this is the NPM module what it does for us and you can see it installs what it does for us let me show you that it's actual module right an NPM valladon it can validate strings for certain things so for example it can validate if certain string is an email so typically if you would like to validate the strength for email being an email you write a reg X and you debug that for years if you have to write that in PL sequel I honestly don't know I I'm not a kill sequel expert I would not even attempt to do that so now what I can do I can just say npm install validator and get that functionality now to integrate javascript which is a not the most strongly typed language and the database which is extremely strongly typed right you have columns they have values they have types I need to inside install types which is a great thing because the typescript community type script is a superset a language is a statically typed language on top of the JavaScript so it introduces types to JavaScript great language if you have a chance to look at that look at that but what I do I install types for the validator package right so now I have this connection between JavaScript code possibly JavaScript code and database types now what I have to do I have to deploy this validate module into my database here you can do that from the outside or from the inside there is a utility that you can use you install that and it runs currently within this docker container taking this JavaScript and adding that to the running database - you offer me the functionality from the JavaScript as normal functions right so now all this that you can see all those functions are available to me within the database so what I can do now I can do this crazy thing called SQL plus we are in the database we can deselect one from dual this is the syntax to select one from a dummy table just nothing doing nothing returns one what I can do now I can use my validator the normal way I would use that I will this is hard I need the proper apostrophe here Olek at oracle calm right from dual semicolon very important you don't put sample and it will throw a different result at here so now what this code is gonna do it's gonna call the grave IAM embedded engine to evaluate a piece of javascript within my database and pass database values to that what has happened select validator is email that was anticlimactic Olek at portal dot-com from duo and you see the result is one if i do the same thing but validator is email just with not an email to show you just all that here from duel you will see a different result because o it is not a proper email you see 0 which represents false in the database so you can use the power of modern libraries on any platform that ground vm support java JVM standalone application you can compile that and use that your JavaScript and Ruby and so on you can use that in the database you can use that to speed up your Java programs you can you can do many things the most important thing that you can do is download the version of gallium that you would like to test the resin Enterprise Edition which comes with better performance you can use that for evaluation so you can freely try it in your environments and you can participate in the community so it's fully open source project as I said you can find the docs and getting started guides and everything on the website you can share the code on github you can ask us for implementing things we are committed to make it a great open source project and yeah join join the conversation ask thanks tweet at us join our little chat room with questions implement a programming language if you wanted to implement a programming language now is the time it has never been as easy to implement a high-performance language as now build tools were just try it out and see the performance boost it gives you with that I'm out of time thank you for your time and your attention [Applause]
Info
Channel: Devoxx
Views: 9,830
Rating: undefined out of 5
Keywords: DVXPL18
Id: tEaEAq0L9Pk
Channel Id: undefined
Length: 50min 55sec (3055 seconds)
Published: Tue Jul 17 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.