Live data from Hacker News

Let's code a TCP/IP stack (2016)

saminiir.com

31–40 of 55 posts

Re: Let's code a TCP/IP stack (2016)

#31

Coming from C/C++ and Having worked for 5 years within the java world now, i must admit that the naming "conventions" and variable abbreviation in c code or more specifically Linux kernel code form a high entry barrier for me. Why is it so hard to write things out? We all look up to the various Linux philosophies (keep it simple, do one thing, etc), but to me it feels that this kind of code style is not written with…

C and Unix are from the early 1970s. They date from an era that predates the prevalence of large, bitmapped displays. There is a famous photo of Dennis Ritchie and Ken Thompson at a teletype in 1972 (http://www.columbia.edu/cu/computinghistory/teletype/ken-and...). When the luxuries of modern IDEs, bitmapped displays, and high amounts of untapped computational power are unavailable, the programming environment and operating system need to adapt to the technologies that are available. The convenience of terse names is more pronounced in an environment of teletypes.

On the flipslide, Smalltalk, also developed in the 1970s, has much longer names. But Smalltalk was developed for the Xerox Alto (https://en.wikipedia.org/wiki/Xerox_Alto), an expensive machine with a bitmapped display, luxurious even by 1980s standards. Lisp also gradually embraced longer names as technology improved; compare the early Lisps of the early 1960s to Common Lisp, which first appeared in the mid 1980s.

C and Unix are products of their relatively spartan environments from the early 1970s, whereas Java, a product of the 1990s, was influenced by Smalltalk, which was born under less austere conditions.

Re: Let's code a TCP/IP stack (2016)

#32
post #31

Coming from C/C++ and Having worked for 5 years within the java world now, i must admit that the naming "conventions" and variable abbreviation in c code or more specifically Linux kernel code form a high entry barrier for me. Why is it so hard to write things out? We all look up to the various Linux philosophies (keep it simple, do one thing, etc), but to me it feels that this kind of code style is not written with…

C and Unix are from the early 1970s. They date from an era that predates the prevalence of large, bitmapped displays. There is a famous photo of Dennis Ritchie and Ken Thompson at a teletype in 1972 ( http://www.columbia.edu/cu/computinghistory/teletype/ken-and... ). When the luxuries of modern IDEs, bitmapped displays, and high amounts of untapped computational power are unavailable, the programming environment and…

> On the flipslide, Smalltalk, also developed in the 1970s, has much longer names. But Smalltalk was developed for the Xerox Alto (https://en.wikipedia.org/wiki/Xerox_Alto), an expensive machine with a bitmapped display, luxurious even by 1980s standards.

Long selectors in Smalltalk make sense as they're split and interleaved with arguments. Even a single programmer would probably write the same code for both environments differently when it comes to naming things.

Re: Let's code a TCP/IP stack (2016)

#33
post #26
post #14

Earlier quoted context omitted.

Nostalgia anecdote: we used KA9Q as the routing software on a 286 PC with an ISDN uplink.

ISDN was super fast - I remember playing Warcraft 2 on an ISDN connect with a friend down the street :)

growing up in the UK stuck with 56Kbps modems, when prompted to select network speeds I remember seeing things like ISDN (128Kbps) and T1/T3 Cable (1Mbps) and thinking wow, those Americans have lightning Internet

Re: Let's code a TCP/IP stack (2016)

#34
post #12

Notice these classic technologies. They’re SIMPLE. That got lost in later development up the stack.

Yes. I found it was quite possible to code up TCP/IP from scratch for my own tiny (arguably toy) bare metal environment here https://github.com/billforsternz/bmz

Re: Let's code a TCP/IP stack (2016)

#35

Earlier quoted context omitted.

The fundamental problem is that once your break/compartmentalize into layers it's harder apply global optimizations at local layers. You are trading off ease of implementation and compositionality for performance. You have to bubble up optimizations up the stack. This is partly why QUIC is based on UDP instead TCP. You don't have all the information needed at the TCP layer to do the kind of optimizations that QUIC do…

This lack of "global optimization" I think is something that should be solved by a new protocol stack. (If it could be done without replacing the whole stack i'd be in favor of it, but I have no idea how) Say you have a backend tcp http REST app that takes requests to modify a widget. To receive the request, the payload will pass over a series of networks and protocols, all with potentially different restrictions and…

Sounds a bit to me like that would necessitate describing your internal network to every outside server or client it trades requests with, unless your routers become much more sophisticated.

I cannot imagine that would ever be acceptable for most companies.

Re: Let's code a TCP/IP stack (2016)

#38
post #26
post #14

Earlier quoted context omitted.

Nostalgia anecdote: we used KA9Q as the routing software on a 286 PC with an ISDN uplink.

ISDN was super fast - I remember playing Warcraft 2 on an ISDN connect with a friend down the street :)

ISDN was the only way to get WCIII was p2p IIRC so this let me play ranked matches against EU players.

Shout out to anyone who remembers “Warcraft III ZAF-1” — I swear that sequence of characters is burned into my muscle memory.

Re: Let's code a TCP/IP stack (2016)

#39

Coming from C/C++ and Having worked for 5 years within the java world now, i must admit that the naming "conventions" and variable abbreviation in c code or more specifically Linux kernel code form a high entry barrier for me. Why is it so hard to write things out? We all look up to the various Linux philosophies (keep it simple, do one thing, etc), but to me it feels that this kind of code style is not written with…

They literally had size limits on variable names back then.
Post reply on HN