6 ms·
Xmake: A cross-platform build utility based on Lua
- eska 7y agoBenefits over meson? I found no unique features from skimming the docs.
- jdc 7y agoIt doesn't depend on Python.
- ComputerGuru 7y agoPeople are downvoting but it’s 100% true. A build system targeting primarily C/C++ requiring an interpreter and runtime dependencies is a no-go for quite a number of projects. There’s a reason they were written in C/C++ in the first place, and the fact that a lot of people install via packages (separating build from distribution) is scarcely solace.
- SahAssar 7y agoBut lua requires a runtime and an interpreter, right?
- ComputerGuru 7y agolua is unique because it can be embedded into C applications as a library, e.g. the difference between SQLite and MySQL. For example, there's an nginx module that lets you use lua to configure the server logic. I'm presuming you don't need to have lua installed to use xmake (i.e. batteries included), otherwise you're a hundred percent correct.
- wruza 7y agoI don’t get it honestly and never did. On Linux-likes deps are installed by a pm, and chances are you already have python for various reasons. The same goes for Lua. On msw there is more routine, since you don’t have a pm, and have to install everything by hand (+PATH) or choose a pm and begin dealing with its nuances. The same for Lua and xmake. What’s the difference beyond non-C/++ impurity?
- ComputerGuru 7y agoI come from FreeBSD where we have an amazing package manager but a “keep it lean” mentality. If a package isn’t on the package manager (the repo is great but nowhere near as expansive as Debian or Fedora) or if I want to build from source, I shouldn’t need to install such a huge system dependency.
- wruza 7y agoOh, that made me nostalgic of that portupgrade-oniguruma-ruby 20+ minute dep build phase.
- ComputerGuru 7y agoIn case you’re not aware, the FreeBSD package manager switched to binary packages a while back. No more compilation unless you want to change from the defaults.
- pixelmonkey 7y agoI believe xmake doesn't "require" Lua. Instead, xmake embeds Lua. Specifically it embeds LuaJIT 2.1, based on what I could tell in their repo source. So, when you run xmake, you're actually running a a full-blown Lua implementation that is self-contained in the xmake binary, that has some automatic imports for the xmake embedded build DSL. If you want to run arbitrary Lua using xmake, there is a built-in "lua" plugin, shorthand "xmake l", described here: https://github.com/xmake-io/xmake/blob/master/README.md#run-the-custom-lua-script-plugin https://github.com/xmake-io/xmake/blob/master/README.md#run-... So, it would be a bit like if you built a build language atop Python, but rather than depending on Python, you made your whole build tool embed the entire CPython interpreter, pinned to some version. Lua is used in this way more commonly than Python is, of course. So: xmake itself is just a C program with large submodules written in Lua, running inside that embedded Lua context. The upside here is that xmake's releases are just plain platform-specific native binaries that bundle everything you need, and that make no assumptions about your base system. This is a nice benefit in a build tool, as it aids in reproducible builds.
- quietbritishjim 7y agoPython can be embedded into C applications as a library.
- dvdkon 7y agoThe build file is a full Lua script, unlike Meson's limited DSL, which you might see as an upside or downside.
- CountSessine 7y agoWith years of experience with Scons, I can say quite confidently that I don’t ever want to work with a Turing-complete build system ever again.
- eej71 7y agoCould you elaborate a bit on what got you to that conclusion? That's not meant as a challenge - just curious to get more perspective on your conclusion.
- discreteevent 7y agoComing from maven I can say the opposite.
- CountSessine 7y agoI think this is sort of the creator/maintainer conflict. Creators hate maven because they have their own idea about how their project should be structured and it’s different from maven’s. Maintainers love maven because they inherit a code base with a canonical structure.
- snuxoll 7y agoAs a creator I love Maven for that same reason, I appreciate having a defined structure for my project that makes it easy for anybody on a team to pick it up without needing to navigate a build script of arbitrary complexity.
- rumanator 7y ago> Coming from maven I can say the opposite. To be fair, maven is in a class of its own with regards of designing a tool that is the worse of both worlds.
- jcelerier 7y ago> I don’t ever want to work with a Turing-complete build system ever again. so do you instead write custom additional executables that may require a cross-compilation step for whenever you have to perform custom pre/postprocessing tasks on your code (e.g. parsing it, etc)
- craftkiller 7y agoLooks pretty similar to premake[1] but I couldn't find a comparison on the site. Could you provide a pitch or comparison? From what I can tell so far, it looks like xmake directly invokes the build tools whereas premake generates a Makefile/Xcode project/visual studio project from which you then need to use those tools to perform the final build. [1] https://premake.github.io/ https://premake.github.io/
- kitd 7y agoI've only kicked the tyres of both, but Xmake seems to be more opinionated than Premake. It gives you quite a lot out of the box that you have to build yourself in Premake. Eg (basic) dependency management. Tbh, I was impressed by Xmake. All I need is a meaningful project to use it on.
- imtringued 7y agoI don't understand the motivation behind an imperative build system. Why is it "add_rules(a,b)" instead of just "rule(a,b)"? It's like someone discovered the benefits of a domain specific language and butchered the concept by making the internal implementation the public interface. Why does it matter to the user that something is getting added to something? Why doesn't it look closer to this [0]? [0] https://repl.it/repls/DeadCalmPrinter https://repl.it/repls/DeadCalmPrinter
- HelloNurse 7y agoIt's imperative in order to allow arbitrary control structures instead of bending over backwards with 80% solutions and stupid fragile tricks like you would need with Make.
- MaxBarraclough 7y agoI'm not sure we need yet another build system. We pay a real price for this sort of fragmentation. If I have to pick up your cross-platform C++ codebase, I shouldn't have to learn yet another build system. CMake/autotools/Premake/SCons/waf/Ninja/Meson/GYP/qmake/Bazel... and now xmake. I'd rather CMake just be improved, than see endless incompatible reinventions. If you'll forgive a little snark: on the plus side, it's unlikely this new challenger will see any real uptake.
- tkuraku 7y agoI fully agree. The more fragmented cross platform build tools become the less useful they are. Cmake is really pretty good and has some support from Microsoft in Visual Studio and Visual Studio Code.
- rumanator 7y agoI feel you're grossly exaggerating the current state of affairs. From your list alone, cmake is the de-facto standard. All others are either defunct, abandoned, or dropped out of favour, or never had any expressive adoption. For instance autotools is largely a relic of back in the days where C++ was C with classes, and Qmake was already dropped by their makers in favour of cmake. Additionally, some of your entries don't make much sense. For example, ninja is at most a low level alternative to raw makefiles, and in fact tools like cmake are able to generate either makefiles or ninja files, and GYP is just a high-level format designed to generate other build system project files, specially IDE-specific projects such as XCode and Visual Studio project files.
- mcguire 7y ago"For instance autotools is largely a relic of back in the days where C++ was C with classes..." Minor point: autotools is a relic of the days when there were multiple, only somewhat compatible implementation of Unix in common use. Now that the world is a Linux monoculture and most software is installed by end users in the form of pre-built binary packages, the form of portability provided by autotools is no longer needed.