Jason (jcreed) wrote,
Jason
jcreed

Am I weird for having a weird feeling in my gut about all these (I confess, often quite nice) haskell combinator libraries calling themselves "domain-specific embedded languages", and ns3 calling itself "a network simulator", in a way that makes me expect that it is a nice standalone application, which it is basically not? If you write a bunch of code in an existing language and it requires a bunch more code in that same language to do something real, which compiles and links against that first bit of code, then that sure walks and quacks like a library to my understanding. And there's nothing wrong with that! I'm both mystified at why people do call them by something other than the plain ordinary word that seems to, according to its well-understood meaning, accurately describe what they are, and also slightly why they want to.

Does it not seem appropriate to get a paper or two out of a "mere" (but well-designed and interesting and useful) library you wrote? Do we think only of big fancy soi-disant "languages" and "systems" as being novel and not-just-the-status-quo enough to deserve recognition or something, that people feel forced to stretch the unsexy truth?

The thing that pushed me over the edge was the ns3 tutorial, where it goes:


We typically run scripts under the control of Waf. This allows the build system to ensure that the shared library paths are set correctly and that the libraries are available at run time. To run a program, simply use the --run option in Waf. Let's run the ns-3 equivalent of the ubiquitous hello world program by typing the following:
./waf --run hello-simulator
Waf first checks to make sure that the program is built correctly and executes a build if required. Waf then executes the program, which produces the following output.
Hello Simulator
Congratulations. You are now an ns-3 user. [emphasis original]


And the source code of this thing is
#include "ns3/core-module.h"

NS_LOG_COMPONENT_DEFINE ("HelloSimulator");

using namespace ns3;

  int 
main (int argc, char *argv[])
{
  NS_LOG_UNCOND ("Hello Simulator");
}


And I'm like, yes, okay, this is Hello World, it's not going to be complicated, but come on, you just wrote Hello World in C with a fancy-named macro interposed between you and printf. The "ns3 network simulator" doesn't stop me from including stdio.h and actually calling printf myself, (I know because I just tried) no more than all these Haskell combinator libraries typically prevent me from using arbitrary Haskell code, thus making it much harder to reason about them than it would be if I actually had a well-defined DSL whose operational semantics I knew the clear limits of.

Then the tutorial goes on to walk you through "writing an ns3 script" by which they mean "writing a C++ program that calls the ns3 library". I just feel creeped out by this, since it seems like an overt way of Sapir-Whorfishly changing what I'm doing to something that more prominently features their brand, you know? I feel marketed-to. It's not just brand X breakfast cereal, it's the brand X breakfast experience. It's not just a C++ program that happens to call ns3 library functions, it's an ns3 script.
Tags: networks, programming
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 22 comments