The Python complier is written in C? Ok. Odd, but ok. You'd think they'd write it in machine language, or something, like the C compiler is written in, but whatever.
But what bearing does that have on anything? You can still write Python code without knowing C, correct? Why should this even matter?
I've never even heard of a compiler written in machine language. I doubt any serious compiler has been in decades, actually. I think the vast majority of compilers are written in C/C++. There's also a long tradition of writing a compiler in the same language it compiles to (Mono's C# compiler is written in C#, for example).
Machine language is probably the least suitable language for writing a compiler, actually, simply because the complexity of the task implies high-level functionality. In fact, the front-end of a compiler is often not even written in a general-purpose programming language, but automatically generated by lexer and parser generators (lex/yacc).
I took a compilers class a little over a year ago, and we wrote a compiler in SML using ml-lex and ml-yacc. That was an adventure.
I don't think this post is a troll, though. I think it's just an incredibly clueless person.
Comments 4
The Python complier is written in C? Ok. Odd, but ok. You'd think they'd write it in machine language, or something, like the C compiler is written in, but whatever.
But what bearing does that have on anything? You can still write Python code without knowing C, correct? Why should this even matter?
Reply
Also, CPython is just the reference implementation. There's as PyPy (written in Python), Jython (Java), and IronPython (C#).
Reply
Machine language is probably the least suitable language for writing a compiler, actually, simply because the complexity of the task implies high-level functionality. In fact, the front-end of a compiler is often not even written in a general-purpose programming language, but automatically generated by lexer and parser generators (lex/yacc).
I took a compilers class a little over a year ago, and we wrote a compiler in SML using ml-lex and ml-yacc. That was an adventure.
I don't think this post is a troll, though. I think it's just an incredibly clueless person.
Reply
Reply
Leave a comment