Is this dumb idea??
I had this random idea for a programming language and I'm wondering if something like this is actually possible.
Basically, the idea is that I could teach the compiler how to implement things in assembly.
For example, I could write something like:
teach get(x):
asm:
; assembly code for getting input
The compiler remembers that. Then later I can just write:
get(age)
and it knows to use the assembly code I taught it earlier.
So instead of the compiler already knowing what every function does, I'm basically teaching it new things by giving it the assembly implementation once.
The goal would be a really simple language to write, but where the compiler generates native assembly/machine code.
Is this actually possible? And would it be worth building as a project?
I don't know low-level programming or compiler stuff that well, so consider me a complete noob and feel free to correct me if I'm misunderstanding something.