SF Scala: Shadaj Laddad Interview
Recording: SF Scala: Shadaj Laddad Interview
Hello everybody, I'm Alexey Kraborov, the organizer of SF Scala, and here we are on location at Oracle Cloud Infrastructure Team in Auckland. This is our first time here, we learned about Oracle using Scala for these cloud native services, and we're going to have a talk from them. And we also have an amazing lineup today. We have Oracle, we have Jason Swartz, and we have Shardash Ladot, who's a freshman at UC Berkeley and a veteran of Scala. So welcome Shardash. Yeah, I'm really excited for the talk and it's really good to be here. And I must say we're super excited too because, you know, everybody wants to do front-end programming in Scala, nobody knows how to do it. And you are on the frontier of this
So the topic is exciting, but let me kind of step back a bit and mention that you really have a long Scala history. My first meetup when I moved to the Bay Area was 2011 at LinkedIn. It was called Bay Area Scala Enthusiasts. It was run by Dick Wall. And your dad, Remy Vassladat, was there. And I think you did a talk, right? And it was seven years ago. Yeah, yeah. That was my first technical talk, I think I did
It was a lightning talk. I had implemented a Conway's Game of Life implementation in Scala. And so everything was there together. My dad was, hey, why don't you give a tech talk? And so reached out to Dick Wall and everything worked out. And that's how I got started. Yes, and I remember that, like, you really gave a good talk. I don't remember the details, but I remember, like, it was, you know, really smooth and it was interesting. Right? And I think it was, it was simpler than type kind of machinery we do nowadays
Right? But, but I'm super curious, how did you get into programming? Right? How did kind of Scala become a family business, family language of choice? Right? And, and was, you know, your dad's choice of Scala affecting that? And I was like, it's not the first, the easiest language to use. How did it all work out? Yeah, so I, for, in terms of programming in general, I got started when I was six. So my family actually had just moved to New Jersey. So I didn't have any friends really there. It was the summer. So my dad said, okay, I'll get you a robotics kit, something to do for fun over the summer. And so he got me that. And I really, really enjoy that
I always enjoy seeing the combination of physical and software kind of blending together, where you're able to write something in this IDE environment, but you're able to interact and see the results of what you've designed in real life. And that was really the hook that got me into programming. And from there I went to a bunch of different languages. I did a little bit of Logo, then Ruby, which was kind of my first more serious language. I did Python. And then I think the bridge between Python and Scala was really interesting. So Scala was my language after Python. Mm-hm
I got into it really by luck. So my dad was using it at work. And so I walked into his office one day when I was at home and I saw him working and I asked him, what are you working on? And so he asked me, oh, what am I working on? And it was like a challenge. He was working on some exercises while he was learning Scala. And even though I actually had never written code in a statically typed language before, I was actually able to make sense of what was going on. And I think that was really the moment that my dad said, OK, now I'm going to try to actually teach you Scala. And that's when I got started using that. And I think that was a really interesting thing where going from Python, which is a very dynamically typed language that's kind of the core of it, to Scala where static types are so important, one of the interesting things was I didn't actually see as much of a jump just because of Scala's language features
So things like type inference and things like that made it very easy to just jump into this world and where I could start moving over the concepts I learned for Python and start using them in Scala. Mm-hm. I wonder how did the kind of syntactic look or kind of beauty or brevity affect it? Because I remember, you know, programming in Ruby and it was in between different things. Like, you know, I had to do it because I joined a startup which used Ruby and I enjoyed it. And what struck me is that, like, there is the visible similarity of Scala. It tries to be beautiful. It tries to be compact. Yeah
Did the fact that you knew Ruby before Python, like, did it make it simpler that Scala looks kind of similar? Yeah, I think probably as kind of an underlying thing in terms of how you're laying out your structure for your code, that definitely probably helped. I think especially with Ruby, Ruby I really learned very briefly. There was a book, Learning to Program by Chris Pine. It's a fantastic book, especially if you're a kid kind of getting started with programming. And back then there were no, like, all these languages that we have today for kids learning to code. So that's what I had. I think more what was helpful with Scala was things like Kojo, which is what I really got started with at first. And because Scala has this ability where you can design these very nice DSLs that are embedded inside your language, Kojo, for example, was able to offer this much nicer and more logo-like interface
But you're still writing code in Scala. So that helped kind of migrate over to that where I'm writing curly braces now to express blocks of code. Right. But jumping into that was not as hard as, for example, jumping into Java because some of the concepts I knew before. For example, in Logo you do repeat 5 and then you write your code. In Kojo you actually have the exact same functionality where you do repeat 5 and then you provide a curried parameter, which is what code to run on each of those iterations. Mm-hm. And so because of those APIs that were available, it was more of a bridge into the new syntax that I had to learn
Mm-hm. Interesting. So how old were you when you basically felt like you started programming in Scala? So I guess officially started programming in Scala when I was 10, but I didn't really get fully embedded and learning Scala kind of from the ground up until I was about 11 or 12. So I think that's when I started actually reading the programming in Scala book by Martin Andersky-Bill Venner's. And that's where I started really going into Scala and that was my first, the first language I actually went really in depth into. The previous ones, mostly it was, I was using the language because the book that was teaching me used that language. Mm-hm. Scala was the first where I approached, okay, this is a really cool language
I've enjoyed using it so far in whatever graphical applications I'm doing. Now I want to actually learn the internals kind of in depth of all the types of things you can do with it. Mm-hm. And so I think that really led up to my first bigger conference talk, which is Scala Days 2012. And so at that point I'd learned enough about Scala in terms of ways to create abstractions with type parameters and implicits and concepts like that. really started getting me a lot more embedded into Scala versus the previous languages I did. Great. And obviously like we followed a career because you know Scala community is pretty tightly knit and you know Scala Days is attended almost by everybody
Right? And so we kind of know what's happening. So that was phenomenal, right? It's like we see you through the years tackling more and more complex topics. Right? So you did the kind of like control of IoT devices, right? And which is super exciting. And also you focus now on the front end and you mentioned like GUIs, right? Interfaces was what motivated you to kind of program them. So which is not a typical fair for Scala people because they like to sit in the back end and you know, manipulate symbols on the screen. So not many people have experience of this. You know, another reason we're very excited to have you talk about React because essentially we're kind of all waiting now. Like while, like we're going to hope this whole horrible JavaScript thing will just like disappear and we'll just, we'll have some nice functional way to program UIs
Right? Like in sort of, we see like it's getting better for instance, you know, in iOS world people were able to wait out objective C, suddenly have Swift. Yeah. Right? And so like it is happening. So some people basically it's like, no, we don't need to learn this anymore. So, so can you tell us a little bit about kind of full stack programming in Scala? You know, do you have to learn JavaScript? Is it like the dream of not being like, not needing to know JavaScript? Is it feasible to do front end programming with Scala somehow? Scala.js and Slinky or do you still need to kind of understand everything and like later, like become like a functional programmer on top of it? Yeah, I think so. I think that's definitely one of the really interesting things that's happened with web development recently. Especially with React. Where now it's not that you're approaching that I want to write my web application with more functional programming concepts
It's more that the natural way to implement web UIs is now with functional programming concepts. Okay. And that's really the approach that React takes. And I think that's the reason that Scala.js has become so successful recently. Because using React, which is a library that was originally written for JavaScript developers, is still primarily used by JavaScript developers. It feels extremely natural if you're using it in Scala. And so I think today, if you don't know JavaScript, if you know Scala and you want to start working on front end apps, I think it's extremely feasible to do that. But I think where it's even more powerful is if you already have a back end and you have a back end team working in Scala
You might have a front end team that is using JavaScript right now, but maybe you're working on a new site or new product. Mm-hm. I think they're using Scala as that common language across both those fronts is extremely powerful. You get lots of benefits. If you have models, you share them automatically. Now you don't have to worry about having things that will scrape out what your schema is on your back end and then generating types. You automatically have those types because you're actually just using the same source code on both ends. Mm-hm
And things like, oh, if you have some complex algorithms that sometimes you want to run as like a batch job on your server, but sometimes you might just want to push it to your client so that your server is doing less work. Right. And so you get these advantages automatically if you're using Scala on both sides. And I think that's one of the really exciting things about using Scala.js. So let's say, you know, I am a Scala programmer, right? And I want to get into kind of front end. I want to do the full stack app, right? So what is the minimal viable knowledge of front end I need to glean? And obviously like all the front end books seem to be targeted to JavaScript developers. Is there a path now? Is there like a happy path where you will kind of like, I want to learn Slinky. I want to learn, you know, Scala React
I want to basically then pick up the minimum, like I probably need to know about the DOM and what it is. Like what are the pieces I need in addition to that? And like other ways to pick them up without going through kind of, you know, JavaScript hubris on the way. Yeah. So I guess, as you mentioned, you need to know the core elements of the web. So whatever HTML, CSS is going on, because that's still going to be what's powering everything. Once you've written all your code, that's just determining what is going to be displayed. But whenever you have CSS or things like that, there's no real things to do in Scala. And there are libraries that let you design your styles in Scala
But really, it's still not as great of an experience compared to just writing CSS, especially when you're working with developer tools. If you're working in Chrome, CSS is the language of styles. I think it really depends on what type of app you're building. If you're building a kind of closed app that you're going to be playing with or relatively simple app, you actually don't need to know too much beyond that. Because you can do everything in Scala. You really don't need to touch any JavaScript code in order to build out your app. I think one of the interesting things and one of the focuses of Slinky is working with the existing ecosystem that's been built in the JavaScript world. And so I think at that point, you need to know a little bit more in terms of how JavaScript libraries are built
Just because it's a lot faster to use libraries like React Router, for example, if you're doing routing in your app, instead of building it yourself. Just because there are a lot of intricacies involved that you might not catch. And these libraries have been tested really hard. I mean, almost all sites that are using React will use these core libraries like React Router or Styled Components. And so it's really advantageous to just be able to use those. So if you're using one of those libraries, then you'll need to know a little more JavaScript. You won't need to code in JavaScript still, but you'll need to be able to look through their API examples and then understand how to translate those over to Scala, which is relatively straightforward, especially because these days a lot of libraries have TypeScript types available. And so you're just able to translate over those types in order to have very nice statically typed interfaces to those libraries
One of the projects I'm actually working on now with Slinky moving forward is the idea of Slinky modules. The idea is there are a lot of core libraries like React Router, Styled Components, that are used in a lot of apps. And so what I'm working on now is to build out these core modules as existing interfaces. So you don't have to actually know about React Router. Someone else has already done that work for you to be able to bridge the connection between your Scala app and React Router. And I think as that grows, it'll be even easier to be able to build complex apps without even having to touch any JavaScript at any point because all these libraries will be ready for you. Interesting. It reminds me, you know, James Ward, he is a, you know, evangelist, now director of open source at Salesforce
He was giving talks about play, right? And so one of the earliest things he did, he did web jars, where we just package JavaScript in the jar. So I think this is this perennial desire of Scala people to create a modular system for JavaScript but inside the Scala ecosystem, right? And TypeScript actually is a very cool thing because I think it's really interesting development for us because suddenly there is a bigger line as Microsoft which basically goes and like types all the JavaScript all there. Yes. So can you talk a little bit more how the TypeScript kind of affect this? Is there a majority of useful JavaScript libraries now that they have TypeScript interfaces? And how much, for instance, should you learn TypeScript? Like is it helping you to know TypeScript in addition to Scala or JavaScript like in this whole full stack programming? Yeah. So TypeScript is a fantastic language. So the past two years I've worked at Apollo GraphQL, which still helps Apollo client. That's all written in TypeScript. So I think from the perspective of a Scala developer who's working with Scala.js, TypeScript is validation that the approach to developing web apps with lots of static types and having a focus on that is the right way to move forward with developing web apps
Not just TypeScript, we've seen things like Flow as well. And the JavaScript community is really moving in that direction. Mm-hm. So yesterday I was at GraphQL Summit and during the keynote someone asked how many of you guys are using TypeScript in your apps? And more than half of the audience said that they're using TypeScript. And this is GraphQL. This is a community of mostly web developers across everything. So that means you have more developers using TypeScript out of all these web developers that you have. So I think really we're seeing this move towards static type as kind of an expectation when you're developing websites
And as a result of that now, all of these community libraries, you almost just, it's just natural. It's a surprise if they don't have TypeScript types available for them. Mm-hm. Especially there have been things like definitely type. So that's a community organization that's even for libraries that themselves don't publish TypeScript definitions, they'll design TypeScript definition files so that even if the library authors themselves aren't maintaining TypeScript support, you get it through that. In terms of understanding TypeScript, I think definitely right now, especially Scala on the web is still something that's growing. It has, it's not anywhere near the scale of JavaScript or TypeScript developers. So I think it's still valuable to actually get experience with writing code in TypeScript, especially in terms of the types of developer experiences that you get
So that was really the inspiration for me to actually start building Slinky. I interned at Khan Academy, there everything is ES6. I was working on mobile JavaScript. Mm-hm. And so when I came back from that internship, I really thought, wow, the experience is so fantastic with JavaScript. Why don't we have this with Scala? And that's what inspired Slinky. And so I think while this community around Scala for the web is still growing, I think it's still very valuable to get experience and understand how things are on that end. And then you can bring a lot of that knowledge over when you're building Scala apps in terms of how you design them and deploy them
Yeah, this is, you know, I noticed, I mean, I'm not a front end programmer, but I've noticed as one of my colleagues at Nitro, where I used to be before, he basically full stack engineer. He programs in Haskell and then in Scala and he whipped out VS Code, which was fairly new and he checked it out. And he loaded, I think it was a file which VSX or TSX, it's a, you know, front end file which has tags in it. It's a DSL with TypeScript. And so basically, and he showed how, you know, you type a tag and you put some content inside of the tag. It doesn't type check because the content inside the tag doesn't match the type of the tag. has a type. And so the front end developers who never saw this, they were kind of, you know, amazed, right? Because like you cannot close the tag, it's wrong, right? So to me, you know, it's like, it's tremendous power and I've seen the effect it has on the front end developers
And, you know, they really saw that they can like, you know, prevent a lot of errors. So to me, that was like an immediate proof that like, yeah, we need to bring this. So, so let me kind of shift gear a little bit and I kind of want to close with this kind of historical question. So, you know, in the next year, 2019, Scala will turn 15. And so we're running this, we're unveiling this new theme at Scala, by the way called 30 years of Scala. And we call it 30 years of Scala because we follow the part term, which Association for Computing Machinery, ACM, introduced when they celebrated 50 years of computing. They celebrated 100 years of computing, fast, you know, 50 past and 50 future. And so this is, I think like, so we're kind of doing this theme, we call kind of, kind of, you know, Scala families
So you have a family, you know, father and son doing Scala. We have, you know, Gahals and brothers, two brothers doing Scala in different companies. Nimus and Arayal are both speaking on scale by the Bay. You have, you know, Sasha of Sunkin and Max of Sunkin. Max is also on the grad, on the grad in Berkeley, third year, right, working with Scala. And so obviously we have Jacob Adersky and Martin Adersky. So, so in, in a way that shows that the language was long enough that the father could teach son this language. Right
And so you are like, on the one hand, you are one of the youngest developers programming Scala in presenting. But now I think you are one of the oldest Scala developers in terms of how many years you program Scala. Right. Because like, you know, the adoption of the language of the majority of them started a few years ago. So, so I am really curious, like, you know, if you come from your perspective, kind of think like what, you know, what was the major effect of Scala on you in the, you know, last 15 years? Or in your case, you know, all the time you were doing Scala. And, and what do you think will be kind of the effect of Scala on your life in the next 15 years? Right. So if you can kind of somehow kind of think like what are the key advantages or kind of themes it brought to you in the beginning? And what do you think like you want to do with it in the future? Yeah. So I guess in terms of what it brought to me, I think it came at a very perfect time when I started learning Scala where I kind of understood programming concepts
I understood you have if statements, you have while statements, things like that. Mm-hm. But now it's starting to move towards building larger applications. And I think the really great power of Scala is the amount of abstractions it enables. Mm-hm. And you just have all these different axes. So you have object oriented programming, that's one axis for enabling abstractions. You have functional programming, then you even have concepts like implicit switch, which offer even a third axis for implementing these types of abstractions
And I think that's the really big impact it had where now I wasn't just thinking of programs as, oh, I wrote up this app, it works, it compiles, it runs. I was thinking about, oh, how can I design this application in order to make it easier to develop on top of in the future? Or how can I make this code as elegant as possible? And that's really what Scala brought to me. Mm-hm. So I think, and also Scala still is very much a language that has lots of connections to research. And I think, especially in the past, I'd say two or three years, this is much more of a recent thing, I've gotten a lot more involved with contributing to some of the more newer open source projects. So Scala native is something I've been contributing to a lot recently, where I'm working on support for 32-bit architectures. Cool. And I think one of the really cool things that Scala has brought to me is, because Scala is this foundation that has so many different things around it, so you have Scala.js, Scala is for JavaScript, you have native for LLVM
Mm-hm. Once you have this base of Scala, it's very easy to expand out into related areas. And so I actually didn't have any experience with writing code in C or C++. Mm-hm. But I knew Scala, and so I was able to use that as kind of a jumping pad to learn about lower-level programming through Scala native. And I think that's one of the really interesting things, where it's sitting at the center of so many different areas. You have web apps, you have backend apps. Mm-hm
That it's a very nice kind of central thing, where if you know Scala, it's very easy to jump into all these new areas. I guess for the next 15 years, I guess Scala as a language in general is moving a lot towards bringing in the principles of having a really fantastic developer experience. So Dottie has the language server protocol and things like that. And I think the way that's going to impact me is as I continue developing libraries like Slinky and move forward, I think there's going to be even more of thought given into how can we make writing Scala code be the best kind of experience it can be. Not just in terms of the compiler is nice, the build tools are nice, but how can we design our libraries in order to make the developer experience as nice as possible. And I think I've seen this kind of start to happen, where you have a lot of libraries that provide all these very complex category theory magic. But now, especially in the past year or two, you've seen a lot of libraries that are developing that are just focused on, I want to get this done, give me the easiest way I can do this. And they might underlying involve a lot of these more advanced concepts, but I think we've seen a lot of how can we present these, especially to developers who are getting started with Scala in a way that makes it very easy to get started
And I think that's going to be a trend moving forward with Scala. Great, great, great. So, and the kind of last question I will ask, you know, again, because we're doing historical kind of perspective. So, you know, you did programs in Scala, you've now program in Scala, it's been going on for many years, right? And so, I'm just curious, you know, you know, Romney Vas is building the startup, right? He presented about it, and so he talked about Scala.js. So, how do you interact, like, do you learn from each other? Obviously, he has a lot of experience in the software world, right? And you are now learning, like, you're at the university. How do you see, like, if you could talk a little bit about how you help each other learn and program? Yeah, I think that's one of the really awesome things. So, both of my parents are working on the startup, as you mentioned. They actually launched today
All right. So, learnraga.com. It's classical music, right? It's Indian classical music. So, I think it's been a really fantastic experience. So, especially because both of my parents have been working on the startup full time, especially in the last years of high school, they were at home all the time. And so, that meant that weekends were this really amazing kind of chance to be productive and, you know, be productive and share ideas. So, especially when I was starting developing Slinky. Mm-hm
My parents go on walks every, almost every day. That's kind of their thing to do. And so, over the summer, I started joining them too. Mm-hm. And these walks weren't just us getting exercise anymore. Now, we were talking about ideas for, oh, what would be a nicer API for how you declare a component in Scala. Mm-hm. And we have all these back and forth
And sometimes, like, my dad will just walk out of his office and I'll be working. And we'll just have this kind of back and forth of, oh, what type of way should I approach this problem? So, especially earlier on, earlier on it was much more specific. Oh, I'm getting this exception. Why is this happening? And so, we would work on that. But I think now as I've learned a lot more in terms of developing larger scale applications, now we're able to discuss things more on designing and making sure the app can scale and things like that. And, well, it's definitely an interesting experience working with your dad on things like this. It sounds like a dream to me. You know, like, my son is standing in your role, but, like, if I had a son who worked with Milan, I would be super happy
I think it's amazing. It's a great thing to have. Yeah, it's a really awesome blend of they're my family, of course, but also when we're working on programming, I get this kind of taste of, like, a professional environment where we're able to discuss ideas, draw things up on whiteboards. And so, it's this really awesome blend that I get when I'm at home. It's fun. Did your dad learn something from you in this process? Yeah, I guess. I don't know. Well, so Slinky really is something that I developed
I got ideas from them. So the app itself, LearnRug, was originally built by Skull.js React, which is a really fantastic library. It's what I used to use before. I developed Slinky for all my Skull.js apps that wanted to use React. And so they were using that. But especially they had a couple of new interns who were working on a couple of projects. And they noticed that, oh, this is very hard to jump into. Some of the concepts were very foreign, especially for people who hadn't used Skull before
And so, I guess with Slinky, that's something I introduced. And kind of, I guess, they learned from that and they adopted Slinky. All right, so it's used in LearnRug. now. So they actually, last year they migrated over. So now it's completely migrated over to Slinky. The entire app is built with Slinky. And so in that process, it was very much a dual, a two-way learning
Because I got a production app to actually test the library with. Yep, yep, yep. And so in my release notes, especially for earlier versions of Slinky, almost all of the statistics about bundle size were actually collected from LearnRug. Where I would send them this beta build. I'd say, hey, can you try compiling it? And I would be able to tell about performance impacts. And that was a really awesome app to develop Slinky with. But on the other side, I was able to bring in, especially from my internships working at places like Khan Academy, I was able to bring in these ideas from the JavaScript world in terms of how modern apps are being developed with things like Webpack and those types of new tools and bring those into how my parents developed their app. So that was a really awesome experience
No, this is great. You know, I think that, you know, like this is a really good background to know because now we know this is used in production. Right. And so, so it's kind of, you know, business success depends on it. So, and, and this is really, really cool. So thank you very much, Sardash. We're looking forward to a technical talk and it's a great pleasure always to have you at the bit ops and the conferences. So, you know, please, you know, be such an awesome member of the community
And we really appreciate it. I know I'm really excited, happy to be part of the Scalic community and I'm looking forward to the talk. Thank you.