• About TC
  • Affiliate Disclaimer
  • Privacy Policy
  • TOS
  • Contact
Sunday, June 15, 2025
Techcratic
  • TC
  • AI
    Artificial Intelligence

    Amazon Nova Lite enables Bito to offer a free tier option for its AI-powered code reviews

    Artificial Intelligence

    Bridging the Gap: New Datasets Push Recommender Research Toward Real-World Scale

    Artificial Intelligence

    7 Python Errors That Are Actually Features

    Artificial Intelligence

    10 Awesome OCR Models for 2025

    Artificial Intelligence

    5 Error Handling Patterns in Python (Beyond Try-Except)

    Artificial Intelligence

    Top 5 Alternative Data Career Paths and How to Learn Them for Free

    Artificial Intelligence

    Implementing Machine Learning Pipelines with Apache Spark

    Artificial Intelligence

    Learn Power BI for Free This Week

    Artificial Intelligence

    Build GraphRAG applications using Amazon Bedrock Knowledge Bases

  • Crypto
    ZKJ Token Plummets More Than 60% in Flash Crash Amid Rug-Pull Allegations

    ZKJ Token Plummets More Than 60% in Flash Crash Amid Rug-Pull Allegations

    Bitcoin Holding $105K During War Is Bullish for Crypto

    Bitcoin Holding $105K During War Is Bullish for Crypto

    Saylor Signals Another Bitcoin Buy—Orange Dots Strike Again

    Saylor Signals Another Bitcoin Buy—Orange Dots Strike Again

    XRP Technical Analysis: Downtrend Dominates—Is the $2.05 Floor About to Collapse?

    XRP Technical Analysis: Downtrend Dominates—Is the $2.05 Floor About to Collapse?

    Best Presales to Buy Today – Which Coins Are Poised for a Breakout?

    Last 72 Hours to Join $49M Raise

    Corporate Bitcoin Holdings a ‘Blessing’ Now, Challenge Later, Says Roxom CEO

    Corporate Bitcoin Holdings a ‘Blessing’ Now, Challenge Later, Says Roxom CEO

    Cryptocurrency Remittances Spike 40% in Latin America

    Cryptocurrency Remittances Spike 40% in Latin America

    Sonic Integrates Bubblemaps V2 to Enhance Onchain Intelligence

    Sonic Integrates Bubblemaps V2 to Enhance Onchain Intelligence

    UBS Sees Senate Rushing ‘One Big, Beautiful Bill’ Toward High-Stakes Finale

    UBS Sees Senate Rushing ‘One Big, Beautiful Bill’ Toward High-Stakes Finale

  • Cybersecurity
    Cybersecurity

    AI Agents Run on Secret Accounts — Learn How to Secure Them in This Webinar

    Cybersecurity

    How to Address the Expanding Security Risk

    Cybersecurity

    ConnectWise to Rotate ScreenConnect Code Signing Certificates Due to Security Risks

    Cybersecurity

    5 Lessons from River Island

    Cybersecurity

    INTERPOL Dismantles 20,000+ Malicious IPs Linked to 69 Malware Variants in Operation Secure

    Cybersecurity

    SinoTrack GPS Devices Vulnerable to Remote Vehicle Control via Default Passwords

    Cybersecurity

    Researchers Uncover 20+ Configuration Risks, Including Five CVEs, in Salesforce Industry Cloud

    Cybersecurity

    Adobe Releases Patch Fixing 254 Vulnerabilities, Closing High-Severity Security Gaps

    Cybersecurity

    Researcher Found Flaw to Discover Phone Numbers Linked to Any Google Account

  • Deals
    Intel Core Ultra 7 Desktop Processor 265K – 20 cores (8 P-cores + 12 E-cores) up to 5.5…

    Intel Core Ultra 7 Desktop Processor 265K – 20 cores (8 P-cores + 12 E-cores) up to 5.5…

    Hitachi FIJ0038 Fuel Injector

    Hitachi FIJ0038 Fuel Injector

    EVGA Supernova 1300 P+, 80+ Platinum 1300W, Fully Modular, 10 Year Warranty, Includes…

    EVGA Supernova 1300 P+, 80+ Platinum 1300W, Fully Modular, 10 Year Warranty, Includes…

    Logitech G502 X Plus Wireless Gaming Mouse – LIGHTSPEED Optical, LIGHTFORCE Switches,…

    Logitech G502 X Plus Wireless Gaming Mouse – LIGHTSPEED Optical, LIGHTFORCE Switches,…

    Cable Matters 8-Pack Snagless Cat 5e Ethernet Cable – 5ft, Gigabit Cat5e Cable, Cat5e…

    Cable Matters 8-Pack Snagless Cat 5e Ethernet Cable – 5ft, Gigabit Cat5e Cable, Cat5e…

    Logitech iPad Pro 12.9 inch Keyboard Case | SLIM COMBO with Detachable, Backlit,…

    Logitech iPad Pro 12.9 inch Keyboard Case | SLIM COMBO with Detachable, Backlit,…

    TECKNET Ergonomic Mouse, Wireless Bluetooth Vertical Mouse, 4800 DPI Optical Tracking, 6…

    TECKNET Ergonomic Mouse, Wireless Bluetooth Vertical Mouse, 4800 DPI Optical Tracking, 6…

    DUMOS Ergonomic Gaming Desk Chair – PU Leather Recliner with Footrest, Lumbar Support,…

    DUMOS Ergonomic Gaming Desk Chair – PU Leather Recliner with Footrest, Lumbar Support,…

    Far Cry 3 (Renewed)

    Far Cry 3 (Renewed)

  • Gaming
    Five Nights At Freddy’s still going strong: The latest game briefly grappled with Dune over Steam’s top seller spot

    Five Nights At Freddy’s still going strong: The latest game briefly grappled with Dune over Steam’s top seller spot

    The Super Mario Bros Movie Reaction!

    The Super Mario Bros Movie Reaction!

    The Legend of Zelda: Ocarina of Time Master Quest Walkthrough (Pt. 78)

    The Legend of Zelda: Ocarina of Time Master Quest Walkthrough (Pt. 78)

    The Legend of Zelda: Breath of the Wild – Champions Ballad Shrines Walkthrough

    The Legend of Zelda: Breath of the Wild – Champions Ballad Shrines Walkthrough

    Legend of Zelda Montage

    Legend of Zelda Montage

    Legend of Zelda Breath of the Wild Gameplay/Walkthrough – Part 3

    Legend of Zelda Breath of the Wild Gameplay/Walkthrough – Part 3

    I'm done with Transformers Reactivate

    I'm done with Transformers Reactivate

    Amazon taps Star Trek Beyond and Mindhunter writer to helm Mass Effect show

    Amazon taps Star Trek Beyond and Mindhunter writer to helm Mass Effect show

    The Last of Us Remastered Honest Review

    The Last of Us Remastered Honest Review

  • Tesla
    Torx Plus Socket, 5-External Torx Socket 1/4″ Dr 10EPR Compatible With Tesla Model 3…

    Torx Plus Socket, 5-External Torx Socket 1/4″ Dr 10EPR Compatible With Tesla Model 3…

    Car Seat Organizers,Multi-functional Back Seat Protectors, Storage Pouches, and Tray…

    Car Seat Organizers,Multi-functional Back Seat Protectors, Storage Pouches, and Tray…

    AOHI USB C Car Charger, PD 45W&QC 30W 2 Port Type-C Fast Charging Car Charger Lighter…

    AOHI USB C Car Charger, PD 45W&QC 30W 2 Port Type-C Fast Charging Car Charger Lighter…

    Roof Sunshades for Tesla Model 3 2025, Upgraded 3.0 Sunroof Shade Sunshade Roof Sun…

    Roof Sunshades for Tesla Model 3 2025, Upgraded 3.0 Sunroof Shade Sunshade Roof Sun…

    SOOPII for Tesla Phone Mount,Strongest Magnetic Monitor Mount for Tesla 3/Y…

    SOOPII for Tesla Phone Mount,Strongest Magnetic Monitor Mount for Tesla 3/Y…

    A2C Gym Fitness Phone Mount for MagSafe – 17 N52 Strong Magnets Stable and Secure Phone…

    A2C Gym Fitness Phone Mount for MagSafe – 17 N52 Strong Magnets Stable and Secure Phone…

    3PCS All Weather Tesla Model 3 Highland Floor Mats 2024 2025 | Sleek Design,…

    3PCS All Weather Tesla Model 3 Highland Floor Mats 2024 2025 | Sleek Design,…

    Tesla Door Handle Cover Model Y Model 3 2020-2025 Door Handle Protector Model Y Model 3…

    Tesla Door Handle Cover Model Y Model 3 2020-2025 Door Handle Protector Model Y Model 3…

    FH Group Custom Fit Car Seat Covers for 2020-2024 Tesla Model Y Ultraflex Neoprene Water…

    FH Group Custom Fit Car Seat Covers for 2020-2024 Tesla Model Y Ultraflex Neoprene Water…

  • UFO
    Secrets of the Moon (S11, E11) | Ancient Aliens | Full Episode

    Secrets of the Moon (S11, E11) | Ancient Aliens | Full Episode

    UFOs Over Arizona: A True History of Extraterrestrial Encounters in the Grand Canyon State

    UFOs Over Arizona: A True History of Extraterrestrial Encounters in the Grand Canyon State

    French Contactee confirms Intergalactic Confederation is seeding human worlds

    French Contactee confirms Intergalactic Confederation is seeding human worlds

    New Balance Men’s 574 Greens V2 Golf Shoe

    New Balance Men’s 574 Greens V2 Golf Shoe

    Armin van Buuren rocking Ultra Miami with the new Exploration Of Space (Third Contact Remix)

    Armin van Buuren rocking Ultra Miami with the new Exploration Of Space (Third Contact Remix)

    I found footage of me explaining all 7 Paranormal Activity movies while haunted

    I found footage of me explaining all 7 Paranormal Activity movies while haunted

    Retro Aviator Sunglasses for Women Men – 70s Trendy Square Vintage Shade Sun Glasses UV Protection

    Retro Aviator Sunglasses for Women Men – 70s Trendy Square Vintage Shade Sun Glasses UV Protection

    Pop Culture Conspiracy Theories! Stanley Cups, Love Is Blind, and Dune

    Pop Culture Conspiracy Theories! Stanley Cups, Love Is Blind, and Dune

    Pocket Squares Handkerchiefs for Men Soft Cotton Mens Womens White Pocket Square with Holder for Suit Wedding Business

    Pocket Squares Handkerchiefs for Men Soft Cotton Mens Womens White Pocket Square with Holder for Suit Wedding Business

No Result
View All Result
  • TC
  • AI
    Artificial Intelligence

    Amazon Nova Lite enables Bito to offer a free tier option for its AI-powered code reviews

    Artificial Intelligence

    Bridging the Gap: New Datasets Push Recommender Research Toward Real-World Scale

    Artificial Intelligence

    7 Python Errors That Are Actually Features

    Artificial Intelligence

    10 Awesome OCR Models for 2025

    Artificial Intelligence

    5 Error Handling Patterns in Python (Beyond Try-Except)

    Artificial Intelligence

    Top 5 Alternative Data Career Paths and How to Learn Them for Free

    Artificial Intelligence

    Implementing Machine Learning Pipelines with Apache Spark

    Artificial Intelligence

    Learn Power BI for Free This Week

    Artificial Intelligence

    Build GraphRAG applications using Amazon Bedrock Knowledge Bases

  • Crypto
    ZKJ Token Plummets More Than 60% in Flash Crash Amid Rug-Pull Allegations

    ZKJ Token Plummets More Than 60% in Flash Crash Amid Rug-Pull Allegations

    Bitcoin Holding $105K During War Is Bullish for Crypto

    Bitcoin Holding $105K During War Is Bullish for Crypto

    Saylor Signals Another Bitcoin Buy—Orange Dots Strike Again

    Saylor Signals Another Bitcoin Buy—Orange Dots Strike Again

    XRP Technical Analysis: Downtrend Dominates—Is the $2.05 Floor About to Collapse?

    XRP Technical Analysis: Downtrend Dominates—Is the $2.05 Floor About to Collapse?

    Best Presales to Buy Today – Which Coins Are Poised for a Breakout?

    Last 72 Hours to Join $49M Raise

    Corporate Bitcoin Holdings a ‘Blessing’ Now, Challenge Later, Says Roxom CEO

    Corporate Bitcoin Holdings a ‘Blessing’ Now, Challenge Later, Says Roxom CEO

    Cryptocurrency Remittances Spike 40% in Latin America

    Cryptocurrency Remittances Spike 40% in Latin America

    Sonic Integrates Bubblemaps V2 to Enhance Onchain Intelligence

    Sonic Integrates Bubblemaps V2 to Enhance Onchain Intelligence

    UBS Sees Senate Rushing ‘One Big, Beautiful Bill’ Toward High-Stakes Finale

    UBS Sees Senate Rushing ‘One Big, Beautiful Bill’ Toward High-Stakes Finale

  • Cybersecurity
    Cybersecurity

    AI Agents Run on Secret Accounts — Learn How to Secure Them in This Webinar

    Cybersecurity

    How to Address the Expanding Security Risk

    Cybersecurity

    ConnectWise to Rotate ScreenConnect Code Signing Certificates Due to Security Risks

    Cybersecurity

    5 Lessons from River Island

    Cybersecurity

    INTERPOL Dismantles 20,000+ Malicious IPs Linked to 69 Malware Variants in Operation Secure

    Cybersecurity

    SinoTrack GPS Devices Vulnerable to Remote Vehicle Control via Default Passwords

    Cybersecurity

    Researchers Uncover 20+ Configuration Risks, Including Five CVEs, in Salesforce Industry Cloud

    Cybersecurity

    Adobe Releases Patch Fixing 254 Vulnerabilities, Closing High-Severity Security Gaps

    Cybersecurity

    Researcher Found Flaw to Discover Phone Numbers Linked to Any Google Account

  • Deals
    Intel Core Ultra 7 Desktop Processor 265K – 20 cores (8 P-cores + 12 E-cores) up to 5.5…

    Intel Core Ultra 7 Desktop Processor 265K – 20 cores (8 P-cores + 12 E-cores) up to 5.5…

    Hitachi FIJ0038 Fuel Injector

    Hitachi FIJ0038 Fuel Injector

    EVGA Supernova 1300 P+, 80+ Platinum 1300W, Fully Modular, 10 Year Warranty, Includes…

    EVGA Supernova 1300 P+, 80+ Platinum 1300W, Fully Modular, 10 Year Warranty, Includes…

    Logitech G502 X Plus Wireless Gaming Mouse – LIGHTSPEED Optical, LIGHTFORCE Switches,…

    Logitech G502 X Plus Wireless Gaming Mouse – LIGHTSPEED Optical, LIGHTFORCE Switches,…

    Cable Matters 8-Pack Snagless Cat 5e Ethernet Cable – 5ft, Gigabit Cat5e Cable, Cat5e…

    Cable Matters 8-Pack Snagless Cat 5e Ethernet Cable – 5ft, Gigabit Cat5e Cable, Cat5e…

    Logitech iPad Pro 12.9 inch Keyboard Case | SLIM COMBO with Detachable, Backlit,…

    Logitech iPad Pro 12.9 inch Keyboard Case | SLIM COMBO with Detachable, Backlit,…

    TECKNET Ergonomic Mouse, Wireless Bluetooth Vertical Mouse, 4800 DPI Optical Tracking, 6…

    TECKNET Ergonomic Mouse, Wireless Bluetooth Vertical Mouse, 4800 DPI Optical Tracking, 6…

    DUMOS Ergonomic Gaming Desk Chair – PU Leather Recliner with Footrest, Lumbar Support,…

    DUMOS Ergonomic Gaming Desk Chair – PU Leather Recliner with Footrest, Lumbar Support,…

    Far Cry 3 (Renewed)

    Far Cry 3 (Renewed)

  • Gaming
    Five Nights At Freddy’s still going strong: The latest game briefly grappled with Dune over Steam’s top seller spot

    Five Nights At Freddy’s still going strong: The latest game briefly grappled with Dune over Steam’s top seller spot

    The Super Mario Bros Movie Reaction!

    The Super Mario Bros Movie Reaction!

    The Legend of Zelda: Ocarina of Time Master Quest Walkthrough (Pt. 78)

    The Legend of Zelda: Ocarina of Time Master Quest Walkthrough (Pt. 78)

    The Legend of Zelda: Breath of the Wild – Champions Ballad Shrines Walkthrough

    The Legend of Zelda: Breath of the Wild – Champions Ballad Shrines Walkthrough

    Legend of Zelda Montage

    Legend of Zelda Montage

    Legend of Zelda Breath of the Wild Gameplay/Walkthrough – Part 3

    Legend of Zelda Breath of the Wild Gameplay/Walkthrough – Part 3

    I'm done with Transformers Reactivate

    I'm done with Transformers Reactivate

    Amazon taps Star Trek Beyond and Mindhunter writer to helm Mass Effect show

    Amazon taps Star Trek Beyond and Mindhunter writer to helm Mass Effect show

    The Last of Us Remastered Honest Review

    The Last of Us Remastered Honest Review

  • Tesla
    Torx Plus Socket, 5-External Torx Socket 1/4″ Dr 10EPR Compatible With Tesla Model 3…

    Torx Plus Socket, 5-External Torx Socket 1/4″ Dr 10EPR Compatible With Tesla Model 3…

    Car Seat Organizers,Multi-functional Back Seat Protectors, Storage Pouches, and Tray…

    Car Seat Organizers,Multi-functional Back Seat Protectors, Storage Pouches, and Tray…

    AOHI USB C Car Charger, PD 45W&QC 30W 2 Port Type-C Fast Charging Car Charger Lighter…

    AOHI USB C Car Charger, PD 45W&QC 30W 2 Port Type-C Fast Charging Car Charger Lighter…

    Roof Sunshades for Tesla Model 3 2025, Upgraded 3.0 Sunroof Shade Sunshade Roof Sun…

    Roof Sunshades for Tesla Model 3 2025, Upgraded 3.0 Sunroof Shade Sunshade Roof Sun…

    SOOPII for Tesla Phone Mount,Strongest Magnetic Monitor Mount for Tesla 3/Y…

    SOOPII for Tesla Phone Mount,Strongest Magnetic Monitor Mount for Tesla 3/Y…

    A2C Gym Fitness Phone Mount for MagSafe – 17 N52 Strong Magnets Stable and Secure Phone…

    A2C Gym Fitness Phone Mount for MagSafe – 17 N52 Strong Magnets Stable and Secure Phone…

    3PCS All Weather Tesla Model 3 Highland Floor Mats 2024 2025 | Sleek Design,…

    3PCS All Weather Tesla Model 3 Highland Floor Mats 2024 2025 | Sleek Design,…

    Tesla Door Handle Cover Model Y Model 3 2020-2025 Door Handle Protector Model Y Model 3…

    Tesla Door Handle Cover Model Y Model 3 2020-2025 Door Handle Protector Model Y Model 3…

    FH Group Custom Fit Car Seat Covers for 2020-2024 Tesla Model Y Ultraflex Neoprene Water…

    FH Group Custom Fit Car Seat Covers for 2020-2024 Tesla Model Y Ultraflex Neoprene Water…

  • UFO
    Secrets of the Moon (S11, E11) | Ancient Aliens | Full Episode

    Secrets of the Moon (S11, E11) | Ancient Aliens | Full Episode

    UFOs Over Arizona: A True History of Extraterrestrial Encounters in the Grand Canyon State

    UFOs Over Arizona: A True History of Extraterrestrial Encounters in the Grand Canyon State

    French Contactee confirms Intergalactic Confederation is seeding human worlds

    French Contactee confirms Intergalactic Confederation is seeding human worlds

    New Balance Men’s 574 Greens V2 Golf Shoe

    New Balance Men’s 574 Greens V2 Golf Shoe

    Armin van Buuren rocking Ultra Miami with the new Exploration Of Space (Third Contact Remix)

    Armin van Buuren rocking Ultra Miami with the new Exploration Of Space (Third Contact Remix)

    I found footage of me explaining all 7 Paranormal Activity movies while haunted

    I found footage of me explaining all 7 Paranormal Activity movies while haunted

    Retro Aviator Sunglasses for Women Men – 70s Trendy Square Vintage Shade Sun Glasses UV Protection

    Retro Aviator Sunglasses for Women Men – 70s Trendy Square Vintage Shade Sun Glasses UV Protection

    Pop Culture Conspiracy Theories! Stanley Cups, Love Is Blind, and Dune

    Pop Culture Conspiracy Theories! Stanley Cups, Love Is Blind, and Dune

    Pocket Squares Handkerchiefs for Men Soft Cotton Mens Womens White Pocket Square with Holder for Suit Wedding Business

    Pocket Squares Handkerchiefs for Men Soft Cotton Mens Womens White Pocket Square with Holder for Suit Wedding Business

No Result
View All Result
Techcratic
No Result
View All Result
Home Hacker News

c3lang/c3c: Compiler for the C3 language

Hacker News by Hacker News
April 3, 2025
in Hacker News
Reading Time: 21 mins read
129 1
A A
0

2025-04-03 09:55:00
github.com

C3 is a programming language that builds on the syntax and semantics of the C language,
with the goal of evolving it while still retaining familiarity for C programmers.

It’s an evolution, not a revolution: the C-like
for programmers who like C.

Precompiled binaries for the following operating systems are available:

The manual for C3 can be found at www.c3-lang.org.

vkQuake

Thanks to full ABI compatibility with C, it’s possible to mix C and C3 in the same project with no effort. As a demonstration, vkQuake was compiled with a small portion of the code converted to C3 and compiled with the c3c compiler. (The fork can be found at https://github.com/c3lang/vkQuake)

  • Procedural “get things done”-type of language.
  • Try to stay close to C – only change what’s really necessary.
  • C ABI compatibility and excellent C integration.
  • Learning C3 should be easy for a C programmer.
  • Data is inert.
  • Avoid “big ideas” & the “more is better” fallacy.
  • Introduce some higher level conveniences where the value is great.

C3 owes its inspiration to the C2 language: to iterate on top of C without trying to be a
whole new language.

The following code shows generic modules (more examples can be found at https://c3-lang.org/references/docs/examples/).

module stack {Type};
// Above: the parameterized type is applied to the entire module.

struct Stack
{
    usz capacity;
    usz size;
    Type* elems;
}

// The type methods offers dot syntax calls,
// so this function can either be called 
// Stack.push(&my_stack, ...) or
// my_stack.push(...)
fn void Stack.push(Stack* this, Type element)
{
    if (this.capacity == this.size)
    {
        this.capacity *= 2;
        if (this.capacity 16) this.capacity = 16;
        this.elems = realloc(this.elems, Type.sizeof * this.capacity);
    }
    this.elems[this.size++] = element;
}

fn Type Stack.pop(Stack* this)
{
    assert(this.size > 0);
    return this.elems[--this.size];
}

fn bool Stack.empty(Stack* this)
{
    return !this.size;
}

Testing it out:

import stack;

// Define our new types, the first will implicitly create 
// a complete copy of the entire Stack module with "Type" set to "int"
alias IntStack = Stack {int};
// The second creates another copy with "Type" set to "double"
alias DoubleStack = Stack {double};

// If we had added "alias IntStack2 = Stack {int}"
// no additional copy would have been made (since we already
// have an parameterization of Stack {int} so it would
// be same as declaring IntStack2 an alias of IntStack

// Importing an external C function is straightforward
// here is an example of importing libc's printf:
extern fn int printf(char* format, ...);

fn void main()
{
    IntStack stack;
    // Note that C3 uses zero initialization by default
    // so the above is equivalent to IntStack stack = {};
    
    stack.push(1);
    // The above can also be written IntStack.push(&stack, 1); 
    
    stack.push(2);
    
    // Prints pop: 2
    printf("pop: %d\n", stack.pop());
    // Prints pop: 1
    printf("pop: %d\n", stack.pop());
    
    DoubleStack dstack;
    dstack.push(2.3);
    dstack.push(3.141);
    dstack.push(1.1235);
    // Prints pop: 1.123500
    printf("pop: %f\n", dstack.pop());
}

In what ways does C3 differ from C?

  • No mandatory header files
  • New semantic macro system
  • Module based name spacing
  • Slices
  • Compile time reflection
  • Enhanced compile time execution
  • Generics based on generic modules
  • “Result”-based zero overhead error handling
  • Defer
  • Value methods
  • Associated enum data
  • No preprocessor
  • Less undefined behaviour and added runtime checks in “safe” mode
  • Limited operator overloading to enable userland dynamic arrays
  • Optional pre and post conditions

The current stable version of the compiler is version 0.7.0.

The upcoming 0.7.x releases will focus on expanding the standard library,
fixing bugs and improving compile time analysis.
Follow the issues here.

If you have suggestions on how to improve the language, either file an issue
or discuss C3 on its dedicated Discord: https://discord.gg/qN76R87.

The compiler is currently verified to compile on Linux, Windows and MacOS.

Support matrix

Platform Native C3 compiler available? Target supported Stack trace Threads Sockets Inline asm
Win32 x64 Yes Yes + cross compilation Yes Yes Yes Yes*
Win32 Aarch64 Untested Untested Untested Untested Untested Yes*
MacOS x64 Yes Yes + cross compilation Yes Yes Yes Yes*
MacOS Aarch64 Yes Yes + cross compilation Yes Yes Yes Yes*
iOS Aarch64 No Untested Untested Yes Yes Yes*
Linux x86 Yes Yes Yes Yes Yes Yes*
Linux x64 Yes Yes Yes Yes Yes Yes*
Linux Aarch64 Yes Yes Yes Yes Yes Yes*
Linux Riscv32 Yes Yes Yes Yes Yes Untested
Linux Riscv64 Yes Yes Yes Yes Yes Untested
ELF freestanding x86 No Untested No No No Yes*
ELF freestanding x64 No Untested No No No Yes*
ELF freestanding Aarch64 No Untested No No No Yes*
ELF freestanding Riscv64 No Untested No No No Untested
ELF freestanding Riscv32 No Untested No No No Untested
FreeBSD x86 Untested Untested No Yes Untested Yes*
FreeBSD x64 Untested Untested No Yes Untested Yes*
NetBSD x86 Untested Untested No Yes Untested Yes*
NetBSD x64 Untested Untested No Yes Untested Yes*
OpenBSD x86 Untested Untested No Yes Untested Yes*
OpenBSD x64 Untested Untested No Yes Untested Yes*
MCU x86 No Untested No No No Yes*
Wasm32 No Yes No No No No
Wasm64 No Untested No No No No

* Inline asm is still a work in progress

More platforms will be supported in the future.

  • If you wish to contribute with ideas, please file issues or discuss on Discord.
  • Interested in contributing to the stdlib? Please get in touch on Discord.
  • Compilation instructions for other Linux and Unix variants are appreciated.
  • Would you like to contribute bindings to some library? It would be nice to have support for SDL, Raylib and more.
  • Build something with C3 and show it off and give feedback. The language is still open for significant tweaks.
  • Start work on the C -> C3 converter which takes C code and does a “best effort” to translate it to C3. The first version only needs to work on C headers.
  • Do you have some specific area you have deep knowledge of and could help make C3 even better at doing? File or comment on issues.

Installing on Windows with precompiled binaries

  1. Download the zip file: https://github.com/c3lang/c3c/releases/download/latest/c3-windows.zip
    (debug version here)
  2. Unzip exe and standard lib.
  3. If you don’t have Visual Studio 17 installed you can either do so, or run the msvc_build_libraries.py Python script which will download the necessary files to compile on Windows.
  4. Run c3c.exe.

Installing on Debian with precompiled binaries

  1. Download tar file: https://github.com/c3lang/c3c/releases/download/latest/c3-linux.tar.gz
    (debug version here)
  2. Unpack executable and standard lib.
  3. Run ./c3c.

Installing on Ubuntu with precompiled binaries

  1. Download tar file: https://github.com/c3lang/c3c/releases/download/latest/c3-ubuntu-20.tar.gz
    (debug version here)
  2. Unpack executable and standard lib.
  3. Run ./c3c.

Installing on MacOS with precompiled binaries

  1. Make sure you have XCode with command line tools installed.
  2. Download the zip file: https://github.com/c3lang/c3c/releases/download/latest/c3-macos.zip
    (debug version here)
  3. Unzip executable and standard lib.
  4. Run ./c3c.

(*Note that there is a known issue with debug symbol generation on MacOS 13, see issue #1086)

Arch includes c3c in the official ‘extra’ repo. It can be easily installed the usual way:

sudo pacman -S c3c
# or paru -S c3c
# or yay -S c3c
# or aura -A c3c

There is also an AUR package for the c3c compiler : c3c-git.

You can use your AUR package manager:

paru -S c3c-git
# or yay -S c3c-git
# or aura -A c3c-git

Or clone it manually:

git clone https://aur.archlinux.org/c3c-git.git
cd c3c-git
makepkg -si

You can build c3c using an Ubuntu container. By default, the script will build through Ubuntu 22.04. You can specify the version by passing the UBUNTU_VERSION environment variable.

UBUNTU_VERSION=20.04 ./build-with-docker.sh

See the build-with-docker.sh script for more information on other configurable environment variables.

Installing on OS X using Homebrew

  1. Install CMake: brew install cmake
  2. Install LLVM 17+: brew install llvm
  3. Clone the C3C github repository: git clone https://github.com/c3lang/c3c.git
  4. Enter the C3C directory cd c3c.
  5. Create a build directory mkdir build
  6. Change directory to the build directory cd build
  7. Set up CMake build for debug: cmake ..
  8. Build: cmake --build .

Installing on Windows using Scoop

c3c is included in ‘Main’ bucket.

Getting started with a “hello world”

Create a main.c3 file with:

module hello_world;
import std::io;

fn void main()
{
   io::printn("Hello, world!");
}

Make sure you have the standard libraries at either ../lib/std/ or /lib/std/.

Then run

The generated binary will by default be named after the module that contains the main
function. In our case that is hello_world, so the resulting binary will be
called hello_world or hello_world.exedepending on platform.

  1. Make sure you have Visual Studio 17 2022 installed or alternatively install the “Buildtools for Visual Studio” (https://aka.ms/vs/17/release/vs_BuildTools.exe) and then select “Desktop development with C++”
  2. Install CMake
  3. Clone the C3C github repository: git clone https://github.com/c3lang/c3c.git
  4. Enter the C3C directory cd c3c.
  5. Set up the CMake build cmake -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release
  6. Build: cmake --build build --config Release
  7. You should now have the c3c.exe

You should now have a c3c executable.

You can try it out by running some sample code: c3c.exe compile ../resources/examples/hash.c3

Note that if you run into linking issues when building, make sure that you are using the latest version of VS17.

Compiling on Ubuntu 24.04 LTS

  1. Make sure you have a C compiler that handles C11 and a C++ compiler, such as GCC or Clang. Git also needs to be installed.
  2. Install LLVM 18 sudo apt-get install cmake git clang zlib1g zlib1g-dev libllvm18 llvm llvm-dev llvm-runtime liblld-dev liblld-18 libpolly-18-dev
  3. Clone the C3C github repository: git clone https://github.com/c3lang/c3c.git
  4. Enter the C3C directory cd c3c.
  5. Create a build directory mkdir build
  6. Change directory to the build directory cd build
  7. Set up CMake build: cmake ..
  8. Build: cmake --build .

You should now have a c3c executable.

You can try it out by running some sample code: ./c3c compile ../resources/examples/hash.c3

  1. As root, ensure that all project dependencies are installed: xbps-install git cmake llvm17 llvm17-devel lld17-devel libcurl-devel ncurses-devel zlib-devel libzstd-devel libxml2-devel
  2. Clone the C3C repository: git clone https://github.com/c3lang/c3c.git
    • If you only need the latest commit, you may want to make a shallow clone instead: git clone https://github.com/c3lang/c3c.git --depth=1
  3. Enter the directory: cd c3c
  4. Create a build directory: mkdir build
  5. Enter the build directory: cd build
  6. Create the CMake build cache: cmake ..
  7. Build: cmake --build .

Your c3c executable should have compiled properly. You may want to test it: ./c3c compile ../resources/examples/hash.c3
For a sytem-wide installation, run the following as root: cmake --install .

  1. Install required project dependencies: dnf install cmake clang git llvm llvm-devel lld lld-devel ncurses-devel
  2. Optionally, install additional dependencies: dnf install libcurl-devel zlib-devel libzstd-devel libxml2-devel libffi-devel
  3. Clone the C3C repository: git clone https://github.com/c3lang/c3c.git
    • If you only need the latest commit, you may want to make a shallow clone: git clone https://github.com/c3lang/c3c.git --depth=1
  4. Enter the C3C directory: cd c3c
  5. Create a build directory and navigate into it: mkdir build && cd build
  6. Create the CMake build cache. The Fedora repositories provide .so libraries for lld, so you need to set the C3_LINK_DYNAMIC flag: cmake .. -DC3_LINK_DYNAMIC=1
  7. Build the project: cmake --build .

The c3c binary should be created in the build directory. You can try it out by running some sample code: ./c3c compile ../resources/examples/hash.c3

Compiling on other Linux / Unix variants

  1. Install CMake.
  2. Install or compile LLVM and LLD libraries (version 17+ or higher)
  3. Clone the C3C github repository: git clone https://github.com/c3lang/c3c.git
  4. Enter the C3C directory cd c3c.
  5. Create a build directory mkdir build
  6. Change directory to the build directory cd build
  7. Set up CMake build for debug: cmake ... At this point you may need to manually
    provide the link path to the LLVM CMake directories, e.g. cmake -DLLVM_DIR=/usr/local/opt/llvm/lib/cmake/llvm/ ..
  8. Build: cmake --build .

A note on compiling for Linux/Unix/MacOS: to be able to fetch vendor libraries
libcurl is needed. The CMake script should detect it if it is available. Note that
this functionality is non-essential and it is perfectly fine to user the compiler without it.

The C3 compiler is licensed under LGPL 3.0, the standard library itself is
MIT licensed.

Editor plugins can be found at https://github.com/c3lang/editor-plugins.

  1. Write the test, either adding to existing test files in /test/unit/ or add
    a new file. (If testing the standard library, put it in the /test/unit/stdlib/ subdirectory).
  2. Make sure that the test functions have the @test attribute.
  3. Run tests and see that they pass. (Recommended settings: c3c compile-test -O0 test/unit.
    • in this example test/unit/ is the relative path to the test directory, so adjust as required)
  4. Make a pull request for the new tests.

A huge THANK YOU goes out to all contributors and sponsors.

A special thank you to sponsors Caleb-o and devdad for going the extra mile.

Star History Chart

Source Link


Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.

Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!


Start your free Amazon Prime trial
today and unlock unlimited streaming and more!

Help Power Techcratic’s Future – Scan To Support

If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.

As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!

BITCOIN

Bitcoin Logo

Bitcoin QR Code

bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge

Scan the QR code with your crypto wallet app

DOGECOIN

Dogecoin Logo

Dogecoin QR Code

D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA

Scan the QR code with your crypto wallet app

ETHEREUM

Ethereum Logo

Ethereum QR Code

0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a

Scan the QR code with your crypto wallet app

Please read the Privacy and Security Disclaimer on how Techcratic handles your support.

Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.

Tags: Hacker News
Previous Post

Cute Beagle x Cocker Puppy | First Time Meeting New Friends

Next Post

Visualized: Trump’s Reciprocal Tariffs on Major Nations

Hacker News

Hacker News

Stay updated with Hacker News, where technology meets entrepreneurial spirit. Get the latest on tech trends, startup news, and discussions from the tech community. Read the latest updates here at Techcratic.

Related Posts

How fast can the RPython GC allocate?
Hacker News

How fast can the RPython GC allocate?

June 15, 2025
1.3k
Biofuels Policy, a Mainstay of American Agriculture, Has Been a Failure for the Climate, a New Report Claims
Hacker News

Biofuels Policy, a Mainstay of American Agriculture, Has Been a Failure for the Climate, a New Report Claims

June 15, 2025
1.3k
SakanaAI/text-to-lora: Hypernetworks that adapt LLMs for specific benchmark tasks using only textual task description as the input
Hacker News

SakanaAI/text-to-lora: Hypernetworks that adapt LLMs for specific benchmark tasks using only textual task description as the input

June 15, 2025
1.3k
tanelp/tiny-diffusion: A minimal PyTorch implementation of probabilistic diffusion models for 2D datasets.
Hacker News

tanelp/tiny-diffusion: A minimal PyTorch implementation of probabilistic diffusion models for 2D datasets.

June 15, 2025
1.3k
How we investigated Amsterdam’s attempt to build a ‘fair’ fraud detection model
Hacker News

How we investigated Amsterdam’s attempt to build a ‘fair’ fraud detection model

June 14, 2025
1.3k
Waymo rides cost more than Uber or Lyft — and people are paying anyway
Hacker News

Waymo rides cost more than Uber or Lyft — and people are paying anyway

June 14, 2025
1.3k
GitHub – zachlatta/sshtron: $ ssh sshtron.zachlatta.com
Hacker News

GitHub – zachlatta/sshtron: $ ssh sshtron.zachlatta.com

June 14, 2025
1.3k
yousef-rafat/miniDiffusion: A reimplementation of Stable Diffusion 3.5 in pure PyTorch
Hacker News

yousef-rafat/miniDiffusion: A reimplementation of Stable Diffusion 3.5 in pure PyTorch

June 14, 2025
1.3k
Load More
Next Post
Visualized: Trump’s Reciprocal Tariffs on Major Nations

Visualized: Trump’s Reciprocal Tariffs on Major Nations

Mixed media layered art tag

Mixed media layered art tag

Get ready for summer with the Beats Pill portable speaker, now 33% off

Get ready for summer with the Beats Pill portable speaker, now 33% off

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Your Tech Resources

  • 30 Second Tech ™
  • AI
  • App Zone ™
  • Apple
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo
  • Google News
  • Hacker News
  • Harvard Tech
  • I Like Cats ™
  • I Like Dogs ™
  • LifeHacker
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • PC World
  • Photofocus
  • Physics
  • Random Tech
  • Retro Rewind ™
  • Robot Report
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Art
  • Tech Careers
  • Tech Deals
  • Techcratic ™
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Wired
  • ZDNet

Tech News

  • 30 Second Tech ™
  • AI
  • Apple Insider
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • ExtremeTech
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo

Tech News

  • Harvard Tech
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • Physics
  • PC World
  • Random Tech
  • Retro Rewind ™
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Careers

Tech News​

  • Tech Art
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Wired
  • ZDNet

Site Links

  • About Techcratic
  • Affiliate Disclaimer
  • Affiliate Link Policy
  • Contact Techcratic
  • Dealors Discount Store
  • Privacy and Security Disclaimer
  • Privacy Policy
  • RSS Feed
  • Site Map
  • Support Techcratic
  • Techcratic
  • Tech Deals
  • TOS
  • 𝕏
Click For A Secret Deal

Techcratic – Your All In One Tech Hub © 2020 – 2025
All Rights Reserved
∞

No Result
View All Result
  • 30 Second Tech ™
  • AI
  • App Zone ™
  • Apple
  • Ars Technica
  • CNET
  • Crypto News
  • Cybersecurity
  • Endgadget
  • Gaming
  • I Like Cats ™
  • I Like Dogs ™
  • MacRumors
  • Macworld
  • Tech Deals
  • Techcratic ™
  • Techs Got To Eat ™
  • Tesla
  • UFO
  • Wired