Let's do an experiment! If you're *not* a professional or habitual programmer, I'd love to hear what you know about what happens between typing a web address like "example.com" into your web browser and actually seeing the page show up. Whatever level of abstraction and verbosity you're comfortable with.

Tech folks: absolutely no making fun of people for being wrong, okay? People are allowed to not know stuff!

Boosts appreciated, but only if you're interested in frivolity 💜

@noracodes as someone who is really not a programmer but very definitely something resembling a network engineer, the way you've defined the audience here is breaking my brain a little bit

I guess I see the idea behind using "programmer" as the catch-all term to refer to people who work or tinker with IT, but at the same time this feels like a very familiar type of, uh, "IT erasure" (I last had to explain I do not write code despite studying IT to someone last week)

@noracodes that said, I am now fascinated by the semantics of the term "programmer" and how its definition has shifted. like, in a way, configuring a network switch is programming but at least in my social circles, programming very much refers to writing code

@tupsu @noracodes heh, you've reminded me of how at my first internship my boss was an EE who was definitely programming with ladder logic, but knew just the smallest scraps of python and java

very cool guy, much more of a generalist than i ever was. i should reach back out to him.

@jyn @noracodes oh yeah. similarly, my ex is a sweng who in the past 5 years has ended up programming Rust in embedded systems and bare metal, and it's been really insightful to watch how over time they've had to start taking the physical aspects of computing into account in their work more and more

meanwhile, coming from a background of networks and electronics, it feels like I'm much more used to having to consider the laws of physics as part of my work

@tupsu ooh, how did they get into embedded systems? i've been thinking of doing some more low level stuff but not sure where to start

@jyn hmm, well, they were put on that path by outside influence - they work at a university and were looking for a new project with the only requirement being that they can write Rust. there happened to be a SoC development project where there was interest in testing Rust as part of the ecosystem

they do also run a course around starting out in bare metal with Rust - I'm not sure if I can share full materials, but I can definitely share the recommended resources if you're interested!

@tupsu the recommended resources sound wonderful, thank you so much!
GitHub - rust-embedded/awesome-embedded-rust: Curated list of resources for Embedded and Low-level development in the Rust programming language

Curated list of resources for Embedded and Low-level development in the Rust programming language - rust-embedded/awesome-embedded-rust

GitHub

@jyn The character limit is tripping me up badly here, if I had more free time I'd probably make a blog post for these as well.

I agree with the other person who replied to you in that the best way to get into all this is to just get some basic device/kit and start playing with it. Arduinos are the most popular and hence have great resources. We've used Longan Nanos because RISC-V is cool, they're also very cheap and there's a support crate for it: https://github.com/riscv-rust/longan-nano

GitHub - riscv-rust/longan-nano: Board support package for the Longan Nano board

Board support package for the Longan Nano board. Contribute to riscv-rust/longan-nano development by creating an account on GitHub.

GitHub
@jyn Without knowing where you are in terms of prior knowledge and experience, here's a few tips to start out:
- get a physical device to mess around with, it's so much more fun when you have something to play with right away
- read up/refresh your memory on interrupts and registers - textbooks on operating systems generally cover this very nicely
- pick something really simple as your first project, involving something like networking quickly makes your project into an inconquerable mess ":D"
@tupsu these are awesome resources, thank you so much!
@jyn You could get yourself an Arduino, and mess around with that. That’s a good introduction to driving the pins on embedded hardware.
@tupsu @noracodes It might stem from the Jacquard machine, and the later stuff by Charles Babbage's analytical engine and Ada Lovelace's work. You are programming the machine to use a loom, and the punched cards are basically a program, then later it evolves and you could argue that it's possible to separate the code-writing and the code-deployment, and only call the deploy part programming, but it's simpler if programming encompasses both, computer science is already complicated enough 😅

@tupsu @noracodes

Yes. This.

I do nearly zero programming. But I know the answer to the OP well enough to teach it.

@tupsu @noracodes good point! I write code for a living and I do not know the first thing about how the internet works

@tupsu @noracodes

Haha I have the opposite issue, as in, I regularly write code for my job so I'm technically ruled out of the group you're asking but I have absolutely no idea what happens in the described scenario. Like... There's somewhere some html and CSS that describe what example.com should look like and maybe has some images saved there in that mysterious place, and something about "example.com" as a string helps point my browser to that place.

@noracodes
The "coding" I do in my free time is mostly just shell scripts but I never learned networking so perhaps I fit this.

I know first there's a DNS lookup to get the IP address of the site to connect to. I'm not familiar with how TCP/IP works but I know there's a http handshake and for https a TLS handshake where asymmetric keys are exchanged that are used to encrypt packets. The browser then requests the page, receives the data and renders it, plus it executes JS.

@noracodes i'm a programmer *now* and have also set up servers, but I can tell you about *before*, when i was a kid:

i've been computering most of my life, and somehow never got weirded out by the dos prompt, just accepted that you can type a specific command that makes it go, no conceptual difference with a button, really.

so fastforward to Internet Explorer 3, i also just accepted that you can type a command (the url) an have the program do a thing, just getting it from "The Online".

@batterpunts @noracodes my partner definitely thought that there's just one big database with everything, like the DMV or how you sign up to get an email address from Google, and also thought that the Internet was all based on satellites. The idea of copper and fiber cables crisscrossing the entire planet was deeply disturbing to them lol
@wilbr @noracodes it's still disturbing to me that there's straight up cables across the deep ocean floor
@noracodes I'm a programmer and I think I could give a 10,000 foot view of what happened when you did this in 1996, but there's so much extra magic in there now since they got rid of an independent search bar that I might second-guess myself.
@mattmcirvin @noracodes At the network level, it hasn’t changed all that much.

@ramsey @mattmcirvin @noracodes Didn't we switch to UDP for HTTP 3 ? That seems like a big shift from TCP.

Something about merging TLS session carry-over into the 3-way handshake?

I still write most of my web stuff like I was using SSL 1.0 and am constantly flummoxed by CORS.

@BoydStephenSmithJr @ramsey @noracodes oh god CORS, been a while since that bit me
@BoydStephenSmithJr @mattmcirvin @noracodes I was thinking primarily about the DNS and TCP/IP level.

@ramsey @BoydStephenSmithJr @noracodes Yeah, that's not so different, but there's so much more *of* it.

In the 90s we used to make fun of people whose way of just going to a URL was opening Yahoo!, typing it into the search bar and following a link that came back, but that's not so far from what everyone is doing now.

@noracodes I think:
I type the letters

My browser sends that to a DNS server which turns the letters into a code, either in IpV4 (xxx.xxx.xxx.xxx) or IPV6 (nope, no clue, but the numbers are in hex)

The browser then asks to connect to the server which has that address, and either gets accepted or denied. If the former, the browser and server start exchanging data directly through the Series Of Pipes.

(no, hands, not the Series of Popes)

@shinydan @noracodes now i'm imagining all the dead popes working overtime in Limbo where their penance is to forward every byte that travels through the internet

@shinydan @noracodes ooh i should write up a section in https://github.com/alex/what-happens-when/ about how "the server accepts or rejects the connection" can go wrong

would be fun to talk about CDNs and virtual hosting, maybe i can collaborate with some Fastly people to cross reference against what i know from working at cloudflare

GitHub - alex/what-happens-when: An attempt to answer the age old interview question "What happens when you type google.com into your browser and press enter?"

An attempt to answer the age old interview question "What happens when you type google.com into your browser and press enter?" - alex/what-happens-when

GitHub
@noracodes The browser checks a DNS registry to see which IP address the URL is associated with. The IP address belongs to a computer somewhere on the internet. The computer has a bunch of files on it that are set to be publicly viewable, one of which is an index.html. It usually forwards you to the https version of the site, checks that the certificate has been recently updated, downloads the index.html file over the encrypted connection to your browser's temporary storage & displays it
GitHub - alex/what-happens-when: An attempt to answer the age old interview question "What happens when you type google.com into your browser and press enter?"

An attempt to answer the age old interview question "What happens when you type google.com into your browser and press enter?" - alex/what-happens-when

GitHub
@JetForMe @noracodes someone already replied with that, but I think the idea of the post was to find out what non-tech folks *think* happens, rather than to get the actual answer.
@nicklockwood @noracodes oh for sure, I didn’t mean to answer the question with that post. I just like the absurdity of the inevitable filling in of details.
@JetForMe @noracodes @nicklockwood this answer deserves a spoiler tag ;D
@viq @noracodes @nicklockwood Oh yeah huh? I’m still new to applying content warnings. That would’ve been a good one. Lemme try to edit it.
@noracodes The browser asks the DNS server "which IP does this URL have", eventually gets the corresponding IP, sends a request "show me what you have" and receives that data in various packages and assembles them.
@noracodes uhm my intuition says that i send some sort of request from that websites server to send the contents over to my browser and load up the website for me. Images and other media is heavier so that can take a bit longer to be loaded. How wrong is my guess? 😆
@foervraengd at a very high level that's on the right track! the browser is the one sending the request, not just receiving the response :) it's sometimes called a "user agent" because it's acting on your behalf.
@noracodes I’m in tech but I’m a bit shy of a proper programmer. Whatever stuff you type in goes to a server and it checks its list to see if it has an IP address that matches what you typed. If not it asks around to other servers it knows to see if they have anything. If not, it throws an error page or a web search. If so, it connects to that IP and serves up whatever is there
@noracodes @shinydan I literally have no idea and only care when it doesn’t work

@noracodes
I'm not sure I count for this, I run a git for a nodecg package and admin a mastodon instance, but adamantly don't program.

>Type address, press enter
>browser checks with dns for ip
>redirects to ip
>recieves HTML and CSS
>downloads JS and Media
>renders webpage

@noracodes My concept of what happens is that the browser sends the URL to my ISP, then the ISP sends it along with my IP address to a DNS server, which basically just a fancy automated lookup table that matches URLs to IP addresses, which then sends my IP address to whatever device the actual website is on. Then that device sends the source code and assets needed to make the site work all the way back through that whole process to my computer, where the code is compiled by my browser, then run.

I think I got most of the basics down? There were some bits that I actually didn't get until I started typing it out and then added later.

@KeybladeSpirit that's on the right track! the main thing that's different is that the DNS request happens separately from the request to the site you're actually visiting. so there's a full round trip between you and the DNS server before the browser sends a request to the IP of the website.

also your ISP is the default DNS server, but it's possible to configure a different server if you want to make it harder for them to know which sites you're visiting.

@noracodes My friend’s three-year-old’s version: ‘This is easy, dad. You go “type, type, type,” and it goes “‘‘pute, ‘pute, ‘pute” ‘.
@noracodes my answer is: I have absolutely no idea. Except that computers and servers are somehow connecting.

@noracodes

Well, isn't it obvious what happens? The searcher living in my browser goes out and hunts down the site I'm looking for, then builds a pipeline to feed the little electron bits from their server to my browser, where the searcher puts them all together in the right order so I can see it. They're very fast, these browser searchers.

(Actually I've been interneting since the early 90s, and have set up a few DNS in my time, but that was long ago, and in another life.)

@noracodes it works like the Windows address bar in folders, only it connects to a computer that isn't on site. (I have done some coding via kludging)
@noracodes When I get this one in interviews, I like to start with explaining keyboard interrupts, and then pull an "of course that's not exactly how it works anymore" derail and start talking about USB protocol messages. I win if they stop me before I get to the network.
@jordan @noracodes I like to invoke the image of a unfathomably long chain reaction of atoms getting bumped into and out of higher energy states first, then jump back to "of course your finger never really *touches* the key.. Nothing ever really touches anything.." :)
@jordan @noracodes Er, yes, and never addressing the matter of the network. Exactly. It's implied 😆

@jordan @noracodes the ramble potential here is limitless

"now if the keyboard supports USB 4 but a Power Delivery Hard Reset was issued by the host then—

@noracodes I, at max experimenting with shell scripts, like to add:
- the browser does performs some computation, that appears somehow as machine commands, juggling various storages and CPU capacities. All of this requires some electricity.
- routers, switches, etc on the way are also computers that, like before, perform some computation, requiring energy.
- tbc.
#carbon

Handshakes confuse me: are the pipes broad enough for cats, mice, etc to actually conduct magic rituals? Do they have hands?

@noracodes the puter yells at the web server to give it the web page so it does