Vivek Galatage's Avatar

Vivek Galatage

@vivekgalatage.bsky.social

buillding browsers for 20+ years • ❤️ languages, os, compilers • contributed to #chromium, #webkit • founding engineer browsercompany • views are personal

91 Followers  |  21 Following  |  22 Posts  |  Joined: 26.06.2023  |  1.9244

Latest posts by vivekgalatage.bsky.social on Bluesky

Post image

Example code to show the ASM code - both for x86-64 and ARM.

godbolt.org/z/e6q715Whf

02.12.2024 17:43 — 👍 1    🔁 0    💬 0    📌 0
Video thumbnail

Did you know you can flush the CPU caches with special intrinsic operations (on x86-64) and use DC CIVAC on the ARM?

More details in 🧵

02.12.2024 17:43 — 👍 3    🔁 0    💬 1    📌 0
Post image

Why this matters❓

- Network protocols (packed structs for wire format)
- Hardware interfaces (for memory-mapped I/O)
- Performance optimization (aligned access for SIMD)
- Cross-platform compatibility (consistent memory layout)

Understanding this is crucial for systems programming! 🚀

28.11.2024 09:26 — 👍 0    🔁 0    💬 0    📌 0
Video thumbnail

🧵 Visualizing struct memory layout in C

- Default: Natural alignment with padding
- Packed: No padding, minimal size
- Aligned: Specified alignment affects padding!

See how memory layout attributes affect the way memory is laid out

godbolt.org/z/c11Mzesa7

28.11.2024 09:26 — 👍 1    🔁 0    💬 1    📌 0
Post image

A visual explanation of priority inversion and inheritance: primarily used in real-time operating systems.

Source: wiki.linuxfoundation.org/realtime/doc...

20.11.2024 13:11 — 👍 0    🔁 0    💬 0    📌 0

Godbolt shows control graph for each function: Use `+ Add new... > Control Flow Graph`

You can see how the conditionals, loops, etc are generated.
godbolt.org/z/Mq3TesbaE

💡 Sometimes, it takes just a moment to fix hard-to-debug issues merely by looking at some of these visualizations.

20.11.2024 12:48 — 👍 0    🔁 0    💬 0    📌 0
Preview
High Performance Computer Architecture: Part 1 - YouTube The course begins with a lesson on performance measurement, which leads to a discussion on the necessity of performance improvement. Pipelining, the first le...

I came across this fantastic playlist that talks about High-Performance Computer Architecture.

Videos are short to watch but rich in scope! Enjoyed the talks about CPU pipelines along with others.

www.youtube.com/playlist?lis...

20.11.2024 12:43 — 👍 0    🔁 0    💬 0    📌 0
Post image

The state of language interop; C ABI drives it all.

💡 Remix the diagram with any language, and it still conveys perfectly.

20.11.2024 04:24 — 👍 0    🔁 0    💬 0    📌 0
Post image

A search engine for finding websites using a specific W3C API would be cool! Does it exist already?

18.11.2024 07:11 — 👍 2    🔁 0    💬 0    📌 0
Post image

Heard this often?- Browsers are multi-process and use Inter-Process Communication.
This guide provides the foundations of IPC in general; a must-read!

beej.us/guide/bgipc/

13.11.2024 08:15 — 👍 0    🔁 0    💬 0    📌 0
Post image

When a light drizzle wakes you up in the morning...

13.11.2024 05:19 — 👍 0    🔁 0    💬 0    📌 0

3. A practical example:
In a job interview, don't stop at asking about company culture. Follow up with how the team handles challenges. Then, crucially, explore how the role aligns with the company's long-term vision.
Don't forget to check the transcript for more insights!

12.11.2024 11:57 — 👍 0    🔁 0    💬 0    📌 0

2. The concept of asking the third question:
When exploring a topic, push beyond surface-level inquiries. While the first question opens the door and the second adds depth, it's the third question that often reveals unexpected insights.

12.11.2024 11:57 — 👍 0    🔁 0    💬 1    📌 0

Here are the key takeaways that resonated:
1. The powerful eulogy by Jony Ive, reflecting on his time with Steve Jobs, emphasizing the interplay of curiosity and discipline.

12.11.2024 11:57 — 👍 0    🔁 0    💬 1    📌 0
219. Curiosity Is a Discipline - Greg McKeown

After sharing these thoughts, a search for "curiosity and discipline" led me to a fantastic podcast.

Curiosity Is a Discipline by Greg McKeown - a short ~12-minute episode filled with a magnificent story and valuable insights!

gregmckeown.com/podcast/epis...

12.11.2024 11:57 — 👍 0    🔁 0    💬 1    📌 0

Once you have thoroughly grasped the concept with the help of such tools, your learning gets only better and better with practice.

11.11.2024 16:19 — 👍 0    🔁 0    💬 0    📌 0

In the above example, volatile variables are read from the register each time they are accessed, with no caching.

Once these concepts are clear, we can better appreciate their role in concurrency & synchronization. It is essential for avoiding pitfalls in multi-threaded environments.

11.11.2024 16:19 — 👍 0    🔁 0    💬 1    📌 0

For the volatile keyword in C and C++, see how the generated machine code differs, how many reads are used for a volatile variable, and how the compiler optimizes everything else.

Start with the smallest usage for a given concept & gradually build on it, laying the foundation for future recalls.

11.11.2024 16:19 — 👍 0    🔁 0    💬 1    📌 0
Post image

💡 Folks new to programming can use visualization to understand it better. One such way is to explore generated machine code for a given concept.

Sample code: godbolt.org/z/hPj6z6arT

11.11.2024 16:19 — 👍 2    🔁 0    💬 1    📌 1

Let curiosity light the way for our dreams to take flight; let discipline carry us forward - transforming our everyday moments into extraordinary tales.

11.11.2024 06:05 — 👍 0    🔁 0    💬 0    📌 0

Curiosity, the front wheel, seeks new trails, chasing horizons and revealing unseen paths. Discipline, the back wheel, is steady and strong, transforming dreams into beautiful realities.

11.11.2024 06:05 — 👍 0    🔁 0    💬 1    📌 0
Video thumbnail

Reminiscing over the years, I realized there are two key growth aspects: curiosity and discipline.

And what better than a bicycle to represent this journey?

11.11.2024 06:05 — 👍 1    🔁 0    💬 2    📌 0

@vivekgalatage is following 20 prominent accounts