News for hackers. Stuff that matters.
Re:Designing a Programming Language: I by ogogmad on Thursday October 27, 2022 @11:44AM (#33359301)
What DSLs might someone make today? And when should they be libraries instead?

[edit] There was a recent example of a constant-time C-like programming language: https://news.ycombinator.com/item?id=33308037

Re:Designing a Programming Language: I by spacechild1 on Thursday October 27, 2022 @05:09PM (#33364090)
One good example that comes to my mind is audio programming / live coding languages.
Re:Designing a Programming Language: I by sshine on Friday October 28, 2022 @12:07PM (#33373305)
> What DSLs might someone make today?

Oh, but there are SO many!

These two super-categories I am very fond of:

- Query languages

- Infrastructure specification languages

Here are some concrete examples:

GraphQL: An API query language: https://graphql.org/

jq: A JSON command-line processor: https://stedolan.github.io/jq/

HCL: A DSL for expressing Terraform assets: https://developer.hashicorp.com/terraform/cdktf/concepts/hcl...

Troll: A DSL for expressing dice roll simulations: http://hjemmesider.diku.dk/~torbenm/Troll/

fvg: Functional Vector Graphics: https://github.com/lemmih/fvg

Kleenex: Optimal regex-based stream processor: https://kleenexlang.org/

Futhark: High-performance purely functional data-parallel array programming: https://futhark-lang.org/

> And when should they be libraries instead?

A friend recently told me that DSLs (stand-alone) and eDSLs (embedded in an existing language) have the main difference that DSLs are overgrown configuration files, and eDSLs are overgrown libraries.

I'd say: When you want to call your DSL from more than one programming environment, it is good to have an abstract representation that transcends one particular syntax-tree definition. A library is good until then.