• The Problem with General-Purpose Programming Languages (1)_588.png

    The Problem with General-Purpose Programming Languages

    Software development use cases are diverse. It would make sense for programmers to learn general-purpose programming languages that tackle many programming requirements. Amid the rising popularity of such languages, one has to wonder if domain-specific languages are still relevant. I would argue they still are, and the rise of general-purpose languages poses a problem for software development.

    General-purpose vs. Domain-specific Programming Languages: What’s the Difference?

    All programming languages fit into one of two categories: general-purpose programming languages and domain-specific programming languages.

    As the term implies, general-purpose languages can easily support various use cases. Java, C, and C# are popular examples of general-purpose programming languages.

    In contrast, domain-specific languages focus on specific niches or needs – such as data science, text manipulation, or web development. SQL, gawk, and HTML are examples of domain-specific languages. (Technically, they're not all programming languages; some are markup languages.)

    The Slow Demise of Domain-specific Languages

    If you look at most of the programming languages that have debuted relatively recently — such as Swift and Go — you'll notice that almost all of them are general-purpose languages. The only possible exception is Rust, which debuted in 2013.

    By most definitions, Rust is a general-purpose language. You could try to make the case that Rust is domain-specific because it's designed for security-centric programming needs. But that's a stretch because Rust can support various development use cases.

    Looking back at programming language history, you'll see that many historical programming languages were domain-specific. The most important domain-specific languages still in widespread use today — such as, again, SQL, gawk, and XML — have been around for decades.

    Plus, some of the languages that are now general-purpose originated with a narrower domain focus. Python was created mostly for system administration tasks on Amoeba, although we can now use Python for almost every programming use case under the sun.

    Likewise, C was created initially to help develop Unix, not for the wide variety of application and operating system development use cases to which C is applied today,

    I mention all of this to make the case that we've arguably seen the demise of domain-specific programming languages over the past few decades. Whereas it was once common to create domain-specific languages, almost all of the languages created in recent years have been general-purpose. Some of those not originally general-purpose have been adapted to fit that bill.

    The Case for Domain-specific Languages

    Is it bad to live in a world dominated by general-purpose programming languages?

    Arguably, yes. Maybe we need more languages that excel at web development, mobile development, or data analytics but don't try to cater to all of these use cases simultaneously. After all, as the Unix philosophy tells us, it's better to have many tools, each of which does one thing well, than to have one tool that tries to do a bunch of things but does none of them well.

    To be fair, the fact that most programmers seem happy enough using general-purpose programming languages might suggest that developers don't feel a strong incentive to leverage domain-specific languages.

    But I'd argue in response that most developers today use general-purpose programming languages because they face pressure on the career front to be generalists. It's easier to find (and keep) a programming job if you can support a wide variety of software development needs than if you specialize in just one domain.

    After all, you do see developers who specialize in particular niches making heavy use of domain-specific languages. For instance, most coders in the data science realm use R, a domain-specific language in most senses. If general-purpose languages were ideal, R should have been replaced by, say, Python at this point in data science.

    There are, of course, plenty of situations where you might use general-purpose and domain-specific languages together. It's common for data scientists to use R and Python within the same workflow.

    But here again, if general-purpose programming languages were so great, you'd think that data scientists could do everything they need using Python. They don't because general-purpose languages just can't do some things, and domain-specific languages like R.

    Conclusion: There's Still a Place for Domain-Specific Languages

    To be clear, I don't mean to suggest that a domain-specific language best serves every programming use case. The flexibility that general-purpose programming languages provide will always be necessary for many projects.

    Developers are likely to create more efficient, reliable, and secure applications if they take greater advantage of domain-specific languages. Suppose the software development ecosystem gave domain-specific languages more love than they've received over the past few decades.

    Follow us on LinkedIn


    About the Author

    Kamal Rastogi is a serial IT entrepreneur with 25 yrs plus experience. Currently his focus area is Data Science business, ERP Consulting, IT Staffing and Experttal.com (Fastest growing US based platform to hire verified / Risk Compliant Expert IT resources from talent rich countries like India, Romania, Philippines etc...directly). His firms service clients like KPMG, Deloitte, EnY, Samsung, Wipro, NCR Corporation etc in India and USA.

Contact Us
US Office
100 Franklin Sq. Drive, Ste 207 Somerset,
NJ - 08873, USA
India Office
707, Siddhartha Building, 96, Nehru Place, New Delhi – 110019, India
Subscribe to Newsletter
Are you a *