Archive

Archive for the ‘scala’ Category

System76 brings linux to the laptop – finally

February 2nd, 2011

I started using linux in 1995 as my primary operating system. Back then it was Slackware and took a LUG in order to even get your desktop to work. If anything changed in the kernel or on your hardware you were pretty much SOL. I rocked linux on an IBM dual processor desktop called Vador for most of my college years. I even had dual 21″CRT monitors which was about as baller as it got back then. RedHat 5 made the world a lot better but it was still a chore to install. In early 1998 I purchased my first gateway laptop. Gateway actually supported linux drivers for their laptops back then. This is before they started “apple” style stores and selling tv’s which ultimately lead to their demise. I kept my faith in linux. Then I bought a dell, HP, dell, and they all sucked. Power management, sound cards, external displays, cd writers, etc  all never worked the way they were suppose to. At least the way that it did on windows. Around that time Apple dropped their crappy OS and released OSX 10! The holy grail to laptops developers. I purchased the very first 17″ MBP that I could. 5 MBP later and about 40 for T8 Webware I still think they are the best laptop hardware I have ever owned….. Until last week.

For fun… OK for 16Gigs of ram and 8 cores of sandy bridge processor with a bad ass screen I ordered a decked out System 76 Gazelle. This pimped out machine was only 1700 too! Because a lot of the work I have been doing latly has been with Scala parallel collections and specifically akka for parallel processing it felt like a good excuse for testing. I was also jazzed to no longer deal with MacPorts or HomeBrew just Ubuntu Linux with EVERYTHING working. Remember why we all bought macbook pro’s as developers? So that everything worked. We all loved linux but we all needed to get things done. Messing with why our battery died when we shut the lid was not something that you could charge a client for! Developers we finally have a linux laptop that boots faster than a MBP, you can shut the lid and it works, and all the drivers for every port work out of the box. It even has a finger print scanner that is tied into authentication. With a laptop like this and the current anti developer mantra of apple we could actually all switch back to linux?!? Kind of crazy i know.

Regardless! Thank you System76. I never thought that the day would come were linux on a laptop was pleasant. Your product makes Linux on the laptop like the server, it just works. After 16 years of being a Linux advocate I feel like system76 makes it a reality for daily use.

scala

Scala is easier than PHP

November 17th, 2010

OK, that was a bit of link bating. However for the types of problems that I am currently working on it really is!  I have been asked a couple hundred times in the last 8 months why I tweet about Scala and Hbase all the time. The larger post is coming but I figured I could answer the technical scala question first. In order to stop the comment flames let’s start by saying that I know PHP better than most human beings. It is something that I have been coding in since PHP 3 and have really enjoyed the language the entire time. I still believe that PHP is the best language for the web for the majority of programmers; it quite possibly has the best documentation and examples of any language like a DSL for the web! I am still slinging PHP and so is my company. I have been a speaker at lots of php conferences, aided in php’s documentation, enjoyed the community, and for the past three years have been Zend Framework committer. That’s all to say that there are lots of other PHP developers that are smarter than me; but I probably have met them.

So why is Scala easier? First it’s easier when you have more requests than you know what to do with. Fundamentally it’s easier because it does so much under the hood for solving concurrency issues in a syntactically concise manor. I have found that as I have moved from writing code that is designed to persist data to a system of service that consist of multiple UI and data service inputs and outputs with different hotspots and unique data mutations requires a different toolset. Partial functions, mutable and immutable types playing together, and scala’s collection library just make this simple. If the system grows just snap on a trait to add what you forgot.  Let’s take Twitter for example. Robey  Pointer wrote Kestrel, and probably others that I don’t know, that enables a lot of real-time scale for them.  Kestrel is a loosely ordered message queue that eloquently wraps scala’s mutable queue hashmap with a swarm of actors to attack the queue. Not to short change Robey as his guthub account is one of the best in the community! But the scaffolding of scala really makes this solution possible. The syntax of scala and ease of deployment also probably made it a reasonable goal to attack while #failwail’s were abound!

Obviously many people have dealt with this scale  problem in PHP successfully. I however find it very difficult to mentor people through the depths of hell that I have been through. When it comes to scalability in PHP this is what your resume looks like.

  • Fantastic at PHP internals
  • Amazing at Apache HTTPD and compiling appropriate PHP extensions.
  • Nginx
  • BigIP – More than round robin load balancing
  • Intimately know how sessions work and probably write your own handlers
  • Memcached
  • APC
  • AMQP
  • BeanStalkd
  • Code based sharding or at least master/slave logic
  • C/C++
  • Lots of security! It’s a problem with all dynamic languages.
  • Zend Framework.

FYI the latest Zend Cluster Server really makes a TON of this easier! Bravo!

This is a really hard resume to replicate. I know; I have tried! More importantly it is very hard to debug. As we continue to add more screens, more protocols, and more data aggregation services, and frankly more data we need to be able use all cores in the server and the cluster. As Guy Steele implied at Strange Loop. The single processor programming model is going the way of the punch card.

What about bringing a scala programmer on board?

This is a scala resume.

It really is a grind to overcome that first 4-6 months but if you need scale I would recommend taking the haul. It will change how you think about problems forever. There is nothing like having your entire system in source code that can be type checked in your IDE as you write. No need for amqp with actors, no beanstalkd with mutable queues, and it’s fast as hell!

If joomla and wordpress do everything you need, then your cool! Just like my lame blog! In the same vain I believe that PostgreSQL is the best database for the majority of data persistence scenarios. Hopefully my next post will be why HBase is the bomb!

Special thanks to the following scala studs for getting me past the grind. I really appreaciate the community support so far! Follow these guys on twitter and read their blogs. They are leaders in the scala community but have still taken the time to answer my neive questions! Almost everything I know has come from their books or blog posts.

So is scala hard? Sure, but I personally recommend never bringing a knife to a gun fight. Especially when the competition has Uzi’s!

Wade

scala