@dabeaz@mastodon.social avatar

dabeaz

@dabeaz@mastodon.social

Free-range computer scientist living in Evanston, Illinois. Former academic. I teach computer science courses, but you'll probably find me yapping on about bikes, dogs, and other random stuff here. I wrote the Python Cookbook, 3rd Ed (O'Reilly) and Python Distilled (Addison-Wesley). Teaching CSCI 1730, Design and Implementation of Programming Languages at Brown.edu in Fall 2023!

This profile is from a federated server and may be incomplete. Browse more on the original instance.

dabeaz, to random
@dabeaz@mastodon.social avatar

A few weeks back, I showed kid the insides of an Apple 2 and then a box of similarly looking electronic components. He picks out a 7-segment LED and says I want to do something with this.

I'm not sure he knew what he was getting into because all I've got are NAND gates. Figuring out how to represent decimal numbers in binary and displaying a corresponding decimal digit from scratch has proven to be much more involved than it looks. It's actually been a pretty awesome project.

dabeaz,
@dabeaz@mastodon.social avatar

I've been treating it as a kind extended improvisational "live coding" project. After a bit of fooling around with LEDs, switches, and transistors I printed out the data sheets for the 7-segment LED and the 7400 quad NAND gate. Everything else from that point has been been a lot of experimentation, pen-paper exercises, and working "the problem." Not following any particular pre-set plan or even looking up anything online to tell us how to do it.

Definitely taken a few weeks though.

dabeaz,
@dabeaz@mastodon.social avatar

@orsinium Exactly! I think the math part of it is pretty interesting and unexpected to a kid. Wait, there's a use for all of that algebra stuff? "Yeah kid, you just saved yourself the trouble of wiring up another 40 chips."

deech, to random
@deech@mastodon.social avatar

In broad strokes this pretty much matches my experience with Haskell and web services. Never again.

https://loglog.games/blog/leaving-rust-gamedev/

dabeaz,
@dabeaz@mastodon.social avatar

@deech That's quite the read but echos my limited experience of "not getting" Rust. I'm not one to deny other people's experience and enthusiasm with it, but my brain is not at all wired for thinking in that language.

dabeaz, to random
@dabeaz@mastodon.social avatar

Kid apparently has to give some kind of "TED" talk in English class today. I asked if it could be combined with something from Chemistry class, say thermite. Apparently not. So, what's the freaking point then?

dabeaz, to random
@dabeaz@mastodon.social avatar

Having some conflicted feelings about missing today's 30-year anniversary reunion of the graduate school research group I was in as a student. I think it pushes a number of buttons related to my "complicated" relationship with academia. I've always liked coding and teaching. That's basically what I do now. Coding and teaching. Playing other sorts of "academia" games though? Not so much. Especially those attached to status and influence.

dabeaz,
@dabeaz@mastodon.social avatar

@vy My one and only one experience sitting on an NSF grant meeting is definitely a contributor to my academic burnout and overall dissatisfaction with the whole affair (generally).

dabeaz, (edited ) to random
@dabeaz@mastodon.social avatar

Must admit, I'm kind of unreasonably mad about getting a SEO spam related to content hosted on readthedocs.org (a first).

Edit: Just to be clear, it was NOT from readthedocs.org, but from some rando apparently thinking that some docs about LALR(1) parser generators needed some SEO. WTAF?!?!

vy, to Software
@vy@sciencemastodon.com avatar

Voyager 1 written in memory unsafe assembly language and FORTRAN, without use of Rust or Category Theory, or reflection, or dependent data types even, seems to still be working.

dabeaz,
@dabeaz@mastodon.social avatar

@vy Could you imagine the difficulty of fixing that thing if it had been written in something like Rust?

When I saw a news report saying they were going to try sending it a "POKE", a little smile went on my face as I whispered "fuck, yeah" under my breath.

dabeaz,
@dabeaz@mastodon.social avatar

@vy @dmbaturin Sure, but what about coaromatherapy?

robpike, to random
@robpike@hachyderm.io avatar

I had the incredible privilege of working/studying in the cosmic ray lab run by Ed Stone, chief scientist on Voyager. The campus used the auditorium to show images coming from the spacecraft as they arrived. Also classrooms with TVs. An expert was there to provide commentary. I remember Larry Soderblom being asked what to make of the first pic of Amalthea: "I have no idea."

What a machine. Incomparable.

https://mastodon.social/@dabeaz/112317859542802282

dabeaz,
@dabeaz@mastodon.social avatar

@robpike Voyager was launched just before I started to learn to code in 6th grade so it was always something for me to admire from afar. However, I can't even begin to say how geeked out I was to be teaching Python courses at JPL for the Mars Curiosity mission some 30 years later. Got to see the actual rover in vehicle assembly. Talking to people working on it in classes was always a kick too.

dabeaz,
@dabeaz@mastodon.social avatar

@robpike The other cool thing about teaching classes there was the attention to detail. Coders tend to think of grandiose things, but more often than not I'd have conversations like this:

"What are you using Python for?"

"I'm using it to help me test a 1 meter long cable."

"A cable?"

"Yeah, if this cable fails on Mars, then a major part of the science mission fails."

"OK, THEN!"

dabeaz, to random
@dabeaz@mastodon.social avatar

The whole Voyager 1 thing is so inspiring. Although, I've always been inspired by the Voyager mission since I was a kid.

brohrer, to random
@brohrer@recsys.social avatar

Seven stages in the professional development of an engineer:

  1. I’m Kirk!
  2. I’m Spock.
  3. I’m Scotty.
  4. I’m Bones, dammit.
  5. I’m Troi?
  6. I’m Picard.
  7. Why am I wearing a red shirt?
dabeaz,
@dabeaz@mastodon.social avatar

@brohrer 8. Oooh! Free shirt!

dabeaz, to random
@dabeaz@mastodon.social avatar

About four years back, my kid was part of some kind of school "robot club", but as far as I can recall, he didn't write a single line of code (nor has he ever expressed an interest in coding since then). Flash forward to now and he's the one setting a friend from the former robot club up on a date. I must admit that I'm considering that to be some kind of parenting "win" on my part.

nedbat, to random
@nedbat@hachyderm.io avatar

A difficult thing when writing docs: wanting to use English words that have more specific meanings in Python. Like "Values should be in the set returned by all_possibilities()" when all_possibilities returns an iterable, not a set.

dabeaz,
@dabeaz@mastodon.social avatar

@nedbat You could put quotes around "set".

dabeaz, to random
@dabeaz@mastodon.social avatar

A fleeting thought that maybe I've been writing Python class decorators wrong all along.

dabeaz,
@dabeaz@mastodon.social avatar

To elaborate, I've been thinking about how a class decorator expands into something like cls = decorator(cls). A function call. So, why in the hell do most class decorators mutate the cls argument in-place as a side effect? (a very non-function kind of thing to do).

I've done this with class decorators in my books, but I'm hardly the only offender. Also class decorators in the standard library (e.g., dataclass) mutate the class. It now just feels off to me.

dabeaz,
@dabeaz@mastodon.social avatar

To further elaborate, I got to thinking about this in the context of mixins. Class decorators are sometimes pitched as an alternative to mixin classes. Which is fine except for the fact that mixins DON'T mutate the other classes that they're mixed with.

I was also thinking about this in the context of dependency injection. Could you use a class decorator in a different way to provide a modified class as a dependency? Yes, but it only works once if there's mutation.

dabeaz,
@dabeaz@mastodon.social avatar

Anyways, this is probably just one of these unfounded "book author" fears. Is everyone writing their code to mutate the class because I (and others) wrote about it that way? Or did I write it that way because that's what I saw everyone else doing? I have no idea.

dabeaz, to random
@dabeaz@mastodon.social avatar

A bit disappointed...

>>> exc = ValueError("Bad Value")
>>> match exc:
... case ValueError(msg):
... print("Failed:", msg)
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
TypeError: ValueError() accepts 0 positional sub-patterns (1 given)
>>>

dabeaz,
@dabeaz@mastodon.social avatar

@emattiza Meh. Sounds hacky.

dabeaz,
@dabeaz@mastodon.social avatar

@drj It's like the cybertruck of matching.

dabeaz, to random
@dabeaz@mastodon.social avatar

Ahhh. Elevator problem. We meet again. (camera slowly zooms into a close up of steely eyes). "Bring it."

dabeaz,
@dabeaz@mastodon.social avatar

@dfarmer Intriguing. I'll take a look at that!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • cubers
  • DreamBathrooms
  • InstantRegret
  • tacticalgear
  • magazineikmin
  • Youngstown
  • thenastyranch
  • mdbf
  • slotface
  • rosin
  • modclub
  • kavyap
  • ethstaker
  • megavids
  • osvaldo12
  • khanakhh
  • cisconetworking
  • Durango
  • everett
  • ngwrru68w68
  • Leos
  • normalnudes
  • GTA5RPClips
  • tester
  • anitta
  • provamag3
  • lostlight
  • All magazines