Debugging a Rust Crate/Library in VS Code

Recently, I have been learning a new programming language. I know, if you follow this really non-existant blog you would know that this is something that I do often. This time it is Rust. If you have not heard of Rust, it is a system programming language that would be in a similar space as C, only a much more modern design and is focused on memory safety and concurrency. Most of the time I get into a language and read about it a bit, then do a few hello world examples and move on. Rust on the other hand has stuck with me a little longer and I have been working on a “scratch my own itch” project with it. More on Rust itself in a future post.

Rust has a library system as many modern programming languages do and they call them Crates and are registered at http://crates.io. I have been in the process of authoring a crate called PJLink that is a Rust API to control projectors or displays that understand the PJLink protocol. The API is growing and I have been getting to points in development where old school print line debugging was just very inefficient and wanted to use the debugging features built into Visual Studio Code.  Code has very good support for programming Rust thought the integration of the Rust Language Server and debugging using  lldb inside of VS Code.

Continue reading

NFP One Fader

icon_256x256I had the need to be able to control the level of the lights in one of the spaces at our West Ashley campus.  The control in the room is currently Crestron controlled and the staff requested more control of the house light level. I was just going to have one of the control buttons reprogrammed to a lower level, but  then I remember that Crestron processor was talking to a Pathways Connectivity Network Fade Processor.  Come to find out, the NFP has a very easy protocol.  I decided it was easier and cheaper to just write a Mac application that gave them a fader to control the house light levels.  Now I’m open sourcing that application and it can be found here:

https://github.com/macoss/NFP-One-Fader

The Programming Connection – Meteor.js

I have always thought that the Holy Grail of web development would be to write all of my code in one language.  The main problem with this is that browsers only accept Javascript. Why is that a problem? Two reasons: the language is ugly, and back in the day javascript didn’t run on the server side. While there has always been the option of other languages being cross compiled into browser compatible javascript such as Coffee Script, Dart, and even Rails had a DSL at one point. That always seemed like it was just an extra step in the build process and another place that you could have to debug code. Today there have been some changes that seem to be bring this closer to a reality.

Why does it matter that Javascript is ugly? What else do you like to use that is ugly?  Nobody wants to buy an ugly car if they don’t have have to. Does an ugly house inspire you to do home improvement? I completely believe that ugly code leads to less productivity.  Even with the best syntax highlighting and linting you still find yourself struggling to find mistakes. Back in the day, I worked with a team of creatives and we needed a ticket system.  I went out and found the most functional system I could find with the best features and showed it to the Creative Director, my boss, and he said, “We can’t use that, it is ugly”. We found another system that was not as feature complete but had a much better design and we used it. A system is only good if people like using it.  I use an Apple computer partially because of the great design and clean looking applications. I think users these days put a high value on aesthetics and choose products based on that.  Javascript, as with many languages have adopted C-like syntax and that is not bad, but Javascript has added some interesting additions that have not helped clarify or beautify the syntax. Nested callbacks and anonymous functions have added solid functionality to the language, but have not improved the readability.  We are starting to see some improvement coming in ES6 and ES7 changes.

Likewise, the server side has always left me wanting. Node.js has been the main player in this space and has been adopted by many and it used in production by some large companies like Walmart and Netflix.  It is also intended to be more then a web frame work, being use in embedded applications such as robots and is one of the main tool kits for the Arm based Beagle Bone single board computer. When I would look at frameworks like Express.js I would feel like I was back in my early PHP days were you really rolled your own data layer and build tooling. Node has had success working with modern web features like Web-sockets which has been a bit of a challenge for tool kits like Rails. When looking for solutions to some of these issues, I found Meteor.js.

Meteor is a new framework that takes a different track then other Javascript frameworks that I have looked at. It has a few key features that caught my attention like real time data push, clients and server side coding support with a common API, as well as a solid set of tooling. This was the first JS framework that I reviewed that I didn’t have to spend time learning multiple different frameworks/components to make a complete web application. Every time I would get started on a new project I would have to figure out the data layer, service side language, client framework, and how to maintain build versions/database changes.  This was something that was daunting when getting started and Meteor has a clear story on how that can be handled. Meteor is opinionated and does have some limitations which won’t make it a ‘be all’ framework, but if it does fit your requirements, it could be a great tool.  We will get into more details in later posts.

The Programming Connection

I have been working in the area of audio/video production for the last nine years, but in the past my focus was on IT and programming. Over the past year or so I have been feeling the itch to do some development again and it is a great distraction from my day to day production work.

I have developed in many different languages and environments.C/C++, Visual Basic, C#/.Net, RPG, Perl, Python, PHP, Objective C, Javascript, and Ruby just to name a few. Recently I have had some ideas for a few new projects, some just to scratch an itch and others to solve work needs. I could just jump into the tools that I have used in the past. For example if I was going to work on a web project I would lean torwards Rails, or if I needed to do a small utility app Ruby or Python might get the call. These are the tools that were productive for me in the past.

Being that some time has passed and I’m really not under any deadlines, I thought it would be fun to check out new languages/frameworks. I have always loved developing my skills and maybe some of it is just to see what all the fuss is about. So I have looked at many new to me languages and frameworks, such as Go, Scala, Erlang, Angular, Rust, Swift, and Ember. All of them have some intereseting ideas and yes I know they all cover many different development needs, but I really haven’t connected with any of them in the way that I did with frameworks like Rails.

It is strange to say that you “connect” with a programming language, but you do. I guess it is like how I like to play Fender Jazz basses, but can’t seem to get comforable with a Fender P bass. Maybe a little closer to this topic Vim vs Emacs, but I don’t want to start a editor flame war. That connection seems to lead to you wanting to dig deaper and continue to build your skill.

Recently I have come across a few new framworks and languages that I have
started to “connect” with. I thought that I might do a few posts on them: and try to
explain what has caught my attention. The two that I’m going to start with are
Meteor.js and Elixir/Phoenix.

Changes 4/6/2008

Just a sample of one of the lighting looks for Sunday
This is a big Sunday for the tech ministry at Sugar Creek. We are going digital. The Digico is installed and this will be the first Sunday running it for the services.  All is tested and ready to go and John is charged with making sure all works correctly. Over the next few weeks we will train the volunteers on the job. I think that they will be back running the shows soon as they become comfortable.  We have had two rehearsal with the digital system and both were successful and the musician said they can hear a difference in the monitors.  We have not even installed the version 2 Avioms yet. More to come on that next week.

We have a new (at least new since I have been producing) CG operator for the Edge service…welcome Janet.  The Digico took up a lot of time this week, but I did get to add some curtian slashes behind the drums.  I’m really looking forward to hearing the difference in sound quality over the next few weeks as well as how the A1 take to the new system.

What would I do without Quicksilver?

QuicksilverI can’t tell you how lost I would be without Quicksilver.  OS X is very cool but it is not the same without Quicksilver.  Now that QS is open source I love it even more.  I have been using QS from about the day I got my mac and what makes it great is that I’m still learning things.

I find myself thoughout the day needing to connect to different servers and using the Finder Connect to Server option.  Little did I know that you can just type the URL into QS using the text input option and then hit enter and you are connecting.  That is awesome.  To enter text mode on QS just type a “.” to start.  Go QS!!!

Open Source Software

MacHashMany people know that I have been a big fan of open source software for a long time.  I have been using one form or another for about 10 years now.  Windows was my bread an butter back in the 90’s.  Starting in the year 2000, more and more of my work was moving to open source solutions in the form of Linux and PHP web applications.

Back in 2005, I decided that it was time for me to try out Apple’s OS X and I was hooked.I couldn’t just use the operating system, I had to learn how to code OS X applications.  Wow was that a great experience.  Cocoa is one of the nicest development frameworks I have worked on.  I was somewhat suprised to find out that there was not many good open source Cocoa applications. So I decided that I would write one.  I released MacHash in 2005.  It has been on the back burner for a long time.  I’m bringing it back and will start releasing new versions soon.  If you want more information click here.

Today I have many open source applications that I live by day in and day out:

Adium (iChat could learn much from this application)
Growl
Quicksilver
Cyberduck (Best Mac FTP client)
Firefox