News for hackers. Stuff that matters.
Re:Show HN: Beast – A Build System by Rochus on Monday July 04, 2022 @08:36AM (#31976373)
Lua is even simpler; there is an all.c which simply includes all other c files in a decent order, so you can just type "GCC all.c" resulting in a full Lua vm executable on all platforms. Other projects like e.g. Duktape offer amalgamated c files as you seem to suggest, but these are redundant.
Re:Show HN: Beast – A Build System by JonChesterfield on Monday July 04, 2022 @06:27PM (#31982376)
This sounded wrong so I checked. You're correct. Current GitHub has a file onelua.c from three years ago.

Turns out I forked the project four years ago. Slightly different implementation in that I expanded the #includes to get a single file I can copy around and hacked in a few libraries (libuv, lfs and penlight iirc). Not totally pleased to discover that was so long ago.

Great to see that cc onelua.c gets the job done today.

Re:Show HN: Beast – A Build System by Rochus on Monday July 04, 2022 @06:57PM (#31982557)
A file called all.c is also present in Lua 5.1 from 2006 in the etc subdirectory.
Re:Show HN: Beast – A Build System by JonChesterfield on Wednesday July 06, 2022 @03:37PM (#32005767)
Could be? https://github.com/lua/lua doesn't seem to have an /etc subdirectory and I think that's where I cloned from. Can totally believe the work had already been done by someone else and I failed to find it.
Re:Show HN: Beast – A Build System by Rochus on Wednesday July 06, 2022 @04:17PM (#32006247)
I recommend to download from the official site: https://www.lua.org/versions.html or https://www.lua.org/ftp/.
Re:Show HN: Beast – A Build System by Rochus on Wednesday July 06, 2022 @07:11PM (#32008041)
I just did an experiment with Lua 5.4.4; moved the file luac.c to another directory and then executed "gcc *.c -lm -o lua" in the src directory; compiled the vm without an issue, and "./lua" does what expected.