Archive for the 'Ruby' Category

Creating a Binary File Using a Ruby DSL

March 25th, 2008 | Category: Networking, Programming, Ruby, XML

So I used ruby to convert a simple hex string into a binary file in Converting hex to Binary in 4 Languages. Today I was trying to create a mixed ascii/binary file at work and created a little Domain Specific Language that has good possibilities.

NOTE: There is an expanded version of this script here: A Better Binary File Generator DSL in Ruby
Read more

Comments are off for this post

Why C Switch Statements Should go the way of the GOTO

March 15th, 2008 | Category: C, C#, Programming, Ruby

The venerable C switch statement keeps showing up in other languages presumably because the people who write new languages are familiar with C and don’t really think about it.
Read more

2 comments

Ruby Shell as Domain Specific Language

February 27th, 2008 | Category: Programming, Ruby

My favorite example of a DSL is the latest jmock API just because you really have to fight the language. Fortunately Ruby makes things easier. I’ve been thinking a shell in ruby might be a nice change of pace so this is a small example of how to go about implementing one.

Read more

Comments are off for this post

Netcat Clone in Three Languages – Part I (Ruby)

February 20th, 2008 | Category: Networking, Perl, Programming, Ruby, XML

I thought I’d continue my series of writing the same application in multiple languages by trying to clone the wonderful network tool: netcat. For the first installation I’m going to try it in Ruby.

Read more

3 comments

Converting hex to Binary in 4 Languages

February 18th, 2008 | Category: C, Perl, Programming, Python, Ruby

I’ve been playing around with some scripting languages recently so I thought I’d do a small example in a few different languages for laughs.
Read more

5 comments

« Previous Page