Author Topic: Basic list of improvement points  (Read 5099 times)

bas

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Basic list of improvement points
« on: October 26, 2018, 09:44:15 AM »
There have been some really good ideas and improvement points on this forum. The problem is that there are so many.
I would hate to miss or lose some ideas simply because there is no way to implement them all at once. So I'm looking at
some way to organize this.

More matured languages (Python for example) seem to have formalized this process by using PIPs (Python Improvement Proposals).
That is very nice for gradual improvements, but not handy when the base is not complete yet. Maybe we can have a list of items here,
that point to various other posts on the forum, along with their status. I'll update the list (and maybe prioritize a bit).

bas

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: Basic list of improvement points
« Reply #1 on: October 26, 2018, 09:51:39 AM »
The list so far: (unordered)


lerno

  • Full Member
  • ***
  • Posts: 247
    • View Profile
Re: Basic list of improvement points
« Reply #2 on: October 26, 2018, 11:00:19 AM »
The easiest way would be to start by filing them as issues on the c2compiler in github.

lerno

  • Full Member
  • ***
  • Posts: 247
    • View Profile
Re: Basic list of improvement points
« Reply #3 on: October 27, 2018, 01:00:44 PM »
A problem with working on the syntax though: any keyword must first be updated in the clang fork :( It makes dev harder since you have to know the workings of [part of] clang as well as C2's source. Some of C2Parser seems to be doing C/C++ parsing (commented out at steps). Cleaning out those remnants would make it easier for further refactorings.

I've made a stab at moving DiagnosticsEngine to be wrapped by "our own" class in a step to refactor things. I had to cheat at some places and obviously the diag:: messages had to be left as is, but maybe if there's some specification as to how C2 uses the Preprocessor, Lexer, DiagnosticsEngine and SourceManager so it's easier to know what can be stripped out in what order.

Obviously since since you wrote the whole thing in the first place you probably would have an easier time than me ripping out the Clang code, but for me (and any other contributor) it has to be done piecemeal so nothing gets broken by accident.

Maybe write up some specs? That would be useful for later anyway.

lerno

  • Full Member
  • ***
  • Posts: 247
    • View Profile
Re: Basic list of improvement points
« Reply #4 on: October 28, 2018, 05:46:05 PM »
Some more points (to be evaluated)

- Zero cost errors - discussion needed
- Nested comments - proposal exists (probably wait for a new lexer to do this)
- Extended switch/case - proposal exists
- C11 _Generic (type-switched macros)
- Real arrays (fat pointers) - discussion needed
- Expression blocks (like gcc's ({ }) expression statements) - proposal exists
- Defer - proposal exists
- Allocator push/pop functionality - discussion needed
- Ergonomics: native string, growable array, map - discussion needed
- Return native register size (32 / 64?) - discussion needed
- Custom C2 Lexer