Add ImportC compiler to dmd

Walter Bright newshound2 at digitalmars.com
Sun May 16 00:00:30 UTC 2021


On 5/15/2021 3:38 AM, Dibyendu Majumdar wrote:
> Other good tests:
> 
> Single file SQLite - https://www.sqlite.org/download.html
> 
> Single file Lua - https://github.com/lua/lua/blob/master/onelua.c
> 
> You could then run SQLite tests and Lua tests. if they pass that would be super 
> amazing!

It sure would be amazing!

On a practical note, I've found that using various 3rd party projects as a test 
suite tends to be more work than they're worth, because:

1. No matter how big a project is, it tends to use only a subset of the 
language, and once one or two of its files compile, the rest will. This makes 
for a lot of costly busywork (test suite time). Compiling lots of code does not 
necessarily translate into good test coverage, it's the same constructs tested 
over and over and over again.

2. To know if the project compiles properly, then you've got to run the 
project's test suite. This can send one rather far afield.

3. Debugging a failure in the project means understanding that project - an 
expensive undertaking.

4. The 3rd party project then needs to be maintained along with the compiler.

The D test suite, on the other hand, is a large number of independent, minimized 
examples. When they fail, they're readily debuggable. They can be quickly 
processed. The redundancy is minimal.

So, I propose that once ImportC is ready, that persons familiar with those code 
bases try out the SQLite and Lua projects. Failures should be reduced to minimal 
test cases for incorporation into the ImportC test suite.


More information about the Digitalmars-d mailing list