3 ms·
I don't know what that has to do with learning about compilers and interpreters.
by dunefox 4y ago
I don't know what that has to do with learning about compilers and interpreters.
- chrisseaton 4y ago> I don't know what that has to do with learning about compilers and interpreters. Compilers and interpreters, unless they're running on bare metal, which is very niche, talk to the operating system using something called 'system calls' to ask for resources that they can't provide themselves, like virtual memory space and IO. These system calls are documented in C. For example I wrote a Ruby compiler in Ruby, but I still need to know about the mmap system call, which is documented in C, to allocate my memory. https://github.com/chrisseaton/rhizome/blob/main/doc/memory.md https://github.com/chrisseaton/rhizome/blob/main/doc/memory.... https://man7.org/linux/man-pages/man2/mmap.2.html https://man7.org/linux/man-pages/man2/mmap.2.html https://github.com/chrisseaton/rhizome/blob/main/lib/rhizomeruby/memory.rb#L72 https://github.com/chrisseaton/rhizome/blob/main/lib/rhizome...
- dunefox 4y agoNow I can finally reply: that makes sense, and in hindsight is quite obvious, thanks. My general lack of knowledge in this area is a part of why I'd like to study it more, but preferably I'd like to use a language I'm already comfortable with. C is just very far removed from everything I have use for and am interested in.
- Koshkin 4y ago> These system calls are documented in C. Sure, but the compiler will still have to generate machine code for those.