hayley 365


why I'm looking for a replacement for javascript

24 Jan 2014

2014-01-24 13:47:00 -0600

So I'm thinking that maybe before I embark on something, I need to figure out the reasons why I'm embarking on something.

So, right now, I think there are three similiar-ish technologies I'm interested in learning, and I'm not sure which one to go for:

the why

I'd really love to find a toolset for developing frontend applications that I can live with. I've played with JS through both front-end work and with node.js stuff and have never really quite liked it. And unfortunately for me, I've found that my enjoyment of the toolset is often more important than what I'd like to accomplish. There's the notable exception of the GrADS scripting language where I toughed through it to build some weather imagery despite GrADS having the worst scripting language that I have ever used. Of course that didn't work out so well, because I have not voluntarily returned since then.

I've got several ideas swimming around my head that I'd love to build on the client-side. Most of them are actually the type of thing that you could build predominantly on the backend instead, but shifting things to the user's browser means you can host things much cheaper than before. And given that most of my ideas so far have been passion-type projects where I'm paying the hosting bill, the less I pay, the better.

Unfortunately, I'm not sure that any of the solutions out there are perfect. In brief:

So what I'm thinking I should do is actually define what it is that I'm trying to solve rather than aimlessly try to make a guess as to what I'd like to learn next.

would love a cleaner syntax

Opal and CoffeeScript solve this. Dart is a little better than JS, but it still has all of those things that I consider to be line noise.

prefer snake_case to camelCase

As an English speaker where very few words are capitalized, camelCaseJustLooksBizarre (I often wonder if I would feel different if I were a German native). Opal would use snake case predominantly, but of course, you'd be back to camel case anytime you had to interface directly with the JS native stuff.

want a sane standard library

This would definitely be Opal, and from what I've seen, Dart is 100 times saner than what's included in JS.

And of course, Dart also calls itself "batteries included", whereas with JS native stuff you end up having to include plenty of separate libraries to do things that (to me) are the most basic of functions.

In terms of actual functionality, I want a language that makes it nice to:

want i18n support

Frankly, I'm not sure how this would be accomplished in Opal, but I do know that Dart has it baked in. As for JS, as with so many other things, since it's not baked in, then you've got a bunch of different options, and yet another thing where you have to go out and do extra research to determine which is the best option, rather than just being given a sane default.

framework for building single page applications

Angular would fit the bill. With Dart, other than Angular for Dart, I'm not sure what options currently exist. For Opal, Vienna is apparently their library for building SPAs.

Haml template support

Hey, I love saving time and typing and since switching over to Haml (I also use Slim), I haven't looked back.

I know Opal can use this because their own todomvc is written with Haml templates.

I've seen a few options for Dart, but it doesn't look like they've been updated in a while, so I don't even know if they would currently work. And I'd prefer to see official native language support for it, or at least some of the major developers using it, in order to feel confident that it was going to continue to be supported.

integration with middleman

This one is huge. It's why I have a Dart project that's actually almost to the MVP stage but isn't posted anywhere public: I never figured out how to get the code "out of the editor" and into a real world project. And especially, I never figured out how to integrate it specifically into Middleman.

Opal's own website uses Middleman, so I already have a working example of what to do (and in fact, I went through the code step by step to get it working on my own system).

integration with other editors

I prefer to work in Vim with tmux.

Now, I'll admit that for something so GUI driven as building a webpage, I might actually prefer a GUI-based text editor, since I'm going to be doing so much switching back and forth.

But one thing I can't stand is to be without my Vim navigation. Call it the curse of learning. Like, Sublime Text supposedly has Vim support, but if you've gone anywhere past the basics of navigations, you find out just how limited their support is.

I tried WebStorm previously which had an impressive amount of Vim support. In fact, if I remember correctly very few native things were missing (if any). It was all of the custom plugins' shortcuts that I've grown so fond of, that were missing.

And then there's the Dart Editor which has zero support for Vim keybindings.

My problem with trying to use anything that wasn't the Dart Editor, is that you always felt like a second class citizen. For instance, if I remember correctly, the Dart Editor would never tell you what actual command it was running, ya know, so that you could run it yourself at the command line.

And then what I remember from WebStorm is that its Dart integration never worked quite right. I found myself having to tab back to the stupid Dart Editor to actually build anything.

But who knows, maybe now with v1.0, everything's changed.

And that's why, in some ways, I kinda feel like I should give Dart another try first, before I try anything else.

I need to figure out how to actually get Dart working without the Dart Editor. I need to figure out how it would actually integrate into the rest of my workflow. I need to get something that uses Dart up on the actual web instead of just sitting inside some folder on my local machine. Because maybe I've already found the toolset that I can live with.

Or maybe I'll just wait for Opal to mature further.