Live data from Hacker News

Xmake: A cross-platform build utility based on Lua

xmake.io

31–40 of 41 posts

Re: Xmake: A cross-platform build utility based on Lua

#31

A teammate evaluated this and the experience was night and day compared to cmake + vcpkg. However, there wasn’t a lot of motivation to cutover our existing large project over because of the unknown unknowns. I think projects like these looking to dethrone the status quo definitely need some case studies or examples of larger projects using it to increase confidence because I’d much rather use xmake over cmake if it c…

I use it for personal projects and I find it substantially easier to mess around with compiling shaders to SPIRV, processing assets, etc... But some of my gripes are, although it _is_ lua, there is some magic fuckery going on. When you specify targets, things for that target need to be close to the definition, and it feels very odd in a lua language to not have `target("name", function (ctx) ... end)`. Anyways, not g…

> not have `target("name", function (ctx) ... end)`.

It supports this syntax.

https://xmake.io/guide/project-configuration/syntax-descript...

  target("foo", function ()
      set_kind("binary")
      add_files("src/*.cpp")
      add_defines("FOO")
  end)

Re: Xmake: A cross-platform build utility based on Lua

#32
post #31

Earlier quoted context omitted.

I use it for personal projects and I find it substantially easier to mess around with compiling shaders to SPIRV, processing assets, etc... But some of my gripes are, although it _is_ lua, there is some magic fuckery going on. When you specify targets, things for that target need to be close to the definition, and it feels very odd in a lua language to not have `target("name", function (ctx) ... end)`. Anyways, not g…

> not have `target("name", function (ctx) ... end)`. It supports this syntax. https://xmake.io/guide/project-configuration/syntax-descript... target("foo", function () set_kind("binary") add_files("src/*.cpp") add_defines("FOO") end)

I did not spot those in the docs. Thanks a ton. This will help my autoformatter not completely wreck my files.

Re: Xmake: A cross-platform build utility based on Lua

#33
post #31

Earlier quoted context omitted.

I use it for personal projects and I find it substantially easier to mess around with compiling shaders to SPIRV, processing assets, etc... But some of my gripes are, although it _is_ lua, there is some magic fuckery going on. When you specify targets, things for that target need to be close to the definition, and it feels very odd in a lua language to not have `target("name", function (ctx) ... end)`. Anyways, not g…

> not have `target("name", function (ctx) ... end)`. It supports this syntax. https://xmake.io/guide/project-configuration/syntax-descript... target("foo", function () set_kind("binary") add_files("src/*.cpp") add_defines("FOO") end)

I think the creators did it a disservice to xmake when they tried to unluaize the syntax. You can also do:

    target("foo", {
      kind = "binary",
      files = { "src/*.cpp" },
      includedirs = { "src" },
      defines = { "FOO", "BAR=BAZ" },
    })
which suits Lua better. Unfortunately you cannot do

    target {
      name = "foo",
      kind = "binary",
      files = { "src/*.cpp" },
      includedirs = { "src" },
      defines = { "FOO", "BAR=BAZ" },
    }
which would be the lua-est lua of all.

Re: Xmake: A cross-platform build utility based on Lua

#34
So, digging through the website git repo a bit, some basic facts:

* The project started almost 11 years ago, in 2015.

* It can be both a build-system generator like CMake, or a 'builder' like Make or ninja.

* Code is almost exclusively by one person, waruqi: https://github.com/waruqi , with several other people making a few contribution.

* Prima facie, the API seems to be less flexible/rich than CMake's, but I'm not sure.

* It supports quite a few languages, despite saying "C/C++" on the website.

* It has a built-in REPL.

As @MobiusHorizons points out, a comparison with other build system generators would be appropriate, mostly CMake, but I did not find it.

Re: Xmake: A cross-platform build utility based on Lua

#35
post #31

Earlier quoted context omitted.

> not have `target("name", function (ctx) ... end)`. It supports this syntax. https://xmake.io/guide/project-configuration/syntax-descript... target("foo", function () set_kind("binary") add_files("src/*.cpp") add_defines("FOO") end)

I think the creators did it a disservice to xmake when they tried to unluaize the syntax. You can also do: target("foo", { kind = "binary", files = { "src/*.cpp" }, includedirs = { "src" }, defines = { "FOO", "BAR=BAZ" }, }) which suits Lua better. Unfortunately you cannot do target { name = "foo", kind = "binary", files = { "src/*.cpp" }, includedirs = { "src" }, defines = { "FOO", "BAR=BAZ" }, } which would be the…

It also supports this syntax.

    target("foo", {
      kind = "binary",
      files = { "src/*.cpp" },
      includedirs = { "src" },
      defines = { "FOO", "BAR=BAZ" },
    })
https://xmake.io/guide/project-configuration/syntax-descript...

Re: Xmake: A cross-platform build utility based on Lua

#36

I am deeply distressed that this doesn't require Xlib.

Why? I'm so confused why would you expect a build tool to depend on a x11 client library, besides the fact that both starts with the letter x. Does it also upset you that xamarin and xaml has nothing to do with xlib, xmake, or to each other?

Re: Xmake: A cross-platform build utility based on Lua

#37
post #35

Earlier quoted context omitted.

I think the creators did it a disservice to xmake when they tried to unluaize the syntax. You can also do: target("foo", { kind = "binary", files = { "src/*.cpp" }, includedirs = { "src" }, defines = { "FOO", "BAR=BAZ" }, }) which suits Lua better. Unfortunately you cannot do target { name = "foo", kind = "binary", files = { "src/*.cpp" }, includedirs = { "src" }, defines = { "FOO", "BAR=BAZ" }, } which would be the…

It also supports this syntax. target("foo", { kind = "binary", files = { "src/*.cpp" }, includedirs = { "src" }, defines = { "FOO", "BAR=BAZ" }, }) https://xmake.io/guide/project-configuration/syntax-descript...

That's what I meant: the first you can do, the second, not.

Re: Xmake: A cross-platform build utility based on Lua

#38
This is an interesting system that I studied closely a few years ago, along with a few others based on Lua or Python.

What surprises me enormously about all these systems is the fact that, in builds that can become enormously large and complex systems in themselves, we voluntarily forego most of the advantages we have learned over sixty years of software engineering. I am thinking, for example, of strong typing and type checking by the compiler, which then also enables better support from IDEs and analysis or visualization tools.

It's kind of like other scripting languages. For small applications, it all looks practical and efficient, but woe betide it if it becomes as big as Qt or other systems with several hundred thousand lines of code.

Post reply on HN