Why Hugo is a "Domain-Specific Language"

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Why Hugo is a "Domain-Specific Language"

Post by Tdarcos »

I originally wrote par of this around December 15, then saved it as a draft for later, then forgot it. I've brought it back with an expanded focus. Enjoy.


Jonsey - whether as his actual opinion or as "Devil's advocate" to get me to try to justify mine - argued in a response to my essay introducing the Hugo programming language and authoring system, that Hugo is not a "domain-specific language" (DSL), and I'd like to offer my reasons why it is, why there's nothing wrong with it being one, and what alternatives should be considered.

I'm not alone in making this observation. I was having a conversation with a user of this board and when I stated that my opinion was that Hugo is a DSL they agreed. There are other similar interactive fiction development systems such as
  1. Inform
  2. ACK
  3. TADS
  4. Twine
  5. Alan
  6. Quest
  7. Spiffy
  8. Ren’Py
(Some of these I had to look up), and most of these, even if output to a general purpose programming language, almost certainly start with a DSL scripting system to develop them. To the extent some of these are domain-specific languages is not a "slur" or a "badge of dishonor." If the language is well-suited to the problem domain it is being used to solve, the language can be very effective in solving those kinds of problems.

to clarify, a domain-specific language is one where the grammar, commands and syntax is primarily oriented to the solution of a specific problem or class of problem, as opposed to general-purpose languages that are open to virtually all types of problems. Macro languages such as those used in spreadsheets or the macro languages available in macros of word processors are examples of domain-specific languages. The original MSDOS bach language is an excellent example of a DSL.

Prior probably to 1990, the most popular programming language in the world was... COBOL. While it was capable of being a general-purpose language, it was strongest in the domain-specific handling of record-oriented processing, especially either batch or pseudo-interactive. Handling payments, making them or taking them; generating reports, sorting, searching and the other features directly related to business processing, made COBOL an ideal language for those purposes. And is still used on large mainframes, as there are programs, written in COBOL, that their owners have spent decades updating and invested literally millions of dollars in the care and feeding of those applications. These applications literally manage trillions of dollars of assets. And as long as what is done on those mainframes is the same workloads, COBOL will continue to be used. It is a general-purpose language whose domain-specific attributes make it perfect for those problems.

I would not consider COBOL a good language for writing a word processor or web server, it just does not have the specific features useful for those types of applications. PHP is a very good language for writing server-side applications on web servers, but chances are, COBOL works better for the retrieval and processing of data on mainframes, because those programs have been well-debugged over decades, all the bugs have been worked out.

The same thing applies to Interactive fiction. If whichever language used fits the problem domain, then the language is the right choice. The question is whether the language does support the features needed now. When Interactive Fiction was exclusively text-based, then any of these languages would be acceptable. We may want to ask, are the additional graphic-related features adequate for today's story demands? Graphic images and video playback along with sound selection might be enough, or it might not.

Perhaps what is necessary is not merely Interactive Fiction tools, but general game production tools, but possibly with either much lower learning curves than full-blown Unity- or Blender-engine based games. Maybe some of the features of these IF languages along with additional features more appropriate to games than typical general-purpose languages. Perhaps more event processing capacity, better string and numeric functionality, ability to handle other things than we have been doing so as to allow for things like visual novels. Handling SVG images would allow for dynamic images that can change as needed. Being able to click on, not just images, but motion pictures as well.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
bryanb
Posts: 807
Joined: Sat Apr 06, 2019 2:56 pm

Re: Why Hugo is a "Domain-Specific Language"

Post by bryanb »

I largely agree with you that Hugo, Inform, ACK, etc are basically domain specific languages. Certainly, they were intended to be used to create specific types of games by their developers. However, programmers have a knack for using tools in nonstandard and unexpected ways. Super Z Trek, zRogue, and Space InvaderZ are written in Inform, but they aren't parser-based text adventures. I think it's possible that a language considered to be domain specific at one point could over time gain recognition as a general purpose language, and most IF languages aren't so locked down that it is impossible to create something other than an adventure game with them.

Great things always seem to happen when Robb and Paul find the same thread and have a two-way conversation. I particularly enjoy it when Robb asks a question and Paul gives a response. Good times, good times.

User avatar
Ice Cream Jonsey
Posts: 28877
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: Why Hugo is a "Domain-Specific Language"

Post by Ice Cream Jonsey »

I know I said this at the time but I don't know where the post is. I asked the question on the ifMud (the interactive fiction mud) and I think three people agreed with you that Hugo (and TADS and Inform) were domain specific. So I disagreed with all of them and you on that point but I can acknowledge when mine is not the prevailing school of thought.

In completely unrelated news, on July 1st I entered into the ninth year of development on the CRPG blobber I am making in Hugo!
Prior probably to 1990, the most popular programming language in the world was... COBOL.
Oh boy.
the dark and gritty...Ice Cream Jonsey!

User avatar
Jizaboz
Posts: 4811
Joined: Tue Jan 31, 2012 2:00 pm
Location: USA
Contact:

Re: Why Hugo is a "Domain-Specific Language"

Post by Jizaboz »

Man, yeah. I started DPRK in 2011
(╯°□°)╯︵ ┻━┻

User avatar
Ice Cream Jonsey
Posts: 28877
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: Why Hugo is a "Domain-Specific Language"

Post by Ice Cream Jonsey »

Jiz, it's important to me that you caught the point I was making in that I have 8 years into something that isn't a text adventure in a domain specific language thread.
the dark and gritty...Ice Cream Jonsey!

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Why Hugo is a "Domain-Specific Language"

Post by pinback »

Yes it is.
I don't have to say anything. I'm a doctor, too.

User avatar
Ice Cream Jonsey
Posts: 28877
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: Why Hugo is a "Domain-Specific Language"

Post by Ice Cream Jonsey »

That's okay, I am on the opposite side of many intelligent men with this one. This is what not wearing a mask must feel like.
the dark and gritty...Ice Cream Jonsey!

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Why Hugo is a "Domain-Specific Language"

Post by pinback »

I meant, Cyberganked is a text adventure.
I don't have to say anything. I'm a doctor, too.

User avatar
bryanb
Posts: 807
Joined: Sat Apr 06, 2019 2:56 pm

Re: Why Hugo is a "Domain-Specific Language"

Post by bryanb »

If Jonsey were to reimplement Cornerstone in Hugo, would that help settle this fractious debate?

User avatar
Ice Cream Jonsey
Posts: 28877
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: Why Hugo is a "Domain-Specific Language"

Post by Ice Cream Jonsey »

Imagine a man losing so much weight that he decides he hates BLOBBERS and refuses to recognize them as a sub-genre.

I hope you're happy.
the dark and gritty...Ice Cream Jonsey!

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Why Hugo is a "Domain-Specific Language"

Post by pinback »

It is a text adventure with RPG elements.
I don't have to say anything. I'm a doctor, too.

Post Reply