NerdLang / nerd

🔱 Javascript's God Mode. No VM. No Bytecode. No GC. Just native binaries.
https://nectarjs.com
MIT License
3.58k stars 127 forks source link

Code quality #125

Closed ariesclark closed 1 year ago

ariesclark commented 3 years ago

After just briefly looking over the source for this project, It's rather clear there's a gross lack of standardization of indentation, naming, documentation, and such.

I think the best bet would be having ESLint as part of the development pipeline to ensure minimal standards, additionally, the source is rather unreadable for someone who hasn't worked on the project, random global objects with little meaning aren't friendly, for example; in https://github.com/NectarJS/nectarjs/blob/master/nectar_modules/console/index.js#L27, __Nectar_NATIVE_LOG_CONSOLE has no clear indication of what it is, or where it's from.

Aside from that, the organization of the project is pretty messy, for something like this to scale properly, I believe it should be a priority to start modularization, platform specific and non essential related files should be given their own repository, and removed from this master one, where it should only contain the essentials for compiling js to c, nothing more.

Thoughts? @adrien-thierry

retronav commented 3 years ago

I was taking a stroll in the compiler/native directory and the code is pretty confusing and hard to grasp unless you go through the whole file. I think enforcing strict code style conventions, and using linters/formatters is a good first step for the JS code in which I can help :). For further works, simplification of logic is a must to welcome new contributors and to ease the load on maintainers.

adrien-thierry commented 1 year ago

Hi, this will completly change in the next release