DEV Community

Discussion on: Why you need to know C for hacking

Collapse
 
pentacular profile image
pentacular • Edited

C programs run in the C Abstract Machine.

Access to the hardware is through language extensions -- you can do the same kinds of things in other languages.

Most of the things you consider 'hacking' won't be legal in portable C, and most will require learning some assembly -- C has no concept of op codes or registers or so on.

Being 'built on top of C' doesn't mean anything significant.

It just means that if you want to maintain implementations written in C, you'd better learn C.

While cpython is written in C, pypy is written in python -- does this mean that python is based on python if you're using pypy and based on C if you're using cpython? If so, what does 'based on' mean here? :)

The main benefits of C are that:

  1. it has many implementations and libraries.
  2. many implementations have very minimal runtime infrastructure (mostly to handle malloc, atexit, and FILE).
  3. many implementations have support for inline assembly.

Also, assembly languages are not particularly hard to learn.