+ 1

How do you define print?

Print in most languages is what appears to be a predefined function, but without the pre-existing ability to to post stuff on the command line, how do you define a function that can do so? I would guess there is some kind of API to interface with for it,but its not the sort of thing that you ever see done.

2nd Jan 2022, 1:24 PM
AnonyMouse
AnonyMouse - avatar
2 Answers
+ 2
I would guess its something you have to define in the early stages of building a language, and there you show it how by referring the print command to another language or assembly code that knows how to do it already,and you bake that into your compiler/interpreter, does anyone have any further useful info on this? As I would be very interested, currently learning how to build languages.
2nd Jan 2022, 1:28 PM
AnonyMouse
AnonyMouse - avatar