Priyadarshi Raj

Exploring JNR (Part 1) - A faster way to connect Java to native libraries

October 28, 2021

If you're writing an actual desktop software, you'll sometimes find a need to call system services from your favorite language. For a Java developer like me, it hurts me every time I'm reminded how messy it is to connect to native libraries in the standard way, i.e. using JNI. Fortunately, there are other libraries JNA, JNR, Panama, etc. that were designed to make this labor easier. In today's post, I'll be showing you how to connect to a C library using JNR FFI - a simple, modern, and performant framework, that also happens to be surprisingly undocumented.

Continue reading

Why choose between NoSQL and SQL when you can choose both?

August 17, 2021

I've been lurking around the cloud vendors' freebies for a while now, and I realized the best 'Always free' tier is neither from AWS, GCP, nor Azure ... it's from my bad boi Oracle, and it is surprisingly good. Among that is one eye-catching offer: 20GB of Oracle Autonomous JSON Database. It's based on the multi-model Oracle Database but geared towards storing JSON and performing SQL and NoSQL-style queries. Keep reading to see my experience working with it and decide if it'll be an ideal pick for your next project. ⛵

Continue reading

Compiling Swing apps ahead-of-time with GraalVM

April 23, 2021

Being the first major release of this year, GraalVM 21.0 added experimental support for Swing and AWT on Linux. A few weeks back I was compiling one Swing app with native-image and the result was as good as I had expected. Even though Swing is almost deprecated, this is a pretty welcome change considering a large number of desktop apps that can make use of this. So while the GraalVM team extends this feature to Windows and macOS, let us dive in.

Continue reading

New Year, New Start

January 23, 2021

Ladies and gentlemen, let me start with my best wishes for the new year. I hope you're as relieved as I am about the end of 2020. It's been a long time since I posted something and all the blame goes to this terrible pandemic. It's certainly impossible to summarise everything I've been through in a single post, but what's gone is gone. And here I am, back in action. 🌞

Continue reading

GraalVM's secret LLVM backend

September 20, 2020

You might have come across GraalVM's LLVM interpreter lli but did you know that it can also output LLVM bitcode too? Welp, maybe it isn't a secret anymore but GraalVM has an experimental backend that can build native images using LLVM instead of Graal. Let's have a quick demo.

Continue reading

Calling uname from Java using GraalVM

August 21, 2020

For years I'd been searching how to build native Linux apps using Java and somehow GraalVM has concluded it all. GraalVM's native-image tooling is arguably the most elegant way of connecting Java to the native world. We'll be exploring a clean way to interoperate with C libraries by writing a uname alternative in pure Java. No JNI mess, no sun.misc.Unsafe imports, just GraalVM. 🛠️

Continue reading

Zimbra Mailbot: Update 1

August 13, 2020

My college exclusively uses Zimbra 8 as its mail server and the most annoying part is that there's no easy way to fetch new emails automatically (unlike Gmail app). The unavailability of any official Android app only makes it worse. So it's been a while since I started working on this chatbot that can forward emails from any Zimbra account to Telegram. On a side note, it's also helping me sharpen my Clojure skills for web dev.

Continue reading

Self-contained, native-looking apps with SWT and ModiTect

July 19, 2020

The Standard Widget Toolkit, commonly known as SWT, is one of the few Java GUI libraries that are still actively maintained. Popularized by the use in Eclipse IDEs, it has a remarkable ability to present apps that look and feel native across all major desktops. Let me show you how to set up a Gradle project to build cross-platform, self-contained apps that mimic the native theme. 🤖

Continue reading