HNHacker News
TopNewBestAskShowJobs

gaurav1804

19 karma · joined September 25, 2021

A competitive programmer and C++ developer! I love solving coding problems! email: gaurav19039@iiitd.ac.in
submissionscomments
gaurav1804··on Show HN: Beast – A Build System
The build process is faster. There are a number of algorithms running (on several threads) while building. That is where optimisation kicks in.
gaurav1804··on Show HN: Beast – A Build System
Hi! Task runner would not be an appropriate term for this. Since it also defines target based on their modification times. This is what we call a general purpose build system, just like we call Make and Ninja build system.

It can do anything you want if you can provide it with proper shell commands and define targets. This can not only be used for tasks but also for physical building targets that can be built on the machine.

I believe that the project you linked here is itself also a build system and not just a task runner. But again, it uses yaml, which might not be best while defining custom things related to a build system

gaurav1804··on Show HN: Beast – A Build System
Hi! I would like to point out as I have pointed out in comments above, that Beast and CMake (though might look similar) are different tools. Beast is an actual build system, that looks at your beast file and carries out the tasks you have specified. It runs at the very base level executing whatever you tell it to.

CMake and Meson on the other hand are Meta build systems. They do not run any build commands on their own. They use other build systems like Make, Ninja to carry out everything. Think of them as a fancy wrapper around build systems. Beast is here as an alternative to Make and Ninja.

gaurav1804··on Show HN: Beast – A Build System
Thanks! That was the idea yeah!... to have more user-friendly syntax :)
gaurav1804··on Show HN: Beast – A Build System
Hi! Thanks a lot!! These are valuable and I am excited to take a look!! Interestingly, some of the things that you mentioned here are things that I discovered while using Make and Ninja purely through experimentation!!!

Great work!!

gaurav1804··on Show HN: Beast – A Build System
I'm not really sure what you are pointing at here. But if you are suggesting to have a single C file that has configurations, dependencies and commands to be run while building your project, then that is not a very good idea. Simply because.... we may not even want to use gcc to build our projects.

We may want a more suitable tool that is first of all more user-friendly (like Beast), allows you flexibility in defining custom tasks (like Beast does).

Secondly, we simply may not have gcc to compile the all.c file (as mentioned in comments below). We just want a unified tool (an CLI preferably) that does all this for us. This is what Beast does. Make and Ninja are long standing build systems that prove my point.

Plus, you get Beast binary as a standalone executable. Check it out here: https://github.com/GauravDawra/Beast/releases/tag/v1.1.0

gaurav1804··on Show HN: Beast – A Build System
Hi! Even so, if you want to compare Ninja with Beast, Beast has much more user-friendly. Ninja itself claims that build.ninja files are not supposed to be written by humans (since they are not always easy to write). But Beast is super friendly here.

Moreover, the benchmarking I'm doing currently (with the Nimble release) shows that not only Beast matches Ninja's speeds, it overtakes it for different configurations and parallelism levels.

Right now it is not supported for Windows. If you have any contribution that can help in this direction they are more than welcome :)

I will surely check out your repository!

gaurav1804··on Show HN: Beast – A Build System
Thanks a ton :)
gaurav1804··on Show HN: Beast – A Build System
Hi! I made a mistake in my previous reply. I forgot mentioning 'pre' as a dependency for 'proj'. I meant something like:

  build pre:
     ! echo 'pre script'

  build proj: pre
     ! gradle hello
This will ensure that 'pre' scripts are run before main 'proj' script!
gaurav1804··on Show HN: Beast – A Build System
By 'faster' I mean better build times than Make for a project of particular size. Benchmarking is going on right now, and the difference in performance is clearly visible.
gaurav1804··on Show HN: Beast – A Build System
Hi! You are right in saying that Beast is "conceptually" similar to Make (and Ninja). But it is much faster and much more user-friendly than Make.

Second, you are listing tools like cmake and meson. Note that these are NOT build systems but they are META BUILD SYSTEMS. Meta build systems are tools that don't really build your project themselves... instead they rely on tools like Make, Ninja and Beast to build it for you. You must have seen that Cmake emits a Makefile (or Ninja file depending upon your choice). So comparison in speed to meson will not be appropriate. (Let us just call them high level build tools)

About your third query... Well Beast is easy enough to compile. If you don't want to compile it, you can directly download the system binaries at https://github.com/GauravDawra/Beast/releases/tag/v1.1.0

I'm currently using Make to compile Beast because I originally compiled it using Make. It will soon move on to CMake. Please note that it is totally OK to use flex and bison. You don't even need them since I have already provided the cpp/h files generated by them on github!

gaurav1804··on Show HN: Beast – A Build System
There can be several reasons for that. Say your project doesn't only require gradle but other tools to be run too. Or say there are some post-scripts or pre-process-scripts that need to be run. They can be done easily like:

  build pre:
     ! echo 'pre script'

  build proj:
     ! gradle hello
Plus, you might want to run some python scripts or run some other shell commands during or after you have built your gradle project.
gaurav1804··on Show HN: Beast – A Build System
Hi! Basically it is supposed to do what Make does... but in a faster and more user-friendly way. Note that Make doesn't have the best syntax. But Beast has sort of a 'python' syntax. It supports strings and integers. Variable modification assignment. It even supports scoping (within and outside beast build rules).

Plus, it is an order of a magnitude faster than Make. All in all, I don't agree with the fact that it's syntax is similar to Make. Well for one thing it has legible special variable names like 'out' and 'dep'.

So yes, while it is a low level build system, it is an improvement over Make in terms of syntax and speed.

gaurav1804··on Show HN: Beast – A Build System
Hi! The reason why you can compile such large amounts of files with only a few lines in a Makefile, is because most of these files might be carrying a pattern in their build rules (like for example most of them are to be compiled in an object file). But this is not always the case. Plus, note that I (and many others I have worked with) are of the opinion that Make may be popular but it is surely not user friendly. The syntax involved in writing a Makefile can get very messy very quickly with all the $<, $@ and what not... Beast's syntax is much more simpler and intuitive, so that everyone... (beginners or experienced) can use it
gaurav1804··on Show HN: Beast – A Build System
Hi! I know I haven't supported my claims in the readme. But if you see the syntax for beast build files, you will see that indeed syntax in beast is much simpler and intuitive. For example, you have strings and integers for variables. You can dereference them easily and even create new variables of any type from other variables. You can declare variables inside a build rule. All in all, the syntax is inspired from python, since everyone loves it so much. This is not all, I'm currently benchmarking Beast. The new release: Nimble is turning out to be way faster than Make and even matching/overtaking Ninja (currently one of the the fastest build systems in the community) But you are right in saying that I should include this in the readme. I will surely post this after the benchmarks
gaurav1804··on Show HN: Beast – A Build System
Thanks! Noted... I will take care of it! Thanks again
gaurav1804··on Show HN: Beast – A Build System
1. Since Beast is new, there are not a lot of examples. Benchmarking is going on and it will take some time. In the mean time, you can take a look at how to write beast build files.

2. You can use it for any project you want if you know what are components of your project depend upon what other components. So as I see it, gradle is a build system for Java project in itself. Beast will not be using gradle if you are trying to compile a Java project. BUT.... you can for sure call `gradle` command from inside the beast.build file. Wherever build.gradle file is stored. So that in this case, beast provides you with an easier to use build system. Let us see an example:

In your beast file, you can have something like:

  build hello:
     ! gradle -q hello
and inside your gradle file:

  task hello {
    doLast {
      println 'tutorialspoint'
    }
  }
Hope that helps
gaurav1804··on Show HN: Beast – A Build System
Hi! It is not only for C/C++, but it can be used for any project in general. This is a low level build system which runs your commands in a shell depending on the rules you define in the beast.build file. Think of it as a faster and more user-friendly replacement to Make. It's 'pythonic' syntax makes it very easy to use and it's build speeds are matching/overtaking those of community standards!

You are right in saying that since any command can be put in the beast file, it is suitable for building a project in any language.

It is a general purpose build system, with focus on speed and usability!