44 points

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

permalink
report
reply
19 points

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

permalink
report
parent
reply
29 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
14 points
*

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

permalink
report
parent
reply
11 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
6 points

Talking about bootstrap here?

permalink
report
parent
reply
1 point

Indeed

permalink
report
parent
reply
2 points

And that’s how you get the Thompson hack

permalink
report
parent
reply
4 points

Back in High School in the 80’s me and a buddy wrote a Z-80 editor assembler in TRS-DOS BASIC.

It was not rocket science.

permalink
report
parent
reply
4 points
*

I never did get very far with the TRS-80 Editor Assembler, but that was my first exposure to such things.

I also remember the BASIC code for the Dancing Daemon which was replete with PEEKs and POKEs, such that much of it was written in machine code.

permalink
report
parent
reply
10 points
Deleted by creator
permalink
report
parent
reply
2 points

Mebly I do, and mebly I don’t.

permalink
report
reply
2 points

I have Dyslexia ¯_(ツ)_/¯ Sorry.

permalink
report
parent
reply
5 points
*

You dropped this \

Short explanation: Type ¯\\\_(ツ)\_/¯ to see ¯\_(ツ)_/¯.

Long expanation: Lemmy supports formatting, like _italic_ becomes italic. To stop this from happening, you can put a \ before it like \_; the \ isn’t shown. This is why ¯\_(ツ)_/¯ becomes ¯_(ツ)_/¯. To show a \ you need an additional \ like so: \\, and to make sure _ is shown and not turned into italic, it too needs \. This is why ¯\\\_(ツ)\_/¯ becomes ¯\_(ツ)_/¯

permalink
report
parent
reply
2 points
*

Alternatively, you can just use the `` enclosure, used for single line code.
That is a “grave accent” or a “backtick”, the key you will find on the left of the ‘1’ key and under the ‘Esc’ key on a standard (ISO, maybe) 104/105 key qwerty keyboard.

¯\_(ツ)_

permalink
report
parent
reply
2 points

The backslash is known as an escape character in this context, because it removes (escapes) the special meaning of the following character.

It’s also used that way in most Unix shells.

permalink
report
parent
reply
1 point

I’m sorry, I have no idea what you’re talking about. Could you explain it in assembly?

permalink
report
parent
reply
8 points

In college back in 1991. Also had to do PASCAL and FORTRAN but thankfully those two were in a single course.

permalink
report
reply
12 points

I also took PASCAL in the 90s, but it is considered a high level language, and writes similarly to other high lvl languages, assembly has a very different syntax

permalink
report
parent
reply
3 points

Oh, I know. I meant that we had to take courses on older languages as part of the curriculum. That was a funky little college program. The oddest experience for me was taking Python back in the day as the “new thing” then not seeing it again until it absolutely exploded ~10 years ago. That program is also why I ended up playing with Linux so early on. The professors truly seemed to have a passion for emerging technologies while not wanting anyone to forget what came before. Thankfully, no punch cards.

permalink
report
parent
reply
2 points

We used turbo pascal in school in the early 90’s. And it had assembly blocks… which I used copious amounts of because it was the only way to make the IBM PS/1’s do useful graphics.

permalink
report
parent
reply
9 points

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

permalink
report
reply
2 points
permalink
report
parent
reply
68 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
19 points

It’s just a joke friend.

permalink
report
parent
reply
-24 points

A very bad one if it requires switching off a large portion of your brain to find it funny.

permalink
report
parent
reply
48 points

permalink
report
parent
reply
0 points

suspension of disbelief

permalink
report
parent
reply
-1 points

I said so in my comment, try to keep up.

permalink
report
parent
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

  • 5.4K

    Monthly active users

  • 886

    Posts

  • 9K

    Comments

Community moderators