Skip to main content

Questions tagged [dsl]

Domain-specific languages are computer languages specialized to a particular application domain. Examples are HTML, Unix shell scripts and MediaWiki templates.

Filter by
Sorted by
Tagged with
1 vote
0 answers
121 views

Extract common parts of Jenkins JobDSL job definitions into reusable functions

I have many Jenkins jobs looking approximately like the example below. I wanted to create reusable functions to encapsulate repetitive parts of the Jenkins Job DSL, so that I can then apply these ...
user7610's user avatar
  • 569
2 votes
0 answers
48 views

Print columns of text without hard coding the width (attempt 6 - pivot edition)

If you'd like to pivot this: ...
candied_orange's user avatar
4 votes
0 answers
80 views

Print columns of text without hard coding the width (attempt 5)

If you'd like to print this: ...
candied_orange's user avatar
4 votes
2 answers
102 views

Extensible typing system for a strongly-typed DSL

I recently finished cleaning up my code in a compiler/interpreter for a strongly-typed domain-specific language, which makes use of three sorts of types: Compile-time enumerated types: Have one of a ...
P...'s user avatar
  • 141
0 votes
1 answer
441 views

Assert MockMvc response by using Kotlin DSL

I build web application using Kotlin and Spring Boot, I use MockMvc to write integration test. I'm not satisfied how assertion looks like, here is typical assertion: ...
Mateusz's user avatar
  • 113
8 votes
2 answers
357 views

Constructing a DSL with properties instead of functions, for use in a type-safe pseudo-builder

As one step in a larger builder setup, I need to build a small collection of objects, each with a small number of required attributes, and each of those with a small set of possible values. The actual ...
Mike M.'s user avatar
  • 223
1 vote
0 answers
64 views

DSL for hierarchical class API definitions

What do you think about syntax of my strictly typed DSL snippet below? Does it look understandable and efficient to define object graphs at a first glance? ...
Dmitry Nogin's user avatar
  • 6,131
1 vote
0 answers
395 views

Extending kotlinx.html dsl to create functions that include bootstrap classes

I'm looking to create a library that extends kotlinx.html and will include functions that have default css classes. The goal is to be able to use a function row{} ...
Johan Vergeer's user avatar
2 votes
0 answers
111 views

Business Rule DSL for Values in Domain-Driven Design

Following the patterns from the book Domain Modeling Made Functional, I am implementing a single-case union for the simple values in my domain model instead of using primitives. The union cases have ...
Aaron M. Eshbach's user avatar
3 votes
1 answer
1k views

AutoMapper DSL (Computation Expression) for F#

I have created a DSL for AutoMapper using an F# Computation Expression Builder. The Computation Builder itself is fairly simple, and effectively defines 5 basic operations: ...
Aaron M. Eshbach's user avatar
4 votes
1 answer
486 views

Elixir PEG Parser Generator

I am trying to learn Elixir, so I decided to write a port of Ruby's Parslet library. I want to define a DSL that lets you define your grammar and given a string can parse it into an AST. I wrote ...
Nigel Thorne's user avatar
3 votes
1 answer
1k views

Small DSL: Converting JSON to MSSQL query

Scenario Once upon a time, there was this human (ahem, me, ahem) who tried (and succeeded) to build a small program which would convert JSON to a MSSQL query using Python 3.x. How does it work? The ...
Cajuu''s user avatar
  • 331
5 votes
1 answer
3k views

Simple query language for CSV files

I'm struggling to improve this command-line java application, which reads CSV or txt files, ands allows the user do some "queries" with the data. I can't use any external library, so I'm doing it all ...
Loading...'s user avatar
6 votes
1 answer
105 views

Web Development DSL

I'm working on a DSL for web development, similar to sinatra. The git repository is here. I've been attempting to improve this code and write it for 4 months, and as a hobby programmer, I would like ...
thesecretmaster's user avatar
10 votes
1 answer
8k views

Event-driven finite state machine DSL in Kotlin

I wrote a DSL for defining a finite state machine. My robotics team wants to use a state machine to manage the state of the subsystems on our robot, like the arms, drive train, lifter, etc. Each ...
Roth's user avatar
  • 103
3 votes
2 answers
3k views

Simple ActiveRecord attributes encryption in Rails 5+

The task at hand was to ensure that certain columns in the database are encrypted in case the database data is stolen. I have a feeling that a lot can be improved here (naming, DSL, encapsulations) ...
Adam's user avatar
  • 117
3 votes
2 answers
172 views

F# function to concatenate some DSL scripts with indentation

I'm rather new to F# and functional programming. I wrote the following method to concatenate some custom dsl scripts. The function works are expected without errors. I wanted to know if there was a ...
Satish's user avatar
  • 139
7 votes
1 answer
165 views

Sentence building DSL

Cardshifter is an online trading card game, made by a gang of Code Review community members. Cards can have a bunch of different, and sometimes complex effects, and descriptions for these are ...
jacwah's user avatar
  • 2,661
3 votes
1 answer
77 views

Binary Bayes network classifier in Java - Part I/II - follow-up

TERMINOLOGY We are given a directed acyclic graph (dag) \$G = (V, A)\$, where \$V\$ is the set of nodes and \$A \subseteq V \times V\$ is the set of directed arcs, and a weight function \$p \colon V \...
coderodde's user avatar
  • 29.1k
4 votes
1 answer
259 views

DSL design -- C DSL

I am trying to design a DSL for writing C. Here is my code as a GitHub gist (Github does not allow me to have slashes in the filenames so I have used underscores instead). It depends on packages free ...
Charles Cooper's user avatar
14 votes
3 answers
7k views

Hello There Calculator

The open source project I work on uses Antlr4 pretty heavily, but I don't know much about it. I thought I would use April's Community Challenge as an opportunity to learn something about grammars, ...
RubberDuck's user avatar
  • 30.8k
4 votes
1 answer
414 views

Expressing Rebol Dates in EBNF

I'm looking to define the Rebol date format in EBNF notation. I'd like as best as possible to only define valid dates—at least those that are valid in Rebol at the moment: ...
rgchris's user avatar
  • 489
3 votes
0 answers
156 views

DSL design for iOS Autolayout

I am building a small DSL for iOS' autolayout feature. Obviously I want to have a typesafe way to define autolayouts instead of doing VSL. I came up with the following: ...
robkuz's user avatar
  • 129
3 votes
1 answer
84 views

Simple spec testing DSL

I wrote a very small little DSL for spec testing: ...
mjgpy3's user avatar
  • 729
4 votes
2 answers
87 views

Basic value comparisons

I made a value comparison "programming language" similar to a previous one I made, except this one is based solely on value comparisons. ...
Vladimir Putin's user avatar
4 votes
1 answer
105 views

Learning to write DSL utilities for unit tests and am worried about extensibility

I'm trying to simplify our unit tests with hand written DSL's. So far I have DSL's that walk developers through processing a service after setting up all preconditions and the construction of an ...
candied_orange's user avatar
3 votes
1 answer
137 views

DSL for describing circuits

I am working on a micro project: a Haskell DSL for describing circuits. (You can find the code here) I'm pretty happy with everything so far, but there is an ugly function ...
JRock's user avatar
  • 31