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

Is there any missing feature of pure C (not C++)? #386

Closed
Naereen opened this issue Feb 20, 2021 · 5 comments
Closed

Is there any missing feature of pure C (not C++)? #386

Naereen opened this issue Feb 20, 2021 · 5 comments

Comments

@Naereen
Copy link

Naereen commented Feb 20, 2021

Hello there,
First of all, 👏 👏 this project is amazing, I've using it from time to time since a few months, and I really like it!
It can be a great tool for teaching I think! So thanks!

Regarding teaching, I'll have to teach a few introduction courses to C (not C++), and of course I'll start by using a local real compiler for C, but I would like to also have such basic interactive environment.
I know Jupyter also has a C kernel, and this one is the only one I'm aware of... but as it's name says, it's pretty minimal.

I'm not a very strong expert of C and C++, but from what I understood, any valid C99 or C11 program is also valid in C++, with the same semantic, so I can expect xeus-cling to be able to run correctly any (small and simple enough) C program?

My question is in the title: Is there any (known) missing feature of pure C (not C++)?

I wasn't able to find the answer on CLING documentation, so I prefer to ask here.

Thanks!
Regards from France, @Naereen

@Naereen
Copy link
Author

Naereen commented Feb 20, 2021

I link here a similar question I've opened on JSCPP, a pure javascript interpreter for C++ that I also intend to use for my teaching. felixhao28/JSCPP#146

@JohanMabille
Copy link
Member

JohanMabille commented Feb 22, 2021

Hi,

Thanks for the kind words! I've never tried to use pure C with xeus-cling, but xeus-cling relies on cling which in turn relies on clang and llvm. So I guess it should work out of the box, and any missing / non working feature could be reported as a bug.

@Naereen
Copy link
Author

Naereen commented Feb 22, 2021

Great, thanks for the answer @JohanMabille !

@SylvainCorlay
Copy link
Member

SylvainCorlay commented Feb 22, 2021

Hey @Naereen,

To my knowledge, the C Kernel linked above does not really offer an interpreter for the C Programming language as each cell is a separate C program with its own main function. Xeus-cling on the other hands provides an interpreter experience, where variables defined in a cell can be used in another cell.

Xeus-cling supports C++14 (as well as clang 5), and higher versions of C++ (17, 20) will not be supported until the cling backend moves to a more recent version of llvm and clang.

Closing the issue!

@Naereen
Copy link
Author

Naereen commented Feb 22, 2021

Hi Sylvain,
Thanks for the answer.
Yes the C kernel is quite limited as it just compiles & runs the code for you, so it can be great to teach about compiling C to native code.

I'll keep learning C and what C features are not supported by Clang (hence by Cling hence by this kernel), but my guess is that I can safely assume any reasonable "L1/L2 Bachelor" programs in C will work perfectly using the C++ kernel. (I'll have to teach that at CPGE level soon!)

Thanks! @Naereen

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

No branches or pull requests

3 participants