rxi / fe

A tiny, embeddable language implemented in ANSI C
MIT License
1.3k stars 81 forks source link

Add a Makefile? #1

Closed PaulBatchelor closed 5 years ago

PaulBatchelor commented 5 years ago

Hi!

Mostly just writing this issue to say how freaking cool this project is. Readable code, good docs, permissible license. Looking forward to exploring the C API a bit. I'd be very curious to learn about your motivations for building fe, and if you use it inside of any other projects.

Oh yeah, right... erm, the issue. Have you ever considered adding a tiny top-level Makefile? It would be nice to be able to build things with "make", clean things with "make clean", and install with "sudo make install". It would only be a small addition to the project, but it would provide a build system that is both consistent and familiar.

rxi commented 5 years ago

Thanks for the kind words! The project was mainly made as a exercise in practical minimalism and simplicity, the original implementation was written over a weekend a few years ago; afterwards I would open up the project every now and then and try and work out how I could make it leaner, or simpler, decide what to strip out. It started as a small project and gradually got smaller. The goal of simplicity and smallness isn't without the restriction of practicality, though. Many things could be done to make the implementation smaller at the cost of features, or readability. Every feature has a cost, a missing feature is a decision that the cost of that feature outweighed the value it would provide. I tried to design both the language and the C API in a way that you could realistically use it in a project with as little friction as possible.

The practical use case for fe might be projects where lua, wren or duktape, typically small emeddable languages, would be overkill. fe sits at around one 20th the code size of lua. If your software's scripting needs consist of a config file or a couple of wrapped C functions and basic arithmetic it might work as a perfect candidate. For example, I used fe in a small sound-effect generator for storing and loading preset files, by wrapping a random function it allowed for having presets that when loaded would be slightly different each time.

Regarding the make file, I'm not typically a fan of make, especially for a project of this nature. The build.sh file (and a build.bat file if anyone wants to contribute one) in this case, I feel, replaces the need for something like make. I appreciate it doesn't cover all the same use cases, but there is, I think, value in it being such a simple system to understand regardless of ones knowledge of build systems.

PaulBatchelor commented 5 years ago

Well said. Thank you for the thoughtful response. I don't see any need for a Makefile anymore.