Closed tom-from-goss closed 1 year ago
Hello Tom,
nice to hear you're also enthousiastic about C2!
C2 by default places all output in a directory called 'output/'
tree output
should show everything it has generated.
I think with the last command you typed: c2c --create hello
(no --created).
This will create a main.c2
and a recipe.txt
in your current directory.
Running c2c
will then create an output/ directory output/
c2c
tree output
└── hello ├── deps.xml └── refs
you can then run ./output/hello (although it wont do much). Then you can extend it to create everything you want :)
Hello Bas,
Thanks for your quick reply. I feel like an idiot here but for me hello is just a directory?
$ tree output
output
└── hello
├── deps.xml
└── refs
1 directory, 2 files
Cheers,
Tom
Ahhh the c2c_native does not generate + compile C code by default yet. Use the -c
flag to enable that. That should generate your hello binary. Good that you kept asking!
Excellent thanks, I actually figured that out just now!
Apologies to go off topic but as a final note, the reason why I'm excited about this project is that it's the only language I've come across that 'gets' what I think modern C programmers want out of a language. Zig, Odin, Hare, Vlang and even c3 claim to be C replacements but behave in totally un-C like ways that make them unpleasant to work in (hidden allocations, complex language models, over the top error handling to name a few sins).
I tweeted a very well known game developer called Casey Muratori about c2 and he said it looked very good. If you've come across Casey you'll know he can be scathing in his critiques of other languages, so that's high praise.
I believe c2 would be a great language for video games and so I would highly recommend thinking about doing more promotion of your incredible achievement and making things easier for Windows developers. Don't know if you've tried but I couldn't get it to build on cygwin despite an hour or so of trying to solve the link errors.
All the best and please keep up the good work.
Tom
Thanks for the big thumbs up! This indeed helps me pour more time into it and make it even better. I'm currently working on an SDL2 wrapper. This is already working (but not complete). C2 makes full program optimizations a lot easier.
One of the things I'm most proud of is the tool integration. It generates the best refs (that are used by the Vim plugin) and also the Deps generation that's used by my DSM (Dependency Structured Matrix) tool. This allows developers to see the structure of the whole program. I haven't seen this in other languages yes.
I've changed some cmdline arguments and recipe parsing. Now if the recipe states it should generate-C it will. The cmdline options are now more similar to the C++ c2c. For some cases, the C++ based compiler is still more advanced just so you know.
UPDATE: Looking at the options for
c2c
I can workaround this issue by passing in the-c
option and then building with then using the object file generated.Dear Developers,
I'll start by saying I'm incredibly excited by c2.
Apologies if I'm doing something stupid but c2c doesn't appear to be generating executables apart from c2c itself.
Tried this on Ubuntu Server 22 LTS on an AWS EC2 instance and on WSL with ubuntu 22 and having the same issue.
In my home directory I have:
~/c2c_native ~/c2_libs
In the c2c_native directory I run
Output is
As you can see the C generation and C compilation worked.
I have /home/<username/c2c_native/output/c2c added to my path.
When I run c2c in c2c_native (expecting it to build ctags and tester) I get the following output:
I can use
c2c --created hello
to create a project but again runningc2c
creates no output.I've tried setting $CC to clang and gcc with no difference.
I'm very keen on trying this project so looking forward to discovering my mistake/getting the fix.
Tom