What does it take to write an emulator in Java?

I am proud, This weekend I did some productive work. I was able to code Chip 8 emulator in Java over a night 😉 I have always been fascinated by them and finally I was able to get the damn thing to work! For those of you who are not familiar with software emulator, It is a software which can emulate the functionality of other hardware or software components. Notable examples are video game emulators(Dosbox/NES Emulator), general purpose software emulators(QEmu)

Read on →

Java’s Type Erasure + Compiler black magic = Bridge methods

This time we will look at an extreme consequence of Java’s Type Erasure. This example shows what can happen to the semantics of Java language by Type Erasure without some compiler massage. Unlike other articles, It makes more sense to explain the behavior along side of the code. So I keep the abstract of the article simple. Below we have a class called Number<T> which has a protected field number of type T and with methods setNumber(T) and T getNumber(). Based on this class, I have created a new subclass called NumberString which extends from Number<String> and provides a method setNumber(String).
Read on →

The rationale behind Java Lambda/Closures

courtesy of blog.takipi.com

In this article I would like to talk about the design choices behind Java’s most awaited language feature Lambdas/Closures. Its no secret that Java 8 now provides the support for lambda functions more precisely closures. But interestingly the implementation and usage of Java closures differs significantly compare to other modern programming languages. There is already a ton of information written on the this subject. So in particular, I would like to provide some thoughts on
Read on →

Git Talk

It is no surprise that Git took the world of source control management by storm since its inception in 2005. For people wondering about what I am talking here, Let me give some context first. Generally, Any reasonably sized source code project needs some sort of ‘change tracking software’ about all the changes/modifications made to it by its authors/programmers. This is where the concept of Source Control Management(SCM) comes in to picture. The idea is nothing new at all. Git is just one such SCM but with some radical ideas built from the grounds up. Ofcourse, These ideas sets it apart from its predecessors.
Read on →

How to install OpenGrok on Windows(and Linux)?

OpenGrokTo successfully setup OpenGrok, We need to perform two steps.
First, Indexing the actual source code and then setting up the opengrok web interface to navigate the indexed code. So before we jump in, first download below software

  1. Java JRE
  2. Ctags
  3. OpenGrok
  4. Tomcat (msi is preferable)

Install Java(update PATH), Extract Ctags to D:\ctags\ and extract Opengrok package to d:\opengrok\
Read on →

Why does Java support multiple inheritance only with interfaces?

As many of us know Java does not support inheriting from multiple classes and it does support inheriting from multiple interfaces. The less known fact is, what made Java designers to make this choice. In this article I would like to provide my understanding of the issues encountered and the trade offs taken when multiple inheritance is allowed at class level.
Read on →