DEV Community

Cover image for How to install Beef Language on GNU/Linux
Marcos Oliveira
Marcos Oliveira

Posted on

How to install Beef Language on GNU/Linux

🐮 A programming language for game developers and general productivity.


Beef is an open-source, compiled, high-performance language specifically designed for real-time applications like games, combining performance with productivity.

• Syntax inspired by C#, with manual memory management from C and C++, and modern ergonomics inspired by Swift and Go.

  • Well-designed project with its own IDE (Windows);
  • CLI compiler (Linux/macOS);
  • Debugger;
  • Code assistants;
  • and Hot-compiling.

Beef is ideal for those who need rapid development and fine-grained resource control, especially:

  • Game and Game Engine Developers (console, desktop, WASM).
  • Projects requiring efficient debugging, hot-reload, and productivity-focused ergonomics.

Precompiled binaries are available for Windows—just download and run the .exe.

But on macOS and GNU/Linux distros, you’ll need to compile from source.

Below, we’ll cover the steps to compile and install on GNU/Linux distros.


Dependencies

First, you’ll need the following tools installed on your system:

Example of dependency installation using APT:

sudo apt install clang-18 llvm-18 build-essential cmake git \  
  libffi-dev libedit-dev zlib1g-dev zstd libcurlpp-dev libxml2-dev  
Enter fullscreen mode Exit fullscreen mode

After that, just clone and build:

git clone https://github.com/beefytech/Beef  
cd Beef  
./bin/build.sh  
Enter fullscreen mode Exit fullscreen mode

Before tests, you’ll see:

[******************************]  
TIMING: Beef compiling: 37.2s  
Frontend time: 23.48s  
Comptime execution time: 3.67s  
Linking BeefBuild_bootd...  
SUCCESS  
Building BeefBuild_d  
[******************************]  
Beef compilation time: 41.44s  
Frontend time: 21.56s  
Comptime execution time: 3.49s  
Executing Command: ReadFile("$(WorkspaceDir)/../IDE/dist/IDEHelper_libs_d.txt", "IDEHelperLibs")  
Testing IDEHelper/Tests in BeefBuild_d  
Enter fullscreen mode Exit fullscreen mode

After compilation finishes, test a Hello, World! via command line:

  • Navigate to the binary folder:
cd IDE/dist  
Enter fullscreen mode Exit fullscreen mode
./BeefBuild -new  
Enter fullscreen mode Exit fullscreen mode

Output: Created new workspace in '/home/$USER/Beef/IDE/dist'

This will generate:

  • BeefProj.toml, with:
FileVersion = 1  

[Project]  
Name = "dist"  
StartupObject = "dist.Program"  
Enter fullscreen mode Exit fullscreen mode
  • BeefSpace.toml, with:
FileVersion = 1  
Projects = {dist = {Path = "."}}  

[Workspace]  
StartupProject = "dist"  
Enter fullscreen mode Exit fullscreen mode
  • src/ (empty folder)

To create a file in src/, run:

./BeefBuild -generate  
Enter fullscreen mode Exit fullscreen mode

This will generate the build/ folder and Program.bf inside src/. However, it won’t contain a Hello, World! by default.

Edit the file: vim src/Program.bf and insert Console.WriteLine("Hello, world!"); inside the Main() function, like this:

using System;  

namespace dist;  

class Program  
{  
  public static int Main(String[] args)  
  {  
    Console.WriteLine("Hello, world!");  
    return 0;  
  }  
}  
Enter fullscreen mode Exit fullscreen mode

Now run the file with -run:

./BeefBuild -run  
Enter fullscreen mode Exit fullscreen mode

Output: Hello, world!.


Installation

Clean up generated files:

rm -rf src/ BeefSpace.toml build/ BeefProj.toml ../../.git ../../.gitignore  
Enter fullscreen mode Exit fullscreen mode

Actually, you only need these directories:

  • 📁 BeefLibs/
  • 📁 IDE/
  • 📁 IDEHelper/
  • 📁 jbuild/
  • and 📁 jbuild_d/

But all of them total 1.4GB (or 1.6GB with extras). If you prefer, just remove the test files (Hello, World!) and Git files.

Move to /opt/:

cd ..  
sudo mv Beef/ /opt/  
Enter fullscreen mode Exit fullscreen mode

Create symbolic links for the binary and libs:

sudo ln -sf /opt/Beef/IDE/dist/BeefBuild /usr/local/bin/beef  
sudo ln -sf /opt/Beef/jbuild/Release/bin/libhunspell.so /usr/local/lib/libhunspell.so  
sudo ln -sf /opt/Beef/jbuild/Release/bin/libBeefRT.a /usr/local/lib/libBeefRT.a  
sudo ln -sf /opt/Beef/jbuild/Release/bin/libBeefRT.a /opt/Beef/IDE/dist/libBeefRT.a  
sudo ldconfig  
Enter fullscreen mode Exit fullscreen mode

Test:

beef -version  
Enter fullscreen mode Exit fullscreen mode

BeefBuild 0.43.6

Test a new project:

mkdir MyGameBeef  
cd MyGameBeef/  
beef -new  
beef -generate  
Enter fullscreen mode Exit fullscreen mode

Edit vim src/Program.bf:

For CSharp-like syntax highlighting in Vim: :set filetype=cs

using System;  

namespace MyGameBeef {  
  class Program {  
    static void Main() {  
      Console.WriteLine("My first game with Beef!");  
    }  
  }  
}  
Enter fullscreen mode Exit fullscreen mode

Run:

beef -run  
Enter fullscreen mode Exit fullscreen mode

I tested the performance of a million-loop for loop with this code:

for(int i = 0; i <= 1000000; ++i){  
  Console.Write(scope $"{i}Ok\r");  
}  
Enter fullscreen mode Exit fullscreen mode

Result:

1000000Ok  
real    0m6,767s  
user    0m2,717s  
sys 0m3,292s  
Enter fullscreen mode Exit fullscreen mode

For more info, visit the official site: https://www.beeflang.org/ and the repo: https://github.com/beefytech/Beef.

Top comments (2)

Collapse
 
nathan_tarbert profile image
Nathan Tarbert •

been cool seeing steady progress on tools like beef tbh it adds up over time you think habits matter more than luck for learning new languages long-term

Collapse
 
marcosplusplus profile image
Marcos Oliveira •

Thanks for the comment, Nathan! =)