Archive for the 'Ruby' Category
Creating a Binary File Using a Ruby DSL
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
Why C Switch Statements Should go the way of the GOTO
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
Ruby Shell as Domain Specific Language
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.
Comments are off for this postNetcat Clone in Three Languages – Part I (Ruby)
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.
3 commentsConverting hex to Binary in 4 Languages
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