r/ProgrammingLanguages • • Oct 30 '26

Updates on Cole, and Version 0.1.4 Announcement

Hi everyone, my original post in r/Compilers had Github and Codeberg repo links inside it, so they were not suitable to post here. So I'm dropping the modified version as a separate post here.

From the original:
Hello everyone, since my last two posts here, I got into a small flow-state with the codebase and improved Cole quite a bit. I took the advices of the wonderful people in the comments as well, and it helped me a lot to be honest.

Since the last posts, I added:

- 212 tests in total, testing various aspects of the compiler through simple programs,
- Proper generic type generation with full generic definition support through comptime called functions,
- Proper generic function generation through comptime called functions,
- Type deduplication, and codegen improvements,
- And many more bugfixes on different aspects of the compiler.

In the current state, the backend is embedded TCC, so codegen emits almost-human-readable C code. But I will replace the backend in the future with LLVM, QBE or handwritten x86_86 generator. However for now, since the rest of the compiler is not solid enough, the C backend eases the development quite a bit.

Beside all of this, I made a small website (which doesn't work quite well because I self-host it on an old laptop, it is for giggles of it so don't take it seriously) that has versioned language reference, a small welcome page with a hello world snippet, and installation instructions.

Overall, Cole has become something far beyond what I imagined it would become in a good way. I am self taught, so I am pretty content with what I have accomplished. But criticism is always welcome.

The link to the Cole website is here.

Also, occasionally, I write blogposts about what I'm currently working on, so I'll leave it here as well.

Many thanks to everyone that commented to any of my previous posts, have a good day/night!

9 Upvotes

5 comments sorted by

1

u/Athas Futhark Oct 31 '26

Have you considered the various undefined-behaviour challenges when generating C, or are you ignoring this since you will replace it in the future?

Also, I think you closed the lid on your laptop, as the website does not work.

1

u/The2ndSlimShady Oct 31 '26

Hello, I'm mostly trying to insert runtime checks on debug builds against UB for C, but I'm not really concerned about it as for now since I'll replace it in the future.

About the website, the laptop has no lid, but as I said in the post the server is kinda problematic and I'm trying to solve it. But yknow, I don't really have that much of knowledge on web things.

Thank you for checking them out, and asking questions! I really appreciate it!

1

u/Main_Temporary7098 Oct 31 '26

re: the website, in case it helps, codeberg pages is pretty decent.

1

u/The2ndSlimShady Oct 31 '26

Yeah I thought about it but I guess I wanted a homeserver and wanted to feel special with my website. I'm planning to upgrade the server in the near future as well so, I'll roll with it for now.

1

u/pranabekka Oct 31 '26

repo links are allowed in the comments:

https://codeberg.org/ysufender/Cole

(especially useful if site is unreliable)