← Back to context

Comment by quink

12 years ago

The one letter abbreviations are neat.

There's no substantial change in readability in going from:

if condition: print "Hello World"

Or: if (condition) { console.log("Hello, World\n"); };

To:

w:condition "Hello, World",!

I never type 'write', but just 'w' instead. Here's a list of commands: http://docs.intersystems.com/cache20131/csp/docbook/DocBook....

> Data right next to your front-end language was neat too.

Don't know about neat, it made it very hard to separate your model from your logic and while convenient at the time that's also quite a bit of a pain.

I guess to me the data thing was neat because you didn't have to bust into another shell just to get at data.

  • Here's how to get a string from your persistent on disk configuration, completely from scratch:

    set foo=^config("foo")

    The '^' means it's a persistent variable.

    Now do this with in the same number of characters either by reading in a flat file or doing an SQL query in any language. I don't think you'll succeed.

    And, yes, it is possible to parameterise this ^config, like so:

    set location="^config"

    set foo=@location@("foo")

    • I don't get it. That seems like a rather trivial library thing to add in most languages, at least ones that let you define operators. Otherwise you'd just fine top-level functions "configp" or whatnot.

      Just like "one letter abbreviations". Again, just "let w = printf" if that's what you're into. I do that kind of stuff all the time, with limited scope.

      1 reply →

    • I could write a library in Scala that allows almost this exact syntax. Say...

      val fooConfig = "config" ^ "foo"

      Of course, there would be some config required. There are various ways to handle that, but it could be as minimal as a single line of code. I don't want to be critical of your work, but my own preference is for languages which are DSL-friendly. Although there are some disadvantages (possible lack of fluidity, mildly more verbose), I feel the advantages (lack of vendor lock in, composable with the rest of the language) are worth the trade-off.

      Admittedly I've never had experience with MUMPS, but I have used PHP. Until pretty recently, that was a language which attempted to break down the barriers between its syntax and the runtime environment at the expense of the language. Reams have been written on the PHP argument, and I won't contribute further here; just noting that my preference for languages with a flexible syntax and a "do it in a library" attitude is based on having experience with the opposite.

      Have you had experience with any of the embeddable-DSL languages (Ruby, Clojure, Scala, Haskell)?

      1 reply →