31 December 2013

Other Languages

Over the past couple of weeks, I've found myself increasingly using other languages than my favorite, C.

There are a lot of possible reasons for this, chiefly just curiosity as to just how nice all of these other languages are. For example, my second-latest trial was with Perl. Though variable syntax is weird and scoping is somewhat odd, it works quite remarkably and is quite concise. My latest, the one I just started about ten minutes ago, involves Python. Both languages are scripting languages, yes, which I'm not a huge fan of (because insane performance is what I strive for), but their conciseness and efficiency pique my interest and make me quite happy with them.

A little while ago, I wrote up a couple of things which use JavaScript. JavaScript is nice, if it weren't for how the "classes" are defined. Beyond that, I'm quite interested in it, as it is heavily optimized and can do a lot. I'm not a huge fan of jQuery, however (as anyone who has worked with me knows very well), and so the fact that JavaScript can't do some things is understandable but slightly crippling. But I digress.

I like to do this, so I will: *raises Staff of Judgement*

The following is a list of my preferences of languages in descending order:

Ruby: While everything about Ruby's syntax and general sanity (including the community) is amazingly awesome, the two major things which I seek most greatly are absent in Ruby. Interfacing with system libraries is hard (so things like windowed graphical development are made harder), and performance is an issue. While there are ways to optimize Ruby code, I'd love it if I could run a Ruby application and have it have C-like speed and efficiency. I'm used to my programs being slowed down by I/O speeds, not controlled by them. Ruby's great for quick tools that do lots of work over time and can do advanced sorting and whatnot, which is why I put it at the top here, but in terms of super-performance, it's certainly not the best alternative.

C: As I've said in the past, C is fun, when you're writing stuff that needs to go über-fast and needs to be really simple. When you're getting into the higher-level stuff, though, and the general-purpose things, C gets harder and harder. For example, without writing your own system, C has no real ways of going about simple general purpose "numbers." Ruby has two types that I know of or see most commonly, one being the Fixnum and one being the Float. C has no equivalents, you have uint{8,16,32,64}_t, {, unsigned{, long}}int's, double's, floats, and many many more (including GMP's mp{z,q,f}_t types which simplify it somewhat) number types. There's not really a built-in way to make a number that can both go past the current limits and can also be used as a decimal. C is too technical for that.

Perl: Perl is like Ruby in terms of the "getting-things-done" philosophy, and there are many, many different ways to approach the same problem. Perl is significantly faster than Ruby, as well (it is almost as fast as C). It supports numbers which match the description I described under "C" and can do a lot of stuff. The CPAN is a beautiful thing which contains everything from SDL and OpenGL wrappers to Apache frontends to graphing libraries to power block control libraries. Perl's community is simply unmatched in my opinion, and I can identify with the decisions that they have made.

JavaScript: JavaScript is great for web applications, but I haven't found much of a use beyond that. I use it a lot for Node-Webkit applications, but beyond that, again, I have little use for it. I may look into Node.JS in the future.

LISP: While I can't say I've used it that much, I can say that LISP has not shown much speed. I haven't done benchmarking of many if any of these languages, but I can say that LISP seems slow. It also doesn't have much of an interface with the system like Perl or C does, which makes it not my kind of language as it can only do really nice mathematics. Who knows, maybe in the future I'll begin to like it more and use it.