yes sir i am emailing you about an undergraduate presentation you gave on a strange data structure you invented in 1976 which i heard about it because of my dad who was your classmate and colleague. no i'm not kidding i promise

· · Web · 4 · 2 · 19

sas engineer give me the Forbidden Concurrent Valves

update: he got back to me but won't have all the details until later

@hope legit this is part of what got me into programming

my dad went to UNC and one of his colleagues invented something called a "valve" which is basically a mutex that switches the flow of control in threads that subsequently attempt to lock the mutex using some very specific implementation but I could only ever get secondhand information about it

but today my dad got back in touch with him and he emailed me basically saying "what the heck is this all about" so we'll see how much i get out of this

@hope and i heard about this first when i was, like, 13? and i was like "wait you can just Make Up Data Structures holy shit" and that's how I decided to learn C by reading K&R in a single sitting. it did not work even a little bit and i didn't actually learn C until like 3 years later but still

@tindall @hope isn't C like the worst programming language to start learning programming in?, she asks, having started learning programming in C

@meena @tindall @hope My €0.02: With simple HW, a simple compiler, and small programs, not too bad, IMHO. If any of the compiler, HW, infrastructure, or example programs are from this side of year 2000, on the other hand... :)


isn't C like the worst programming language to start learning programming in?

I'd say no!

Being a small and primitive language, it forces you to learn how to deal with memory management, error handling, I/O and raw memory buffers. Stuff that will make you better able to understand how a computer actually works, and what the other more fancy languages do for you under the hood. It will probably make you a better programmer.

It's not an easy language to learn though, for precisely the same reasons :)

@meena @tindall @hope
There's worse. Perl. Anything that mutates its own syntax. Most assembly languages. Deliberately pathological languages like the BF family

The hardest thing for me to learn about C, though, was all the things that aren't C - the build tools and the macro language. If a tutorial was to start with one and two file programs and teach the most used 20% of the standard library before diving into compiler concepts and command switches for more complex builds, it wouldn't suck. I was able to work around the lack of that kind of learning tool by studying an existing codebase where someone else had already set up the build system

But I'm also really curious about this valve data structure

@yaaps @tindall @hope i never could wrap my head around Perl's types…

but Lisp… i am very fond of…

so, the way I learned C was with the best IDE in the world: Turbo C.
The integrated debugger made for some of the most pleasant programming experiences.

And I quite didn't know what I was missing, switching to Linux where there was no adequate equivalent… until I learned about Ruby's pry almost 12 years later.

@yaaps @tindall @hope @meena I would unironically argue that Perl is a better first language than C. bash is a better first language than C. awk is a better first language than C. Scheme, Tcl, Python and Ruby are all more readable and consistent languages than those and they make excellent first languages. All of the above except awk also have REPLs, which is *chef's kiss* for learning programming.

Anything that allows you to play with higher-order concepts without having to understand anything about segfaults is better than C. Don't learn DAlg, compilers, interpreters, distributed systems or any other informatics in a segfault-oriented language like C or C++.
At some point, and not a too distant one, one should do some programming at the lower level. But that's not informatics, that's computer technology. For the educational purpose of understanding the computer metal, C isn't half bad. It's high-level assembler and that's exactly what you need. When you're doing that, the segfaults are educational. C++ is high-level C.

They taught us the compiler course in C++ and yacc, like, why? It wasn't even good C++ for the time. I had to hold back the urge to refactor their whole awful mini-architecture when I was just supposed to fill in the blanks.
(also none of those languages force you to deal with linkers and makefiles and other chaff as you mention)

@clacke @tindall @yaaps @hope Ruby's pry is, unironically, what gave me the confidence to call myself a programmer,

@meena @tindall @hope

C has some advantages:

1. Calls to user code are visibly distinct with clearly-marked inputs and outputs.

2. Each feature of the base language is very simple.

3. The base libs are also predictable and well-documented.

The footguns are still there but modern tooling and MMUs help a *lot*.

C really expanded BASIC-trained mind when I learned it because I realized I could add to the language.

@meena @tindall @hope

Too late; mind was blown by C. (Then Perl and Smalltalk, but that's another story.)

(Although if someone had taken teenaged-me aside and explained that that Logo language we were all making fun of was actually just Lisp in disguise and that Lisp was a super power hacker language, I'd probably have learned more sooner.)

@meena @tindall @hope

Also, I like to brag that I've written more Lisp systems than non-trivial Lisp programs. Which is probably true.

@meena @tindall @hope

A co-worker of mine did some computer pedagogy research in grad school and told me that his group had been pretty successful in teaching programming using C as a first language. I was surprised too.

Although I suppose a C dialect with memory safety and memory leak detection might be a better option.

@suetanvil @tindall @hope Zig seems nice as a contender for replacing C

(and Rust for C++)

@tindall love to do this. once upon a time i emailed Simon Peyton-Jones for some supporting files for a paper he wrote the same year i was born, and he was like "sure thing hope this helps"

love how often this works. i had a cs instructor who gave out one (1) extra credit point once because they discovered that the 'b' in "b-tree" stands for "Boeing" this same way. it's like mountains of secret information are locked in peoples' brains and you can unlock it by being brave enough to email

@nfd > the 'b' in "b-tree" stands for "Boeing" this same way.


@tindall yep! apparently they invented it while working for boeing

@nfd @tindall huh, I live near Boeing's airfield and have worked on deploying Btrfs (and previously studied B-trees in college) and didn't know about the Boeing connection! Thanks!

Looking forward to learning more about this valve too

@nfd @tindall made me look. Wikipedia claims that “Boeing” is only one of the things they’ve claimed that the B stands for over the years? Which is the real B?

@nfd @tindall I guess you get to choose what you want to believe and the Boeing story is more fun :)

@skybrian @tindall this story was re: someone at my university personally contacting one of the authors to ask what it stood for--not exactly a wikipedia-viable published secondary source.

@tindall which data structure plz? I would like to know! Sounds like an amazing story!

Sign in to participate in the conversation

cybrespace: the social hub of the information superhighway jack in to the mastodon fediverse today and surf the dataflow through our cybrepunk, slightly glitchy web portal support us on patreon or liberapay!