Aro – Zig's new C compiler
Aro is a C compiler integrated into Zig, focusing on fast compilation, low memory usage, and good diagnostics. It supports C up to C23, GNU, MSVC, and Clang extensions. Find more on GitHub.
Read original articleThe GitHub URL provided contains information about Aro, a C compiler designed for fast compilation, low memory usage, and good diagnostics. Aro is integrated into the Zig compiler as an alternative C frontend for `translate-c` and aims to compile C files by translating them to Zig. It supports standard C up to C23 and various extensions from GNU, MSVC, and Clang. Aro offers basic code generation for x86-64 Linux and can successfully generate a "Hello, world!" program. For further information, the Aro GitHub repository can be accessed at https://github.com/Vexu/arocc.
Related
A portable lightweight C FFI for Lua, based on libffi
A GitHub repository offers a portable lightweight C FFI for Lua, based on libffi. It aims for LuaJIT FFI compatibility, developed in C. Includes features, examples, basic types, build instructions, testing, and acknowledgements.
Zig-style generics are not well-suited for most languages
Zig-style generics, inspired by C++, are critiqued for limited universality. Zig's simplicity contrasts with Rust and Go's constraints. Metaprogramming praised for accessibility, but error messages and compiler support pose challenges. Limited type inference compared to Swift and Rust.
Oxidize – Notes on moving Harfbuzz and Freetype tools and libraries to Rust
The "oxidize" project on GitHub aims to migrate tasks from Python & C++ to Rust, such as shaping, rasterization, font compilation, and manipulation. It outlines objectives, priorities, and references. For more details, inquire further.
AxRuntime (AxRT): Creating Applications Using Amiga APIs
AxRuntime (AxRT) aids developers in creating Amiga applications seamlessly on Linux or Windows using modern tools. Recent updates include AROS ABIv0 version 20220318-1 and AxRuntime version 41.5 in 2023, emphasizing Amiga API compatibility.
Show HN: You can program without loop and recursion and×÷- is all you need
A language named "Ar" on GitHub, inspired by Blindfolded Arithmetic and Z3, is Turing complete with functions like inc, sub, mul, and div. It implements various operations and aims to compute the Ackermann function, sparking discussions.
- Clarification that Aro is an independent project by Veikka Tuominen, not officially managed by the Zig Software Foundation.
- Questions and concerns about Aro's functionality, such as its inability to include standard headers and its value proposition given Zig's dependency on LLVM.
- Comparisons to other compilers and tools, like D's compiler and TinyCC, highlighting potential use cases and missing features.
- Interest in Aro's optimization capabilities and its support for C23 and GNU extensions.
- Criticism of the project's documentation, with calls for more detailed explanations of its purpose and differences from Zig's official frontend.
We embed TinyCC for FFI, but TinyCC doesn't expose a way to read the types for exported symbols.
Currently, it looks like this:
import { dlopen, FFIType, suffix } from "bun:ffi";
// `suffix` is either "dylib", "so", or "dll" depending on the platform
// you don't have to use "suffix", it's just there for convenience
const path = `libsqlite3.${suffix}`;
const {
symbols: {
sqlite3_libversion, // the function to call
},
} = dlopen(
path, // a library name or file path
{
sqlite3_libversion: {
// no arguments, returns a string
args: [],
returns: FFIType.cstring,
},
},
);
console.log(`SQLite 3 version: ${sqlite3_libversion()}`);
It would be nicer if it was something like this: import {sqlite3_libversion as version} from "sqlite3.h" with {lib: "sqlite3"};
console.log(`SQLite 3 version: ${version()}`);
Would love to use Aro to do this in the future dmd hello.c
./hello
hello world
This helps enormously in binding to existing C libraries.Am I understanding correctly that this is a regular C compiler used as a component of the Zig compiler chain allowing compilation of C files alongside Zig? Or does Zig generate C and therefore need a C compiler under the hood?
Looking at the documentation suggests it is the former, not the latter.
What is the value proposition of this compiler, then?
main.c:1:10: fatal error: 'stdio.h' not found
#include <stdio.h>
It'd be nice if header inclusion, and -l options work. This would allow benchmarking Aro against some other compilers on a wide range of C files. Usually sqlite3.c is my first go-to for stress-testing C compilers.- why create a competing front end to Zig?
- what problems is it solving?
- what’s different than the official Zig frontend?
Etc
Related
A portable lightweight C FFI for Lua, based on libffi
A GitHub repository offers a portable lightweight C FFI for Lua, based on libffi. It aims for LuaJIT FFI compatibility, developed in C. Includes features, examples, basic types, build instructions, testing, and acknowledgements.
Zig-style generics are not well-suited for most languages
Zig-style generics, inspired by C++, are critiqued for limited universality. Zig's simplicity contrasts with Rust and Go's constraints. Metaprogramming praised for accessibility, but error messages and compiler support pose challenges. Limited type inference compared to Swift and Rust.
Oxidize – Notes on moving Harfbuzz and Freetype tools and libraries to Rust
The "oxidize" project on GitHub aims to migrate tasks from Python & C++ to Rust, such as shaping, rasterization, font compilation, and manipulation. It outlines objectives, priorities, and references. For more details, inquire further.
AxRuntime (AxRT): Creating Applications Using Amiga APIs
AxRuntime (AxRT) aids developers in creating Amiga applications seamlessly on Linux or Windows using modern tools. Recent updates include AROS ABIv0 version 20220318-1 and AxRuntime version 41.5 in 2023, emphasizing Amiga API compatibility.
Show HN: You can program without loop and recursion and×÷- is all you need
A language named "Ar" on GitHub, inspired by Blindfolded Arithmetic and Z3, is Turing complete with functions like inc, sub, mul, and div. It implements various operations and aims to compute the Ackermann function, sparking discussions.