3 ms·
Carbonlang is meant to have a seamless migration path, that is, flip the compiler on the same codebase for starters, no changes. It's not like TS/JS as a supers
by wseqyrku 2y ago
Carbonlang is meant to have a seamless migration path, that is, flip the compiler on the same codebase for starters, no changes. It's not like TS/JS as a superset langauge, but you can have both at the file level and compile side-by-side.
- pjmlp 2y agoFirst there is no Carbonlang, it is called Carbon. Second, it is mostly a Google thing for their C++ use, it is still mostly a frontend implementation at this point, with semantics yet to be fully defined. They are also open that Carbon is basically an experiment.
- bbsbbs 2y agoIf it is just a frontend, does it mean that it could be used everywhere the backend is used?
- pjmlp 2y agoFirst you need to create a backend that understands what the frontend generates. https://godbolt.org/z/rzMcs6nvh https://godbolt.org/z/rzMcs6nvh
- bbsbbs 2y agoI see... Does it mean that the compiler is more than just a frontend? Or maybe I don't understand what a frontend is?
- pjmlp 2y agoIt definitly is. Frontend in a compiler, is what converts the text code representation of the language into some intermediary format, usually a graph or intermediate language, that is than further processed for type checking and other semantic analysis, suffering other transformations in the process, until fed into the backend, which takes it from there for the further phases required to generate machine code. https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/index.html https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/index...
- bbsbbs 2y agoThank you for your explanations. I don't understand why you provided that link to goldbolt though? What was it supposed to demonstrate? Also, you said that one need a backend for a frontend (to be useful I guess). Do you mean to say that the "Carbon" frontend does not have any backend to work with?
- pjmlp 2y agoI suggest learning about compilers in first place. https://www3.nd.edu/~dthain/compilerbook/compilerbook.pdf https://www3.nd.edu/~dthain/compilerbook/compilerbook.pdf