Dan Halbert
S03:E28

Dan Halbert

Episode description

Dan Halbert joins the show and shares how he started with computers, discovering CircuitPython, where CircuitPython might be going next, and more

Show Notes

00:31 Dan’s start with computers and electronics

02:54 Making computers easier to use

05:09 Discovering CircuitPython

8:40 Advice for new contributors to CircuitPython’s core

9:40 How CircuitPython is ported to new hardware

11:35 Managing CircuitPython releases

13:49 Where CircuitPython might be going in the near future

16:33 Which board?

Download transcript (.srt)
0:00

[Music]

0:03

Welcome to the Circuit Python Show. I'm

0:07

your host, Paul Cutler.

0:09

This episode I'm joined by Dan Halbert.

0:11

Dan has over 40 years of programming

0:13

experience with expertise in embedded

0:13

software,

0:15

databases, user interface, speech

0:17

recognition, and more.

0:19

Dan holds a PhD in computer science from

0:21

the University of California Berkeley.

0:23

Dan is sponsored by Adafruit to work on

0:26

Circuit Python.

0:26

Dan, welcome to the show. Hi Paul, thanks

0:28

Thanks for inviting me.

0:29

- I'm glad you're here.

0:30

How'd you first get started with computers and electronics?

0:33

- So when I was in eighth grade,

0:36

we had to do a math project of our own doing.

0:40

And I had this idea, I was kind of interested in electronics

0:44

and I subscribed to popular electronics.

0:46

This is 1970, okay?

0:48

And they had this kit

0:50

from Southwest Technical Products Corporation,

0:52

which made a lot of interesting kits,

0:54

some music stuff and other things.

0:56

And it was a, what's called,

0:58

they call it a digital logic micro lab,

1:00

which was this basically breadboard-y thing

1:03

where they had like four NOR gates

1:05

and some inverters and some flip-flops

1:08

and a way of jumpering them together.

1:10

And I was like, oh, this is great.

1:11

I can like build this kit

1:13

and then demonstrate digital logic.

1:16

Ordered it.

1:17

And then they wrote that it was gonna be backordered.

1:20

Too late for me to get it for the math project deadline.

1:24

My parents are physicists

1:25

and they worked at Oak Ridge National Lab

1:27

in Oak Ridge, Tennessee.

1:28

That's where I was born and grew up.

1:30

And my father said, "Well, you could learn to program

1:33

instead, like, you know, you can use a computer

1:36

where you worked."

1:37

So I said, "Okay."

1:38

So I like wrote some programs in Fortran,

1:42

which were on punch cards,

1:44

and had a good time doing that too.

1:47

And I was still interested in the electronics.

1:49

I was kind of had an interest in like computer architecture

1:53

and programming.

1:55

But it was interesting that that was kind of a critical

1:57

like inflection point.

1:59

It might've been like more electrical engineering

2:01

than software,

2:03

but for the fact that this thing was backordered.

2:06

Later we went for a year to Belport, New York

2:10

where my parents worked at Brookhaven National Lab.

2:13

The high school there had just started

2:16

to get a timesharing connection to a PDP-10

2:20

that was shared by a bunch of people in the county,

2:23

bunch of schools.

2:24

And because they were renovating the high school,

2:27

we went on a split session.

2:28

So I ended up having four hours in the afternoon

2:31

every day with a bunch of other people

2:33

to just use this time-sharing system.

2:36

So I learned a lot about that, and I read a lot of books.

2:39

And that kind of launched me.

2:41

And I did a lot of programming after that,

2:44

and went to college, and then grad school in computer science.

2:48

And the rest is what has happened since then.

2:53

- Well, starting in grad school

2:55

and all the way up to today,

2:57

how have you worked to make computing easier

2:59

for people over the course of your career?

3:01

- That was a thing that I became really interested in

3:04

when I was working on my bachelor's thesis.

3:06

I read kind of a seminal thesis in that area.

3:10

It was a system called Pyramelian

3:11

by a guy named Dave Smith, who was at Stanford,

3:14

and he worked with Alan Kay.

3:17

It was just a really interesting,

3:18

it was about a thing called programming by example,

3:20

and it was also kind of using icons to program with.

3:23

And I thought that was really neat.

3:24

That's not what I did my thesis on,

3:26

but I thought this is really neat

3:27

and this is a way of making computers easier to use

3:30

instead of having to teach people

3:32

how to use Fortran or whatever.

3:34

That's what I ended up doing for my graduate work.

3:36

I worked on this thing called,

3:38

this stuff called programming by example,

3:40

which was like demonstrating a program as it operated.

3:44

It would be kind of like using a programmable calculator,

3:47

except that we would actually do the operations

3:49

as you perform them,

3:51

and then you could go back and substitute different numbers.

3:53

That was kind of the basic idea.

3:55

And it was done in the context of the Xerox Star System,

3:59

which was the first system with a desktop metaphor,

4:03

you know, icons and folders and things like that.

4:06

And so I did it in a simulation of the Xerox Star System

4:10

that I wrote in Smalltalk.

4:11

And I thought that was really neat,

4:13

but it was before user interfaces

4:16

became really a thing in computer science.

4:19

And so there were no jobs available in that field, really.

4:24

And so I ended up doing a lot more stuff

4:25

about programming languages

4:26

because of my experience with Smalltalk,

4:29

which was an early object-oriented language,

4:31

and also one that had its own IDE,

4:34

and it was sort of like its whole world.

4:38

I didn't work on that for a long time.

4:40

And then when I ended up taking the Adafruit job,

4:43

which was not quite six years ago,

4:46

it was like, here's this opportunity

4:48

work on something that is CircuitPython, which is the whole point of it is to make computers easier

4:53

to use. And so it's really a circling back of my original interests, you know, what I had been

5:01

interested in long ago in the 1980s, and didn't come to fruition. And now it really has. And I'm

5:07

really pleased with that. That's fantastic. How did you first discover CircuitPython?

5:12

I had been paying attention to Adafruit's product line, but kind of only in a vague way, kind of

5:19

like, "Oh, this is an alternative to Arduino stuff." And I didn't even have an Arduino. I was just

5:24

just kind of, you know, armchair checking into this. We have a child with special needs, and I

5:32

was on a mailing list of parents of people with special needs, and I ended up getting in touch

5:38

with somebody who had an adult son who was a filmmaker but who had cerebral palsy. He

5:45

had trouble. He couldn't use his hands very well at all, but he had a foot pedal and a

5:54

chin-operated joystick, which he used. He actually edited videos with this. It was quite

6:02

a feat, and it's kind of slow and tedious. He had some troubles with the joystick. This

6:07

His chin-out-for-head joystick was basically a game joystick that somebody had removed

6:11

the handle of and stuck a screwdriver in it.

6:14

So they would wear out after a while, and his father was saying, "Can you help us with

6:19

this?"

6:20

I didn't really solve that problem.

6:23

It was kind of a mechanical engineering problem that he didn't solve, but I talked to him

6:27

about what might make his life easier.

6:29

What he really wanted was some way of invoking the keyboard shortcuts in a professional video

6:35

editor that had a lot of drop-down menus and keyboard shortcuts. And I said, well, I could

6:40

make you a thing with multiple foot buttons that would do this, and I could make it so that it was

6:45

configurable, because that seemed to me to be important, because if I gave him this thing,

6:50

I wouldn't want him to be trapped in not being able to say, I want to add this other keyboard

6:56

shortcut. And so I had just been reading about CircuitPython was just getting started, and

7:02

I read about what Scott was doing and saw the videos and stuff and saw that it presented a USB

7:08

drive. And so I said, "Well, I can just have this guy edit a configuration file, you know,

7:14

and have a circuit Python program that reads that configuration file." And there was no way to do

7:18

this with Arduino or anything. So I built such a thing. It took a long time because there were

7:25

various mechanical aspects. And also it didn't really fit on like a feather expression. In zero,

7:31

there wasn't enough RAM and getting the display to work and so forth. But I ended up fixing a bunch

7:38

of things having to do with mouse and keyboard support in CircuitPython really early on, and it

7:43

was a huge amount of fun. I submitted pull requests as a volunteer, and then I thought, well, maybe I

7:49

could do this part-time because the regular my day job at the time was not that interesting.

7:57

I was contracting for a large research lab, a defense lab. I arranged to be able to work

8:06

part-time. I got permission to do that from my contracting company, who was fine with it.

8:11

But the defense lab said, "No, you can't do this because we buy Adafruit things," even though what

8:17

I was doing there had nothing to do with that. It was a perceived conflict of interest. Then I went

8:21

back to Adafruit and said, "Could I work for you full-time instead of part-time?" They said,

8:27

sure." And then I just made this transition, and this was around August 2017. So then I became the

8:33

second core developer after Scott on CircuitPython and have continued with that since then.

8:39

>> What advice would you have for someone looking to contribute to the core?

8:43

>> I would say you may have an idea of some feature that you want to add, and if so, check with us in

8:49

the CircuitPython dev channel on Discord, or you may have some idea of something that you want to

8:54

fix, in which case take a look at the open issues. And it takes a lot of reading code,

9:01

kind of figuring out how things work internally. But the best way to figure it out is usually to

9:07

read, pick something that seems sort of like what you're doing already. And there's a whole lot of

9:12

boilerplate associated with like the busio.i2c class, for instance. There's the Python interface,

9:19

and then there's how it's implemented on the back end. And usually when we add a new feature,

9:24

we end up taking a bunch of files, copying them, gutting them, and putting new things in. And

9:29

that's the way you get started is that you just use the existing code as a template. You don't

9:33

have to start from scratch. And that's how you end up learning how it works.

9:38

How has CircuitPython brought the new hardware like the PicoW or the NXP/IMX family?

9:45

So the PicoW, it's really, I mean, that's really just a Pico with a coprocessor. So that was

9:51

simple. It was really just, or it wasn't simple, but it was like the only thing we have to add is

9:56

the coprocessor, is support for the Wi-Fi BLE coprocessor. So there was a library already

10:02

existing that we used, and that's what Jeff Epler did. But for the NXP, what it really is, is like

10:09

We look at what existing SDK or other package that the hardware manufacturer supplies

10:18

and make some decisions about. Maybe there might be multiple choices, or it might not be a very

10:25

good choice. Maybe we want to work at the register level, and we would like -- it's easier to use the

10:29

SDK if it provides the right features. So we end up, again, taking an existing

10:35

implementation that's kind of as close in terms of how we want the build structure to work,

10:40

copying the guts of that. And then we would start with digital I/O and basically, can we get LEDs

10:45

to blink? Can we start controlling the GPIO pins? Then proceed from there through the most necessary

10:51

classes like the bus I/O classes. And usually there's some complication. For instance, the

10:57

NXP has a very complicated memory architecture. It has fast RAM and slow RAM, and there isn't

11:03

internal flash on the chip. It's external. It's hard to get all that stuff to work properly. So

11:10

you have to do a lot of studying of that. In our case, Scott did a lot of that.

11:14

I did a lot of the NRF52840 original port, and that's a very nice chip. Like, any pin can connect

11:22

to anything, for instance, to any peripheral. So it was actually a pleasure to do, and it had a very

11:29

nice low-level API, and it was probably one of the easiest to do compared with all the rest.

11:34

You coordinate and manage the release of new versions of CircuitPython.

11:39

When do you know it's ready for a point release or versus a whole new version?

11:43

So we usually have some theme for a major version, and we'll say like, well, we want to have these

11:50

one or two major things, like we want expressive Wi-Fi support or we want NXP or something,

11:56

And so we would lean toward that. We would add features toward that. But for a point release,

12:04

what we usually say is, what are some minor additions and fixes that are not just bug fixes?

12:11

We make bug fix releases. That's the third digit, like 8.0, 0.3, or 0.4. And of course, then we

12:17

release those as soon as it's clear that there is some serious issue that we need to fix.

12:23

And for the point releases, we usually just say,

12:25

I usually just come to the point where I say like,

12:27

"Okay, I have a bunch of pull requests.

12:29

"They're not a bunch of them pending.

12:31

"And so I can kind of come to a stopping point.

12:35

"I'm not waiting for some desirable feature or fix

12:38

"that's imminent in the next two or three days.

12:40

"And so let's go ahead and make a release."

12:42

And I think our aspiration is to release early and often.

12:50

but without a lot of incompatibility churn.

12:54

Okay, so that, okay, this release is definitely better.

12:57

A lot of people are very anxious

12:59

that they're using a beta or an alpha release,

13:03

but except in the very early stages,

13:06

usually that release is still more stable

13:09

than the actual stable release

13:11

because it includes more bug fixes.

13:13

Because we don't backport all the simple bug fixes

13:16

necessarily because they have workarounds

13:19

or we can just tell people to use the beta, for instance.

13:22

So it really is just like,

13:24

let's accumulate a bunch of things.

13:26

And when it gets to be,

13:28

like there are 60 or 70 pull requests in each release,

13:32

in each minor release,

13:33

and that could only be like three weeks worth of work.

13:36

It's actually like,

13:37

I have to go through all the pull requests

13:38

and write one line summaries to put in the release notes.

13:41

And the less of that I have to do,

13:44

the easier it is to make a release.

13:45

So I'd rather make a release more often than less so often.

13:48

Where do you see CircuitPython going in the next year or two?

13:52

I think we're going to see more support for the i.MX chips.

13:58

The Metro M7 RT1011 is the first one of those.

14:03

Those are interesting because they're very fast.

14:07

The Metro M7 doesn't have a lot of RAM so much, but for instance, Jeff Epler did this

14:15

synth I/O thing, which runs very well on such a fast processor. So I think we're going to see more

14:20

of that. We're going to see BLE support added to the PicoW at some point, probably, and better

14:29

BLE support in the Espressif line. Espressif has a nice, a very interesting risk chip coming out

14:37

that's not Wi-Fi based, but would be presumably be below cost and yet fast. And that's going to

14:43

to be a very interesting chip, but we don't know about that yet. And I also think we need to not

14:49

just keep adding features. We have a backlog of things that need to be fixed. And so I'd like to

14:53

see some sort of increase in the overall quality to happen in the short run. And then also, I'd

15:00

like to see more work being done with async.io, with async with cooperative multitasking. And we

15:06

have somebody who's very interested in that and has made some major changes. We need to review

15:11

and take advantage of, but we've kind of been held up by getting the eight releases out.

15:18

And so I hope to see more of that. And also what that means is, very importantly, is writing up

15:24

more examples and using Async I/O in simple projects and giving people simple templates

15:31

for using Async I/O so that even beginners can follow those templates and use it successfully

15:41

and say this is a style of programming which is actually pretty natural because async.io in the

15:45

past has been very abstruse and this if but if you use it in a very structured way I think that

15:53

people can make progress with it and can use it in ways that and make it actually easier than

15:59

writing one big while true loop for their program. I agree with you I just wrote my very first async

16:05

program using one of the learn guides and it was eye opening actually how easy it really was.

16:11

Yeah, it's like, is that all to it? Like, really? You don't have to worry about all the issues that

16:16

come up with, say, threading where you have dangerous shared access to things, where things

16:22

change out from under you, right? Instead, you're saying, "Now I'm ready. Go ahead." Okay, right. So

16:29

I'm glad that you found it easy. I'm really happy about that.

16:33

So out of all the chipsets that you just mentioned, if you were starting a new project,

16:37

which board would you reach for?

16:39

It's kind of funny. I don't have a whole bunch of projects that I want to do. I usually can say,

16:44

"Oh, yeah, I could do that." But when I'm testing something or when I just want something to work

16:51

reliably, I often reach for one of the Atmel boards because I know that, or now they're

16:57

microchip. I know that the implementation is very reliable. And I also find the NRF implementation

17:04

very reliable. It's not idiosyncratic. So those are the ones that, if I just want to see, like,

17:12

well, does this work, for instance, like if I'm just testing a sensor or writing a library or

17:17

something like that, I will go for one of the more mature implementations, ports.

17:23

Dan, thanks so much for being on the show.

17:26

You're welcome. Thank you very much for having me.

17:28

Thank you for listening to the Circuit Python Show. For show notes and transcripts, visit

17:34

circuitpythonshow.com. You can also now follow the show on Mastodon. Just visit the homepage

17:39

and click the follow button in the banner. Until next time, stay positive.

17:43

[Music]