5 ms·
Ok, maybe I'm missing something, I'm not C nor Objective-C dev but... Language is just a specification, right? Which is just a document. Then you have to impl
by kovrik 8y ago
Ok, maybe I'm missing something, I'm not C nor Objective-C dev but...
Language is just a specification, right? Which is just a document.
Then you have to implement that language using that spec: interpreter, compiler, VM, runtime, whatever.
So I was always under impression that you could implement any language in any other language (almost; sometimes with the help of another, more low-level lang, say assembly, C etc.).
It is like saying "Java has no Tail-Call optimization (yet), hence you can't implement Scheme (which requires TCO) in Java". Surely you can! Just use trampolines or even use your own stack and calling convention.
What am I missing?
- georgeecollins 8y agoI think what you are missing is that while any Turing complete system can solve the same problems as any other, not all programming languages have the same functionality. An easy example is that some languages are typed and some are untyped. Some have objects (Objective C) and some don't (C). Can you replicate the functionality of Objective C in C. Apparently not completely.
- kovrik 8y agoBut that is my point: if host language doesn't have feature X, you still can implement that feature yourself, can't you? If host language is untyped, then write your own type system. Another example: Java has no co-routines, has no continuations, but Kotlin (written in Java) does. They compile Kotlin code with co-routines into finite state machines in Java.
- arcticbull 8y agoAn object is just a struct with a well-known layout. What you cannot do with C is necessary to offer the same type guarantees.