Ian Hobson - An introduction to Rust for audio developers

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Cool! I'm rooting for rust and I hope it becomes a great language for audio. Joe Clay made a blog post about making a VST with rust with detailed instructions here if anyone's interested.

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/kwaddle πŸ“…οΈŽ︎ Nov 28 2018 πŸ—«︎ replies

Thanks for mentioning our VST crate at the end :)

I hope that Rust will become more popular for writing VST plugins..

Btw, do you know if any company in the audio DSP industry is considering using Rust in the future?

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/boscop πŸ“…οΈŽ︎ Nov 30 2018 πŸ—«︎ replies

Published on the JUCE channel? I'm confused. :-)

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/teknico πŸ“…οΈŽ︎ Nov 28 2018 πŸ—«︎ replies
Captions
talk of the day and also of the conference so we've got in Hobson here who is the technical principal for DSP and device sir Ableton and he's going to talk about an introduction to rust for audio developer so please give a back and for in hello hi can you can you hear me cool great yes so welcome I'm very excited to be able to talk with you all today about rust the programming language which I've been following for a few years now I'm very interested in and I'm looking forward to sharing some of my thoughts about it with you my goals for this talk definitely not to suggest that you should drop everything in news for us that's totally not my goal what I'm hoping to achieve is to show you a brief overview of the language and then give you the necessary entry points to be able to explore it on your own I think it's a fun language to play with and hopefully if if I if I do this right you'll feel like there's nothing stopping you from exploring it if you if you fancy it also I'm going to show how you can use rust in your existing projects if that's something that would be interesting to you and at the end if we have time I'll give a quick overview of the state of some of the important features that we need an audio development so a bit about me working at Ableton in Berlin since 2011 as mentioned already I'm the technical principal for DSP and devices there and what that means is I have a dual role essentially where I'm working as a software engineer in the sound team working on our instruments and effects and I'm also looking after a long term strategy for sound technology so in terms of sound technology there isn't really anything more fundamental to what we do than use C++ so why am i interested in rust well like many of you I think you'll be using C++ it really dominates the music software industry and it has since the start of my career so about 15 years and there hasn't really been much choice we've been using C++ or C if you're feeling brave or some somewhere on the spectrum between basic C and full-blown C++ with all the bells and whistles and you'll find some comfort zone in that spectrum of C and C++ did we have a choice beyond that not really that I've known about I haven't seen a viable alternative in my career I think there might have been in the old days like Delfy I think I remember seeing some code examples in Delfy when I was starting out I haven't seen many since if you use Delfy and you think it's great then let me know I'd be interested but rust like it has caught my eye and I think is caught a few of your eyes too because it offers much of what I like about C++ you get low level control high level abstractions I like abstractions so I tend towards the C++ end of things performance on par with C and C++ I'm not gonna spend time improving this but if you allow me to wave my hands and say it's basically the same kind of performance II you get received plus past and one how you tune things but we can just say that they're in the same ballpark and it offers precise timing and this is the the thing that really has stopped me from investigating a lot of languages that look attractive that usually have garbage collection or some kind of messaging system that locks or something that's just in the way so it's quite exciting to me that there's maybe a viable alternative now to C++ for real-time audio so a bit about the background of rust for those of you who don't know it started as a project at Mozilla they were interested in maybe finding an alternative language for building complex applications like web browsers that have lots of security holes because of common programming mistakes that people often makin see in C++ so this was a language that was intended for maybe a new approach to building complex applications if they announced it publicly in 2012 I've got lots of other people on board now Mozilla aren't the majority contributor many other people are contributing to rust and there's an open development process and they reached a stable 1.0 release in 2015 which allowed people to start using it in production essentially because they knew their code would continue to run as the chain evolved and in 2016 Mozilla managed to start shipping code that was written with rust in Firefox and since then the amount of code that is shipping in Firefox with rust has grown and they seem very happy about it also happy about rust are the people who vote in the stack overflow developer survey and for the last three years it has been voted the most loved language know what that means exactly I don't know but it's worth pointing out that this language is getting a lot of attention a lot of mainstream traction and so then to me it seems sensible for us to be thinking about it in this context which is why I suggested doing a talk about it and it's not really my place to give this talk in a way like I'm not a rust contributor or anything I'm not an expert but a an enthusiast and thought see if we could start a conversation about having an alternative language to C++ C figures worth talking about so let's get involved in a bits of rust is hello world and you can see already that it looks quite familiar to C in C++ I've got curly braces and semicolons we've got a function that's being called called main the the exclamation mark on the end of print line means macro and in rust macros are okay they're not even looking C and that prints out hello world very good here's a slightly more complicated hello world I don't know if that's maybe too big for that looks all right okay so we call a function get name that returns a string then we pass that string into another function then we use a formatting thing to print out hello ADC isn't even more complicated example where now we're using an enum and here in rust enums are like see like enums but also like variants in c++ they they are some types and you can apply very nice language based pattern matching 2d structure the the option in the in the enum and then print that out and this is nice but this isn't why I think rust is interesting it offers like a lot of interesting ergonomic enhancements to your your programming that don't exist yet in C++ but maybe over time they will we'll see what happens we hope but that's not why I think it rust is worth investigating really if if that if economics was all it was it wouldn't be particularly interesting I think but there are some fundamental properties that make rust very different to work with compared to C++ let's take a look at what some of those properties are this is C C++ code we have a value a and then we take two pointers to a and then we manipulate a via the pointers and then we dereference the pointers to print out a value if we do the same thing in rust well this is the equivalent code here we have a mutable value a in rust everything is concert by default and you have to buy into mutability we take two mutable references to a then we manipulate values print them out but the compiler will block you from doing this because we cannot borrow a as mutiple more than once at a time first mutable borrow occurs here a second okay so that's a rule that the compiler has the you're not allowed more than one mutable reference okay what if we make the second reference immutable so that we're only taking one mutable reference well the compiler still blocks you here cannot borrow hey as immutable because it's also borrowed as mutable now this might seem a bit restrictive because actually there's nothing particularly wrong with that careers this is a toy example but this illustrates the the kinds of restrictions that are baked into the language and maybe it's best spelled out in writing the rules are you can have as many immutable references to a value as you like you can have a thousand if they're all immutable or a single mutable reference those are your two choices as many immutable references or one mutable reference and also those are all the values that references refer to have to outlive their references so the lifetime of values is statically tracked throughout your program to put it another way because maybe that's not entirely clear we'll say it again but in a different way if you want to access a value by reference the language guarantees that the value exists and if you want to modify a value you must have the only reference to it now in a toy example that might not be particularly interesting or exciting but if you apply those rules throughout your entire program as you build up a more complex application then these rules start to become much more important as you start like doing things that maybe you had to put it have unintended consequences so here's an example of a classic pitfall in C++ we have dangling pointers so we have a pointed at X which we point to the first element in a vector the vector gets destroyed we still have a point of what happens if we dereference it well crash I guess certainly something you don't want to do if you have the equivalent code in rust so here we're assigning X as a reference to the first element of a vector V then we try and dereference it well we we can't even get to the dereferencing because the lifetime checker knows that V does not live long enough and we're trying to borrow a value that does not live long enough v gets dropped here while it's still borrowed and the borrowed value needs to live here and in terms of like understandable error messages I'm not sure what they could do better there I think it's it's really spelled out super clearly on it's quite nice another way you can shoot yourself in the foot in C++ is if you have if you're iterating over a container and then you happen to be modifying the container while you're iterating over it so here we're going over the the integer 0 1 2 3 we're printing them out but while we're doing that we're also manipulating the contents of the vector then strange things can happen on my machine I get 0 0 2 3 I don't know why but that's what happens maybe you would get something else if we try and do the same thing in rust this is the equivalent code then we get an error cannonball V is mutable because it is also borrowed as immutable so like the the mutable borrow is happening here we're trying to push into the vector but we can't do that because we have to have we have to be the sole owner to be able to mutate V and we can't because there's already an immutable borrow active like from the iteration now we can go a lot further with examples where safety comes into play in particular with like parallel algorithms where these kinds of safety checks allow you to have or they what do they call it fearless concurrency or something like this is like you can write threads thread multi-threaded code in a guaranteed to be safe way without really having to think about it too hard which is quite refreshing and quite cool and hopefully I've made the point that there are some fundamental properties here which just simply don't apply in C++ so it's worthy of attention I think so if you want to play around with rust although there are online compilers that you can try out but if you want to install it locally you go to this website rust RS then if your honor if you're on Mac or Linux then you run a shell script and you you get a tool chain installed if you're on Windows you get an installer and then you get a tool chain on your system and on my system I happens we've installed three you get the stable by default and then rust up is a command that you can run to manage your tool chain so if you want to like see which ones you have rust up if you want to switch between them then you go to rust up and once you've installed the tool chain then you have access to the cargo command which is very useful now I'm gonna do a risky thing let's see if I can show you how this works so if you say cargo hello so we created a binary application called hello very good let's have a look at that sorry the screens a bit laggy so it's not the easiest thing to type on we have a directory then we can see what's in the directory we have a main source file which looks promising and a cargo tamil file the cargo tamil file is the configuration for the package that you're in so cargo has created a package which is this binary application and then you can configure it using the tamil file then you can run it so it compiles the application then runs it for you and prints out the result and it just happens to have a world example for you I was going to edit this and play with it but actually I think it's probably better if I just go back to the slides at this point but yeah that's the idea you can it's almost instant to setup a project and get building and you can edit that for hold and play around see how do I get back to the slides of things like this yeah now Pargo isn't just a build run out but it's also a package managers so you external dependencies pulled in through cargo it's the same my command you do cargo search and you find a library that you want to use in your application it's also a test runner a benchmark runner sort of a documentation generator and more it's really quite nice to have all of the tools that you probably find and bundle together in your C++ projects and you come up with your own stack of stuff that you put together so you make and oxygen and Google test or you know you find your own combination of these tools here it's all standard and people mostly use the same stuff and that's also quite nice because like everyone's aligned around the same tool set it's just great quickly mention that when you're looking into using rust you're going to see that there are different release channels it's fairly straightforward you have the stable version which is updated every six weeks beta is the thing that's about to become stable and nightly is where the new changes implemented and people play around with like the new stuff and this updates every night might be unstable and you probably don't want to use it unless you want to try the new thing but if you do want to try the new things then you can use rust up and just immediately switch between the different tools of tool chains the other thing that I need to mention I dunno I wouldn't but I kind of have to do that coming up is the 2018 addition of rust which is going to be released in a couple of weeks and I figured it's close enough in time that I should just be using the 2018 editions so the examples you see you have to use the beta channel or the nightly channel but in a couple of weeks it's all going to be stable rust 1.0 is now known as the 2015 edition and yeah something that's nice about the additions is that it allows the language designers to incrementally introduce breaking changes so the language can evolve and then you opt in to the breaking changes and this allows the community and like the user base to come along with improvements to the language while still maintaining kobata compatibility with the old changes these are subtle tweaks but it allows for ergonomic enhancements which is quite a nice thing and in general though that new features will be available in auditions all right so I think that's enough orientation so let's see if we can build something I thought an audio application would be nice and over 20 minutes in so we've got 25 minutes left so I'm gonna have to hustle a bit but okay so something that's interesting enough but small enough and I thought maybe a rust version of free verb which is this like well-known open source like reverb algorithm that's been around since 2000 and was made public domain there and it's everywhere you find it in tons of different software packages but I didn't see a rust version so I thought that might be a nice thing to work on and we can go through like how the whole thing is put together pretty quickly because it's extremely simple that is like the the structure of the algorithm you have a stack of comb filters that have internal feedback and filtering there's some together and then passed through a series of all pass filters so the this is for one channel then you duplicate the structure for the other channel and like do some mixing and then you have a stereo reverb the the image comes from a write-up that julie smith has on the common website where he talks about the structure analyzes the properties of it and that's worth reading and you can find the original source code which i've converted into rust following the link below they're easy to find on google if you don't have you know you'll find it easy enough so it's easy to build this we only need two things really current fields for in an allpass filter they all create a library first so instead we use cagonu Lib and instead of a main RS we now have a live RS so this package that we've just created is a library which we're then going to reuse in a couple of different applications so the comb filter in the or pass filter both use delay lines and we can create a delay line we've made a new file here to lay line two RS inside our free verb library and this in this implicitly creates a delay line module and so I like I'll be referring to the delay line module here inside the module we've created a delay line struct so this is the same thing essentially as a C struct pub means that it's public outside of this module and we have two elements in our strut a buffer and an index buffer is effect of 64-bit floats index you size you sizes essentially society in C++ terms to add methods to this type we don't do that in line in the type like you would in C++ but we separate the behavior out into implementations and the default implementation by convention will usually include a static method called new this isn't a constructor or it's not like the new keyword it doesn't allocate anything unless you happen to be not using a vector here that will allocate but new is just a convention we don't have constructors in rust instead it there's an expectation that whenever you have a delay line value it has been fully initialized and however you achieve that is is up to you but the convention is new so we're initializing a buffer with a zero doubt like string of zeros and an index of zero then adding some methods here we you see a fast method essentially is a method in an implementation that has a reference to self as the first parameter this is like this pointer in C++ so we have a read method that returns the current currently index value in the buffer and we have a write an advanced method which takes a value it sticks it in the buffer and then it increments the index or wraps around if we're at the end and so then we just have a continuously circling delay line we can show that with a test so here we've added a unit test that's in the same module in a child module called tests and the conflict test command here is a compiler declaration that says you only need to worry about building this if we're building tests and then we have a length 10 function which we tagged with the test declaration and this is now registered as a unit test so we create a delay line with ten elements shove a bunch of numbers in and expect to be able to read them back out on the next time around then if we run cargo tests it will find this test and then run it and tell us that everything's ok so something I really like about this is writing the tests with the code I think this is like quite a nice way of working that they're in the same module in context of the code that they're testing and you know having a having like a test framework a test runner out of the box is also really nice there's there's no setup cost here the all pass filter well we're going to create a new module all pass and use the delay line that we've just created stick it in a struct that's all the old past needs the delay line then we initialize it and the tick function is like reading value out mixing it with the input applying some gain and then putting it back in the delay line and it's all passed ish is how it would be described it's not exactly in all past but it's it's what the free vote algorithm calls an allpass the comb filter is slightly more sophisticated again it's a delay line with feedback but here we have some filter state there's a one-pot filter embedded in this and like here's the tick function we're again reading a value out from the delay line applying some filtering and then putting it back into the delay line and returning the output so I take here is just a method beam on using for these DSP blocks that taken in a sample of input and then give you a sample of output that's just a name that I've chosen putting it together we then have like a free verb module and a free verb struct in the module and here we see that we're using our all passes and combs that we just created and on we have eight pairs of combs and four pairs of all passes the this pass syntax this is actually tuple syntax they can be like n elements long but this is good enough for this purpose I think that you just have a pair left and right and then a bunch of other state like for the different parameters that are used in the new construction we sorry the new method we're initializing our combs using these like delay lengths that have been carefully tuned by the original author and you'll find in the source code and same here with the all passes then a bunch of stuff and you have a free verb that is ready to go so that's fully initialized and like yeah it sounds like a reverb the tunings look like this so you can have constants and the syntax there is just put them all in caps and find it's a convention we're adjusting the length because the original only sports 44.1 I think that does the job I'm really tested it that much but so something to show here okay it's a bunch of setters for the free verb and the only different thing here that you haven't seen so far is that a private method is just a function in an implementation that isn't public so these two setters are publicly available they defer to a helper which is private I just figured I'd show that then the the tick function we take the input the stereo and put summit to mano pass it into each of the stereo pairs of cones sum all of that together run through the old passes and then the output is a bit of stereo mixing plus the dry signal oh the thing that's new here is tuple accesses dot zero for left dot one for right if you sort of mean that's the the zeroth element at the table the first element of the tuple yes so that that's it that at this point we have the complete algorithm defined for the free verb so then does it work how does it sound well let's try it see if we can get this to work think you can say is but you can hear that that's actually playing in the background my first playing is passing through sound fire into the application that has two inputs to our first lecture than me yeah that is processing audio it gets better okay so there we had an application that was like a full audio application with the GUI how did we put that together well I'm using existing libraries that happen to have rust wrappers so I was able to pull them in as like dependencies into the application project very easily which I'll show you now our main function I'm calling the run main you don't have to worry about this template e syntax for now I'm going to explain this but for now the thing that's interesting is that we're creating a command queue using the external crate crossbeam so this is a dependency that I'm pulling in this is a rust library and then I'm using port audio for audio in and out it does the job and here we're we're spawning a thread where the audio will run and then that thread receives the command receiver and then on the sender side we have UI widgets I'm not going to show you everything but like you get the idea I'm using a gtk window here and gtk window widgets and this this just works is it it it feels straightforward to use that you don't have to worry about this too much the the way that you declare these dependencies is in your cargo tamil in the dependency section you say okay I want version 0.5 of gtk point 7 of poor audio the thing that's interesting here is that I've included two internal dependencies for things I haven't shown you yet one called audio module and the other called free verb module and I really didn't need to do this but I figured it would be good for the talk to show a bit of a more sophisticated application than just basic setters so I started making a module framework and I'm not sure it was the best idea but it gets to it gets to a nice feature of rust which is trait and [Music] traits are very similar to virtual interfaces in C++ they're also very similar to concepts which are coming in C++ 20 I think and they allow for like different different different behaviors depending on what you do with them but really if you think of it as declaring an interface and then how you use that interface is something that will become a bit clearer so here we're saying an audio module is a parameter provider so that's another trait there is a trait called parameter provider and the trait audio module also includes that trait as part of its interface the audio module declares a processor type and the processor type meets the it satisfies the interface of audio processor and then it also has a method called create processor which when given a sample rate gives you a a processor by a value the audio processor trait I've got define it as like being something that processes stereo audio so we have an input buffer and an output buffer this syntax here you haven't seen yet this is like an array but it's sized at runtime so this is like I said spam that's coming in C++ so it's just a reference plus a length and that's the standard syntax for it the audio processor we expect to also be able to handle commands and so you can compose these traits together and create a full declaration of an interface which on its own doesn't do anything but can then be used for cases like this so we I created a new module free verb module which then has a free verb processor which internally has the free verb struct that we made that does the ticking but we're kind of encapsulating that here and then we implement audio processor and the process stereo method for it and instead of taking sample by sample here we're dealing with a buffer so we have to iterate over the buffer and what this is doing is taking the indices or the even indices up to the input length and then using those even indices to give access to the interleaved stereo data in the buffer maybe explain that clearer but I think you get the idea it's interleaved audio so you need to take left right left right left right and we do that by stepping by 2 over the indices then we take the input get some output and assign it to the output how am i doing for time not great okay we start skipping over I wanted to show here also so the parameter trait here that I didn't show you yet but this is now being used in this context for dynamic polymorphism so the parameter provided given an ID will give you a parameter which we don't know about at compile time but we do know about at runtime and it becomes a what's called a trait object in C++ I guess this would be a virtual object so it has a V table and this object is stored in a box which in C++ tones is a unique pointer so I'm gonna I'm gonna skip ahead a bit so we have a free verb module that declare some parameters and there's a whole thing about that but I get I think we get the idea come on handler as a trait we have to handle commands and then so if the processor receives a command and then calls the relevant setter on the processor so now coming back to the main function I think we we see what's going on here like I wanted to separate out the the free verb aspects of the application from the the thing that actually runs the runs the system so like we just passed in a module which implements the trait audio module so the the whole application doesn't know anything about free verb it just knows about audio modules so then maybe it could be reused for other effects so treats are generic type constraints similar to C++ twenties concepts also offer static polymorphism functionality also dynamic polymorphism similar to C++ virtual objects and having like the same language feature providing all of this functionality is really quite remarkable I think and like it's one of my favorite things about rust so I'm gonna have to prattle on right so Fi yeah linkie again see libraries and rust is well supported crates are available for many major c libraries and also c++ libraries that happen to have c bindings if you find that a crate doesn't have a rust wrapper than making a rust repair would be a nice contribution to the ecosystem so if you felt so inclined that would be a really good thing to be spending time on how is it possible to call c code given rust safety restrictions this is an important question Rusty's very strict C code is not if we're calling in C code then how does rust allow this so to quickly highlight how this is possible we have the unsafe keyword which tells rust I know what I'm doing just don't worry about what I'm about to do here with memory or like lifetimes or whatever like you can just bypass the whole of the all of the safety checks for most of them if you need to and when you need to might be when you are working with a C library that communicates in raw pointers and if you're using unsafe you probably want to extract it away I think it's very rare that you'll actually see much unsafe code in the in the client code that you're writing if you're writing unsafe code probably you're building a library so we've seen using C and rust how could we use rust in C++ well if the way that you do this is that you build a static library or a dynamic library if you prefer and you apply attributes to the functions in your library to ensure that they're exposed in a C compatible way so here we're creating a new library free lips free verbs feelin and it depends on our free library that we created earlier and we're telling cargo please build it as a static library in the Russ code for this library we have a create and destroy method where we're able to create a raw pointer to a free verb struct which we essentially forward declare for the purposes of C so we tell see there is this struct you can allocate it but we'll take care of the details and here we're using box to allocate on the heap and then it gets returned as overall pointer and on the destroy side then we receive a pointer that we just have to hope is and we tag it as unsafe it's like the the thing that comes in here could be anything but we fingers crossed and it will be okay also no mangle and that that's pretty much all you need to make sure that extern so it's no mangle annex turn make sure that that function is available outside so once you built that you have a library that can be linked into your C++ application but you also need a header or you know the declarations of the things that you're trying to access you can write that by hand if you want there's also a tool C bind gen which will generate a head of for you from the Russ library and used that here and you get a like a regular C++ header speaking in types that C++ understands I can skip over this we have a process function inputs and outputs and ticking and we get this kind of C interface using the free road a rust library in a juice project right so now we have a C library we can use it in C++ and because this is an audio conference I guess there's a lot of juice developers here so this is how you do it in producer you tell you you set the the right flags and the flags you need are where where the header is so it's in this C Lib folder local to the juice project you tell you where the library is you tell it which library you want to link against to make this nice you can create a pre build script that takes care of compiling the Russ library and generating the matter for you and this works pretty nicely then in our juice code right quickly we have free vert HPP I didn't do the whole module thing in the juicer example but what we have is a unique pointer to a free verb and when it gets destroyed we need to call the free verb destroy a function when we are preparing to play we create a free verb using our create function and we we stick it into our unique pointer to hold on to it then when we're processing an audio book well we have a command Q and we we set our parameters as necessary and then we call free verb process with our instance of the fever now let's see does that work well here is the juice project so this is with the same do speed implements with us running very basic but it works better so I don't get to the slides it's like this right so now you know you you're in a juice project so you could build a VST with this or you know whatever you want to do with you your juice project another target that's interesting is web assembly and with rust the the tool chain for generating web assembly is pretty nice and we're going to follow the same approach here creating a another wrapper library in this case I'll call it wiesen and in in this case why isn't vine gen is the tool that we're using rather than step engine and here we tag our objects and methods that we want to like expose using this white and Biogen attribute so this is a slightly different approach to the C approach but I it's pretty straightforward really the process function is very similar to what we've seen before but now we're speaking in native rust Heights because why's it bun Jen knows a bit more about rust and it can like expose the correct types for the JavaScript that ends up being called the web suddenly the ends up being called so it's much the same as you've seen before then the way that this is compiled well we use cargo build but we tell it to cut the target weird assembly instead of whatever your platform is compiling for and then you run wise and bind gem you tell it where your web somebody is and then it gives you a set of files it gives you some JavaScript bindings which I wouldn't show you it gives you web assembly in the correct place and it also gives you some debug symbols for typescript which I'm not front-end developer so I wouldn't know what to do with but I can put them on a slide for you because they're much more readable the other files and that shows you the the shape of what wasn't blind Jen is outputting then I don't have time to show you how to hook this up but it we're just using Web Audio we instance we import the the web sembly blah blah blah and then we create a script processor this isn't the the the modern way to do custom DSP for the web but it's slight friendly so there we have the input and output and we're calling process on our free verb object connected to a microphone and then connected to the output hook up some sliders then yeah this looks familiar [Music] sorry again that's the same DSP that we wrote at the start of the talk and now we've used it in a GC project and we're using it in the web which i think is pretty decent okay to summarize exposing rust to C is easy by skype-ing and exposing rust code to JavaScript as easy Verizon bunging I'm making the claim easier I think is straightforward there's a few details to figure out but like it's there like the tool changes there and like it you can you can use it that's it's fine you've totally got it is anything missing right so this is the wrap up now and we've got five minutes left so I'm going to rattle through this and then maybe there's time for a couple of questions so 70 support is in its stable the intrinsics are available there are there is a crate now which is building a nice abstraction over the low-level operations there's also an effort to create a standard abstraction for the low-level intrinsics kant's generics is still working progress but it's coming soon what this means is in C++ you could say static vector of T's and there are n n as a maximum number for your static vector and you can't express that in rust and run you have to use macros or workarounds but I would really like this feature and it's coming soon inline assembly still work in progress it's unstable but gated and maybe will change fast math intrinsic tonight Leone they're not stable and I think these are quite important but hopefully they'll come soon and maybe some people in the audience here would be able to help the the Russel community figure out how to do this well placement you wasn't Knightly is not anymore they have things to figure out there what's not great will compile times are getting there like they they were not great they decent enough now I think like either I find it usable unless I'm using a particular crate that is slow to compile but then maybe I don't use that crate I'd say if you if you're building complex C++ applications you won't notice things are dramatically slower you'll be okay you'll be okay with the compile times and rust if you're writing more like low-level C style code then maybe you'll find it unbearable but yeah you should you should try it out and see what you think incomplete iOS support there is an issue with component to iOS bit code which maybe you need for the App Store apparently there are ways of making it work I haven't tried it there's a long issue that you can read to describe this but if iOS support is important to you then you should really look into this what is great safety is great ergonomics at the language are very nice traits are wonderful having a standard tool tool chain that everyone uses is great I think if we could take in C++ if we could take something from rust this is the thing that's kind of low-hanging fruit by creating standard tool chains that everyone can like rally around and get guest interaction behind I think this would be really good for people learning the language and coming into the language debugging Visual Studio code I didn't get to show you this but if you have Visual Studio code then the Russ community have kind of chosen that as their standard IDE and it seems like that's the thing to use and debugging works really well breakpoints and inspecting symbols and values and everything the Russ book is brilliant you should read it it will give you a full orientation of the language and it's very well-written the the communication effort that is part of the community I think is fantastic and worth studying really good and in general the community is great get involved like they would love to have you like I think the more people involved in real-time audio who are working in a community the more things will be built and at the moment there's not so many people doing this stuff and so there's if you'd like places where just tools that you need don't exist yet and maybe making those tools would be a good contribution and maybe you know how to so it would be a good thing to do a couple projects worth looking at Ralph Levine did a talk last week at a meet-up and presented his work on building an open-source synthesizer in rust it's looking very promising and interesting and if you you're looking for a thing to contribute to you then this would be a good place to start also there's a group of people are interested in building vsts with rust and they're working on a project there that's worth checking out alright so that's it thanks for listening you can find the code examples that github tapcon / ir h slash free verb - RS and there's also gonna be an ADC 2018 branch there which will capture the current stake so I think I'm going to keep working on it but like if you want to see the state if the code as it was when this talk was done then there'll be a branch also on Twitter on unschool hops and underscore and I should probably mention that the company I work for Ableton is hiring especially for C++ engineers and you can look at our positions at Ableton comm slash jobs alright that's it thank you very much so I think we've got time for a couple of questions there's one here first question is there manual control over function inlining in rust and second you mentioned debugging if I write a C++ application with some pieces in rust can I just be bucket like using existing tools the first question lining finance applause-plause basically I don't know I didn't check that seems like a good thing to have I would imagine they thought about that if it exists it will be easy to find and if it doesn't then you'll find a long discussion about why they haven't added it that's generally the way these things go like they they see these problems and discuss them in depth and it's all in the open and easy to find so the simple answer is I don't know but like I think it's a really good question practicality but mixed applications written like partially in C++ partially in rust using existing tools Windows Mac you should be able to yet the debug symbols like in the standard format and I haven't tried that but I would anticipate that there is something we could we could give it a go after the talk if you like we'll see if it works anyone else going once ok cool well thanks very much in
Info
Channel: JUCE
Views: 10,323
Rating: 4.9860139 out of 5
Keywords: juce, juce framework, audio developer conference, adc, adc 2018, vst, audio coding, audio programming, dsp, digital signal processing
Id: Yom9E-67bdI
Channel Id: undefined
Length: 49min 48sec (2988 seconds)
Published: Tue Nov 27 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.