Все вопросы: [dsl]

104 вопросов

7
голосов
6ответов
1090 просмотров

What separates a Ruby DSL from an ordinary API

What are some defining characteristics of a Ruby DSL that separate it from just a regular API?

6
голосов
1ответов
863 просмотров

Base a small expression DSL on the DLR or keep it hand-rolled in F#?

I'm building a spreadsheet-like application, where a lot of small calculations needs to be stitched together in a tree-structure. These calculations are user-defined and I need a way for the user to enter them at runtime. My current approach is to write a small "expression DSL" in F#, where I pa...

46
голосов
6ответов
26015 просмотров

Mini-languages in Python

I'm after creating a simple mini-language parser in Python, programming close to the problem domain and all that. Anyway, I was wondering how the people on here would go around doing that - what are the preferred ways of doing this kind of thing in Python? I'm not going to give specific detail...

5
голосов
7ответов
2896 просмотров

writing a portable domain specific language

I'd like to know good strategies for deploying a domain-specific-language which must run under at least 2 languages (Java, C#) and probably more (Python, and possibly Javascript). Some background. We have developed and deployed a domain-specific language currently written in C#. It's deployed th...

16
голосов
8ответов
2280 просмотров

Domain-specific languages vs. library of functions

This may be subjective, I don't know: I have this problem, which I'm kind of equating to the "what language for this project?" question, since I can't seem to solve it. I've been commisioned to write a book about a certain domain (let's say a very specific branch of physics) for a very technica...

11
голосов
6ответов
3725 просмотров

Is there any way to programmatically generate Python bytecode?

I want to hack around with the Python interpreter and try creating a small DSL . Is there any module where I can do something like this theoretical code (similar to LINQ expression trees)? expression_tree = Function( Print( String('Hello world!') ) ) compile_to_bytecode(expre...

0
голосов
2ответов
445 просмотров

DSL Custom Constructor - only calling when created not loading

Info: VS2010, DSL Toolkit, C# I have a custom constructor on one of my domain classes which adds some child elements. I have an issue as I only want this to run when the domain class element is created , not every time the diagram is opened (which calls the construtors) public Entity(Pa...

1
голосов
1ответов
310 просмотров

Populating a Visual DSL with database information

I have the following problem to solve: Currently we have a metadata tree of the databse schema that has a in-memory representation and a proprietary schema XML serialization as well (that is we can read/write all the in-memory data to an xml file). Currently I am developing a Visual DSL solu...

2
голосов
8ответов
3544 просмотров

How to define a DSL over C#

For a little night project I would like to write a validation component that could be used in .NET application to do the usual and tedious validation of object, input parameters and post conditions. My first idea was to dump all this validation setup logic into a XML configuation file and provid...

2
голосов
2ответов
5964 просмотров

e.data.GetData is always null

I am working with Visual Studio 2010, developing an Extension I need to drag and drop from a WPF TreeView in a Toolwindow onto a DSL Diagram but when I call e.data.GetData I can not get a value and want to know what I am doing wrong private void OnDragDrop(object sender, DragEventArgs e) ...

2
голосов
1ответов
1224 просмотров

Lua Closures in implementing a DSL

Lua has a really nice no-parenthesis call syntax that coupled with function closures allow me to write the following local tag = 1 function test(obj) return function(str) return function (tbl) tbl.objtag = tag tbl.objname = st...

0
голосов
1ответов
108 просмотров

Domain Property as Element and Hiding Default Value Properties

I have two questions How do I achieve the following, I have a domain class called 'Property' - Property has two properties 'Type' and 'Value' it is currently being serialized as the following: <Property Type="TestType"><Value>TestValue<Value><Property> I need it to...

1
голосов
1ответов
359 просмотров

VS2010 and DSL deployment

Can anybody help me on this? I want some guide on how to deploy DSL in vs2010, i use the VSIX output that is in DSLPackageProject\Bin\Debug but when then i want to add that item to some project(File->Add New Item) it just adds dsl but without any DSL functionality that is available in experime...

3
голосов
3ответов
1431 просмотров

Help with learning to use Irony for .net

I am trying to get up to speed with Irony. I keep seeing some terminology that I don't yet understand: terminals, non-terminals, token, state machine, Associativity, Abstract Syntax Tree. Can someone please give some meaning to some of these terms? I keep reading great things about Irony, so any...

15
голосов
8ответов
6908 просмотров

Is metaprogramming possible in Javascript?

During my routine work, i happened to write the chained javascript function which is something like LINQ expression to query the JSON result. var Result = from(obj1).as("x").where("x.id=5").groupby("x.status").having(count("x.status") > 5).select("x.status"); It works perfectly and give the...

10
голосов
1ответов
1175 просмотров

Simplfying DSL written for a C# app with IronPython

Thanks to suggestions from a previous question, I'm busy trying out IronPython, IronRuby and Boo to create a DSL for my C# app. Step one is IronPython, due to the larger user and knowledge base. If I can get something to work well here, I can just stop. Here is my problem: I want my IronPython ...

0
голосов
1ответов
365 просмотров

Extending Jython Syntax

I would like to add syntax to Jython to enable a nicer API for users. For instance, matrix libraries like NumPy would benefit from having both matrix and elementwise operations like Matlab's :* vs. * infix operators. You can create a matrix in Octave using: A = [ 1, 1, 2; 3, 5, 8; 13, 21, 34 ] ...

4
голосов
3ответов
659 просмотров

Infix operators in Scala and Jython

I'm evaluating languages for a computational oriented app that needs an easy embedded scripting language for end users. I have been thinking of using Scala as the main underlying language and Jython for the scripting interface. An appeal of Scala is that I can define methods such as :* for eleme...

0
голосов
2ответов
472 просмотров

DSL Add Root Element to Serialization

I am looking for help to achieve the following The Diagram represents a car, users can add engine and colour when I view the XML it looks like this: <Car> <Engine>BigEngine</Engine> <Colour>Pink</Colour> </Car> What I would like to do is to wrap the ca...

1
голосов
1ответов
135 просмотров

Resolving problems with DSL SetUp project

I'm fighting with the InstallerDefinition.dslsetup file in a DSL setup project. I'm getting the following error: Running transformation: The setup project could not retrieve the output path for project 'PsiTraffic.Modeling.PomModel.Dsl' from the environment. Ensure that this project exists in th...

4
голосов
5ответов
2918 просмотров

Parser generator for Delphi?

Can anyone recommend a parser generator that will produce win32 Delphi code? What I'm trying to do is create a simple Domain-Specific Language.

3
голосов
3ответов
792 просмотров

Haskell equivalent of Python's "Construct"

Construct is a DSL implemented in Python used to describe data structures (binary and textual). Once you have the data structure described, construct can parse and build it for you. Which is good ("DRY", "Declarative", "Denotational-Semantics"...) Usage example: # code from construct.formats.gr...

1
голосов
1ответов
369 просмотров

How to fix blurred Icon Decorator on DSL Tools?

I faced this problem and after an extensive research I found its root cause and a workaround that can be useful for other people. The icon decorator becomes "blurred" because its positioning on the shape and the conversion from pixels to inches. Usually the drawing surface of the Domain Specifi...

2
голосов
2ответов
7709 просмотров

StructureMap Exception Code: 202 No Default Instance defined

When I register the following in SM and then attempt to create an instance I get the exception - 'StructureMap Exception Code: 202 No Default Instance defined for PluginFamily...' Scan(x => { x.Assembly("MVCDemo"); x.Assembly("MVCDemo.Infrastructure"); ...

1
голосов
3ответов
606 просмотров

What is the difference between "DSL Tools" and "Oslo"?

I've just started playing with domain-specific tools development, and I'm playing with Visual Studio SDK DSL Tools. However, I heard that Microsoft have another initiative into domain-specific development called "Oslo". My impression is that DSL Tools is focused on graphical domain-specific lang...

0
голосов
2ответов
508 просмотров

Visual Studio DSL Tools and Server Explorer

Is it possible to enable users to drag and drop a Table from the Visual Studio Server Explorer onto my own DSL Diagram? I can drop custom Domain Classes I have created but want to make use of the build in funcationality. I am working in Visual Studio 2010.

7
голосов
3ответов
23650 просмотров

log4j in grails : how to log into file?

I have this log4j configuration in my grails config.groovy log4j = { error 'org.codehaus.groovy.grails.web.servlet', // controllers 'org.codehaus.groovy.grails.web.pages' // GSP warn 'org.mortbay.log' appenders { rollingFile name:'infoLog', file:'in...

2
голосов
3ответов
87 просмотров

Language to express complex time multi-intervals?

I'm wondering if anyone knows of any declarative language to express absolute date-time multi-intervals. I mean sets which are the union/intersection/complement of time intervals. Intervals I would like to represent are like: ( (from the second day of the month to the 10th) intersection (mont...

18
голосов
12ответов
1461 просмотров

Для каких проблем вы пишете DSL?

Мне просто интересно узнать о доменных языках. Я видел их несколько раз в статьях, и мне кажется, что их можно использовать вне гарантий или проблем определения банковских данных. Итак, я пришел в SO, чтобы получить конкретную информацию. Вы когда-нибудь пользовались DSL? Напишите один. Ес...

1
голосов
1ответов
376 просмотров

Как решить «DomainClass XXX не является абстрактным, не является ни корнем модели, ни встроенным в нее». предупреждение

В VisualStudio я получаю следующее предупреждение: «DomainClass ManagedField не является абстрактным, не является ни корнем модели, ни встроенным в нее». Предупреждение верное, мой класс не является абстрактным (и не должен быть), и он не должен быть корнем модели. Итак, дело доходит до по...