Replies: 3 comments 1 reply
-
@mingodad I know "keep it simple stupid" is an old saying, but you don't have to keep saying "stupid" -- "simple" is fine, and more in keeping with the way we want to discuss ideas in the Carbon community (whether yours or otherwise). You can also find other phrasing suggestions on wikipedia's KISS entry (e.g., straightforward), but I've just switched your post to remove "stupid" because "simple" seems to capture what you're trying to say. |
Beta Was this translation helpful? Give feedback.
-
While we're developing Carbon, we're trying to focus on a single build setup in order to keep development as consistent as we can. Even if other setups are fairly simple, they're still extra work to monitor, maintain, and support. As Carbon matures, I expect we'll want to handle more setups, but right now we're interested in focusing on building out the core of the language. |
Beta Was this translation helpful? Give feedback.
-
Just found the missing parameters to allow execution of |
Beta Was this translation helpful? Give feedback.
-
This is my opinionated take on a simple way to build carbon using clang, gcc, emscripten for 32/64 bits see here https://github.com/mingodad/carbon-lang/tree/compile-with-gcc.
I'm actually using Lubuntu 18.04 and when I attempted to build carbon following the instructions of the project I've got lost on
bazel
and it's way, too much work for a few source files (of course it'll grow with time).Then I look around to know/understand what really matter to build
carbon
, basically carbon uses a subset of llvm/Support to supplement the standard library for it's implementation, building the official way do not allow build or cross-compile with gcc or emscripten for both 32/64 bits.So I started with my old friend
Netbeans 8.2
and created a C++ application project then I added directly all files that I found necessary or the compiler complained about not found then or missing symbols when linking.After getting it to build with clang-13, clang-14, clang-15, gcc-9, emscripten (not exactly in that order or before the next step) then I create a folder for the subset of
llvm/Support
used bycarbon
and did a copy of the used ones and added then to this branch on my fork https://github.com/mingodad/carbon-lang/tree/compile-with-gcc (some small changes were needed to build with emscripten and gcc).I also added simple scripts to manually generate the missing files (ast_rtti, lex, parser) and added then to the repository too (to facilitate first time build for anyone trying to play with
carbon
).This is the list of llvm/Support files used https://github.com/mingodad/carbon-lang/blob/compile-with-gcc/explorer/fromllvm/check-from-llvm.sh.
This is the simple shell script that can build
carbon
with gcc, clang, emscripten for 32/64 bits https://github.com/mingodad/carbon-lang/blob/compile-with-gcc/build-it-simple.sh .And here another simple shell script to test (execute the carbon binary on all explorer/testdata/*.carbon) https://github.com/mingodad/carbon-lang/blob/compile-with-gcc/test-it-simple.sh .
I also included my Netbeans 8.2 project here https://github.com/mingodad/carbon-lang/tree/compile-with-gcc/carbon-nb just in case it can be useful to anyone.
Here is the output of building
carbon
using my simple shell script:And here is the partial output of my simple shell script to test
carbon
:The resulting
carbon.js/carbon.wasm
shows the usage but it's failing to run any*.carbon
source file and I'll investigate what's missing:Next step can be create a simple makefile.
Also would be interesting to try build
carbon
withcosmopolitan
https://github.com/jart/cosmopolitan !Here is a list of the binaries created:
Why not also have a simple way to build carbon included in this project ?
I hope this experiment can be useful to someone interested on this project !
Beta Was this translation helpful? Give feedback.
All reactions