-
Notifications
You must be signed in to change notification settings - Fork 25
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
Zig Template: zigConsole #94
Conversation
awesome! Let's review it, thanks for the contribution |
@kassane also is needed to add the template here: https://github.com/toradex/vscode-torizon-templates/blob/dev/templates.json The VS Code extension uses these metadata, and lists the templates when creating new projects. |
82cbd38
to
0b24f2f
Compare
Ok. |
Hey @kassane I took the liberty of switching to |
I'm checking here, we are missing the |
Ok. (also rebased to |
cde0f9b
to
d053e09
Compare
After this PR, started another project since there was no docker container with latest zig (no bootstraping). So, I started running some tests. I even suggest you see here are some of my tests: For the main purpose of this PR it is not impaired because (cited in the issue above) ziglang projects do not have any problems during build, as they do not need libc and Debian/Alpine containers works normally. But, still looking into the problem with libunwind in the (busybox) container. I'll do more testing with the other containers (Debian and Alpine). |
Hey @kassane I will remove the milestone for the |
e19cf0b
to
ed78c32
Compare
deb48a7
to
7de1230
Compare
hey @kassane thanks for the work, I was on vacation, but I'm back. I will take a look this week |
* new container added on dockerfile sdk
@kassane thanks for the great work, we are very close to the end! |
Nice! Thank you for your attention and patience. |
@kassane this looks good, but there is another detail. We need a way to add the pretty printer to the Debug session: https://github.com/ziglang/zig/blob/master/tools/zig_gdb_pretty_printers.py Without this the variables look weird on the VS Code inspector |
Ok. Need more scripts |
To be honest I have no idea. I tried the configuration locally and on the remote but these do not work as expected. Do you have these working on your machine? |
Pretty printer not work in all and on zig is experimental. I put scripts in my configuration and didn't see much difference. cppdbg w/ gdb LLDB References |
LGTM |
Hi @microhobby ,
website: https://ziglang.org
Template based on v0.11.0 release-notes - uses LLVM 16.0.6.
Glossary:
build.zig
: build-system written on zig, makefile like.build.zig.zon
: dependencies manager, cargo.toml like.zig
: toolchainziglang
: languageAbout:
Ziglang is a new language having the purpose to be an alternative to C, not as replacement only, also as complement (easy ffi - better than using C code in C++). Zig can guarantee that C code runs with clang rules and not clang++.
Current Status
Today, zig has llvm-backend to build C and C++ projects (
clang
/clang++
) in which it manages porting somelibC
for easy cross-compilation ( CI added by me is proof of that), so it is first class support. Except for BSDs with incomplete support and MSVC because of MS license.Zig libc: https://github.com/ziglang/zig/tree/master/lib/libc (first class support = portability)
Zig can also move between
glibc
versions. It makes it possible to choose the version ofglibc
in the target build.https://github.com/ziglang/glibc-abi-tool
For C++ exclusively, zig has support
llvm-libcxx
+llvm-libcxxabi
+llvm-libunwind
+ customlibcompiler-rt
(rewritten on zig) that are statically linked in the binaries.https://github.com/ziglang/zig/tree/master/lib/libcxx
https://github.com/ziglang/zig/tree/master/lib/libcxxabi
https://github.com/ziglang/zig/tree/master/lib/libunwind
https://github.com/ziglang/zig/tree/master/lib/compiler_rt
I'm a C++ developer currently porting some libraries which will allow me to use
zig-pkg
(package manager). Something equivalent tofetchContent
(cmake
), that is, for non-header-only libraries would need that dependencies havecmake
to be built and linked to the main project. The same applies tozig-pkg
which needs to push includes and libs built before linking to the main project.Summarizing,
zig c++
build our app statically runninglibcxx
+libunwind
on almost all platforms under the same condition (C++ABI unified).Zig is planning to not depend from LLVM. How will C++ support work?
Yes, however only version 1.0 that maybe will be released in mid 2025!
Explained here: https://youtu.be/AqDdWEiSwMM?t=2435
The zig project has always wanted to become a self-hosted toolchain making LLVM support optional, while benefiting from all the targets of this tool. However, many bugs inhibit further development of the main project (zig), which has fewer compiler developers.
Andrew Kelley has plans for zig to become not only a language and toolchain focused on the language itself, but also a new backend compiler that competes with LLVM and GCC keeping compatibility.
Roadmap: old diagram (v0.9.0)
std.log