I made a MIPS simulator

AKA MIPS – A Java Based MIPS simulator. Browse the code on GitHub.

Long story short, my Data Structures teacher gave us this project where we hasd to use our knowledge of data structures to make something useful. She said we could do it in groups so naturally I found myself in a team of 3.

She told us about the project near the start of the semester and a week before it was due we were still trying to decide what we were gonna make. She said that we would have to present our project and pitch it and convince the audience that it’s a useful piece of shit. The problem with us was that any idea we came up with was either far too advanced and therefore not worth the time and effort or far too simple for our ego to allow us to go about presenting it as our grand project.

I thought maybe we could make like a virtual machine of the Altair or any other primitive computer and that led us to the idea of making a MIPS simulator. We opened the instruction set in a browser tab immediately and were relieved to find that it was sufficiently small and therefore we decided that this was what we wanted to do.

Within 24 hours I had written a buggy but functional parser that could read assembly files coupled with a machine object using a couple of integer arrays for simulating the RAM and registers. Downloading and running some assembly code for MIPS on my parser helped me fix some bugs and typos that had crept in.

Because the teacher had insisted that the project be a graphical program, one of our team members was tasked with creating a GUI for this and so he made a JavaFX project that ended up looking very similar to the MARS simulator for MIPS. No it wasn’t at all a coincidence because he had used MARS before.

After coupling my code with the GUI, I would say we ended up with a pretty decent program. It has a few limitations, e.g. lack of floating-point support. I learned from Steve Wozniak that it’s okay to leave that out when you’re writing your own language processor. On a serious note though, I didn’t initially plan on leaving it out but I learned after it was a bit too late that MIPS had a whole set of 64 bit registers for handling floating-points and I didn’t feel like making any changes to the otherwise working parser. Other than that, there’s no support for unsigned arithmetic. The whole program is Java based and Java doesn’t have unsigned types so neither does the simulator.

The code for the program is available on github. Feel free to check it out, give your feedback and even suggest improvements. It’s not on my teammates account because he created an pushed the code for the GUI on a separate repo and then merged the parser code directly into it.

 

Toggl’s “Building a Horse with Programming” comic explained

If you don’t know what this is about, you should first go and check it out.

So, C++ is, for me at least, an intolerable programming language. Everything from the code to the resultant program tends to be as ugly as it gets. More than half the time it feels like it was hacked-together to include everything. However, it has been around for a very long time and you can use it to do just about anything that you could want to do with a programming language. Only, the experience and the result may not exactly be great.

Then we have Java. The main problem with Java is that for a language that aims to be useful for all sorts of applications on all platforms, it’s missing a lot of features that are commonly used by full-stack developers. Very often, when writing programs in Java, programmers end up spending more time than they need to creating new types and methods so that they can use them in the program that they actually set out to write.

Ever since npm and nodejs gained popularity, JavaScript has become one of the world’s most widely used languages and npm is probably the most used package manager of them all. And the thing about Javascript programmers is that they use a lot of external libraries and packages and every once in a while, they add their own package to the global repository just to get a kick out of it. By now there are probably more packages in npm than there are libraries for any other language out there and when you are a JavaScript developer, you really have use them if you want to get any work done. The pinked “Backbone” and “Angular” are references to Backbone.js and Angular.js, two popular JS frameworks.

NoSQL refers to database systems that don’t use SQL and are non-relational. An example is MongoDB, which stores JSON objects grouped into collections. The joke is that the non-relational model doesn’t always expose enough information for you to be able to access your objects without using the abstract api.

COBOL? Well, I guess no one entirely gets it except for its creator.

Lisp has a lot of parentheses. Just google sample codes for lisp and you’d know.

C# is a fairly complete and tolerable language. The problem? Microsoft. Windows. The thing about the costume is that C# is basically Java in a costume (it closely resembles Java in terms of syntax and semantics.) The camel is basically the windows environment. Basically, it means that C# programs don’t always work as intended if not running on Windows.

Assembly doesn’t really offer a lot of language features. There’s a basic set of operations that have to be used for everything. But coding something in such a low level language means you get control over aspects that most languages abstract over. So you can make a really efficient program, hence, the thing about running.

Everyone hates PHP. They say it’s a terrible and unsafe language and has unpredictable behavior. I personally have reasons to really like PHP but I will still go ahead and tell you that most good posts on the subject target aspects of the language that really do suck so yeah some of the hate is justified.

 

Angular vs React vs Vue.JS

This is the shortest and most effective comparison that aims to make the decision making process easier.

Angular: 

Pros:

  • The oldest and therefore very mature.
  • A complete framework in itself and ideal for large projects.
  • The MEAN stack remains, to date, one of the most popular stacks for web-development so finding jobs is never tough for Angular developers.
  • With NativeScript, you can use it to develop smartphone apps.

Cons:

  • If you don’t know, don’t like or don’t want to learn TypeScript, I would suggest staying away from it because the current releases are TypeScript based.
  • Packed with features, it’s a huge framework and therefore takes a fair amount of time to learn and master.

React:

Pros:

  • Been around for a fair amount of time and therefore can be said to be just as mature as Angular.
  • Smaller than Angular and therefore easier to learn.
  • Just as popular, if not more, and therefore has a well-developed community.
  • Just as many jobs out there for it as for Angular.
  • React Native allows for it to be used to make Android apps.

Cons:

  • You will have to learn JSX. Basically the idea is that in ReactJS, you try to maximize your use of JS and minimize your use of HTML. JSX kinda merges both. Obviously this adds to the learning curve.
  • Not a complete framework. React Developers almost always use Redux or some other flux implementation for state management. Code often becomes a real mess with large projects.

Vue.JS:

Pros:

  • Has just as many features as React, if not more.
  • Small enough for you to be able to learn it in a single day.
  • Great for small projects.
  • Gaining popularity real quick.
  • Resembles the original Angular.JS so if you are familiar with it, you’d love Vue.
  • Unlike React, with Vue, the goal is to maximize the use of HTML and minimize the use of JS.
  • Although not a complete framework, it comes with it’s own router and flux implementation, that, although independent projects, offer seamless integration with Vue itself.

Cons:

  • Relatively new and therefore has a small community and fewer jobs are available.
  • NativeScript has a plugin for Vue support but it not supposed to be ready for development yet. Although, it seemed pretty functional when I tried it.
 

Die Verwandlung

I just finished reading Franz Kafka’s “Die Verwandlung,” translated into “The Metamorphosis” by Stanley Corngold. Before I even started reading it, I’d told my classmate about how it seemed like a weird one — something I’d deduced from its synopsis — and he’d responded with “Franz Kafka’s works tend to be.”
Now that I’m done with it, I’m not quite sure how I feel about it. For one, it was incredibly short. Like I knew it was a short story but I’d still been expecting it to be longer. Then there comes the fact that (SPOILER ALERT) 
… 

 

Linus on C++

C++ is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it...
In other words, the only way to do good, efficient, and system-level and
portable C++ ends up to limit yourself to all the things that are
basically available in C.
In general, I'd say that anybody who designs his kernel modules for C++ is
either
 (a) looking for problems
 (b) a C++ bigot that can't see what he is writing is really just C anyway
 (c) was given an assignment in CS class to do so.
Feel free to make up (d).

You can read the emails here.

 

How GoDaddy robbed me.

Humble request to all readers: Share this post.

I really want to keep this as short as I can and address only the primary issue. For those who don’t know, GoDaddy is one of the most popular domain registrar’s in the market and I started using it a couple of years back as a means for getting rid of my local registrar who had been screwing up routinely in a most inefficient way.
Abstract: Lately, they have not only made a few irrational and immoral decisions, but they also robbed me of a rather large sum of money and then messed up my order completely. In short, I paid thrice for the same order and I didn’t even get what I ordered. Furthermore, somehow the same domain was purchased twice using my account and I have absolutely no idea how it’s even possible. … 

 

Did Nokia really not do anything wrong? They did.

“We didn’t do anything wrong but somehow we still lost.”

Those were the words of the CEO. Do I agree with them? No.
Let’s go back to, say, 2006. Every average person had a Nokia. The Motorollas? Those were what people bought between two successive Nokias. Sony Errison? Well, that one had its own cult. There was a wide variety of different lines of phones in the market, each aimed at a different class of users. The basic featured for those looking for a cheap calling device, the multimedia enabled for those that wanted more, the communicators for those that afforded them.
That wasn’t all. That was the time when Nokia did some strange experiments resulting in the production of some really weird and unique phones. And guess what? A large percentage of those took off as well. Examples of such models could be the NGage and the Ngage QD – Gamepad shaped devices aimed at gaming. I happen to have owned both models. Nokia was also infamous for coming up with some really weird designs, which, surprisingly, sold just as well.
Why? Cause Nokia owned the market. They were among the pioneers and they had almost monopolized the mobile market. What they produced was good and was pretty regardless of how shitty it might actually be.
All the awesome devices that Nokia ever made were … 

 

Kaspersky OS

First, it’s based on microkernel architecture, which allows to assemble ‘from blocks’ different modifications of the operating system depending on a customer’s specific requirements.
Second, there’s its built-in security system, which controls the behavior of applications and the OS’s modules. In order to hack this platform a cyber-baddie would need to break the digital signature, which – any time before the introduction of quantum computers – would be exorbitantly expensive.
Third, everything has been built from scratch. Anticipating your questions: not even the slightest smell of Linux. All the popular operating systems aren’t designed with security in mind, so it’s simpler and safer to start from the ground up and do everything correctly. Which is just what we did.

Let’s talk about this. Micro-kernel design? Interesting, but MINIX has had that for ages now. Linux vs MINIX = Monolithic vs Microkernel = Performance vs Security. Yes, going for one kernel design instead of the other does equal compromising one aspect for the other. In short, this decision to use the micro-kernel isn’t honestly innovative.
Built-in security system? Oh wow.. Sure, whatever. Give us more details and then we will consider it’s existence and efficiency.
Everything has been built from scratch? I admire your effort, but at the end of the day, it is going to have to be POSIX compatible. It’s hard to say whether or not it really was worth the effort. And I hate to break this to you, but it would have saved time, and made more sense, to proofread  the code instead of rewriting it.
In short: As of now, it offers nothing too interesting. Sure, I’d like to download an image and give it a go but that’d probably be it.