32 points

I get the feeling that all of these assembly jokes are justifications to avoid learning assembly.

You can still make syscalls in assembly. Assembly isnt magic. It isn’t starting from the creation of matter and energy, it’s just very specific code.

permalink
report
reply
20 points

Assembly code is for writing C compilers, and C compilers are for writing Lisp interpreters.

permalink
report
reply
10 points

I saw a Scheme interpreter written in assembly running a C compiler written in Scheme.

permalink
report
parent
reply
13 points

permalink
report
parent
reply
4 points
*

There’s actually good reasons for this design. It’s easy to write a Scheme interpreter in assembly, but it’s hard to write a C compiler in assembly that handles everything correctly. Much rather write it in higher level language if possible and Scheme lowers the bar to getting there, so you can get away from using assembly as quickly as possible. Or you can copy somebody else’s Scheme implementation of a C compiler because now you’re platform independent.

Then you can write your C compiler in C (or steal a better compiler already written in C) and close the loop. For your final step, you use the C compiler to compile itself.

permalink
report
parent
reply
6 points
*

Only the most very basic compilers. C compilers are in C mainly.

permalink
report
parent
reply
5 points

Talking about bootstrap here?

permalink
report
parent
reply
2 points

Indeed

permalink
report
parent
reply
4 points
*

Not the first C compiler obviously. According to this Stack Overflow post, BCPL* begat B, which begat C. Language self-hosting is pretty fascinating.

*Perhaps BCPL was originally written in assembly; I’m not certain: https://github.com/SergeGris/BCPL-compiler

permalink
report
parent
reply
7 points

It’s now been 18 years since the last time an employer paid me to write assembly, but it’s only been a year or so since the last time I had to read assembly at work (in order to verify what the compiler really was doing).

permalink
report
reply
6 points

Ha! I teach assembly and use this one every year to lighten the mood before midterms.

permalink
report
reply
6 points

I remember watching assembly demos in the early-mid 90s and thinking those guys were wizards

permalink
report
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 4

    Monthly active users

  • 755

    Posts

  • 2.2K

    Comments