0

I've used and created domain-specific languages before, plenty of times (e.g. using yacc/lex). Normally we'd start with grammar written in BNF, and a bunch of keywords. This is easy to do, easy to share.

Recently, I've started working with diagrammatic programming languages - closest parallel is circuit-diagrams in electronics, where it's very difficult to express ideas in text, but very easy to express them in wiring-diagrams.

This is a new and novel problem for me: how to efficiently express these mini-languages, and share concepts in them with colleagues?

(i.e. how to whiteboard-program within them. Actual programming is easy - you have physical components to hand)

Are there tools for this? Or good/best practices (e.g. equivalent of "always use BNF as starting point for your new DSL, and use tools like yacc to generate the parser, compiler, etc"). My googlefu is proving weak - all I get is false positives for wiring diagrams, and UML editors (since these are custom languages, UML doesn't seem to help)

  • meta.programmers.stackexchange.com/questions/6483/… (it's the same here as at Stack Overflow) – gnat May 28 '14 at 19:04
  • @gnat That page contains many, many independent items. I'm afraid I have no idea which of them you're referring to, nor why. – Adam May 28 '14 at 19:11
  • "product or service recommendations" are explicitly off-topic per help center. See also: Why is asking a question on “best practice” a bad thing? – gnat May 28 '14 at 19:12
  • 4
    I don't have a problem with the whole "is there such a thing" aspect of this question. What I do struggle with is what problem you're trying to solve here specifically. Are you trying to write a Visual Programming Language? Or is the problem more specific than that? Are you trying to figure out how to model lines and connectors in a textual way? See also en.wikipedia.org/wiki/Verilog – Robert Harvey May 28 '14 at 19:22
  • Aren't diagrammatic languages just a nice UI overtop of an AST? Couldn't you have a textual version of the language that is simply a different view of the AST? I'd be inclined to start with BNF and similar tools for the (perhaps awkward) text version and then layer the UI on top of it. – Telastyn May 28 '14 at 21:21
1

There are tools available that will allow you to represent your DSL graphically and then use the graphic representation to "program" the DSL. These are called "DSL Workbenches"

Right now the only DSL workbench that I can think of that is specifically targetting Graphic DSLs is Microsoft's DSL Tools. There might be others out there, but that's the only one that has hit my radar.

1

I am not aware of any tools that are generic enough for your purposes but perhaps I can help with your Google-Fu...

If you are not familiar with the concept of Dataflow programming languages the wikipedia article is a great place to start - it should at least help make your google-searches a little more targeted to more appropriate content.

I would also recommend that you check out some of the graphical programming languages described there, especially LabView/G. My thought here is that the symbolic languages used in such tools can be easily mimicked in tools like Visio. I am someone who uses pictures and diagrams a lot to communicate with my technical peers and over time I have come to adopt a kind of visual short-hand that looks a lot like LabView's programming language - especially when I am trying to communicate something in the realm of parallelism or multi-threading. I have a set of VISIO template shapes that I use for this purpose... it was a little spendy in terms of VISIO shape authoring learning curve but I think it was worth it.

-2

Not sure, if is what you are looking for, but, aA visual way to express a programming language are "Syntax diagrams", also known as "RailRoad diagrams"

http://en.wikipedia.org/wiki/Syntax_diagram

Good Luck

  • 1
    He's not looking for a visual way to express a programming language, he's looking for a way to express a visual programming language. – Jörg W Mittag May 29 '14 at 1:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.