1

So recently I have been learning about compilers and llvm and all of that kinda stuff. But what is really bugging me, is Beef. Beef is a cool programming language that I just learned existed but it is like C# Pro. But the one part I don’t understand is the window creation. Beef uses SDL which I get. (I have no idea how it links it) You can just create (on MacOS) an NSWindow and tada. But that is only supported in objective-c(++). So how on earth is beef able to do something like that?

Anton Korobeynikov
  • 9,074
  • 25
  • 28
James51332
  • 164
  • 11

1 Answers1

0

In the constructor of the WinBFWindow class in WinBFApp.cpp, Beef calls CreateWindowExW function of the Win32 API to create a window.

Whenever BFWindow.Init is called in beef, that is what eventually gets to that Win32 API call.

Ruzihm
  • 19,749
  • 5
  • 36
  • 48
  • So I have been doing a lot of research and I believe that since beef is compiled it is just using c/c++ externs to handle win32 calls (it also uses SDL to simplify that process) Beef doesn't have to do much work. The linker is simply language independent. (for the most part) – James51332 May 15 '20 at 06:41