Posts

Showing posts from April, 2023

Using NimScript for your build system

Welcome to this tutorial on using NimScript for your build system! In this tutorial, we'll explore how to use NimScript to define tasks and automate your build process. NimScript is a powerful and flexible scripting language that is a sub-dialect of the Nim programming language. Benefits NimScript is a versatile scripting language that can be used on any platform where Nim can run. With NimScript, you can enjoy the same syntax, style, and ecosystem as compiled Nim. This means that developers won't need to learn anything new or switch contexts. [source: https://nim-lang.github.io/Nim/nims.html#Benefits ] Getting Started To use NimScript as your build system, you can use the task template. With this, you can write tasks that can be executed with a working Nim compiler. You can write these tasks either in the .nimble file or in a separate .nims file, which can be executed by calling nim taskname filename.nims directly. Running nimble tasks in the package root will display a

Naylib Goes Mobile: Porting to Android in Just 3 Days!

Image
Hello there! In this post, I'll share how I managed to port my Nim raylib bindings to Android in just three days. I'll talk about the challenges I faced and the solutions I used to make it happen. To be honest, I had no clue about Android development before starting this project. I just wanted to show off my cool demos to my classmates on my phone. So, after my exams were over and I had a few free days, I got right into it. Background So, I had recently revamped my build system. I dumped the outdated nake tool and started using nimble tasks instead. I also took into account some feedback from users of my library who weren't too happy. I changed the way the raylib static library is built by using this cool compile pragma that builds the C sources alongside the nim project. This approach makes it easier to target different platforms. So, let's say I want to develop a web game now, all I have to do is provide the right --cpu and --os command arguments when building my