2012-05-29

Awk-Like JavaScript

I’ve been thinking about the Awk in JavaScript implementation that I want to do. Ultimately what I wanted was essentially a version of JavaScript that could support Awk style programs / patterns.

I think it will actually be easier just to do that, than to try a full implementation of Awk in JavaScript. All I have to do to get the Awk-like version of JavaScript to work, is figure out how to transform the pattern / action pairs that Awk supports into the equivalent if / body statements in Javascript. The the only other things that really need to be done is creating the implicit read loop and the autospliting of lines into the $0 – $n variables. I guess there might be other variables that should be auto-generated also.

Standard

2012-05-26

Vimacs Naming

I think I’ve decided to go with the standard names that Vimacs expects of either vm or vimacs. Since there are multiple computers that I work on, I think the convenience of not having to modify the scripts when I install in a new location, outweighs the slight dislike for the expected names.

Dtach

I’ve playing around with trying to get a short way to instantiate a dtach session for commands that I run over ssh from my phone. That way if my phone connection quits mid way through the process, I can still get back to what I was doing when I reconnect.

I would usually just se screen for this but my Blackberry seems to have some wierd interactions with Screen which causes odd display issues. Dtach seems to do less to the display which seems to cause less problems.

So my current command is a script called d with the following contents:

dtach -c $1 $*

This lets me call a command as

d vim filename.txt

and it will put that into a session called vim in that directory.

The only place where it has trouble is when I try to run a script in the same directory where the script file is located, in that case the dtach session name conflicts with the script name. I think I can probably fix that by adding a prefix or suffix to the dtach session name.

Update: Yes, that worked.

So now the script d is:

dtach -c $1.dtach $#

Awk2JS

I continue to be fascinated with the idea of a version of Awk written in Javascript. My latest thought is to try to write a program in Awk that can take an Awk program and output an equivalent JavaScript program. Once that can be done in general, then the hope is that the program can be run on itself, producing the equivalent compiler in JavaScript.

[NOTE: this became my project called hawk for "Higher Order Awk"]

Standard

2012-05-24

Got Some Emacs In My Vim

I’m trying out the Vimacs plugin for Vim. This basically turns Vim into a non-modal editor with Emacs style keybindings.

Obviously it’s not a full clone, but most of the navigation works like it does in Emacs, and even things like window commands, changing buffers, and quitting / saving files.

It seems to be good enough that I actually don’t find myself using it and getting frustrated.

I’m not sure that I would recommend it to someone who wasn’t specifically after the Emacs keybindings, because I actually think Vim’s normal keybindings are faster and more consistent than Emacs.

But for some reason, I find the Emacs keybindings to be more pleasant to use (except that when I don’t have arrow keys available I long for hjkl movement).


Got Some Bass In My Guitar

Continuing the theme of making things act like other things, I’ve been playing around with tuning my guitar in 4ths across the strings kind of like it’s a 6 string bass an octave higher.

I find it much easier to use for soloing, because the tuning is consistent. If I find a pattern that I like in one place it is trivial to move it around or transpose it to a new location. I can go across strings and keep the same pattern.

So I basically now tune the B and high E strings up a half step for soloing, and then tune them back down if I want to play chords for accompaniment. That’s not perhaps ideal, because it means I can’t easily switch between soloing and accompanying in the same song, but it seems to be the only real way for me to be able to solo without consistent mistakes on guitar.

I’d also like to keep playing with bass and see if it makes sense to get one at some point.


Fortran

It’s seems a bit wrong to admit that I’m actually liking using Fortran to work back through some early Project Euler problems.

I can’t really explain it – maybe it’s because Fortran is actually a pretty simple language (especially Fortran 77). and at least for the stuff so far has been pretty easy to get working.


Vimacs – 1 Frustration

The only frustrating thing I have found about the Vimacs plugin for Vim is that I can’t figure out how to call a different .vimrc file for it without it somehow disabling certain aspects of Vimacs.

I also can’t set a new color scheme in the command to start vimacs because it looks like the .vimrc file is sourced after vim starts up, therefore, I have to leave out a default color scheme in my .vimrc file if I want to be able to set the color for vimacs. However, then I can’t set the color scheme for a default run of Vim.

I don’t think any of this is really the fault of Vimacs, more a result of the way Vim works.


Linux Mint Debian Edition

I’m trying out installing the above named version of Linux on a virtualbox instance at work. I like the idea of rolling release distributions, but Arch has given me a couple of instances where upgrades were less than smooth.

I am curious to find out whether a rolling release based on Debian might be less prone to breakage.


Linux Mint VirtualBox

Unfortunately I haven’t been able to get VirtualBox Guest Additions working with Linux Mint Debian Addition. Or if they are installed, the video resizing is still not working seamlessly.

Standard

2012-05-23

Moving Toward Emacs

I’ve generally bounced between Vim and Emacs for the past 6 or so years. Recently I’ve found the pendulum swinging toward Emacs again.

I don’t actually find Emacs faster for editing text than Vim, but I find the general experience more pleasant. I’m not sure why that is, perhaps it’s because Emacs has better support for interacting with external interactive programs.

Standard

2012-05-21

Spine.js

Saw an interesting article on Spine.js vs. Backbone.js. I have no idea yet of how correct it is, but it makes it seem worth looking at Spine.js also.

Windows Install Scripting

I’d like to figure out what’s the best scripting language for writing install scripts on Windows. I’ve come to hate Windows .bat files and I’d prefer not to have to use something like InstallShield.

Standard

2012-05-20

Tragedies

Tragedies would be more dramatic if the flaw that led to destruction was also the character’s strength


Productive Weekend

This weekend has been fairly productive, even though I haven’t been able to work on either of the code projects that I had hoped to have time for.

It looks like we may be able to get a car for Jayne that will work for the baby. We looked at one today that seems like it will work. The plan is to purchase it tomorrow evening.

We made some progress getting the house organized, and got the computer set up so that I can work with 2 monitors like my setup at work.

Standard

2012-05-17

Less vs. Sass

There’s a post on Hacker News today comparing Less and Sass for CSS preprocessing.

I don’t know enough about either of them to know which one to choose, but I know that I need to learn at least one of them.

More Less

Less plugins that seem useful

Possible Weekend Projects

I’d really like to accomplish one of these this weekend:

  • Cluster enabled http-server for node
  • Lex(Flex) based port of Forth4(awk/js) to C
Standard

2012-05-16

Unfamiliar Languages To Learn

Here are a few languages that I’ve messed around a little with recently. They are all outside the C-derived paradigm, so I don’t really want to focus on them right now. But at some point in the future I’d like to give each of them enough of a shot that I have a reasonable idea of their usefulness and strengths

  • Fortran
  • Prolog
  • Haskell

Concurrency Languages / Frameworks

Here are languages I’m interested in as far as supporting significant concurrency.

  • Node.js (JavaScript server framework)
  • Go
  • Erlang

I’ve been experimenting with Node and am fairly pleased with it so far. At some point I also want to spend more time with Erlang.

I’ve had a fair amount of fondness for JavaScript and Erlang for a number of years, so I think I’d be happy to be using either of them.

I can imagine writing prototypes of web-facing stuff in Node and then where necessary implementing backend stuff in Erlang. There might be other architectures that make sense in combining the two languages.

Go is a languages I haven’t really used yet, but am trying to keep aware of. I’m not entirely sure how I feel about it yet. I like the idea of it, and the ideas expressed in it, but I’m a little wary of focusing on it yet. Go doesn’t have a good story on Windows yet, which isn’t really necessary, but I like languages that are fairly cross-platform. Also, it’s interoperability with other languages is still low. That is, it can call C libraries, but there isn’t really a good way for other languages to call Go code. As a result, for the moment at least I might be more likely to write low level stuff in C with the hope that it could be used in whatever other languages I work with.

Standard

2012-05-15

Essential JavaScript Libraries

Here’s a list of JavaScript libraries that seem to come up really frequently as being useful to real people doing development.

  • JQuery
  • Backbone.js
  • Underscore.js

I need to spend some time looking at these.

Other Interesting JavaScript Libs

A few other libraries I think are interesting, though not necessary.

  • Processing.js
  • Three.js – 3d graphics
Standard