Monitor performance issues & errors in your code

#20: Interactive Python and Teaching Python: Beyond Text Books Transcript

Recorded on Tuesday, Jul 7, 2015.

00:00 What if your computer science textbooks could run their Python code samples, and that code ran directly in your browser? Kind of like Javascript but better because: Python. It is possible, and Brad Miller is making it happen.

00:00 This is Talk Python To Me, episode number 20.

00:00 Recorded Tuesday, July 7th 2015

00:00 [music]

00:45 Welcome to Talk Python To Me, a weekly podcast on Python- the language, the libraries, the ecosystem, the personalities. This is your host, Michael Kennedy. Follow me at Twitter where I am at @mkennedy, and keep up with the show, and listen to past episode at talkpythontome.com and follow the show on Twitter via @talkpython.

00:45 This episode we'll be talking to doctor Brad Miller, about interactive Python, Python in higher education and Skulpt, the Python that you run in your browser.

00:45 I'm happy to tell you that this episode is brought to you by Hired and Codeship. Thank them for supporting the show on Twitter via @hired_hq and @codeship.

00:45 Now let's get right to the show.

01:28 Brad Miller is an associate professor of computer science at Luther College. He is the founder of Runestone interactive, he loves to travel, hack, bike and cook, but not necessarily in that order.

01:40 Brad, welcome to the show.

01:42 Thanks. It's a great pleasure to be here.

01:45 Yeah. You guys are doing some really awesome stuff over at Runestone and online platforms for people like learning and teaching Python, and that's what we are going to talk about today. But before we get to online Python and Python in the browser and a bunch of other cool stuff, what's your story, how did you get here?

02:01 So, we can go all the way back to 1979, when I first got into programming I suppose. That was when our high school got the first Apple tools installed and I discovered Apple soft Basic, and I discovered that I could win a lot more often if I hacked The Lemonade Stand game, and made a rain on player two a higher percentage of the time than player one. So, that was kind of my introduction to programming, digging into Basic code.

02:34 That's really awesome, I mean, that's what a lot of programming is, is you are like I don't want to just use this tool, I want to like make a better tool or change it or whatever, right, that's really, that's cool.

02:43 Yeah, it doesn't say much about my ethics, in those days, but...

02:48 It was just the Lemonade.

02:49 It was gap. Better than Organ Trail, which was the other popular game back in those days.

02:56 Yeah, indeed. So, yeah so, that's how you got started in sort of interest in computers. How did you get into the programming?

03:03 So, I started out as a computer science major, at Luther when I went to undergrad, and learned- you know, that was back in the days when people learned Pascal, and then I started my career at big iron mainframe manufacturer called "Control Data" and I worked on energy management systems for "Control Data".

03:28 Yeah well what kind of language?

03:30 Fortran. So-

03:34 Oh yeah, I was told when I was in college, and starting out that Fortran was the most important language I was ever going to learn in my career. And I pleaded to take C++ after Fortran.

03:44 I just missed the punch card days, so I guess Fortran is as bad as I get.

03:50 Yeah, cool.

03:52 Yeah, and I had a great internship with 3:54 research, where I got to work in their AI lab, so that got me interested in less interpreted languages, and yeah, then in grad school I started hacking in Perl a lot, and then C++ and Java, and then I made a career change in 2003 when I became a college professor.

04:16 Oh, wow.

04:17 I left the successful startup company and came back to teach. And I taught Java to introductory CS class for a year and I realized that it was just the worst possible language for teaching people that had never programmed before how to program. And so we looked around and there was this language called Python, which was still, you know I know it's not new, but it was really very very new in educational field back in 2003. In fact there was only one textbook available but we decided that we were going to ahead and adopt Python as our introductory language for teaching in computer science. Which immediately led to myself and my colleague David Ranum writing a data structures textbook, because we wanted to be able to teach Python in both CS1 and CS2.

05:06 Yeah, of course it the book isn't there... maybe you have to go back to Java and you don't want to do that.

05:11 No. Yeah, so that was definitely ok we can use this one textbook that's there but we are going to write the other one, and so that worked out really well.

05:19 Yeah, that is really cool. You know, one of the things I think is really success story for Python is it's become the most popular sort of introductory computer science language at least at US universities, but I think that's pretty global.

05:34 Yeah.

05:34 Yeah, can you compare what it's like to teach Java and what it's like to teach Python, the way the student received it, were there like better grades, more excitement, less drop out, those kind of things?

05:45 I mean certainly less drop out with Python, and I think it's much much quicker to much much quicker for them to kind of get up and running and be able to do interesting stuff. When you teach Java I like to say there's like 12 things that you have to lie to them about on day 1. Starting with public static void main string, arcs, there is like none of that do you want to try to talk about to introductory students on the first day of Java class. So, whereas with Python you can I guess say print "Hello world" and at least you get something. But it's also just as easy to say import turtle, make a turtle and make the turtle go forward by a 100 and that gives, there is that immediate gratification of being able to see something visual on the screen and you know, be able to control the stuff just by typing. So, that was a huge change, just sort of in student mentality, to be able to kind of get into something where they could get that immediate gratification.

06:52 Yeah, that's really cool. The show I just released this week with Lynn Root, she talks about how she was studying C++ to make a switch basically get some foundation to move on to like a PhD program in finance and they had to do programming so she took C++ class at it just about crushed her will to do anything of programming and she came in and learned Python and that's what she is still doing today, it's great.

07:16 Oh yeah, I mean and there's still many great you know, packages out there for Python that you can really get students working with interesting stuff right away.

07:26 Yeah, that's for sure. I just found today, a GitHub project called "Awesome Python" so I think it's, if you just search for awesome- python GitHub, and it's a like a curated list of all the amazing packages that people like really love, so...

07:44 Oh, that's really cool. I have to go look at that.

07:47 Absolutely. So, are you still teaching at the university?

07:52 I am. Yes.

07:53 And you are doing this thing with Runestone Interactive, why don't you tell everyone what that is?

07:56 Yeah, so Runestone Interactive is kind of three components I'll say- first of all it's a set of tools, for authors that want to create interactive course materials. So anything from lecture notes to a lab to a full blown book like what we are doing. So that includes, I like to say the kind of a big hairy audacious goal is that we would like to be the Latex of interactive writing.

08:27 So we've got all these tools that we are trying to build to make it easy for instructors and other people to write interactive materials. So things like interactive code, visualizing code, including video, including little assessments like filling the blanks or multiple choice or short answers, you things so you can hide things and show things and so all those kind of things that you would want to have in an interactive textbook whether it's for computer science or for some other topic in fact.

08:59 Yeah, absolutely, So it's kind of like taking the traditional textbook but making it something that is more native to the real world, right, if I'm learning about computer science I should be able to run the code, I should be able to see visualizations, I should be able to listen and all that kind of stuff is part of what you guys have there, right?

09:18 Yeah, exactly. I mean this sort of started out on my sabbatical in 2011, when I was supposed to be working on new additions for the two textbooks that I've written, that are paper based textbooks. But, as I was trying to write these updates to the paper textbooks, I kept thinking, "God this would be so much cooler if it was actually doing something interactive on the screen". And so, I stopped working on the stuff with the paper books, and I started experimenting with how we could make all this stuff interactive. And then I realized nobody in their right mind would ever write a textbook where he had to go and use Javascript to hardcode every code example you wanted. Then I started to think ok, how could I write some Macros that would make this easy? And so that kind of led to that first part of the authoring tools.

10:15 So that's sort of part one. Part two is that then there is this sort of setup back end services that you have to run. Things like when students run code, or write code you want to be able to save what they've written, so that the next time that they come to the website they don't have to start over and re-enter all their code again. And if you are going to use it for a class, you would like to have it let's say save the answers to the multiple choice questions or give the instructor a grading interface that they can go and grade and keep track of how the students did.

10:45 So that's sort of the setup interactive services that support the book on the front end.

10:52 That's really cool, do you guys actually use the interactivity bed for like assessments and tests and things in your classes?

11:00 Yeah, yep. It's great for daily assignments for example, like what I can do is say, "All right, I want you to read this section and at the end of the section there might be a little coding thing, or there might be 3 or 4 multiple choice or fill in the blank kind of questions" and then every day before class I can go in, I can go in the instructor's dashboard I can look at the responses to all those questions and get a sense for all right, what were the things that they understood about this section, and what were the things that they've struggled with, what were some of the common mistakes that they made. And then that pretty much informs what I am going to talk about at least at the start of every class, is to think about-

11:39 That's really powerful, you don't really typically get that experience with textbook.

11:44 No. Because yo never know, right. I mean, all of us suspect that our students don't really read, the assignments that we give them, but now we actually know, because we can track them online. So...

11:58 That's really excellent. All right, what's part 3?

12:00 Part 3 then became this hosting service. So, in the beginning what I thought was, "Oh great, we'll make this all open source, and if somebody else wants to use this for their class, they can just go to GitHub, they can clone this, they can setup the server, they can build the books, they can run it on their own server". And then what I learned is that most people really don't want to do that.

12:22 So, most people just have enough problems you know, teaching their own class. So we created this hosting service where you can go in and you can say all right, yeah, I want to use textbook A, textbook B, textbook C, and what it does is it just makes a kind of a custom copy of that textbook and sets up an instructor dashboard for that custom copy so that an instructor can have their students register for their course, and all of their stuff is separate from all the other people in the world and the instructor can then just look at the dashboard for their own course. And they don't have to do anything, except go in and click a few buttons to build their book.

13:00 That's really cool. Do you mind talking about the business model just a little bit, like is this totally free, is there like a fee, do you sell the books to the students, so what's the story around that?

13:08 So we really right now are just based on donations, which doesn't work all that well.

13:16 Is there a chance of like NSF, National Science Foundation support or like Stem Research support or any of those?

13:23 I think so, I mean right now I do have an NSF grant for the next three summers. So I've got two undergrad students that I am working with this summer, making a bunch of enhancements to the way they were doing these extensions or these kind of Macros that we’ve talked about before.

13:42 Right, that's really cool.

13:42 So, yeah, but I don't get any support from them for paying for hosting fees or anything like that.

13:49 Sure, so people who want to use it out there keep in mind maybe a donation.

13:54 Yeah, you know, one of the universities that uses it is Duke university and they're really good. They've got 400 students in their introductory course, and so I know the instructors there, we've known each other for a while through conferences and what not, and I know they always go the first couple of days and say "look, we are using this textbook, it's free instead of the $140 you would probably pay at the bookstore, the least you can do is go make a $5 donation". And you know, we get about 20 out of 400.

14:25 So there is a 5% appreciation ratio.

14:25 Very cool.

14:34 But anyway.

14:33 Yeah yeah, no that's good, so keep going with that. So do you want to talk a little bit about some of the underline tools that you are using on underline packages, and technology, it's mostly Fortran in the back end, is that correct?

14:45 No, it's mostly Python.

14:49 I'm just teasing. Cool, so tell us what are you doing there, maybe before we do this actually so I went and watched your video on interactive Python, and you've got a nice video that shows you a lot of the really cool stuff you can do. Maybe you can just hit some of the high points so people would know what we are talking about.

15:10 Yeah, so I think the real a-aha moment for me was when I found this project called Skulpt.

15:10 [music]

15:10 This episode is brought to you by Hired. Hired is a two-sided, curated marketplace that connects the world's knowledge workers to the best opportunities.

15:10 Each offer you receive has salary and equity presented right up front and you can view the offers to accept or reject them before you even talk to the company. Typically, candidates receive 5 or more offers in just the first week and there are no obligations, ever.

15:10 Sounds awesome, doesn't it? Well did I mention the signing bonus? Everyone who accepts a job from Hired gets a $2,000 signing bonus. And, as Talk Python listeners, it get's way sweeter! Use the link hired.com/talkpythontome and Hired will double the signing bonus to $4,000!

15:10 Opportunity is knocking, visit hired.com/talkpythontome and answer the call.

15:10 [music]

16:30 And so Skulpt was started by Scott Graham who now works for Google. And it was an implementation of CPython in Javascript. So this was back in 2010, 2011 that he had worked on that, and I thought Oh my Gosh, this is so cool, we can run Python right in the browser, there is none of this let's submit it run it back somewhere on the server and then have the result come back to the browser.

16:57 With all the security issues and configuration issues that come with that.

16:59 Right. So this is running right in the browser, and not only that, but because it was written to run right in the browser, when I saw that, I got really excited about that and the first thing that I did was I figure out how to add the turtle graphics module to it, so now you can write your Python program and you can do turtle graphics right in the browser. So you get that kind of instantaneous gratification of seeing something-

17:23 Yeah, that's awesome. And it pops up right in like a little section or div or something of the HTML page and it's just animated. Just like the regular real turtle.

17:33 Yeah exactly.

17:34 Is that using the HTML 5 canvas?

17:36 It is. Yes, so this is all totally HTML 5 based, yeah.

17:41 Excellent, ok.

17:43 Yep. And then, so that's one thing, then the second thing is this what we call code lands, in the textbook but it's really based on the work by Philip Guo, an online Python tutor. And you know, if you've ever taught Python, if you've ever really thought about Python, very deeply in terms of things like variables for example, variables are just names for things in Python, so we are always drawing these pictures on the board of here is a name, what is that name reference you know, as a reference in the list or dictionary, or some object that you've created, right, and there's all these reference diagrams that just clutter up the whiteboard.

18:24 Yeah, something on the stack, within error drawn the something on the heap with the pointer over to somewhere... and something like that, right?

18:30 Yeah, exactly. Because you are trying to help students get a mental model for how the state of the program changes as you step from line to line, and just to really understand kind of what goes on inside the Python interprete. And so what Philip had done is he'd automated that with this online Python tutor, and so we worked with Philip and took that and made it so that we could have these kind examples and embed them right into textbook.

18:57 So another way of thinking about it if you've never seen it is it's kind of like having the debugger that where you could kind of go into step mode in the debugger, only this is even better, because not only can you go forward, but you can go backward.

19:10 Yes. And that was really impressive to me from a learning perspective, you know, if you obviously it's helpful when you are new to step to the debugger and actually see how the program is working. We get used to the fact that it's just innate to us how text becomes execution; but when you're new, my kids have looked at what I'm doing and they are like, those are words, is that really what that website is? Like how does this become a game or whatever, right? And so just seeing that happen I think is really cool, and the fact that you can go forwards and backwards is great.

19:44 Yeah. And then we enhanced that, even beyond what Philip has on the site and that for some of the examples what we can do is we can step through and you get to an if statement and we'll break into the execution at pop up a dialog box and say, "All right, after we evaluate the condition of this if statement, what's the next line that's going to execute?" And so it'll make the student really think about, "Ok, how does this if statement work and if it's true what's going to happen- if it's false, what's going to happen?"

20:13 Right. So that's like a better interactive visual version of what does this code printout, that kind of assessment, or test you might have in a computer science course.

20:27 Yes, exactly. And so kind of along those same lines one of the things one of my students is working on this summer we are calling it the clickable area question, and so this is one of my favorite kinds of questions to put on an introductory exams, is to give them some code and then I say, "all right, circle all the variables that are integers in this example," or, "circle all the assignment statements in this example"; And so now we can automate that, we can give them an example and say, "click on all of the assignment statements", or, "click on all of the things that have title float in this code snippet".

21:06 Yeah, that's cool. Does the program discover the right answer or do you have to teach it?

21:11 No, as the instructor you tell what the right answer- you know, as the author I should say

21:17 It's not like you understand the abstract syntax tree like oh yeah, here is the tree branches, we are going to have to cut these... Cool.

21:23 That would be even cooler-

21:24 Because it would save you the work. But still, that's very awesome.

21:27 Yeah.

21:27 Very awesome. Yeah so I've mentioned Philip Guo on the show before because he has a really cool CPython deep dive course from the university- are you guys at the same university or are you just kind of on the same projects?

21:42 Yeah, we just I forget exactly how we met, but yeah, we have just been working, he is at University of Rochester in New York, and I'm here in Iowa, and yeah we see each other at conferences, and we Skype and email and write papers together-

21:56 Yeah, that's cool, I’m a fan of what he is doing, so that’s really nice, I had no idea of this connection until we started talking, that's great. So one of the things that you said you guys are up to and you are actively doing it right now maybe one of your summer students is doing this, is upgrading, moving from web.py over to Flask for your web platform.

22:14 Yeah, so we've been running with web.py since 2011 when we first kind of went online with this, and I mean one of the cool things about the research that I do is that I always, I always have to try to tie it somehow into my teaching or into a class that I'm working on and so I teach this internet programming course, and I really like web.py kind of as a teaching platform, it really does a great job of enforcing that kind of model view controller paradigm into building web apps, with just kind of by the naming structures that it uses and so on. But as we've grown and as we've started to have to scale this system to support all of the schools that are starting to use it, and all the people around the world, and just like any system, especially a research system like this it's become organically grown mess.

23:16 And so in order to kind of take the next step you know, I really took a step back over the last six months and really kind of thought about all the parts of the system and how we should re-architect it. And it became very clear to me that it was time to kind of move from web.py to a different framework and so I looked around and it seems to me that Flask is, right now at least for what I want do, the kind of the best choice. So that's what we are doing, we are moving to a much more of a microservices model for the back end services and Flask works very well for that.

23:52 Yeah, it does seem like Flask is really what people are choosing for those types of apps, and because you are running Python on the client, it seems like you have a lot of fairly static HTML and you just need some back end services and it seems like Flask is a really good thing for that.

24:07 Yeah, I mean I sort of in modern speak I sort of think of each page of the textbook or each section of the textbook as a single page application with these microservices running in the background.

24:20 Yeah. That's great.

24:21 Yeah.

24:22 Another thing you are using is Sphinx, and reStructuredText.

24:25 Yeah, so that's what I use to generate all the static web pages.

24:31 So instead of coding like formatted HTML or exporting from 24:33 or something terrible like that you just do reStructured yeah?

24:38 Yeah, everything is written in restructured text. And then what I really love about reStructuredText over something like Markdown, is that it is very extensible so you can go in and you can add your in reStructuredText you can add your own directives. So the runnable code examples what we call active code, there is an active code directive that you write in Sphinx. And instead of having to do a whole bunch of Javascript, you just say .. active code [dot dot space active code] and then indent underneath that put your Python code, and then when you run it through, the Sphinx generator it goes out and generates all the Javascript that you need in order to make it look on the page like this beautiful example with the run button underneath and the canvas and all that other cool stuff.

25:29 Yeah. That's really cool...

25:34 It makes it really easy to write.

25:35 Yeah, indeed. Where are you guys going with Runestone?

25:38 So yeah, so I think we've started on with a couple of really cool things, over the last summer and not as much this summer as I was hoping. We've gathered so much data, over the last three years, that there's just this I have this huge interest in understanding how I can apply some machine learning techniques to maybe doing some automated tutoring as a part of the platform.

26:07 Ok, so right now it's kind of very much in the university structured class, you know, CS101 or something like that, but if you could get it to be more self supporting maybe it could be just online training or something like that, right?

26:25 Yeah. I mean right now our audience is really divided into 2 pieces, we have a huge number of colleges and high schools that are using the book for their sort of traditional classroom classes, but we also have the book just open and we get about half of our traffic just from people who have heard about the site from various sources and just want to come and teach themselves how to program in Python.

26:49 Yeah, that's cool. So how do they get started doing that, do they go to the book links and they pick a book?

26:56 Yeah. And we just have kind of one giant open book that anybody can go and read, how to think like a computer scientist book and anybody can come up to that and they can create an account if they want, there's nobody there that's going to grade their homework for them, but they can read, they can experiment, as they are reading, they can do the multiple choice questions... And, yeah, we get a surprising number of people who come in and do that and go long ways in the textbook.

27:23 That's really cool. It says that you join more than 850 000 other readers learning to think like a computer scientists in Python.

27:29 Yeah.

27:30 That's cool, you guys have to have some champagne or some good beer when that crosses over a million.

27:35 Yeah. I think we are actually probably already there, I had to actually hard code that 850 000 number a while ago because turned out that calculating that was slowing down the whole website every time somebody brought up one of the pages. So it just was one of those things that I threw in there thinking it would be fun and then one day I realized that the whole site crashed because all of my threads were busy counting.

28:03 Yeah, so you've taught a lot of students Python over the last three years. What are some of the takeaways or key things you learn from that experience?

28:15 So I mean one of the funny things that we've learned is something that we've always suspected and that is that nobody studies on Saturday. So we of course we track all the clicks that the students make from all over the world and it's so consistent every week there is this giant dip on Saturday when nobody uses the textbook. So-

28:38 So don't even try, let's just work with the way the world is and-

28:41 So let's just forget about that. I think the two more real results that I think are interesting one of them, one of the first things that we learned and we worked with Mark Guzdial and his wife Barb Ericson down at Georgia tech for a year with this and they've put together a bunch of different metrics and a bunch of different kind of tests. So we could try to understand what things were having an impact on students. And in that preliminary year that we did all this study what we found was that there actually was a correlation between the students that used code lands a lot and the students that ended up doing very well in the class. So we think that there is something going on there with CodeLands and how it helps you develop that internal model, of what's going on in the interpreter and ultimately how well you do in the class. So I think that if nothing else, that' solid proof that yes, using CodeLands is a good thing.

29:44 Yeah, that's really cool. Are you writing any papers or anything on it?

29:48 Yeah, Philip and I have collaborated on I think two papers now, and he just got one of them accepted so that will be coming out soon.

29:57 Yeah, excellent.

29:57 And then, Mark and his group got another one accepted at the ISER conference.

29:57 [music]

29:57 This episode is brought to you by Codeship. Codeship has launched organizations, create teams, set permissions for specific team members and improve collaboration in your continuous delivery workflow. Maintains centralized control over your organization's projects and teams with Codeship's new organizations plan.

29:57 And, as Talk Python listeners you can save 20% off any premium plan for the next 3 months. Just use the code TALKPYTHON.

29:57 Check them out at codeship.com and tell them "thanks" for supporting the show on Twitter where they are at @codeship.

29:57 [music]

30:53 Cool, so it's yielding some results, so it's great.

30:55 Yeah. And then the second thing that we did, which is kind of a really cool part of the having control of the Python interpreter itself and how you display everything in the book was between the first year that we used the book, and the second year that we used the book we spent some time in the summer changing and enhancing how we displayed error messages to students.

31:19 So the first year that we used the book, we just had a Javascript pop up dialog box that would come up with the standard Python error message if you ran into a syntax error, you know, or whatever. And they're really not that informative. So the second year, instead of the pop-up dialogue box we changed the whole thing and we gave the error message and then we had an error description much more like almost a paragraph describing this is the error, these are the kind of conditions that might make this error a pier, here is a couple of examples maybe even the kind of things that are going to give you an error like this, and then we also added a paragraph of here is some ways to try to track this down and how you should fix this error.

32:07 And what we saw, was a huge huge improvement in terms of how efficient students were in completing homework assignments and doing programming exercises. Because every time a student runs a programming exercise in the book, we save their code, and so we can keep track of how many runs did it take from ground zero to the point where the student either gave up or completed the assignment.

32:34 And so we saw this huge decrease in the number of runs after we'd made that change to how we presented all these error message information to the students.

32:43 That's really cool. Those error messages are so frustrating when you are new. You get used to them, but they're not as helpful as we looking from an experienced perspective think they are.

32:56 Yeah, exactly.

32:58 Cool, so that's really new result.

33:00 Yeah, we are taking that same set of data that every run data and now we have added this thing called code coach and we really haven't had the ability to go back and do much assessment of it yet, but code coach what it does, is actually in the background it runs PyLint over each submission. And then if the student clicks on it, you can actually click through and you can look at the differences from run to run to run to run, you can see kind of after the fact, what did I change about this code. And then it'll also then give you any hints from running PyLint on things that obviously don't generate error messages, but there is some really valuable stuff in PyLint especially for beginners.

33:46 Yeah, that'll definitely give a jumpstart at writing what looks more like professional code.

33:50 Yeah. Just a quick example of a thing that really catches beginners is forgetting their parentheses, on a function call. Especially on a function call that has no parameters. They're always forgetting to put their parentheses in, well that doesn't generate any kind of error message in Python because that's a valid statement. It's just useless, right, it just comes back and tells you that it's a function. Well, fine. From the beginner's point of view there is no value to that especially when they don't see that when they are just running a program. But if you run it through PyLint, it will tell you hey, line 12 that's a useless statement. And they will look at it and they'll think wait a minute, I was trying to make a turtle there but it's telling me there is something wrong with that line so...

34:33 Yeah, that's really helpful. The conversation about parentheses made me think are you guys doing Python 2 or Python 3?

34:40 So we are doing sort of a hybrid. And without starting any religious words I think that from a beginners point of view the differences in Python 2 and Python 3 are so slight, that it's not really worth worrying about.

34:58 Yeah, I agree.

35:00 So, we support either parentheses or no parentheses after your print statement. And we have a flag that you can set if you want to make sure that you are getting the Python 3 division semantics.

35:14 Right, ok. Very cool. At the heart of all that of course is Skulpt and somewhere along the way you became the maintainer of Skulpt, and by the way for those listeners S-K-U-L-P-T, right?

35:25 Correct. Yeah so that was one of those, you know, I found this I thought it was really the most awesome code that I'd ran into that enabled this Python in the browser and unfortunately the time that I was getting super excited about it was about the same time that Scot was making a career change and it was sort of more or less losing interest in the project. So, he was very gracious and we sort of transitioned that over to a random maintainer of it and I moved it over to GitHub, and yeah, now we have this great I think very thriving community of people who are contributing to Skulpt right now, who are continuing to improve it.

36:04 Yeah, the short story or the tagline for your GitHUb project is Skulpt it's a Javascript implementation of the Python programming language. So basically, download some Javascript which is the Python interpreter if you will, and then you write some more Python and just run it in the browser, right?

36:23 Yeah exactly, yeah.

36:24 Yeah. Very cool. Yeah you guys have almost 1000 stars, that's pretty excellent.

36:28 Yeah. It's been a fun project, it's one of those great things you know, I get up in the morning and there's people in Germany and people in France and there's people all over the world that are, you know, working on this and submitting requests and whatever and so, it's a very international effort.

36:46 Yeah, that's great. One thing came to mind while I was thinking about this, it's just this morning I was emailing with Ryan Kelley who did PyPy.js, can you compare those two projects, or sort of say like what's the story I mean these are both kind of Javascript implementations in the browser.

37:07 Yeah, so I think there's actually three separate projects going on for Python in the browser, there is Skulpt, there is project called Brython and then there is PyPy.js. So PyPy js `is really awesome because it's using the extension to lovm compiler right. where you can compile to a different target. Instead of compiling it to machine language you can have a compile to Javascript.

37:37 Exactly.

37:39 So they are actually taking the C source code for PyPy running it through the compiler, and having the compiler generate all the Javascript for him. So, the advantage for PyPy.js is that you kind of get absolutely the CPython implementation, no question about it. What's lacking there at the moment, and I know they are working on this, is to be able to bridge things like the turtle graphics module, or like the processing graphics module. So that you can do the kind of cool interactive graphics kind of things in the browser that you might want to do.

38:14 Yeah, that sounds cool.

38:15 The other thing, the other difference is that Skulpt is just the tiny fraction of the size of PyPy.js at the moment, so it-

38:22 What's the size of the Javascript files for the Skulpt?

38:25 They are like 143K.

38:30 Ok, that's pretty decent, does that include the standard library?

38:34 Well it includes the parts of the standard library that we've implemented.

38:37 Right, of course.

38:38 Which is a fraction of the standard library.

38:42 I guess you know if you are missing a piece and it's pure Python, maybe you could try to just run it.

38:53 So I don't know, there are maybe a day when we- when all the stuff kind of comes together in the great singularity of Python, in the browser, and we'll get all the best of all the world's-

39:03 It's really exciting to see that happening. So yeah I think both of these projects are super cool, did you ever watch or maybe I should just recommend to the listeners Gary Bernhardt's "The Birth and Death of Javascript"?

39:17 No, I haven't.

39:18 Oh my Gosh. It's this fictional, you know he is hilarious of course, I believe this is presented at PyCon 2014, I'm not sure when it was but it's on the video, and basically he takes us through this fictional history of going from 2005 into 2035 and how Javascript has changed, but there is this sort of real technical underpinning of asm.js, and compiling C down into Javascript for the running in the browser and it's definitely worth a look, I'll put it in the show notes.

39:48 Yeah.

39:50 It's both hilarious and instructive. Ok, so we are kind of coming up to the end of the show, I have a few questions I always ask on the way out, but before we get there, do you want to just talk briefly about the books that you have available, and you know, what ones maybe you want to call people's attention to- there is a lot of educators listening and also students, so maybe both ends would appreciate what you guys have in this format at Runestone?

40:16 Yeah, thanks. So, we have "How to think like a computer scientist" interactive edition. And that's based on I think the very well known "How to think like a computer scientist book" by Allen Downey and Jeff Elkner, and a couple of other people but I think Allen and Jeff are kind of the main authors on that. And so that's been an open source textbook for quite a few years now and I'll just be forever indebted to them for doing that because it saved me from yet again having to write an introductory chapter about lists, when I didn't want to do that ever again.

40:58 So, we took their open source textbook and made it interactive and added the questions and over the years we've added some of our own things to it and added a couple of new chapters, so that book has a great pedigree, and has proven itself over the years as a really solid textbook. Not only for the college level, but also for the high school level.

41:25 So we have that out there. And then, we have a data structures textbook, "Problem solving with algorithms and data structures" by Brad Miller and David Ranum, that's published by Franklin Beedle publisher right out in Oregon in your neighborhood I think. And so our publisher there was gracious enough when we approached him about saying, "hey we have this great idea to change the world we want to make a textbooks interactive" and we showed him kind of proof of concept using the how to think book and he immediately said "wow, that's great, yeah you have my permission to take your book and put it online like that".

42:09 Oh that's excellent.

42:10 Yeah. Funnily enough, it's one of those great stories where we put it online and a year after we put it online we had our best year in royalties ever from the paper book sales.

42:23 That's the real irony of open source sometimes. I work really close to this with MongoDb and the guys there and you know, that's a multi billion dollar company and you can go to GitHub and get their product and just download it for free, I mean that's amazing. Red Hat and Open sack and all sorts of stuff is really sort of paradoxical or in the sense you would think giving it away would be a problem but in fact it's actually the thing that makes it catch fire.

42:52 And then I have a little book called "Java for Python programmers" which is just a short little book on making the transition from Python to Java, and then we've got a couple of other several other books actually, one of them written by my friend Paul Resnick, at the University of Michigan, called "Programs, information and people" we call it the the pip book, and that's part of their information science program at the University of Michigan that's written using the Runestone tools and is now freely available. Mark Guzdial at Georgia tech has written a book for high school computer science instructors as part of the new AP programming class called computer--ah, look it up.

43:43 Definitely.

43:46 It's not Java based, what the cool thing about it is it's kind of language agnostic. So it's-- CS principles is the name of the course that's the new course by the AP and so Mark has written a textbook just for instructors about how to teach that course, and then this fall he'll also be coming out with the student book for that, and both of those are based on the Runestone tools.

44:09 Yeah, so it sounds like you guys are really building quite a platform for the teaching going forward.

44:15 Yeah. That's what we hope, and you know, the more people that do this, it's always one of those crazy exciting things when you find somebody on the other side of the world or in some place else that has suddenly translated your textbook into Russian or Czech, or some other language and is using your tools to write a book you never thought of.

44:34 Yeah, that's amazing. It's really gratifying, I'm sure.

44:38 Yeah.

44:39 Brad I think that might be a good place to wrap it up. Final thoughts- favorite editor?

44:44 Favorite editor- PyCharm.

44:48 PyCharm, all right. Do you use that in your class?

44:51 I do. We stay in the browser for about half the class, and then we transition to PyCharm.

44:58 That's cool. Have you tried the PyCharm education edition?

45:02 I have messed around with it a little bit.

45:05 Yeah, it's interesting, because it kind of guide you through, it sort of hand holding a little bit, but I haven't done anything with it either.

45:12 Yeah.

45:12 All right, awesome, yeah. That's the one I use as well, I love PyCharm.

45:12 Favorite PyPi package?

45:18 IPython.

45:21 Yeah, IPython is so good.

45:22 Yeah, I use it in all my upper level classes now, it's such a great teaching tool that way.

45:27 Oh I bet it is, I haven't even considered sort of here is the thing I can give the student component of it.

45:34 Yeah, I mean for making class notes it's really awesome and now with this new Jupiter integration that's one of my little projects is to get a Jupiter server running on one of our servers on campus here so the people could just access-

45:51 The whole IPython thing will break out of being just Python, not that it's just terrible but it'll let it grow significantly, right.

45:57 Yeah.

45:58 Awesome. All right, anything we didn't talk about, you want to let people know, some links you want to get people, things like that?

46:04 Yeah, I would just say if anybody wants to give Skulp a try or experience Python in the browser, there is another group of guys that I work together with very closely at Trinket.io and they have this, they are actually little startup on the east coast, and yeah, trinket.io you could write Python programs right in your browsers save them, share them, email them to your friends, so it's also a great way for doing Python in the browser so I just wanted to give a shout out to the guys at trinket because they've been very super helpful in keeping the Skulpt project.

46:42 Oh cool, it's a little bit like Js fiddle but for Python.

46:46 Yeah.

46:47 Yeah, that's cool. Very nice. Anything else?

46:51 I think we've hit it.

46:52 All right. Brad, this has been super interesting, I really love to sort of see how Python is making its way into education-

47:00 Yeah, it's really gratifying.

47:02 What you are doing at Runestone is very cool so people should check it out at interactivepython.org.

47:06 Yeah. Definitely.

47:08 All right, thanks for being on the show.

47:09 Thanks for having me. This was a lot of fun.

47:11 Yeah, it sure was, see you later.

47:11 This has been another episode of Talk Python To Me. Today's guest was Brad Miller and this episode has been sponsored by Hired and Codeship. Thank you guys for supporting the show.

47:11 Hired wants you to find your next big thing- visit hired.com/talkpythontome and get 5 or more offers with salary inequity presented right upfront and a special listeners signing bonus of $4000.

47:11 Codeship wants you to always keep shipping- check them out at Codeship.com and thank them on Twitter via @codeship. And don't forget the discount code for listeners, it's easy TALKPYTHON.

47:11 You can find the links from the show at talkpythontome.com/episodes/show/20.

47:11 Be sure to subscribe to the show. Open your favorite podcatcher and search for Python. We should be right at the top. You can also find the iTunes and direct RSS feeds in the footer on the website.

47:11 Our theme music is Developers Developers Developers by Cory Smith, who goes by Smixx. You can hear the entire song on our website.

47:11 This is your host, Michael Kennedy. Thanks for listening!

47:11 Smixx, take us out of here.

47:11 [music]

Back to show page
Talk Python's Mastodon Michael Kennedy's Mastodon