top | item 37965903

(no title)

arnaudvalette | 2 years ago

Do you have any ressources to share ? I am a self taught developer, I do stuff at my level (typescript, lisp), also because when you work alone, such high level languages allow you to express things nicely and fast. I kinda know how a cpu works, I understand what is going on when you perform some bare metal programming, but I never barely went down the rabbit hole and performed some low level stuff. I'm in the situation where I don't know what I should learn to be on par with graduates/undergraduates students. I am searching ressources about networking, operating systems, or anything that could enhance my proximity with low level stuff.

discuss

order

criddell|2 years ago

For very foundational stuff, Charles Petzold has put out some great books.

His book Code is fantastic. He starts at simple battery and lightbulb circuits and builds and builds towards a simple CPU.

He also wrote The Annotated Turing which is a breakdown of Alan Turing seminal paper and you only need high school math to get through it.

When I was in school my favorite course was compiler design and we used Compilers: Principles, Techniques, and Tools (aka the dragon book). It’s one of the best textbooks I’ve used but that was 30 years ago. There might be something better now. Understanding parsers and lexers and (especially) state machines is something that will serve you well.

arnaudvalette|2 years ago

Thanks !

Ah, I'm interested in parsers these days (I just wrote one for parsing org data, I am a bit unsure about the architecture of the project but at least it does what I needed personally). I am right now at a friend's place that just showed my the dragon book from its shelves, that's a funny coincidence. I will check out Code.

danielvaughn|2 years ago

Code is an awesome book. Those first few chapters were nothing but lightbulb moments for me (pun intended).

danielvaughn|2 years ago

I'm also self-taught. I've been doing it since (roughly) 2009, and like many others I started at the highest level of abstraction with front-end web dev. I've worked with some mid-level languages like Objective-C and Java, but like you I've never really dug deeper than that.

I know this is tired and cliche at this point, but literally this week I sat down with ChatGPT and asked it to teach me how to write WAT (web assembly text format) so I could understand how memory is managed at a really low level (but not so low that I risk crashing my computer).

It turned out to be super valuable. This is where AI shines for me - I can ask it any question that pops into my head, and also validate whether what it's telling me is true by running the code and seeing whether it works. It was amazing.

If you're curious, I'm fine sharing a link to the chat:

https://chat.openai.com/share/583bf23b-b43d-4566-956a-e92b6f...

pcthrowaway|2 years ago

Very cool! Have you already taken the time to cross-examine the output to ensure it's hallucination-free?

lukasgraf|2 years ago

This is a 30min talk that I keep coming back to:

Python, Linkers, and Virtual Memory by Brandon Rhodes (Python core dev)

https://www.youtube.com/watch?v=twQKAoq2OPE

(Most of the content is not actually specific to Python)

He beautifully pulls back the curtain on so many lower level concepts like virtual memory management, dynamic linking, heap/stack, fork(), copy-on-write.

The talk is broad in nature, not deep. It takes you just below the surface of many magic black boxes, and, as you put it, enhances your proximity with those topics.

For me, so many things clicked in this single talk:

- How virtual memory works (incl. paging in/out, swapping)

- Why there's those discrepancies between RSS / PSS

- What segfaults and page faults are

- What actually happens when I get errors related to dynamically linked libraries, either at build time or runtime

- Actually understanding the output of top / ps

enriquto|2 years ago

> Do you have any ressources to share ?

Godbolt [0] is an invaluable resource. But simply setting up tasks to yourself and completing them may be the best course of action. Then you'll find whatever resource you need for a concrete objective.

For example, if you have a week, I'd suggest to start "in the middle", and move up and down according to your tastes.

- Write a hello world program in C, compile it and run it. Try to compile it statically and understand the difference.

- Ask the compiler to produce an assembly file. Try to build the executable from that assembly.

- Try to write a hello world in assembly language by yourself, compile and run it.

- Write a program in assembly that prints fibonacci, or prime numbers.

- Now, forget about assembly and move upwards. Download python source code, compile it, and run a python hello world with that interpreter.

- Look at the Python source code, which is written in C, and try to follow what happens when you run your hello world.

- Try to change the "print" function of the python interpreter so that it prints your string backwards.

Depending on your experience, you may need more than a week (5 days) to complete all these steps. But that's OK! In a few months you can find a new spare week and continue your work.

[0] https://godbolt.org/

arnaudvalette|2 years ago

That's a nice recommendation, I have already done this type of stuff, but it seemed to me rather basic, I will check godbolt !