CppCast - Java
Episode Date: September 28, 2017Rob and Jason are joined by Patricia Aas to talk about Java and some of the similarities and differences between the Managed language and C++, she also talks about her work on the Vivaldi Browser. ... Patricia has been a C++ programmer for 12 years. Currently she is working on the Vivaldi Browser. Previously she has worked on the Opera Browser, on embedded telepresence systems at Cisco and even did a two year stint as a Java consultant. She is passionate about learning and teaching, as well as trying to make the world in general and tech in particular, a more inclusive place. News Bjarne Stroustrup awarded 2017 Faraday Medal Orbit C Performance Profiler Introducing Abseil, a new common libraries project CppCon Videos Patricia Aas @pati_gallardo Links C++ for Java Developers (Slides) C++ for Java Developers (Video) Java Vivaldi Browser Sponsors Backtrace JetBrains Hosts @robwirving @lefticus
Transcript
Discussion (0)
This episode of CppCast is sponsored by Backtrace, the turnkey debugging platform that helps you spend less time debugging and more time building.
Get to the root cause quickly with detailed information at your fingertips.
Start your free trial at backtrace.io.cppcast.
And by JetBrains, maker of intelligent development tools to simplify your challenging tasks and automate the routine ones.
JetBrains is offering a 25% discount for an
individual license on the C++ tool of your choice, CLion, ReSharper, C++, or AppCode.
Use the coupon code JetBrains for CppCast during checkout at JetBrains.com.
Episode 120 of CppCast with guest Patricia Oates recorded September 27th, 2017.
In this episode, we talk about some of the news coming from CppCon 2017.
Then we talk to Patricia Ose.
Patricia talks to us about Java and her work on the Valdi browser. Welcome to episode 120 of CppCast, the only podcast for C++ developers by C++ developers.
I'm your host Rob Irving, joined by my co-host Jason Turner.
Jason, where are you right now?
Where am I? I am
in Seattle, well Bellevue technically
at CBPCon. I am
exhausted
and it is only the beginning of the third day
of the seven that I am here. Right.
Because you're going to be doing all your training at the
tail end of CBPCon. How's it going
so far though?
It's going great. it's a fun conference as
always tons of listeners here um talking about the podcast it's it's a lot of fun
hey everyone need to interrupt just for a moment because we had some audio issues during the
recording of this episode and i wanted to explain uh we thought it was just a skype problem and that
the recording would sound fine in the
end, but that was not the case. My voice is going to change dramatically, but we didn't want to
scrap the episode and have to re-record with Patricia. So I apologize for the poor quality
of the sound, but the show will go on. So what's going on at the conference today?
Oh my goodness. You know, honestly, I don't even have the schedule up right now to know what's going on today.
Although the main thing that I know is that 8 o'clock in Seattle time, Matt Godbold is giving an open session on his work on emulating the BBC Micro in JavaScript.
And I'm going to try to head over there, so I might have to cut out a few minutes early on the podcast today.
Okay, no problem. Well, we're glad to have you here, and it's pretty cool to be talking to
you live from CppCon.
Well, at the top of our episode, I'd like to read a piece of feedback. This week, we got an email from
Tom, who writes in, Hi, Rob and Jason. Thanks for making the podcast.
I find it really interesting.
With features such as lambdas in the language
and ranges on the way,
C++ is becoming steadily better
as a language for functional programming.
I haven't listened to all your episodes yet,
but I think the only reference for functional programming
was a brief mention in episode four,
which was way back when with David Sengel.
If they're willing,
it'd be interesting to hear from those teaching
and promoting functional programming in C++, such as Ivan Kukic
or Bartosz Maluski. I apologize for butchering those names.
But yeah, we probably have mentioned functional
programming. I feel like it had to have come up. Yeah, at least with Jackie
and Ben specifically, because those are two that talk about functional programming a lot.
But that episode probably didn't focus on it. I mean, Jackie, we talked mostly about
robotics. We don't think we delved too deep into functional. So yeah, we should try
to do an episode on that. Sure. We'd love to hear your thoughts
about the show. You can always reach out to us on Facebook, Twitter, or email us at
feedback at cpcast.com. And don't forget to leave us a review on iTunes.
Joining us today is Patricia
Oss. Patricia has been a C++ programmer for 12 years. Currently, she's working on the Vivaldi
browser, and previously she has worked on the Opera browser, on embedded telepresence systems
at Cisco, and even did a two-year stint as a Java consultant. She is passionate about learning and
teaching, as well as trying to make the world in general and tech in particular a more inclusive place.
Patricia, welcome to the show.
Hi. Thank you.
I don't think we've had any web browser developers at all on the show yet, have we, Rob?
Well, we had someone from Google working on WebGL, right?
Yeah. Oh, yes. Yeah, but someone actually...
So you do work on the front end, I assume.
I mean, like, with the part of the web browser we see,
or what are you working on?
I'm very curious.
Well, in Opera, I did,
because Opera had the UI, it was in C++.
But in Vivaldi, the UI is actually in JavaScript and React.
Okay.
So now I'm behind the scenes.
But, you know, we... know generally people here work both in
JavaScript and C++ but so far
I've mostly been in
only in the C++ side
so does Vivaldi use its
own JavaScript engine or
are you using someone else's?
its own?
that is a
pretty big undertaking to make that perform well.
Yeah, so it's pretty good, actually.
You should try it.
It's surprisingly well when you think about it
because JavaScript isn't necessarily what you consider performant,
and especially for UI, it's very important.
But you should try it.
I will.
We will.
Okay, Patricia, well, we have a couple
news items to discuss. Feel free to comment
on any of these, and then we'll start talking to you
more about the world
of Java and your involvement
in there and C++.
Okay?
Okay, so
the first one is
Bjorn Stroustrup was just awarded
the 2017 Faraday Medal from IEEE.
And this is a pretty big honor, right guys?
Yes, it is.
It came up at the conference here.
Yeah, I saw it just before Bjorn's talk.
Yeah, it's not technically IEEE.
It's the Institute of Engineering and Technology.
Oh, okay. I'm sorry. I thought it was the IEEE.
It's the EIET.
Okay, yeah, he's already a fellow of the IEEE, that's what I saw.
But yeah, pretty good to see the founder of C++ recognized with such a prestigious award.
You said this was mentioned during his talk
yes and it's also interesting to point out that most of the previous recipients have sir in front
of their names he's one of the few who is not a knight who has won okay so that's the next stage
then he needs to be united yeah i don't believe uh knighthood is bestowed upon non-residents of the
crown or whatever.
Okay, so we'll have to...
Yeah, and I think because
I think he's an American citizen,
I don't think if you're an
American citizen, you can be knighted.
Like, you'd have to revoke your citizenship
in order to become knighted. That is my understanding
also, but you know what, if I was offered a
knighthood... Exactly, that's what I knighthood, it might be worth it.
It would be awfully cool.
Yeah.
Okay, the next
thing we have is this new
Orbit Profiler, which is
a C and C++
visual profiler. It does look like
it's limited to Windows,
but I watched the video they have on the website, and it looks pretty
powerful, and you don't need to do any modifications
to your source code in order to work with the profiler. You just need to point
it to your running application and have a PDB
available, and it just works with that,
which is pretty cool.
Yeah, I was looking on their website,
and if you click on the About link,
it takes you to a blank page.
Okay.
So I did download the binary and start searching through the zip file to find the license,
because that's what I was curious about.
Is this ultimately a commercial project or not?
The license says BSD2,
so it looks like it's not a commercial project.
So it looks very interesting regardless, though.
Yeah, I'd highly recommend listeners just watch the quick video
so you can see kind of what the tool is capable of.
I think it looks like it might be more powerful
than some of the built-in profiling tools
with Visual Studio, which is pretty impressive.
I'm curious, Patricia,
since Vivaldi is a cross-platform browser, right?
Mm-hmm.
Do you profile on all the different platforms
to see if there's performance anomalies
on different platforms,
or do you stick with what you like?
Well, I've only worked in Vivaldi since January and I'm normally or up until now I've been
a Linux programmer but while being in Vivaldi I mostly work on Mac and Windows so most of
the time I'm actually trying just to learn how Mac and Windows works.
Because I guess I'm the strange person that is like,
I've been a Linux programmer since I started university.
So that's 17 years.
I haven't had a Windows machine for 15 years.
Wow.
So, but, you know, I'm learning. I'm fixing bugs, especially on the media side, but mostly
there's not, it's not so much performance that is the problems.
I'm mostly doing bug fixing for platform issues.
But I assume that I would need to use, like usually on Linux, I would use things like
CacheGrind and Valgrind.
Right.
But I would have to
get to learn the Windows
and Mac tools for profiling.
I thought to ask it
because I've been doing
cross-platform development
for a very long time,
but I prefer Linux.
And if I was doing
a profiling thing,
I would just stick on Linux
because that's what I know
for profiling.
Yeah, no, me too.
But the thing is sometimes you have platform-specific issues
and then you probably should try.
At least I want to learn.
That's where I am now.
I want to learn more about how OS X works,
how Windows works more in the internals and the platform APIs
where I don't feel like I know very much now,
whereas Linux, I'm kind of comfortable.
So I need to get out of my comfort zone.
Cool.
Okay.
Next thing, and this is another CPCon related article.
Google has just released Abseil,
which is a new common libraries project, and
apparently many of their internal projects use these
Abseil libraries. Right, Jason? Yes. So what makes it
interesting, and I guess Titus' talk will probably be up very soon
since they get the keynotes up very quickly. Yeah, and we will be talking to
Titus next week, I believe.
Right.
So I probably shouldn't go into too much
of what he talked about.
But let's just say that they are providing
a guarantee of API stability around the library.
And then we'll talk to Titus about that,
what exactly that means.
Well, what I thought was interesting is that even if you only have C++11,
they're providing C++14, C++17 type APIs,
which looked really cool because very often you can't change your compiler.
So suddenly you can have STD optional,
and even though you're in C++11.
So it looked really interesting, but I have never seen it before.
So I haven't seen it inside of Chromium,
but I guess they have their own kind of similar type
of in-between library.
So maybe they'll be switching.
I don't know.
I haven't seen anything to that effect.
Yeah, it sounded like we can expect
to maybe see it in more Google projects since it's more visible now.
He did make a comment that supporting variant
on a C++11 compiler is apparently shockingly difficult.
I didn't hear the details
on that, but yeah. But I don't know.
I use variant in Qt.
They have a variant type thing, but I don't know.
What is the use case for variant, really?
If you want a non-allocating thing that can have multiple different states,
I'd say that's the main goal.
Because any might allocate, but a variant never will.
So if you're doing parsing of nodes and you've got three different things that a parse tree could contain,
you may as well just make a variant of those three different things instead of doing a shared pointer to a virtual function, a virtual thing.
Okay, so it's a union.
Yes, it's a discriminating union
is how it's described.
But still, I hardly
ever used union either, so
I don't know, have you used variant
in real life? I haven't. Or something
similar? I haven't,
but I do see, well, no,
actually I have now
because I just ported some code to
C++17 and in my JavaScript
parser specifically,
instead of having,
um,
instead of having an,
um,
an object,
a map of vector and an int and a double and a bull as possibilities,
I have a variant that can be one of those five things,
six things.
And then I just have vectors of those variants.
Okay.
And it did work.
Well, that's good.
No, because I had never really used union either.
But it is very present, like, in the X server APIs,
they use union a lot.
So, but I've never used union much either.
But I guess it's for those kinds of cases that you're talking about.
Yeah, and I will say I completely agree with you.
Like I felt like I've had no use for union at all,
but I've had to, as I'm teaching things,
like how is variant implemented,
having to learn more about how union is used
and how these things work and then going,
oh, this has more utility than I thought that it did.
See, that's probably what I need.
I need to watch some talks about this,
and then suddenly I'll realize the use cases.
Yeah.
Perhaps.
Well, speaking of talks,
the first CppCon 2017 videos
are starting to go on YouTube already.
It looks like the Bjarne Stroustrup keynote
was posted 14 hours ago,
so that was overnight for me.
I didn't have a chance to watch it yet.
But for our listeners, by the time you hear this, I'm guessing a couple other
keynotes will be available as well. Almost certainly, yes.
Yeah, they're pretty good about getting these videos up quickly. I think
by the end of the week, I'm guessing almost all the keynotes will be available, and then other
sessions will start to get posted next week. Right. So if this airs normally like on Thursday night, Friday morning,
then I would expect at least the first three keynotes
will be available to the listeners when they log in.
Yeah.
So I'm going to have to go ahead and watch this
Baron Strewsup keynote later today.
And I guess we already talked about that,
but you said it was a good talk, Jason?
Okay.
Okay. Okay, so
Patricia, we have you on the
show today because a couple
weeks ago we had a listener email us saying
that even though he's not a C++ developer,
he is a Java developer,
I think he was, but he really likes
listening to the show and he was kind of hoping we could do
a Java for C++ type episode.
And right after that episode,
I saw you on Twitter, I think getting retweeted by Kate Gregory, preparing for your C++ type episode. And right after that episode, I saw you on Twitter, I think, getting retweeted
by Kate Gregory, preparing
for your C++ talk at
the JavaZone conference.
So, yeah. So, could you
tell us a little bit about that C++ talk
and why you decided to do a C++ talk
at a Java conference?
Well, generally, I choose
a conference based on different
kinds of criteria.
And this one is probably the biggest development conference in Norway.
And second biggest is NDC also.
And I spoke at NDC also this spring.
So that means I get to go to the two biggest conferences in Norway for free.
So that's one big one.
But also, I used to work as a java programmer and and
when i was in university that was also the main programming language university and so i i did
the transition from being a java programmer to being a c++ programmer kind of suddenly when i I joined opera. And that was a rude awakening.
So I thought, you know, and then I generally tried to do that.
I tried to make talks that I would go to if somebody had that talk.
And I think there's a lot of good lessons that you can learn up front instead of learning the hard way when doing that transition.
So it's not as painful.
So was the talk well received then?
Yeah.
Yeah.
Actually, the funny thing is there wasn't that many people there because Java programmers generally aren't very positive to C++.
I don't know if that's a worldwide thing.
But generally, everybody has some kind of traumatic experience.
But it's true, it is um so so uh it was the people that were there were really uh really happy but also what was
interesting was that i shared the slides after my talk and uh after like four hours I had 400 views of my slides I'm like oh
my god there's there is there is really an audience for this more like worldwide
than in my actual conference but it like the conference I guess it was 60 or 70
people for my talk which it's about half full room. So it wasn't bad. There's like nine parallel tracks. So most
of the talks are, you know, 100 people. So it's all right. And then a couple of people came up
to me afterwards and said that they wanted to try C++. So that was good. Mission accomplished then.
Yeah. So what are some of the key differences between Java and C++ that you
highlighted during this talk and that you think are worth highlighting for the Java developer?
Well, especially two things that I was focusing on. And the primary thing was
pointers. Well, actually, the two things, pointers and new so basically because this is the problem
is that if you're coming from java into c++ you think you know what these things are and that's
usually where everything goes haywire because java developers aren't used to managing their
own memory and so they knew things all over the place and they don't have any concept of managing the lifetime of these objects.
And so they don't really know when they're going to be deallocated
because they don't think about memory that way.
Because you just knew stuff when you need them.
And then it disappears on its own.
And you don't have to really think about it.
So that's the first thing.
So I basically, I had one slide that I said,
if you don't remember anything from my talk, then just remember this one slide. And that's
using new. So I basically told them, don't ever knew anything. Because if you don't knew anything,
then you don't have to delete anything. And then you're good. It's very hard to end up in a bad
place. You're not going to be leaking memory. Probably you're not going to be having memory
errors. So it's going to be much easier. But if they're not doing anything,
then it comes to the second part. Don't use pointers. Don't use raw pointers. Because that
is the other problem is they think they understand pointers. Coming from Java, they have what they
call pointers. But what they call pointers is more like references. And so suddenly they're coming to the C++ pointer, which is a raw
pointer right into memory. And there can be anything there. Things can be deleted. We can
do all sorts of stuff. We can cast raw memory to a class. We can cast two totally different objects to each other
with a hard C cast, and it works.
You can call functions on a deleted object,
and as long as you're not touching the members,
it just might actually run.
I mean, this is crazy.
You can send your pointers going all the way past your objects and into the stack and into other parts of the memory.
And you can do this in C++.
And they don't think about pointers that way.
But so the problem is that if you're looking at something simple, like I had an example of a banana.
So it's like banana star banana or B equals new banana.
That looks surprisingly similar to Java.
If you just take away the star, then, you know, they think,
so they think they know what that means.
But the problem is it means so much more and so much more dangerous things
in C++ than it does in Java.
So I basically told them, if you don't remember anything else from my talk,
then just remember this one slide.
Don't knew anything.
Because if you start with that frame of reference,
then you're thinking,
you have to allocate something, right?
So you're sitting there and you're thinking,
okay, but Patricia said, don't knew anything.
So what should I do then?
And then you're going to a good part of C++.
Then you're learning more about value objects, about allocating on the stack. They don't even
think about the stack. All their allocations are on the heap. And so, you know, they're getting to
a place where they're Googling the right things. And, you know, then they get the smart pointers
after a while, and the smart pointers are
on the stack, and then they're
going to make unique,
and they're not doing anything.
So I was
trying to teach them more modern C++
to get
them more in a safe environment.
So did you actually
cover the difference between the stack and the
heap, or did you just try to keep it at that level of, okay?
No, no.
Well, I have to because I have to show them how it's different
and how you can use a small object that you hold on the stack,
like a smart pointer, that is the owner of the object on the heap.
And in that way, you can manage the lifetime of stuff on the heap
by having a small value object on the stack.
But basically, I was...
You have to talk a lot about how to manage memory because
they're not used to managing their own memory. And they're not used to thinking about the stack.
Yeah. So that was, that was a,
but I also went through a lot of modern C++ because I wanted them to see,
because what I see a lot when I talk to people is that they,
they tried C++ once and it was like 15 years ago.
Exactly. And so then they think, you know, that's what C++ is.
And so then I wanted to show them other things you know like that are like range base four or structured bindings which i think is really cool
and uh and other things so i could show them a different um that c++ isn't what it was and you
can do a lot of what they consider modern type of programming in C++ and it doesn't have to
and auto, a lot of people don't even
know that we have auto
and yeah
that makes a huge difference
it does, it does I think
for people and especially because what I
hear a lot is that people have had
traumatic experiences
like yeah I tried C++ once
and it leaked all sorts of memory and then
it crashed and I didn't understand. And then, you know, it's like you can feel their pain. I mean,
this was like a thing. And then they were like, no, so I didn't do that anymore.
So I think if we're going to like onboard people to C++, we have to give them a smoother way than just throw pointers and memory at them
and just let them die there.
So I'm hoping modern C++ can do that.
I like that you brought up the ranged for loop and auto and that kind of thing, because
I even have forgotten myself that as a young C++ developer
there was a huge mental load in simply understanding how to iterate over a vector.
Yeah. And now that's like one line.
Exactly. You don't have to think about it. And there's enough
stuff to think about. You don't have to think about that.
Right.
Let's talk a little bit more about some of the differences between Java and C++.
There's a big difference between the way parameters are passed through a function, right?
Yeah.
You have ways of passing in C++ that they don't have.
So it becomes kind of weird.
Like I said, the Java pointer is somewhere in between
a C++ pointer and a C++ reference.
And so separating those two
is often very difficult for Java programmers
to understand the difference
between a raw pointer and a reference
because they're similar
in two different directions.
But also they can pass objects by value.
They can only pass them by reference.
In this case, their pointer, right?
And so the idea of having passing non-primitive types as parameters
or returning them is something that they don't,
they have never seen before.
But it is something that they're working on in Java, actually.
For Java 10, which is not now, but a future version,
they're thinking about introducing what they call value objects. But I don't know to what extent the syntax for it is finalized but for the understanding I
think it will help. I was at Java Zone and I made some jokes to a friend of mine who was also a C++
programmer, a current Java developer now, that for a conference on Java which is and they say you
know oh we don't have to think about memory. I was in constant
talks about memory problems and debugging memory problems. So, I mean, they're getting to a point
where they realize that they probably have to handle memory better than they have been.
And so I think if, so we'll see. But basically, in memory, in parameter passing and return values,
they have a very limited ways of passing.
And so introducing all of these other ways is...
The thing is, you can introduce all the ways,
but you should also add some kind of rule set,
like what is the best way, what is the second best way so so that they also have some
kind of culture with it because that's something i feel with c++ is very important and we have to
teach it with you have to learn it from a c++ developer so that they can tell you yeah you can
do it in 50 different ways but this is the way it's done. Because they have to interact at a certain point with other
developers and then, you know, I want them to be successful in that first meeting of showing their
code and people are like, what have you been smoking? I mean, this is... Because we do have
crazy ways, you can do almost anything in 50 50 different ways but we don't think about it but
they are like the way we do and then there's a bunch of ways we don't so so kind of trying to
introduce that a little bit as well so you said that you were in lots of talk about uh memory and
debugging memory and i am kind of curious i mean you said that they're having to rethink how they
pass parameters maybe using value types.
But what kinds of things were you talking about in those conversations?
Other than that, I haven't programmed in Java in so long that I don't even remember what the issues were.
No, what they see a lot is the garbage collection takes a long time.
Okay.
And this is a problem that we had takes a long time. Okay. And this is a problem that we've had for a long time.
It's because it is a lot of the way they handle memory, right?
They're allocating lots of small objects over and over and over again
that get reclaimed right after.
And then if they're unfortunate, they will allocate a very big object.
And then in garbage collection,
they have what they call young generation and old generation.
And if you allocate objects and they end up in the young generation,
they're usually easily garbage collected.
But if you end up in the old generation,
it will take longer and it's slower.
And if you allocate a very big object,
it might end up in old generation,
even if you're only keeping it for a very short time. And they they end up in so the thing is i'm coming from c++ and i have a different
concept of time right these people so so that's like i was sitting in the talk and and and uh this
um person who worked on the garbage collector the new garbage collector that they got in java 9 and
and he said you know if you're lucky, 90% of your GCs will
be less than 10 milliseconds. And I'm sitting there going, 10 milliseconds? Oh, my God. Is
everybody just going to sit around for 10 milliseconds? And the thing is, that's the problem. i talk to java developers i'm gonna like yeah
startup time isn't really bad it only takes like five seconds and i'm gonna
five seconds so they i don't know so i'm having a little bit of a culture
culture clash because i'm coming especially from like, especially from the embedded side and doing real-time media.
It's like, I have 60 milliseconds to do everything.
Or I'm going to skip a frame.
And that's not going to happen.
So all of your stuff has to happen in 60 milliseconds.
And that's all of your calculations, all of your rendering.
The frame from start to finish has to be done in 16 milliseconds.
Can you imagine sitting around and just waiting for 10?
I can imagine how they do smooth animations in Java.
I'm not sure they can.
So, no.
But basically, that's their problem, right?
They end up like, that is what they consider a fast GC.
And suddenly, you can have a GC that takes hundreds of milliseconds.
And then that will really impact your user experience.
Yeah.
I'm sorry, go ahead.
No, go ahead.
I was recently doing some Ruby programming,
and I knew this might be an issue, but I had a tight loop that was doing data processing.
And I had to manually call the garbage collector because it simply wasn't finding its own time to call itself.
And I was running out of memory.
And that's theoretically a language that should have been keeping track of the memory for me. No, tight inner loops,
it's not very good for these languages where you have no way of allocating your memory correctly.
And that is also another way that you can do in C++,
you can manage your memory layout,
you can try to optimize it for your caching
to try to hit a more optimum cache level.
And they don't even think about that.
And it's no wonder because there's nothing they can really do about it.
They can have an array of objects, but they're not co-located.
They have an array of pointers to objects.
And so when they're traversing these objects,
they could be anywhere in memory.
And so they will be having cache misses all the time.
So I'm not really sure what they can do, actually,
to improve their memory handling when they have a language
that doesn't really give them memory control.
But maybe with this new value types things,
maybe they will get to a point
where they can at least manage,
especially small objects
by holding them on the stack instead
and then managing the memory on the stack.
I'm hoping, I don't know.
So we'll see.
I want to interrupt this discussion
for just a moment
to bring you a word from our sponsors.
Backtrace is a debugging platform
that improves software quality, reliability, and support by bringing deep introspection and
automation throughout the software error lifecycle. Spend less time debugging and reduce your mean
time to resolution by using the first and only platform to combine symbolic debugging,
error aggregation, and state analysis. At the time of error, Backtrace jumps into action,
capturing detailed dumps of application and environmental state.
Bactrace then performs automated analysis on process memory and executable code to classify errors and highlight important signals such as heap corruption, malware, and much more.
This data is aggregated and archived in a centralized object store, providing your team a single system to investigate errors across your environments.
Join industry leaders like Fastly, Message Systems, and AppNexus
that use Backtrace to modernize their debugging infrastructure.
It's free to try, minutes to set up,
fully featured with no commitment necessary.
Check them out at backtrace.io.cppcast.
So Java is currently being actively maintained by Oracle,
and you're talking a little bit about some big updates
they have planned for Java 10.
What are some of the more recent updates going on in Java?
Any big new features?
They have some small things that I thought was,
well, basically, okay, the first big thing that they have,
the most famous thing they got in Java 9 now
that they're rolling out is modules.
They beat us by three years.
So, yeah, so they're going to be rubbing that in our faces for three years now.
But they got modules finally.
And it looks pretty good, actually. I think it's going to be good for Java, especially
for structuring things, things that we've been using frameworks for a long time, I think will
be better now. And also, they got another little thing, which I think is important for learning,
is, and maybe we should get, maybe something like this exists for C++ actually.
It is basically a console type thing where you can evaluate expressions.
Like in your browser, you have your browser console.
You can put in small JavaScript stuff and have them evaluated
without writing all sorts of boilerplate around it.
You can just put in an expression and have it evaluated.
And they call it JShell, I think.
But I think it's very good for learning
and for just thinking, how is this?
How is this evaluated?
I don't remember.
Instead of having to write a small main and compile it and blah, blah, blah,
then you could actually do something in this small console thing.
So I think especially for people at universities
and learning and starting out,
I think it's very useful.
But it's not very famous
because it doesn't really do anything
for experienced programmers.
But yeah, so I think those,
but they're also working on stuff
as things around network and stuff,
but they have a lot more libraries
built into the language than we do.
I'm hoping that we'll get network stuff,
cross-platform network stuff.
Anybody know?
Well, the ASIO proposal, I think, is moving forward.
I think we probably expect to see the TS in 2020.
Anyhow.
I'd say that would be really good.
Yeah.
Because we're still not very...
It was hard for me to say to Java developers,
it's like, oh yeah, we got a cross-platform file API.
It's like, I can't even say that to anybody.
It's like, okay, you didn't have that.
That's weird.
I was...
No, I'm sorry.
No, go ahead.
I used Java pre-Java 1 days.
And the fact that it came with a gigantic set of things
that did everything from GUI to file system and networking was huge.
That was very handy.
Yeah.
And actually, one thing that's interesting
that they'll get now with modules is a way of selecting.
Because the thing, again, is like for more embedded platforms,
then the Java library is very big.
And so what they're getting now with modules
is also the possibility of selecting modules that you want versus modules that you don't want.
And not only packaging those, which is interesting.
I haven't seen it yet, but I find it very interesting.
We, like, in Qt did this, like, in Qt 4 or 5 or something. They also did the split where you could select which ones
and you could just select a very
small subset of modules
to take with you
which is very good for things like the Raspberry
Pi and things where you really have
limited space in all
sorts of ways. So I must say
I must go now as I said at the beginning of the
interview. I am disappointed to have to leave.
I am curious if you are planning to be at any of the European C++ conferences.
Right now, I'm not traveling that much
because I have a young son who is autistic,
so it's not very easy to...
So I try to go to everything that's really close by.
But I'm hoping maybe next year that traveling will be easier.
Okay.
Well, hopefully I get to meet you at some point.
And sorry, I have to jet.
Thanks for having me.
Enjoy.
Thanks for coming on today, Jason.
Hey, thanks.
Okay, so I can keep talking to you, though.
So you said you started out doing Java programming and you transitioned into C++.
Did you ever do any cross-platform work between the two?
Between Java and C++?
Not much.
I did a little bit at university, but that was just to try things out.
And I did a little bit when I was, I made some proof of concept Java apps or Android apps.
Okay.
Where I was using C++ libraries inside of a Java app.
And so there I had to do some JNI stuff.
Okay.
But I haven't mixed them much.
And it's not really a very comfortable space
in my experience but maybe there are better libraries now
Yeah, JNI always seems like it's pretty painful
for cross-platform development compared to
some of the other options like between C Sharp and C++
Yeah, definitely
No changes there as far as you're aware?
Not as far as I'm aware, no.
Do you want to tell us a little bit about the work you're doing at Vivaldi?
Yeah.
What am I doing?
I'm fixing old bugs.
No, well, the thing is I've been tasked with taking care of the platform integration of media on Windows and Mac, because there's a lot of proprietary codecs that are used on the web today.
And to decode those, you have to have licenses for the decoders.
And we don't.
Big companies do, like Google, they do.
And so we have to have some way of decoding these. for the decoders and we don't, big companies do like Google, they do.
And so we have to have some way of decoding these.
And we're using some code that Opera open sourced a few years ago,
but then they un-open sourced it again.
So it's, but it was open source at the time.
So we made a fork.
So we forked it way back when.
But it had bugs, and it's sort of been...
The thing is, it's like they're making a browser, and there's not that many people,
so this thing didn't really have a dedicated person.
So I've been trying to take it in to give it some TLC, fix some bugs,
but most of the bugs are really hard bugs because all of the easy bugs were already fixed.
So I just have a really long bug list of the really, really hard bugs.
But it's getting better.
I think we've gotten fixed a bunch of issues over the summer
and it's looking better.
So I think my goal is that all the Vivaldi users
should have as good of an experience in Vivaldi
as any other browser.
Okay.
And then hopefully over time,
we'll make some really cool features as well.
Okay.
Taking it back to this JavaZone conference,
I think last year at Google I.O.,
Kotlin was announced,
which is a new programming language for Android.
Do you think Kotlin might become
the preferred language for Android development over Java?
Did they talk much about Kotlin at the JavaZone conference?
There was a lot of talk about Kotlin.
But the thing is, it's very hard for me to judge.
Java is getting to be quite a mature language,
like C++.
And so it's very difficult to see how,
like they've had lots of these hyped up languages over time
that run on the JVM.
And some have been more popular than others.
Some have, so I don't know exactly
how well Kotlin is going to go.
I think probably Google is very motivated to move away from Java because of all of the lawsuits.
Right, right.
But I don't know.
I'm very curious to see how it goes.
I'm also paying more attention to the JavaScript community, and they are really fast moving in what is cool it's like that you you kind of
what was cool six months ago is not what's cool now so but java tends to be a little bit longer
in the culture so we'll see but i'm i'm very curious to see how it goes what types of
applications are developed most in Java these days?
Are people making GUIs? Is it
server stuff? Websites?
I don't know.
I don't know.
Here in Norway, it's back-end
server stuff.
So generally, they make
back-end in Java
and then they'll make a front-end in JavaScript
HTML. And nobody makes desktop applications in Java and then they'll make a front end in JavaScript HTML.
And nobody makes desktop applications in Java anymore.
Well, there are probably like IntelliJ and those kinds of,
they probably are in Java still.
They are in Java still.
But they generally have their own UI libraries because the Swing library was not very good
and there wasn't really any replacement.
So people make their own UI libraries
and then open source them
and other people use them.
But right now I don't think
new desktop applications often are based on Electron
and people are making,
web developers are making desktop applications.
That's like a JavaScript library, Electron?
It's basically Chromium packaged as a desktop application,
and then you can make your own UI.
And so it's basically, it's very, it's, how can I say it?
It's like you're taking an entire browser and you're packaging it just to
show one webpage.
But you know,
the web developers love it because they know they can write desktop
applications just using web technologies.
But from my point of view,
coming from,
but the
thing is, I'm feeling like I'm getting old. It's I because we
used to think about memory, we used to think about, you know,
how much disk space you're using, you used to think I
remember us worrying about package size. And now people are
just they're just spending memory bandwidth disk space package size
is just they're just throwing everything around and everything's fine because everybody has
supercomputers and i'm not sure that's true actually but all of the developers have supercomputers
yeah that's true okay well i don't think I have anything else left to ask about.
Is there any big updates coming to the Valdi browser anytime soon?
Well, we're working on sync
so that you can have synchronization between the different installations.
And we're also working on getting an Android app.
And those two things are together very important
so that you can synchronize your stuff
from your different desktop machines and your phone.
And so I guess those are the biggest two features
that we're working on.
And of course, the mail client,
I keep forgetting because I keep using it every day
and an integrated mail client, of course,
because we've always coming from this old school opera.
So the old classic opera, the one before the new opera.
Same kind of idea of a very configurable experience.
So we're getting an integrated mail client as well.
Very cool. Well, thank you so much for your time today, Patricia. configurable experience. So we're getting an integrated Melclite as well.
Very cool. Well, thank you so much for your time today, Patricia.
Thank you. Thank you for having me.
Thanks so much for listening in as we chat about C++. I'd love to hear what you think of the podcast. Please let me know if we're discussing the stuff you're interested in. Or if you have
a suggestion for a topic, I'd love to hear about that too. You can email all
your thoughts to feedback at cppcast.com. I'd also appreciate if you like CppCast on Facebook
and follow CppCast on Twitter. You can also follow me at Rob W. Irving and Jason at Leftkiss on
Twitter. And of course, you can find all that info and the show notes on the podcast website
at cppcast.com. Theme music for this episode is provided by podcastthemes.com.