Files
compiler-explorer/lib/compilers/c3c.ts
T
aliaegikandRubén Rincón Blanco 91334b9d9b New Language: C3 (#5086)
Related to: https://github.com/compiler-explorer/infra/pull/1017

C3 is a system programming language based on C. It is an evolution of C
enabling the same paradigms and retaining the same syntax as far as
possible.

Design Principles:
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.

You can try it out live on its tutorial website:
https://www.learn-c3.org
Source code: https://github.com/c3lang/c3c

---------

Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
2023-06-02 08:08:57 -05:00

25 lines
888 B
TypeScript

import path from 'path';
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js';
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
import {BaseCompiler} from '../base-compiler.js';
export class C3Compiler extends BaseCompiler {
static get key() {
return 'c3c';
}
constructor(info: PreliminaryCompilerInfo, env) {
super(info, env);
this.compiler.supportsIrView = true;
this.compiler.irArg = ['--emit-llvm'];
}
override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: string) {
return ['compile-only', '-g', '-l', 'pthread', '--emit-asm'];
}
override getIrOutputFilename(inputFilename: string, filters: ParseFiltersAndOutputOptions): string {
return this.filename(path.dirname(inputFilename) + '/output.ll');
}
}