Stickybits

Blog Categories
Twitter Updates
    follow me on Twitter
    Currently Reading
    Powered by Squarespace
    Git Projects
    Sunday
    Jan032010

    Erlang Quick Tip: The user_default module

    If you are anything like me you spend a lot of your time in the erlang shell debuging and testing your code. And some commands are used more than others but they may be a bit on the long side and you may make regular errors while typing it. One of these wonderful functions is make:all([load]). that will compile using your Emakefile and then magically reload the newly compiled modules into the running shell. What I reglarly do is to type load instead of [load]. Enter the user_default module.

    Click to read more ...

    Thursday
    Dec172009

    Edging your way towards Ruby 1.9.1 and Rails 3.0pre

    The Rails 3 release is expected any day now but many of you, like me, may not have the patience to wait until release to start fiddling with it. So why not take the time and do some Ruby 1.9 testing at the same time. We have all been delaying the 1.9 switch but the fact is that 1.9.1 is the current stable version of Ruby and we should all really be using it for new projects. Sure there may be some gems we may need that are not 1.9 compatible yet but that is just a perfect opportunity for you to learn the new features of the current Ruby release. I can think of no better Ruby 1.9 learning tool for you than updating that gem, that you need, to a 1.9 compatible status. Also we should always remember when we build our applications that we probably saved ourselves many many days buy using work that others have done and given away. The least we can do is to spend an hour fixing that bug.

    EDIT: Some people prefer installing using RVM(Ruby Version Manager). I personally am a source guy but feel free to check the comments below for the RVM install info and skipping to the Rails part.

    EDIT 2: Rails is now available as a pre-release gem and the rails installation step here is out of date.

    There are many tutorials out there on how to install Ruby 1.9 but most of them involve installing the binaries with a "*19" suffix leaving you with 2 names for ruby. One called ruby and other called ruby19. I really dislike this methods as I see multiple ways how that can be annoying. I prefer my Ruby being called ruby so I usually install it in some directory that I can easily switch to by adding or removing a directory from the path.

    Click to read more ...

    Friday
    Apr102009

    Power CouchDB - Basic HTTP Handlers

    You may know CouchDB's mostly as a kick ass document store but you can use it's base for many great things. Thanks to the fact that CouchDB is an amazingly well written and very modular piece of technology. It is easy to extend it and add your custom code to all areas of CouchDB. If you want to use your own language for views you can add it without even touching the CouchDB code. Write your own authentication handlers connected to LDAP or even CouchDB itself in just a few lines of erlang.

    Click to read more ...

    Thursday
    Jan152009

    The State of Me - Jan 2009

    Well. Just a little status update on me and my various projects for 2008.

    2008 was a good year for me and my education as a developer. I got to know Erlang at the middle of the year and by the end of the year I was almost exclusively coding in Erlang. I have also started learning some standard C for playing with Arduino. I also learned the basics of Emacs and so far I like it though I still use Textmate for many things. And I started using Git and Github. I was to begin with skeptical about it and the fact that Linus Thorvalds was a bit of a dick when talking about it didn't help. But once I tried it I found it to be very productive and combined with GitHub it's quickly revolutionizing open source development in the world.

    I became a contributor to the Nitrogen Web Framework. I have many ideas for it and hope to add many things to it. Nitrogen is at a very exciting stage as we are finding the path we want to take and can make many choices at this stage.

    Is started playing with a little project I call CouchMail. It's basically a quick ugly hack to research gluing together a mail server with Nitrogen, Cappuccino, Mochiweb and finally CouchDB for data storage. If this works out ok I may consider writing a real application from scratch from what I learn.

    I forked CouchDBX and completely rewrote the UI. I like my changes as they remove CouchDB from the desktop and you don't have to know about it until it is needed. I have most of the new code needed for CouchDB 0.9.0 ready so it should come out as soon as the new CouchDB is released.

    ErlangXcode is an attempt to make Apple's Xcode 3 IDE be a kick ass Erlang IDE. A lot of the basic syntax is there with some, like records, still to be implemented. Also a basic build system in place and compilation errors show up in-code. I had to take a bit a break from it before going nuts though. Xcode's plugin system is 100% undocumented and there is no way do debug anything. What you have to do is to make small changes, compile and then reboot Xcode. There are no errors. The code just works, quietly doesn't work or it crashes Xcode. Hopefully I will quickly have energy to deal with it again soon. I did however start a little wiki project at google code documenting the xcode plugin system.

    Finally there is a little project I started in the middle of the year called AstAssist. It's in a bit of a pause at the moment but basically it is an Erlang based system for Asterisk management. It's a complete solution for configuration, monitoring, event parsing, fastagi and so on. I have some of the basics done and hope to continue later in the year.

    Well.. That's the bullet points. Hope some or all of these will become something amazing in 2009.

    Thursday
    Dec182008

    Erlang Web Development Frameworks

    Web Frameworks.

    I'm going to mention the two of the most interesting web frameworks out there. They choose a very different path and I would call both of them production ready. As they are both projects in active development you might have a problem with a new release breaking a few things.

    Nitrogen

    Nitrogen is the new kid on the scene but has quickly become my favorite framework. Unlike most frameworks it's event driven. I enjoy it even more than Rails at the moment. It's dead simple to get started in and very powerful. It's in very active development and new and cool features are added almost weekly. The last new feature added was the simplest but one of the most powerful Comet implementation out there.

    ONe of it's drawbacks is that there is no routing system in it. Paths are defined by the module names. So web_index.erl becomes /web/index or /web and web_blog_comment.erl becomes /web/blog/comment. Some might find this a bit limiting.

    There are many cool features planned and one of the most interesting is implementing Erlangs power to be a distributed web frameworks. Thus solving many of the problems of scalability that many other web frameworks have

    Pros:

    • Dead simple.
    • Nice bindings system.
    • Kick ass Comet support.
    • Interesting future ideas.

    Cons:

    • No routing at the moment.
    • A little too simple on the template side.
    • Really young so no real documentation yet.

    Erlang Web

    I have not much experience with Erlang Web but many seem to have started using it. It's and MVC framework built on OTP principles and uses many standard Erlang practices. It's template system on first view reminds me a bit of good old WebObjects. Currently it supports INETS and Yaws but not MochiWeb at the moment.

    Pros:

    • Very Flexible.
    • Powerful template language.
    • OTP Principles.

    Cons:

    • Could be simpler.
    • Needs way better documentation.

    Template Languages

    Sometimes you may just want something simpler. Just a little template engine on a custom built web server to show some dynamic data. Or for use in your own web framework. Here are 2 notable template engines.

    HERML

    HERML is an erlang implementation of the HAML markup language. It's quick and simple but remember that this skips HTML altogether so it might not be for everyone.

    ErlyDTL

    ErlyDTL is an erlang implementation of the Django Template Language. I personally found DTL to be Django's most anoying feature but as many people like it it's best to mention it.

    Fork me on GitHub