Hacker News new | ask | show | jobs
by devy 2232 days ago
Checking the Github repo, it says 92.3% C[1], 2.6% Lua[2], why does the author claim it's a "text editor written in Lua" instead?

[1]: https://github.com/rxi/lite/search?l=c

[2]: https://github.com/rxi/lite/search?l=lua

5 comments

Because it has complete copies of Lua 5.2 (src/lib/lua52), stb truetype (src/lib/stb), and SDL2 (winlib/SDL2-2.0.10) checked in.

Excluding those, it's 1369 lines of C (.c or .h), and 5389 lines of Lua (.lua), and 112 lines of other files (license, readme, build scripts...); or 78.4% Lua, 19.9% C, and 1.6% other. I didn't count fonts or images (.ttf, .ico, or .inl).

It seems to include the entirety of Lua - https://github.com/rxi/lite/tree/master/src/lib/lua52

Which is written in C.

Odd that they chose lua 5.2. The most popular luas nowadays are 5.1 (the version that luajit implements), and 5.3 (which was for a long time the 'latest and greatest', though it's been superseded by 5.4).
5.4 hasn't officially released (it's in the RC stage) so 5.3 is still the latest stable/supported version.
They have all of the lua implementation checked in, which they didn't write.

Most of the implementation is oddly in the "data" folder.

Probably because that C code is the embedded Lua interpreter. See the lua.h file, there's the copyright notice at the bottom.
If you check the C sources you'll find that it's Lua itself and libSDL.