DSL for software projects
We are all writing too much code.
We software developers haven't applied the principle of DRY - Don't repeat yourself - sufficiently to our own discipline. Boilerplate code is very common and we end up the same old problems again and again.
What if there existed a language and framework agnostic DSL for all software projects - apps, command-line tools as well as libraries? Humans should be operating at the right level of abstraction and tools should exist to help them get to the low-level when needed.
Let's adopt a few principles:
  • Don't ever repeat yourself
  • No code is better than autogenerated code which is better than custom handwritten code
  • Encourage best practices
Here is what it might look like:
1
{
2
"bestsite": {
3
"kind": "webapp:ssr",
4
"platform": {
5
"lang": "ruby-jruby-3.0.1-x86",
6
"lang_options": [],
7
"framework": "rails-7.0",
8
"framework_options": ["--css=tailwind", "--db=postgresql","--websocket=true"]
9
},
10
"models": {
11
"User": {},
12
"Post": {},
13
"Comment": {}
14
},
15
"behaviour": {"pwa": true}
16
},
17
"myapp": {
18
"kind": "mobile",
19
"platform": {
20
"lang": "dart-1.2.0",
21
"lang_options": [],
22
"framework": "flutter-1.0",
23
"framework_options": ["--platform=android,ios,desktop,web"]
24
},
25
"models": {
26
"User": {},
27
"Post": {},
28
"Comment": {}
29
}
30
},
31
"mylib": {
32
"kind": "lib",
33
"platform": {
34
"lang": "js-ts-3.0.1-all",
35
"lang_options": ["--test=jest"]
36
},
37
"api": {}
38
},
39
"cmdtool": {
40
"kind": "unix:standalone",
41
"platform": {
42
"lang": "golang-1.0.1",
43
"lang_options": []
44
},
45
"behaviour": {
46
"daemon": true,
47
"network": true
48
}
49
}
50
}
Copied!
Now, a program - which can support plugins for any language or framework - can take this description and produce a working project. There should be as little generated code as possible.
Perhaps some day, this DSL will be powerful and standardized enough that you don't need to write any custom code. Just start a standard binary and pass this DSL description as a launch argument and you get your zero-code application. This is not so far-fetched. Think about how already PostgREST or Graphile give you a full-fledged backend API without any custom code.
Does this seem useful or exciting to you? Is this a goal worth pursuing?
Last modified 29d ago
Copy link