c3lang / c3c

Compiler for the C3 language
https://c3-lang.org
GNU Lesser General Public License v3.0
2.98k stars 183 forks source link

Audit vector and matrix functions in the standard library #1331

Open lerno opened 3 months ago

lerno commented 3 months ago

There are vector and matrix function in the standard library, but they need to be audited so that they are (a) efficient and (b) above all - correct!

carlosvneves commented 3 months ago

As I first became interested for the language because of its matrices and vectors functions, I'd like to help.

But I need to get some background about how the auditing process is made. As asked in the Discord, it should be implemented writing tests, contracts? Is there any code in the standard lib that you think is a good model to follow?

Thanks.

lerno commented 3 months ago

Well, both of them ideally, but the primary objective is to have tests. You can look into test/unit/stdlib. There are tests there, including some tests on math.c3, so you can either add your tests there, or create a separate file with some suitable name and place it in that same sub folder.

I typically just go to the /test/ directory and run c3c compile-test unit with runs all the tests.