Are Lower Level Languages Better?

6

I dropped a link to the post on my programming history on Facebook and got an interesting comment from one of my lifelong buddies – none other than Digger Waggle:

 I learned 6502 assembly when I was around 14 . Never really learned C or C++ or any of the higher level scripting languages(though I know how to read them like I can read a French or Spanish label on the back of the shampoo bottle.) I’m still of the strange mindset that the only way to really program is ASM.

I’ve often thought about the subject of this post, and Digger’s comment just brought it to the forefront of my mind.. Are Lower Level Languages Better?

My definitive answer is: Um, it depends? But more often than not, the higher level language will win out.

“Why”, you ask? Let’s start out with an abbreviated and paraphrased computer history lesson… On second thought, check out this article and then come on back for my explanation. I’ll wait here.

Ok – back? Did you get all that? Good. Read on…

PDP-1

PDP-1

Read more

A Look At My Programming History – Part 1

3

I’m an old man – I’ve just broken through the 40 year barrier – and I’ve been coding a long time. By my guesstimation, about 30 years or so – starting with a Basic cartridge on my IBM PCjr.

IBM PCjr

IBM PCjr

It was my first real machine, and my mom paid a king’s ransom for it at the time. It was very upsetting to her when I took it all apart to explore the guts (I’ve always been a take-it-apart kinda guy. I could take apart anything. Remember real metal indestructible Tonka trucks – yeah, I took them apart, too). Luckily, I got it all back together and working to avoid Armageddon, but I digress.

Back to Basic programming on that behemoth… I knew nothing about programming back then, but I was always curious as to how this machine did things. Being the inquisitive person that I am – I researched. There were no interwebs back then, no Google, no BBSs – I had no other recourse but to RTFM that came in the box – which was good enough to get me going. The light went on, and I had the perfect project in mind to practice my new skills!

AD&D

AD&D

Some background on my selected project. I, like most 10 yr old boys at the time, really dug AD&D. You know – the Dungeons and Dragons role-playing game series (my mom loathed it, but that’s another story in its own right). AD&D was great fun, the only problem was that you really couldn’t play it alone – you needed a player and a Dungeon Master, at the very least. Not only that, you kinda needed a dungeon or something similar in which to adventure. The gathering of folks to play, as you can imagine, wasn’t always easy. But I was in luck! The Dungeon Master’s Guide had in its appendix a series of random dungeon generation tables! Awesome stuff! You roll a D20 die and based on the result you could get the room size, layout, creatures, treasures, etc.

Read more

Emacs Calendar Extension – Information Unity (Part 2)

0

Go back to the first post in this series, I was trying to solve the problem of having many views of my calendars, but only a single source of record. Specifically, I wanted to be able to view this “source” calendar in Emacs without the manual syncing process.

As was discussed earlier, a few of the issues were solved:

  1. Google Calendar exports calendars in the iCalendar format
  2. Emacs Calendar is able to import an iCalendar format file via URL

Stellar! This is going to be easy! I’ll just list out my calendars’ iCalendar URLs (provided by Google), and have Emacs Calendar cycle through them and import them. Nice 🙂

First, let’s create a var that points to our diary file (that way we can export it to our site config if necessary)

1
(setq diary-file (concat my-emacs-org "diary_entries"))

Next, I’ll create an alist  to hold all my calendars.

1
2
3
(setq my-ical-calendars-alist '(
 ("test", "https://www.google.com/calendar/icaltest.ics")
 ))

All nice and easy thus far. The next thing we need to do is write a nifty function to help import the URL as icalender.el can only import from a file via icalendar-import-file.

No problem, as there’s a built-in function to download a URL to a local temp copy – url-file-local-copy.

We’ll write our function to:

  1. Download the URL
  2. Pass the temp file to icalendar-import-file
  3. Close the buffer
1
2
3
4
5
6
7
(defun import-remote-ical (url my-diary-file)
 "Download ics file from URL and add to diary"
 (let ((tmpfile (url-file-local-copy url)))
 (icalendar-import-file tmpfile my-diary-file nil)
 (kill-buffer (car (last (split-string tmpfile "/"))))
 )
)

I run it and am astounded that it works! So I run it a few more times to make sure I’m not imagining things. Yup – it does work!

I hurriedly open my diary file, anxious to see my handiwork and… (wait for it) … uggh. There are multiple duplicates for each event. I should’ve known that it couldn’t of been that easy.

Read more

Tags: , , ,

Emacs Dired “Shortcuts”

4

I’m always trying to make my development workflow more efficient – whether it be tools or process – and this post solved one of my recent pain points – as well as giving me another practical problem to solve with Lisp.

As I noted previously, I’m really heavy into Emacs use at the moment: development, calendaring, RSS, news, Jabber IM – all from within this awesome thing called Emacs.

As I started to use it more and more for all types of different chores – and more specific to this post – file editing, I began to notice fairly quickly that directory navigation with Dired (Ctrl-X d, by default) led to far too many keystrokes to get to disparate locations – and to boot there was no notion of persistent “favorites” or “shortcuts”.

The above may just be my newness to the Emacs ecosystem and the functionality may actually exist – but it never turned up in my many searches. So I went about providing my own solution.

NOTE: This effort had no intention of making handy-dandy menu items as I don’t like them – or the mouse for that matter – all that much. Maybe I’ll add that at some point for thoroughness sake – we’ll see.

The plan was simple:

  1. Create a dictionary of shortcut to locations
  2. Use Emacs interactive ability to select a shortcut name and open its location with Dired.

Read more

Tags: , , ,

Emacs Calendar Extension – Information Unity

3

Well, I’ve been away for a while. Honestly, I find it hard to make time to post – but I swear, I’m going to make more of an effort because I’m actually working on some very exciting stuff.

I’ll put off the super exciting stuff for a bit, but did want to post something exciting – to me at least…

As a preface, I’ve been getting into pretty heavy use of Emacs over the last few months. To the extent that I’m on a mission to use it for as a replacement for as many apps as possible. If you are aware of Emacs and the multitudes of extensions then you know just how powerful it can be. To the point that my desires of an Emacs-only desktop are not outside the realm of possibility – but I’ll get into that in some later posts.

So one of the things I hate in life is repeating myself – specifically in the realm of information. Having to put to-do items into multiple devices, multiple contacts apps, multiple calendar apps, etc.

Read more

Tags: , , ,