Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do you think Adept need a build system? #12

Closed
ghost opened this issue Jun 23, 2024 · 7 comments
Closed

Do you think Adept need a build system? #12

ghost opened this issue Jun 23, 2024 · 7 comments

Comments

@ghost
Copy link

ghost commented Jun 23, 2024

Zig comes immediately to mind, even though I only hear about it from other people and I have never actually tried it. But I think Adept should have the ability to build C/C++ projects (maybe only C, because C++ is another beast). This will also help cross-compilation.

@IsaacShelton
Copy link
Owner

Yes this is the plan,

we will have to see how viable it is though. Getting the ABI right for every platform/os is extremely difficult.

But yes like you mentioned, if it works out, it would drastically simplify cross compilation and potentially allow running sandboxed C code at compile time.

Also yes, there are no immediate plans for C++ support. If it goes well with C, then maybe a subset of C++ would be supported (as the entire C++ spec is so massive and constantly changing that it's nearly impossible for any one person to fully know and implement).

@ghost
Copy link
Author

ghost commented Jun 24, 2024

It seems you are misunderstanding me. I'm not talking about mixing Adept code with C/C++ code. I'm talking about support building of C/C++ projects. I have seen people using the Zig build system to build C/C++ projects. It's good to be able to parse C/C++ headers to import C/C++ methods, but it's not what this thread is about. Maybe you could have something like build.adept similar to build.zig.

@IsaacShelton
Copy link
Owner

Ah ok yes,

There are a lot of headaches that come with building C/C++ projects. Potentially there could be a hybrid approach of prebuilt binaries for complicated libraries, and optionally-prebuilt libraries with our own build format for less complicated ones.

It might be possible, but there's still a lot to figure out

@IsaacShelton
Copy link
Owner

IsaacShelton commented Jun 24, 2024

That being said, it will not be suited for every project. It is the entire compiler and build-system, and cannot be switched out in parts.

@ghost
Copy link
Author

ghost commented Jun 25, 2024

Please have a look at how Zig is doing it. I have never used Zig but I have read a lot of articles about it so I at least can imagine how it works.

@ghost
Copy link
Author

ghost commented Jun 25, 2024

As Adept distribution already includes the gcc binary, something like adept cc that is similar to zig cc is entirely possible, isn't it? I know currently the gcc binary is only used for compiling .rc resource files on Windows, but it can be easily extended to a full-blown GCC/LLVM toolchain.

@IsaacShelton
Copy link
Owner

IsaacShelton commented Jun 26, 2024

Yes, zig cc is pretty much just clang.

It could be possible to ship with an entire gcc/llvm toolchain, but that is also computationally slow, expensive to maintain/support and takes up significantly more disk space.

Zig is currently suffering from these problems and more from it's dependence on clang. They are trying to address them, but because it's so tightly coupled, they are struggling to make improvements. ziglang/zig#16270

Maybe there could be an optional additional install where you try to use the equivalent of zig cc that includes an entire gcc/llvm toolchain for building C/C++ projects, or something like that.

However, in the long run we probably want to avoid relying on external tools as much as possible.

In an ideal world, we would just support compiling them with the Adept compiler itself, which would be way faster, more portable, more interoperable, and easier to maintain. But yes we will have to see

@ghost ghost closed this as completed Jun 27, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant