Skip to content

Conversation

@davy39
Copy link
Contributor

@davy39 davy39 commented Sep 25, 2025

Description

Add a new Clang C23 kernel, for those who need to code in C and not with C++ (lot of students in France).

Edit : + c11 & c17

Type of change

Please tick all options which are relevant.

  • Bug fix
  • New feature
  • Added/removed dependencies
  • Required documentation updates

@anutosh491
Copy link
Collaborator

Thanks for opening this. Saying this cause I've gotten multiple messages on mail and LinkedIn for a C kernel (yes only C and not c++)

@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.78%. Comparing base (81fed93) to head (bc0c694).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #379   +/-   ##
=======================================
  Coverage   81.78%   81.78%           
=======================================
  Files          20       20           
  Lines         950      950           
  Branches       87       87           
=======================================
  Hits          777      777           
  Misses        173      173           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcbarton
Copy link
Collaborator

Feels like since we have a c++17 kernel, then it might make sense to add a c17 standard kernel as well, but this is just my opinion.

@vgvassilev
Copy link
Contributor

@davy39, thanks for your pull request. Do you think you can add kernels for the other standard c versions, too?

@davy39
Copy link
Contributor Author

davy39 commented Sep 25, 2025

Now my PR include c11, c17 and c23.

@vgvassilev
Copy link
Contributor

Now my PR include c11, c17 and c23.

Thank you! @mcbarton do you know why the docs build fails?

@mcbarton
Copy link
Collaborator

mcbarton commented Sep 26, 2025

Now my PR include c11, c17 and c23.

Thank you! @mcbarton do you know why the docs build fails?

@vgvassilev Honestly I have no idea. It looks like a random failure. It doesn't appear to be anything to do with main as I rebased the sub interpreter PR #380 to check and it built the read the docs. My suggestion is for @davy39 to either squash his 2 commits and repush, or push an empty commit to rerun the read the docs workflow.

@mcbarton
Copy link
Collaborator

This appears to be passing the read the docs workflow now. I will take this in once the ci goes green.

@davy39
Copy link
Contributor Author

davy39 commented Sep 26, 2025

Sorry for messing up with git... I had to force-push few times to get what I wanted :)

@mcbarton mcbarton merged commit 4449bfb into compiler-research:main Sep 26, 2025
26 of 27 checks passed
@dannluciano
Copy link

@davy39 thanks for your work.

@davy39
Copy link
Contributor Author

davy39 commented Oct 19, 2025

@davy39 thanks for your work.

Actually I did almost nothing except introducing new bugs...

@anutosh491
Copy link
Collaborator

@davy39 thanks for your work.

Actually I did almost nothing except introducing new bugs...

Haha, no. The bugs with the C kernel are interesting. I'll try to address them in the coming days ;)

@anutosh491
Copy link
Collaborator

Hi @dannluciano @davy39 ,

I would like a small help if you would like to have a go at it.

As I know y'all might be the first hand users of the C Kernel, would ya'll be interested in contributing a demo C notebook

Check the C++ notebooks here : https://github.com/compiler-research/xeus-cpp/tree/main/notebooks

As we develop the project, we need to

  1. Be able to test a standard notebook there is. Which probably covers most of what can be achieved !
  2. ensure there is consistency between the native and the wasm kernel. If we realize something works in the native kernel and not in wasm (or vice-versa) we need to fix it too !

Probably can start with a wasm notebook and then we can see if the same notebook everything on the native side too !

Let me know if y'all might be interested in coming up with one (possibly something standard, like something inspired by what can be taught at university I guess. Feel free to also try to replicate the exact C++ notebook but in C)

@dannluciano
Copy link

Hi @anutosh491 I already have this demo.

But some features are not possible today in C xeus-cpp wasm version:

  • write on stderr
  • read on stdin

This other sections of https://github.com/compiler-research/xeus-cpp/blob/main/notebooks/xeus-cpp.ipynb can't make sense in C version:

  • Polymorphism
  • Templates
  • Using the display_data mechanism

I can make pull request now with a bug version, or I'm waiting for the fixes?

@anutosh491
Copy link
Collaborator

It's totally fine to have Todos I think !

@davy39
Copy link
Contributor Author

davy39 commented Dec 2, 2025

Hi @anutosh491
I'm sorry I've no time to work on that.
I did run some test here (in french): https://github.com/davy39/ide-4x/blob/main/notebooks/C/demo-c.ipynb
As I said before #263 (comment) , I couln't really work with this kernel since I did require redefinitions for it to be a sandbox environment...
In case you need Todos, that could be one 🙂
Thanks for your work !

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

Successfully merging this pull request may close these issues.

6 participants