iOS DX with Zig: demo at Zig Milan meetup Specifically for the Zig meetup in Milan, I’ve decided to see how much I can stretch the reality of iOS development with Zig. Some of the questions I wanted to find answers for were: do we really need Xcode to deploy apps to an iPhone? Do we need to rely on codesign tool for managing signatures? If you are curious about any of those, check out my talk from…
Hot-code reloading on macOS/arm64 with Zig - part 2: entitlements Last week I wrote about a proof-of-concept (poc) hot-code reloading on macOS/arm64 with Zig. By the way, if you didn’t get a chance to read it yet, you can do so by following this link here . To summarise, the poc was a success, and we have a way to perform hot-code reloading in Zig by directly writing to the running process’…
Hot-code reloading on macOS/arm64 with Zig Hot-code reloading, or hot-code swapping, is the ability of the compiler to allow you, the developer, to make changes to your program appear instantaneously while the program is already running. Typically, compilers utilise the idea of dynamic library hot swapping (for native targets such as macOS) where your program (logic) is compiled and linked down to…
Disable ASLR when debugging with LLDB on macOS TL;DR If you want to disable ASLR in LLDB, set the following option: (lldb) settings set target.disable-aslr false The long version This is one of these weird, short posts that the vast majority would not even think of doing since, in most cases, it actually hinders the debugging process of your binary, but here goes. As you might be aware, for a few…
Thread-local storage, LLVM, and Apple Silicon: What can go wrong? The release of Apple Silicon in the form of the M1 chip has definitely stirred things up a lot! M1 boasts some scary performance gains over Intel’s even the most powerful i9 chips, while at the same time using much less energy. But, while the hardware is something to look up to, the decision to switch to the ARM architecture and…
Stubbing out WASI manually in Rust Following a really cool blog post “A beginner’s guide to adding a new WASI syscall in Wasmtime” by @RaduM on adding a new WASI syscall to the WASI spec and then stubbing it out in Wasmtime , I thought I’ll contribute to his effort in making Wasm and WASI simpler for the beginners, and delve a bit deeper into stubbing out WASI imports manually when compiling from…
Porting projects to WASI: the flite program This post is hopefully the first of many more to come demonstrating my efforts to port as many advanced projects written in C/C++ to WASI as possible. What is WASI? WASI is a system interface to run WebAssembly outside the web. If you would like to learn more, I cannot recommend enough the fantastic blog post by Lin Clark Standardising WASI . You should…
The ECB art! Do you remember from your crypto course why you should never use ECB as a block cipher? Well, here is why: It looks great though! The script In order to compile the code below, you will need to install Crypto++ library , and download header-only bitmap library . #include <cryptopp/aes.h> #include <cryptopp/osrng.h> #include <cryptopp/modes.h> #include <iostream> #include <string>…
C++ short stories: type traits, concepts, and type constraints Suppose you find yourself in a hypothetical situation where you are designing a complex algorithm, for example, an algorithm that requires multiple depth-first searches through a complex tree-like structure. In situations like these, while I do appreciate the power of the debugger, if each node in the tree is a compound data structure…
Conway’s Game of Life Since it is the first post I’ve written in a longer while, I’ll keep it short and simple. Lately, in my spare time, I’ve been exploring C# and .NET framework. To this end, I’ve had a look through two great books: C# in a Nutshell by P. Drayton, B. Albahari and T. Neward, and Concurrency in C# Cookbook by S. Cleary. In order to further enhance my understanding of the concepts…
Example of streaming data from the database using Persistent and Conduit libraries in Haskell At work, I have to deal with increasingly larger datasets. And by large, I mean a PostgreSQL table with over 7 millions rows of data. If I really wanted to, I could probably be able to load it all into RAM…maybe, I haven’t even tried as it just sounds silly, and especially given the fact that I have quite…
Unconstrained nonlinear programming: Nelder-Mead Simplex algorithm In the previous two posts, I have described the basics of penalty methods ( exterior and interior ), and how they can be used to solve constrained nonlinear optimisation problems using unconstrained nonlinear programming algorithms. In this post, I will take a step back, and describe the simplest (yet quite powerful) heuristic…
Constrained nonlinear programming: interior penalty methods In the previous post , I have briefly outlined how to solve a constrained nonlinear problem using unconstrained nonlinear programming; in particular, using exterior penalty methods. In this post, I’ll present an alternative approach called interior penalty methods (or barrier function methods). The problem revisited Let’s revisit the…
Constrained nonlinear programming: exterior penalty methods Recently, my PhD research has taken me on an exciting journey through the world of nonlinear programming. Nonlinear programming is a subfield of mathematical optimisation that deals with optimisation problems which are nonlinear in nature. For example, minimising a quadratic function of one real variable is considered as nonlinear since…
Circumventing PDF conversion issues on Manuscript Central This is a rather short post that is meant to serve as a reminder of what to do when Manuscript Central (MC) rejects the PDF version of your paper generated with pdflatex . By default, pdflatex generates PDFs in version 1.5, and to the best of my knowledge, MC accepts PDFs up to version 1.4. If the PDF is of newer version than 1.4, the…
Lazy evaluation in Python Recently, while working on my PhD, I’ve started exploring different algorithms for computing and approximating Nash equilibria in games (I’m using a really well-written book, “Algorithmic Game Theory” by Nisan et al. , and in order to enhance my understanding of the theory, I’m concurrently having a go at implementing some of the algorithms therein presented – you can…
Watery electronics (or how my Macbook Air survived drowning in water) A full week ago, I experienced something you dread reading about on the web, but never expect it to happen to you: I managed to spill an entire glass of water (approx. 250 ml) on my 10-month-old 11” Macbook Air (MBA). As you can imagine, I was not overly pleased with the incident, and the fact that I was 1.5 weeks after…