Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6337511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:15:52+00:00 2026-05-24T19:15:52+00:00

I’ve forked this question from a similar question I made in a comment I

  • 0

I’ve forked this question from a similar question I made in a comment I made to one of the many great answers I recieved. I was originally asking about AST macros, which mostly provoked very detailed and thoughtful responses from Lispers. Thanks.

Lazy Evaluation vs Macros

The question I made in a comment was whether project-specific DSLs are actually a good idea. Of course, this is completely subjective — After all, when you are writing in a really expressive language, where do you draw the line between an expressive API and an actual DSL? For example, I think what most Rubyists call ‘DSLs’ are actually just well-designed APIs and nothing more.

Note that I say project-specific APIs. I don’t think many will argue against using regular expressions or SQL where it makes sense to do so.

But despite this, I think we can all draw a vauge, hazy line between an API and a DSL. Of course they’re both really APIs, but whatever.

On one extreme you have Lisp, where DSLs seem to be actively encouraged via macros. On the other you have the likes of Java where DSLs are pretty much impossible.

Proponents of DSLs would argue that they increase flexibility, expressiveness, and increase consistency (for example, a custom number object using the same operators as the language’s own numbers).

Detractors would say that they can lead to sub-languages that nobody except the DSL writer knows, kills the point of having different programming languages in the first place, and leads to code nobody can understand because the way of interfacing with API is different.

I gotta say, I agree with both sides in many ways. Some Java APIs are just plain nasty due to the lack of expressiveness. Despite this, I can generally always work out what’s going on without reading the documentation — Which can’t be said about custom DSLs in the slightest. Maybe DSL proponents argue that you should always read API documentation. I disagree, but I also digress.

But let’s look at some of the big languages at the moment. C# and Java, namely. Neither of them really ‘do’ DSLs, yet they’re massively popular. Is this precisely because they don’t allow things like DSLs, allowing mediocre coders to churn out code that’s still comprehensible?

Is the fact that DSLs allow mediocre coders to produce impenetrable garbage the reason why Lisp is not used as much as it should be, despite what a DSL can look like in the right hands?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:15:53+00:00Added an answer on May 24, 2026 at 7:15 pm

    There are of course arguments in favor of DSLs and against them, and there’s of course a vague line between “a library” or “an API” and “a DSL”. That part you’ve covered well in the question, so I’ll avoid those subjective points and focus on just the question of whether they’re a liability.

    A good project to consider for this is Racket which puts language construction as its main feature. It’s easy to slap up a language for any definition of “a language”: DSL or not, made up from near scratch via an interpreter or (more commonly) done via macros that define the new language and possibly a parser for a different syntax. As a result, the Racket source tree has a bunch of languages — some of them have fundamentally different execution semantics. Some examples:

    • Lazy Racket is what you’d expect the name to mean,

    • Typed Racket is a statically typed language,

    • Scribble is a language for writing documentation and other prose,

    • Slideshow is a language for writing … slideshows,

    • RackLog/DataLog are languages that are even more different in both semantics and syntax.

    In fact, making up languages is so easy in Racket, that you easily slap up a language even if it’s something that fits a very limited use, or even just a single one. For example, we have such “small languages” that are used to create our web pages, decide which files are included in distributed installers, and many many more. See this tutorial for a description of how to come up with a language.

    It’s true that there’s a fine line between a useful DSL that many people can use and one that only one person uses — but still, the kind of abstractions that you can get when you define a language rather than a library are substantial, to the point that it’s a useful concept even when it’s a “one-man’s language”. One hard problem in this are is considering interoperability — Racket allows each module to be written in it’s own language, which brings up issues of what happens when several of these modules are supposed to talk to each other. For example, how does evaluation proceeds when there’s interaction of functions in the lazy language and in the default one; or how does the typed make sure that it can interact with the default untyped language and still get the usual benefits of a statically typed language.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.