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

Compiling a simple hello world program #20

Closed
VarLad opened this issue Sep 10, 2021 · 9 comments · Fixed by #26
Closed

Compiling a simple hello world program #20

VarLad opened this issue Sep 10, 2021 · 9 comments · Fixed by #26
Labels
enhancement New feature or request

Comments

@VarLad
Copy link

VarLad commented Sep 10, 2021

❯ arocc test.c -o test
thread 12150 panic: integer cast truncated bits
/home/varlad/arocc/src/Parser.zig:226:19: 0x2b86bc in Parser.addList (arocc)
    const start = @intCast(u32, p.data.items.len);
                  ^
/home/varlad/arocc/src/Parser.zig:3275:71: 0x2a317c in Parser.condExpr (arocc)
        .data = .{ .if3 = .{ .cond = cond.node, .body = (try p.addList(&.{ then_expr.node, else_expr.node })).start } },
                                                                      ^
/home/varlad/arocc/src/Parser.zig:2491:27: 0x28a5c0 in Parser.macroExpr (arocc)
    const res = p.condExpr() catch |e| switch (e) {
                          ^
/home/varlad/arocc/src/Preprocessor.zig:415:28: 0x26ef1f in Preprocessor.expr (arocc)
    return parser.macroExpr();
                           ^
/home/varlad/arocc/src/Preprocessor.zig:121:40: 0x267f80 in Preprocessor.preprocess (arocc)
                        if (try pp.expr(&tokenizer)) {
                                       ^
/home/varlad/arocc/src/Preprocessor.zig:1098:22: 0x26fecb in Preprocessor.include (arocc)
    try pp.preprocess(new_source);
                     ^
/home/varlad/arocc/src/Preprocessor.zig:205:55: 0x268a8a in Preprocessor.preprocess (arocc)
                    .keyword_include => try pp.include(&tokenizer),
                                                      ^
/home/varlad/arocc/src/Preprocessor.zig:1098:22: 0x26fecb in Preprocessor.include (arocc)
    try pp.preprocess(new_source);
                     ^
/home/varlad/arocc/src/Preprocessor.zig:205:55: 0x268a8a in Preprocessor.preprocess (arocc)
                    .keyword_include => try pp.include(&tokenizer),
                                                      ^
/home/varlad/arocc/src/Preprocessor.zig:1098:22: 0x26fecb in Preprocessor.include (arocc)
    try pp.preprocess(new_source);
                     ^
/home/varlad/arocc/src/Preprocessor.zig:205:55: 0x268a8a in Preprocessor.preprocess (arocc)
                    .keyword_include => try pp.include(&tokenizer),
                                                      ^
/home/varlad/arocc/src/main.zig:209:22: 0x25f5ac in processSource (arocc)
    try pp.preprocess(source);
                     ^
/home/varlad/arocc/src/main.zig:196:22: 0x25884e in handleArgs (arocc)
        processSource(comp, source, builtin, user_macros) catch |e| switch (e) {
                     ^
/home/varlad/arocc/src/main.zig:33:15: 0x24f8c2 in main (arocc)
    handleArgs(&comp, args) catch |err| switch (err) {
              ^
/home/varlad/zig-master/lib/std/start.zig:507:29: 0x2481cc in std.start.callMain (arocc)
            return root.main();
                            ^
/home/varlad/zig-master/lib/std/start.zig:452:12: 0x22c1ce in std.start.callMainWithArgs (arocc)
    return @call(.{ .modifier = .always_inline }, callMain, .{});
           ^
/home/varlad/zig-master/lib/std/start.zig:366:17: 0x22b1f6 in std.start.posixCallMainAndExit (arocc)
    std.os.exit(@call(.{ .modifier = .always_inline }, callMainWithArgs, .{ argc, argv, envp }));
                ^
/home/varlad/zig-master/lib/std/start.zig:279:5: 0x22b002 in std.start._start (arocc)
    @call(.{ .modifier = .never_inline }, posixCallMainAndExit, .{});
    ^
fish: Job 1, 'arocc test.c -o test' terminated by signal SIGABRT (Abort)

where test.c reads

#include "stdio.h"

int main()
{
	printf("Well, heck");
	return 0;
}

Built with Zig v0.9.0-dev.861+311797f68 via zig build

@Vexu
Copy link
Owner

Vexu commented Sep 10, 2021

With 7222741 the compiler no longer crashes but you need to add your own minimal stddef.h and stdarg.h (at least with glibc).

// minimal stddef.h
typedef long ptrdiff_t;
typedef unsigned long size_t;
typedef int wchar_t;
#define NULL ((void*)0)

With all that there are still a bunch of compiler errors due to bugs and unimplemented features.

@Vexu Vexu added the enhancement New feature or request label Sep 10, 2021
@Vexu
Copy link
Owner

Vexu commented Sep 10, 2021

With 8af9873 and 634c286 I'm now able to successfully parse that simple hello world on my machine using arocc test.c -Wno-macro-redefined. Note that since there is no backend yet the command will just dump the resulting AST.

@VarLad
Copy link
Author

VarLad commented Sep 10, 2021

Now I get

fatal error: could not find Aro builtin headers

I guess I'll have to define stddef.h and stdargs.h

Any help with that?

@Vexu
Copy link
Owner

Vexu commented Sep 10, 2021

You don't need to but it isn't able to find the correct headers. Can you give which arocc? Using zig-out/bin/arocc works for me.

@VarLad
Copy link
Author

VarLad commented Sep 10, 2021

Okay, I cut pasted it from zig-out/bin/arocc to .local/bin/arocc

I pasted it back and made a symlink in .local/bin
Now it works but now I get this

viav0.9.0-dev.861+311797f68 
❯ arocc test.c -o test
/usr/include/bits/wordsize.h:4:10: warning: '__WORDSIZE' macro redefined
# define __WORDSIZE	64
         ^
/usr/include/bits/wordsize.h:12:10: warning: '__WORDSIZE_TIME64_COMPAT32' macro redefined
# define __WORDSIZE_TIME64_COMPAT32	1
         ^
/usr/include/bits/wordsize.h:14:10: warning: '__SYSCALL_WORDSIZE' macro redefined
# define __SYSCALL_WORDSIZE		64
         ^
/usr/include/bits/long-double.h:21:9: warning: '__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI' macro redefined
#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0
        ^
4 warnings generated.
typedef: 'long'
 name: ptrdiff_t

typedef: 'unsigned long'
 name: size_t

typedef: 'int'
 name: wchar_t

struct_decl_two: 'struct (anonymous struct at /home/varlad/arocc/include/stddef.h:10:9)'
  record_field_decl: 'long long'
   name: __aro_max_align_ll
  record_field_decl: 'long double'
   name: __aro_max_align_ld

typedef: 'struct (anonymous struct at /home/varlad/arocc/include/stddef.h:10:9)'
 name: max_align_t

typedef: 'int'
 name: va_list

typedef: 'int'
 name: __gnuc_va_list

typedef: 'unsigned char'
 name: __u_char

typedef: 'unsigned short'
 name: __u_short

typedef: 'unsigned int'
 name: __u_int

typedef: 'unsigned long'
 name: __u_long

typedef: 'signed char'
 name: __int8_t

typedef: 'unsigned char'
 name: __uint8_t

typedef: 'short'
 name: __int16_t

typedef: 'unsigned short'
 name: __uint16_t

typedef: 'int'
 name: __int32_t

typedef: 'unsigned int'
 name: __uint32_t

typedef: 'long'
 name: __int64_t

typedef: 'unsigned long'
 name: __uint64_t

typedef: 'signed char'
 name: __int_least8_t

typedef: 'unsigned char'
 name: __uint_least8_t

typedef: 'short'
 name: __int_least16_t

typedef: 'unsigned short'
 name: __uint_least16_t

typedef: 'int'
 name: __int_least32_t

typedef: 'unsigned int'
 name: __uint_least32_t

typedef: 'long'
 name: __int_least64_t

typedef: 'unsigned long'
 name: __uint_least64_t

typedef: 'long'
 name: __quad_t

typedef: 'unsigned long'
 name: __u_quad_t

typedef: 'long'
 name: __intmax_t

typedef: 'unsigned long'
 name: __uintmax_t

typedef: 'unsigned long'
 name: __dev_t

typedef: 'unsigned int'
 name: __uid_t

typedef: 'unsigned int'
 name: __gid_t

typedef: 'unsigned long'
 name: __ino_t

typedef: 'unsigned long'
 name: __ino64_t

typedef: 'unsigned int'
 name: __mode_t

typedef: 'unsigned long'
 name: __nlink_t

typedef: 'long'
 name: __off_t

typedef: 'long'
 name: __off64_t

typedef: 'int'
 name: __pid_t

struct_decl_two: 'struct (anonymous struct at /usr/include/bits/typesizes.h:73:24)'
  record_field_decl: '[2]int'
   name: __val

typedef: 'struct (anonymous struct at /usr/include/bits/typesizes.h:73:24)'
 name: __fsid_t

typedef: 'long'
 name: __clock_t

typedef: 'unsigned long'
 name: __rlim_t

typedef: 'unsigned long'
 name: __rlim64_t

typedef: 'unsigned int'
 name: __id_t

typedef: 'long'
 name: __time_t

typedef: 'unsigned int'
 name: __useconds_t

typedef: 'long'
 name: __suseconds_t

typedef: 'long'
 name: __suseconds64_t

typedef: 'int'
 name: __daddr_t

typedef: 'int'
 name: __key_t

typedef: 'int'
 name: __clockid_t

typedef: '*void'
 name: __timer_t

typedef: 'long'
 name: __blksize_t

typedef: 'long'
 name: __blkcnt_t

typedef: 'long'
 name: __blkcnt64_t

typedef: 'unsigned long'
 name: __fsblkcnt_t

typedef: 'unsigned long'
 name: __fsblkcnt64_t

typedef: 'unsigned long'
 name: __fsfilcnt_t

typedef: 'unsigned long'
 name: __fsfilcnt64_t

typedef: 'long'
 name: __fsword_t

typedef: 'long'
 name: __ssize_t

typedef: 'long'
 name: __syscall_slong_t

typedef: 'unsigned long'
 name: __syscall_ulong_t

typedef: 'long'
 name: __loff_t

typedef: '*char'
 name: __caddr_t

typedef: 'long'
 name: __intptr_t

typedef: 'unsigned int'
 name: __socklen_t

typedef: 'int'
 name: __sig_atomic_t

struct_decl: 'struct (anonymous struct at /usr/include/bits/types/__mbstate_t.h:13:9)'
  record_field_decl: 'int'
   name: __count

  union_decl_two: 'union (anonymous union at /usr/include/bits/types/__mbstate_t.h:16:3)'
    record_field_decl: 'unsigned int'
     name: __wch
    record_field_decl: '[4]char'
     name: __wchb

  record_field_decl: 'union (anonymous union at /usr/include/bits/types/__mbstate_t.h:16:3)'
   name: __value

typedef: 'struct (anonymous struct at /usr/include/bits/types/__mbstate_t.h:13:9)'
 name: __mbstate_t

struct_decl_two: 'struct _G_fpos_t'
  record_field_decl: 'long'
   name: __pos
  record_field_decl: 'struct (anonymous struct at /usr/include/bits/types/__mbstate_t.h:13:9)'
   name: __state

typedef: 'struct _G_fpos_t'
 name: __fpos_t

struct_decl_two: 'struct _G_fpos64_t'
  record_field_decl: 'long'
   name: __pos
  record_field_decl: 'struct (anonymous struct at /usr/include/bits/types/__mbstate_t.h:13:9)'
   name: __state

typedef: 'struct _G_fpos64_t'
 name: __fpos64_t

typedef: 'struct _IO_FILE'
 name: __FILE

typedef: 'struct _IO_FILE'
 name: FILE

typedef: 'void'
 name: _IO_lock_t

struct_decl: 'struct _IO_FILE'
  record_field_decl: 'int'
   name: _flags

  record_field_decl: '*char'
   name: _IO_read_ptr

  record_field_decl: '*char'
   name: _IO_read_end

  record_field_decl: '*char'
   name: _IO_read_base

  record_field_decl: '*char'
   name: _IO_write_base

  record_field_decl: '*char'
   name: _IO_write_ptr

  record_field_decl: '*char'
   name: _IO_write_end

  record_field_decl: '*char'
   name: _IO_buf_base

  record_field_decl: '*char'
   name: _IO_buf_end

  record_field_decl: '*char'
   name: _IO_save_base

  record_field_decl: '*char'
   name: _IO_backup_base

  record_field_decl: '*char'
   name: _IO_save_end

  record_field_decl: '*struct _IO_marker'
   name: _markers

  record_field_decl: '*struct _IO_FILE'
   name: _chain

  record_field_decl: 'int'
   name: _fileno

  record_field_decl: 'int'
   name: _flags2

  record_field_decl: 'long'
   name: _old_offset

  record_field_decl: 'unsigned short'
   name: _cur_column

  record_field_decl: 'signed char'
   name: _vtable_offset

  record_field_decl: '[1]char'
   name: _shortbuf

  record_field_decl: '*void'
   name: _lock

  record_field_decl: 'long'
   name: _offset

  record_field_decl: '*struct _IO_codecvt'
   name: _codecvt

  record_field_decl: '*struct _IO_wide_data'
   name: _wide_data

  record_field_decl: '*struct _IO_FILE'
   name: _freeres_list

  record_field_decl: '*void'
   name: _freeres_buf

  record_field_decl: 'unsigned long'
   name: __pad5

  record_field_decl: 'int'
   name: _mode

  record_field_decl: '[20]char'
   name: _unused2

typedef: 'long'
 name: off_t

typedef: 'long'
 name: ssize_t

typedef: 'struct _G_fpos_t'
 name: fpos_t

extern_var: '*struct _IO_FILE'
 name: stdin

extern_var: '*struct _IO_FILE'
 name: stdout

extern_var: '*struct _IO_FILE'
 name: stderr

fn_proto: 'fn (__filename: *const char) int'
 name: remove

fn_proto: 'fn (__old: *const char, __new: *const char) int'
 name: rename

fn_proto: 'fn (__oldfd: int, __old: *const char, __newfd: int, __new: *const char) int'
 name: renameat

fn_proto: 'fn () *struct _IO_FILE'
 name: tmpfile

fn_proto: 'fn (__s: *char) *char'
 name: tmpnam

fn_proto: 'fn (__s: *char) *char'
 name: tmpnam_r

fn_proto: 'fn (__dir: *const char, __pfx: *const char) *char'
 name: tempnam

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: fclose

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: fflush

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: fflush_unlocked

fn_proto: 'fn (__filename: restrict *const char, __modes: restrict *const char) *struct _IO_FILE'
 name: fopen

fn_proto: 'fn (__filename: restrict *const char, __modes: restrict *const char, __stream: restrict *struct _IO_FILE) *struct _IO_FILE'
 name: freopen

fn_proto: 'fn (__fd: int, __modes: *const char) *struct _IO_FILE'
 name: fdopen

fn_proto: 'fn (__s: *void, __len: unsigned long, __modes: *const char) *struct _IO_FILE'
 name: fmemopen

fn_proto: 'fn (__bufloc: **char, __sizeloc: *unsigned long) *struct _IO_FILE'
 name: open_memstream

fn_proto: 'fn (__stream: restrict *struct _IO_FILE, __buf: restrict *char) void'
 name: setbuf

fn_proto: 'fn (__stream: restrict *struct _IO_FILE, __buf: restrict *char, __modes: int, __n: unsigned long) int'
 name: setvbuf

fn_proto: 'fn (__stream: restrict *struct _IO_FILE, __buf: restrict *char, __size: unsigned long) void'
 name: setbuffer

fn_proto: 'fn (__stream: *struct _IO_FILE) void'
 name: setlinebuf

fn_proto: 'fn (__stream: restrict *struct _IO_FILE, __format: restrict *const char, ...) int'
 name: fprintf

fn_proto: 'fn (__format: restrict *const char, ...) int'
 name: printf

fn_proto: 'fn (__s: restrict *char, __format: restrict *const char, ...) int'
 name: sprintf

fn_proto: 'fn (__s: restrict *struct _IO_FILE, __format: restrict *const char, __arg: int) int'
 name: vfprintf

fn_proto: 'fn (__format: restrict *const char, __arg: int) int'
 name: vprintf

fn_proto: 'fn (__s: restrict *char, __format: restrict *const char, __arg: int) int'
 name: vsprintf

fn_proto: 'fn (__s: restrict *char, __maxlen: unsigned long, __format: restrict *const char, ...) int'
 name: snprintf

fn_proto: 'fn (__s: restrict *char, __maxlen: unsigned long, __format: restrict *const char, __arg: int) int'
 name: vsnprintf

fn_proto: 'fn (__fd: int, __fmt: restrict *const char, __arg: int) int'
 name: vdprintf

fn_proto: 'fn (__fd: int, __fmt: restrict *const char, ...) int'
 name: dprintf

fn_proto: 'fn (__stream: restrict *struct _IO_FILE, __format: restrict *const char, ...) int'
 name: fscanf

fn_proto: 'fn (__format: restrict *const char, ...) int'
 name: scanf

fn_proto: 'fn (__s: restrict *const char, __format: restrict *const char, ...) int'
 name: sscanf

typedef: 'float'
 name: _Float32

typedef: 'double'
 name: _Float64

typedef: 'double'
 name: _Float32x

typedef: 'long double'
 name: _Float64x

fn_proto: 'fn (__stream: restrict *struct _IO_FILE, __format: restrict *const char, ...) int'
 name: __isoc99_fscanf

fn_proto: 'fn (__format: restrict *const char, ...) int'
 name: __isoc99_scanf

fn_proto: 'fn (__s: restrict *const char, __format: restrict *const char, ...) int'
 name: __isoc99_sscanf

fn_proto: 'fn (__s: restrict *struct _IO_FILE, __format: restrict *const char, __arg: int) int'
 name: vfscanf

fn_proto: 'fn (__format: restrict *const char, __arg: int) int'
 name: vscanf

fn_proto: 'fn (__s: restrict *const char, __format: restrict *const char, __arg: int) int'
 name: vsscanf

fn_proto: 'fn (__s: restrict *struct _IO_FILE, __format: restrict *const char, __arg: int) int'
 name: __isoc99_vfscanf

fn_proto: 'fn (__format: restrict *const char, __arg: int) int'
 name: __isoc99_vscanf

fn_proto: 'fn (__s: restrict *const char, __format: restrict *const char, __arg: int) int'
 name: __isoc99_vsscanf

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: fgetc

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: getc

fn_proto: 'fn () int'
 name: getchar

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: getc_unlocked

fn_proto: 'fn () int'
 name: getchar_unlocked

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: fgetc_unlocked

fn_proto: 'fn (__c: int, __stream: *struct _IO_FILE) int'
 name: fputc

fn_proto: 'fn (__c: int, __stream: *struct _IO_FILE) int'
 name: putc

fn_proto: 'fn (__c: int) int'
 name: putchar

fn_proto: 'fn (__c: int, __stream: *struct _IO_FILE) int'
 name: fputc_unlocked

fn_proto: 'fn (__c: int, __stream: *struct _IO_FILE) int'
 name: putc_unlocked

fn_proto: 'fn (__c: int) int'
 name: putchar_unlocked

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: getw

fn_proto: 'fn (__w: int, __stream: *struct _IO_FILE) int'
 name: putw

fn_proto: 'fn (__s: restrict *char, __n: int, __stream: restrict *struct _IO_FILE) *char'
 name: fgets

fn_proto: 'fn (__lineptr: restrict **char, __n: restrict *unsigned long, __delimiter: int, __stream: restrict *struct _IO_FILE) long'
 name: __getdelim

fn_proto: 'fn (__lineptr: restrict **char, __n: restrict *unsigned long, __delimiter: int, __stream: restrict *struct _IO_FILE) long'
 name: getdelim

fn_proto: 'fn (__lineptr: restrict **char, __n: restrict *unsigned long, __stream: restrict *struct _IO_FILE) long'
 name: getline

fn_proto: 'fn (__s: restrict *const char, __stream: restrict *struct _IO_FILE) int'
 name: fputs

fn_proto: 'fn (__s: *const char) int'
 name: puts

fn_proto: 'fn (__c: int, __stream: *struct _IO_FILE) int'
 name: ungetc

fn_proto: 'fn (__ptr: restrict *void, __size: unsigned long, __n: unsigned long, __stream: restrict *struct _IO_FILE) unsigned long'
 name: fread

fn_proto: 'fn (__ptr: restrict *const void, __size: unsigned long, __n: unsigned long, __s: restrict *struct _IO_FILE) unsigned long'
 name: fwrite

fn_proto: 'fn (__ptr: restrict *void, __size: unsigned long, __n: unsigned long, __stream: restrict *struct _IO_FILE) unsigned long'
 name: fread_unlocked

fn_proto: 'fn (__ptr: restrict *const void, __size: unsigned long, __n: unsigned long, __stream: restrict *struct _IO_FILE) unsigned long'
 name: fwrite_unlocked

fn_proto: 'fn (__stream: *struct _IO_FILE, __off: long, __whence: int) int'
 name: fseek

fn_proto: 'fn (__stream: *struct _IO_FILE) long'
 name: ftell

fn_proto: 'fn (__stream: *struct _IO_FILE) void'
 name: rewind

fn_proto: 'fn (__stream: *struct _IO_FILE, __off: long, __whence: int) int'
 name: fseeko

fn_proto: 'fn (__stream: *struct _IO_FILE) long'
 name: ftello

fn_proto: 'fn (__stream: restrict *struct _IO_FILE, __pos: restrict *struct _G_fpos_t) int'
 name: fgetpos

fn_proto: 'fn (__stream: *struct _IO_FILE, __pos: *const struct _G_fpos_t) int'
 name: fsetpos

fn_proto: 'fn (__stream: *struct _IO_FILE) void'
 name: clearerr

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: feof

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: ferror

fn_proto: 'fn (__stream: *struct _IO_FILE) void'
 name: clearerr_unlocked

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: feof_unlocked

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: ferror_unlocked

fn_proto: 'fn (__s: *const char) void'
 name: perror

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: fileno

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: fileno_unlocked

fn_proto: 'fn (__command: *const char, __modes: *const char) *struct _IO_FILE'
 name: popen

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: pclose

fn_proto: 'fn (__s: *char) *char'
 name: ctermid

fn_proto: 'fn (__stream: *struct _IO_FILE) void'
 name: flockfile

fn_proto: 'fn (__stream: *struct _IO_FILE) int'
 name: ftrylockfile

fn_proto: 'fn (__stream: *struct _IO_FILE) void'
 name: funlockfile

fn_proto: 'fn (*struct _IO_FILE) int'
 name: __uflow

fn_proto: 'fn (*struct _IO_FILE, int) int'
 name: __overflow

fn_def: 'fn (...) int'
 name: main
 body:
  compound_stmt_two: 'void'
    call_expr_one: 'int'
     lhs:
      function_to_pointer: '*fn (__format: restrict *const char, ...) int'
        decl_ref_expr: 'fn (__format: restrict *const char, ...) int' lvalue
         name: printf
     arg:
      array_to_pointer: 'd[11]char'
        string_literal_expr: '[11]char' lvalue
         data: "Well, heck"
    return_stmt: 'void'
     expr:
      int_literal: 'int' (value: 0)
       value: 0

I guess you're right, it just throws the AST at me

Any way to get the output binary though?

@ehaas
Copy link
Collaborator

ehaas commented Sep 10, 2021

Any way to get the output binary though?

This is just a frontend - no code generation currently. I can't speak for Vexu but the stated goal from the README is that it becomes good enough that Zig's translate-c can use it and thus be entirely self-hosted instead of relying on clang for parsing the C. The Zig compiler could also use the AST from this project for the stage2 C codegen, instead of emitting strings.

@VarLad
Copy link
Author

VarLad commented Sep 10, 2021

Thanks! Hope its usable enough to replace the use of clang in Zig soon enough 🙂

@Vexu Vexu mentioned this issue Sep 12, 2021
@Vexu Vexu closed this as completed in #26 Sep 14, 2021
@VarLad
Copy link
Author

VarLad commented Sep 14, 2021

@Vexu This looks interesting!
Is it something I can try?

If so, any instructions?

@VarLad
Copy link
Author

VarLad commented Sep 14, 2021

Ahh, right, in the README.md!
Sorry to ping! Thanks again!

This was pretty fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants