Software Product Lines (SPL) for Domain Specific Languages (DSL) [closed] - dsl

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Does it make sense to focus on Domain Specifics Languages (DSL) development following a Software Product Line approach?
Does anyone know any other approach to create and maintain several related Domain Specifics Languages at the same time? Note that to support a custom language, requires support multiple tools, from parser, compilers, interpreters, to current state of art IDE, etc.

Our DMS Software Reengineering Toolkit is exactly this idea. DMS provides generic parsing, tree building, analyzes (name resolution, control flow anlaysis, data flow analyis, call graphs and points-to analysis, custom analyzers, arbitrary transformations). It has a variety of legacy language front ends, as well as some DSLs (e.g., HTML, XML, temporal logic equations, industrial controller languages, ...) off-the-shelf, but has very good support for defining other DSLs.
We use DMS both to build custom analyzers and transformation tools, but also as product-line generator. For example, we provide test coverage, profilers, smart differencers, and clone detections for a wide variety of languages... because DMS makes this possible. Yes, this lowers our dev and maintenance costs because each of these tool types uses DMS directly as a foundation. Fundamentally, it allows the amortization of language parsers, analyzers and transformers not only across specific languages, but across dialects of those languages and even different languages.

I think it makes sense to focus on DSLs following a Software Product Line approach. If you define the DSL correctly, it will essentially define a framework for creating applications within in a domain and an operating environment in which they execute in. By operating environment, I mean the OS, hardware, and database, as well as the code that implements the semantics or run time environment of the DSL. The framework and operating environment will be the artifacts that get reused across product lines. You may have to create an operating environment that consists of run time environments for multiple DSLs to support multiple product lines.

Related

Can a Haskell program resemble objects passing messages to each other? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Haskell is a purely functional language, breaking from traditional object-oriented languages. However, consider the following quote from Alan Kay on the "true" meaning of OOP:
OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I’m not aware of them. -- Alan Kay
and later on:
I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages (so messaging came at the very beginning -- it took a while to see how to do messaging in a programming language efficiently enough to be useful).
I'm curious to what extent this style of programming can be achieved in Haskell. In particular, is it possible to structure a Haskell program as a sequence of (something resembling) encapsulated objects passing messages back and forth to each other?
NOTE: I'm looking for examples specific to Haskell, not functional languages at large (when in conflict).
only messaging, local retention and protection and hiding of
state-process
like biological cells and/or individual computers on a network, only
able to communicate with messages
I believe certain Haskell programming patterns do resemble Kay's description, to a degree.
In streaming libraries like conduit, pipes or streaming, it is common to build a computation as a pipeline composed of different stages. Each part of the pipeline is quite independent of the others and can maintain its own private state (you can have "shared" state in the pipeline as well).
The topologies tend to be linear and unidirectional. That said, abstractions like conduit's ZipSink—and the Applicative instance for Folds in the foldl package—let you build "tree-like" topologies that branch out. And pipes can be bidirectional, although I haven't seen many examples that make use of it.
Then there's arrowized functional reactive programming. It lets you build "circuits" of automaton arrows that can even include loops. Each part of the circuit can maintain its own state. As the description of the netwire FRP library states:
This library provides interfaces for and implements wire arrows useful
both for functional reactive programming (FRP) and locally stateful
programming (LSP).
And from the docs of the auto library:
auto works by providing a type that encapsulates value stream
transformers, or locally stateful functions; by specifying your
program as a (potentially cyclic) graph of relationships between value
streams, you create a way of declaring a system based simply on static
relationships between quantities.
Instead of a state monad type solution, where all functions have
access to a rigid global state, auto works by specifying relationships
which each exist independently and on their own, without any global
state.

can I use different two class diagrams for two different environments? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I'm working on project for two different environment which are iOS and Android, and it's so hared for me to design one class diagram for two different systems, so can I use two class diagrams, one for android and the other for iOS ?
I mean it doesn't make any sense to use the same class diagram for two environments which use two different programming languages
It doesn't matter how many diagrams you make. In general it is considered a best practice not to overload your diagram with too much classes, so you should have multiple class diagrams for anything but a trivial model.
But I'm guessing the real question is whether or not you want to use the same classes when targeting a different platform.
That depends on the level of abstraction you are modelling on. MDA defines three levels
CIM -> Computation Independent Model
PIM -> Platform Independent Model
PSM -> Platform Specific Model
Which more or less is equivalent to the Conceptual/Logical/Physical layers defined in Zachman or IAF.
So if you are modeling on a CIM or PIM level then you should use the same classes. If you are modeling on a PSM level then should to use different classes for the parts of your system that depend on any of the specifics of your platform.
Look into the Adapter Pattern for a possible way to deal with multiple platforms while still keeping the core business logic of your application platform independent.
UML diagrams weren't made for specific languages or APIs. If both languages are object oriented, I don't see any why you would need two different class diagrams.
The problem I think is that you are putting in "too much" details in the UML, which should not be the case. Let the UML communicate the structure, behavior or nature of interaction between the classes not the nity-gritty details.
It would only make more sense when the languages are significantly different like javascript is event-driven, while LISP is functional.

Are Domain Specific Languages (DSL) bad for the Common Programmer? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have lately been delving into F# and the new DSL stuff as in the Microsoft SQL Server Modelling CTP, and have some concerns.
Will this new idea that will come about be bad for skilled programmers?
Is code going to be dumbed down?
I know I sound like a luddite, but this does worry me, after spending years of time practising in my craft, and now might be scuttled by genius from within.
I am afraid, very afraid.
Will I be now trapped in a job that only programs against a DSL and therefore every job that I work on, I have to learn a whole new DSL based on top of a Framework (.net Java), that I will only be allowed to touch certain parts of.
I don't think the world is ready for DSL, but the sales pitch is deafening!
DSLs will liberate programmers from doing a non-programming stuff. Cleaner separation of responsibilities is always a good idea. Programmers should program (e.g., implement DSLs), and other domain experts should do what they are good in. I am personally doing whatever I can to turn this industry towards a wider use of DSLs. I do not want to code business logic. I love to implement compilers. So I'm not afraid. I am looking forward for a time when every little task will require its own little DSL.
There will always be a need for real, knowledgeable programmers to construct those DSLs and to add new capabilities to them as requirements change. No problem domain is static.
I wouldn't worry, DSL's are a long, long, long ways away from being embraced by your average corporate IT department.
I am developer and I frequently design my own DSLs and DSL2Text transformations to speed up many boring parts of my job. To this end I use the Eclipse plugins (i.e. EMF, XText, ACceleo, etc.) as explained in this site http://lowcoupling.com/dslengineering
I think DSLs in reality will elevate the levels of software engineering work. Here are the reasons:
Think of ORM or SQL DSLs. It models SQL access in your native programming language. It reduces complexity, allows higher level constructs, is more readable and is less error prone (than SQL string manipulation). A good SQL DSL is composable. Trying to achieve what a SQL DSL does with Ad Hoc code on the fly is way too difficult and error prone. In this case, a DSL reduces mundane complexity and elevate the level of your code into higher level abstractions. (Same concept as we don't want to code every TCP/IP handshake every time we open a TCP connection).
Many DSLs are not meant for software programmers. When we design DSLs, often they are handed off to domain experts (who are non-programmers) to use. These easier DSLs will not require programmers, so you won't be stuck using them. The software field is currently dumbed down because we have schools churning out programmers that code simple ASP.Net pages. Shifting these type of mundane work to non-programmers will force schools to produce higher quality engineers.
Good DSLs hide complexity, but they are flexible, and allow users to customize/fine tune behaviors when needed. This means they won't confine programmers into rigid/mundane coding behaviors.
When a problem is highly complex, it's usually better to reduce it into a domain specific problem and construct a mini DSL for it. DSL code is simply more relevant and easier to maintain, and the business logic will be shorter, easier to verify and easier to reason.

Diagramming program to help in designing software? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm looking for a diagramming program that can help in designing software, right from the high-level requirements down to the low-level classes and functions.
I've seen a lot of UML programs, but they don't let you design at multiple levels of detail in the same map, like if you could "zoom in" and design the details of a part.
Do programs exist that help in such designing? Programs that let you design at the high-level and low-level on the same map?
Most of the UML products from large vendors will let you do what you want. "Rational Rose" and "Enterprise Architect" are just two examples that I have used. They both let you mix component, package and class level information in the same view. Both of them provide a way to specify requirements as part of the meta-data to a class and I believe, functions too.
Edit 8/23/09
I just found Topcased. It's free and does many of the same things as Rose & EA. I'm not sure about mixing different diagram types in one view, but you might want to give it a shot. I'm definitely going to investigate using it for my personal projects.
I recommend BOUML. It's a free UML modelling application, which:
has a great SVG export support, which is important, because viewing large graphs in vector format, which scales fast in e.g. Firefox, is very convenient (you can quickly switch between "birds eye" view and class detail view),
this can work as the "zoom" feature you're asking (I use such SVG exports my self, to be able to quickly overview relation of group of classes, and then zoom in into details of selected one),
is extremely fast (fastest UML tool ever created, check out benchmarks),
has rock solid C++, Java, PHP and others import support,
is multiplatform (Linux, Windows, other OSes),
is full featured, impressively intensively developed (look at development history, it's hard to believe that such fast progress is possible).
supports plugins, has modular architecture (this allows user contributions, looks like BOUML community is forming up)
The "zoom" feature you're asking can be obtained through SVG export. I use such exports my self in the way you're asking.
I've used Rational Rose and looks like it fits your needs.
You could try BOUML which, although it doesn't allow you to "zoom in", does cover all the aspects of UML, and allows you to view different parts of the design at once (in multiple windows). It is also free, which may or may not make it more desirable for you, and is quite cross platform.
First of all there are different diagrams for different things you want to express. During software design you dont only use UML, but also HTML sketches and things like that. So choose the right tool for the right task is my advice. Create a folder structure depending on your granularity, one for Frontend sketches (you can place it hiracially), one for class diagrams and so on. So try to establish a process that fullfils all your needs. Often the holy grail programm doenst exist or is not good, just because of the fact that it tries to satisfy to many customers.

Agent-based modeling resources [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I would like to know what kind of toolkits, languages, libraries exist for agent-based modeling and what are the pros/cons of them?
Some examples of what I am thinking of are
Swarm, Repast, and MASS.
I found a survey from June 2009 that answer your question:
Survey of Agent Based Modelling and Simulation Tools
Au. R.J. Allan
Abstract
Agent Based Modelling and Simulation is a computationally
demanding technique based on discrete event simulation and having its
origins in genetic algorithms. It is a powerful technique for
simulating dynamic complex systems and observing “emergent” behaviour.
The most common uses of ABMS are in social simulation and optimisation
problems, such as traffic flow and supply chains. We will investigate
other uses in computational science and engineering. ABMS has been
adapted to run on novel architectures such as GPGPU (e.g. nVidia using
CUDA). Argonne National Laboratory have a Web site on Exascale ABMS
and have run models on the IBM BlueGene with funding from the SciDAC
Programme. We plan to organise a workshop on ABMS methodolgies and
applications in summer of 2009. Keywords agent based modelling,
Archaeology
http://epubs.cclrc.ac.uk/bitstream/3637/ABMS.pdf
I also recommend NetLogo. It is an IDE+environment+programming language based on logo (which was based on Lisp) which lets you build multi-agent models extremely fast. I have found that I can reproduce (simulate) algorithms from research articles in a couple of hours, algorithms that would have taken weeks to implement with other libraries.
You can check some of my models at this page.
I got introduced to Dramatis at OSCON 2008, it is an Agent based framework for Ruby and Python. The author (Steven Parkes) has some references in his blog and is working at running a language agnostic Actors discussion list.
This page at erights.org has a great set of references to, what I think are, the core papers that introduce and explore the Actors message passing model.
There is also a pretty good link in wikipedia:
http://en.wikipedia.org/wiki/Comparison_of_agent-based_modeling_software
On the modelling side, have a look at FAML, an agent-oriented modelling language. This is a pretty academic paper, but it may help depending on your interests: http://ieeexplore.ieee.org/xpl/freepre_abs_all.jsp?isnumber=4359463&arnumber=4967615
I know this is an old thread, but I thought it would not hurt to add some extra info. There is a great new website which is dedicated to agent-based modeling. The site contains links to papers, tutorials, tools, resources, and researchers working on agent-based modeling in a number of fields.
you should also have a look at Madkit and Turtlekit
Old thread, but for completeness there is also Anylogic and pyabm which can be used for ABMs.
I have experience programming agent-based models in several environments / languages. My opinion is that if you want to implement a relatively simple model, use Netlogo. It's also possible to use Netlogo for heavy-duty models as well (I've done this successfully), but at some point the flexibility of a programming language like java/python/c++ outweighs the convenience of the native methods available in Netlogo, especially when performance becomes a major issue.
Repast is becoming a bit bloated. If you are an experienced programmer, all you really need to start building an ABM is the ability to schedule events and draw random numbers. The rest (defining agents / environments and their behaviors) you can craft on your own. When it comes to managing the objects in your model, use the regular data structures you're used to (arrays / hashes / trees / etc.). To this end, I'm developing a very lightweight Java library called "ABMUtils" (on github) that implements a scheduler and wraps a random number generator. This is in the early development stage but I expect to flesh things out (keeping it simple) over the coming months.
If you are an evolutionary economist you can also check Laboratory for Simulation Development (LSD).
PHP and Java developers should take a look at KATO.

Resources