Starting a State Machine External Domain Specific Language (DSL)

I was going to write about the existing state machine I have working. It’s very powerful, has parallel features, and its output was shown in Rethinking State Machines meaning I wouldn’t have to actually create any code, just go through a post-mortem.

Then I changed my mind.

My Lisp version was designed intentionally to be an integral extension of the Lisp technology we use internally. It’s not that it’s a trade secret (how does one make a “trade secret” out of something as well known as state machines?) but rather, it’s not actually comprehensible without an understanding of Lisp and the nature of the Lisp development needs that drove its creation.

What I really want to write about is the process of creation that allows one to make the step from “code that works with data” to “data that is representing code.” That’s the jump, the spark, that enables metaprogramming, where the program code is the data to other program code.

And that process warrants starting at the beginning, which is with the problem.

The problem is my desire to allow direct expression of the basis for responding over time to external events. Think of this as the architect’s perspective instead of a developer’s perspective. No matter the language of the system implementation (or set of languages) I want the system to respond properly to any sequence of events.

I want this to be independent of the code that carries out the intention so that I can work “at a higher abstraction.”

Continue reading

The Trap of Diagrams for Meetings

I spent many years teaching for Learning Tree International, New Horizons, and privately. That has given me a very formal perspective on presenting complex material that isn’t yet understood to people who are much smarter than I am.

I’ve also created an enormous number of models and diagrams over the years to present to clients. And I’ve been in the meetings when others present their diagram sets as well.

Having made the mistakes, watched the mistakes, and sometimes even avoided the mistakes, there’s a very basic trap that I want to spare all my fellow modelers and diagram authors — and it’s one I see still at all levels of organizations.

The trap is this: showing the big picture first.

I understand that you should “tell them what you’re going to say, say it, and tell them what you said.” Perhaps. But if you show a complex diagram (more than two or three boxes) that you expect to explain in detail, it’s only going to go downhill from there.

Continue reading

Rethinking State Machines

I have made a few extensions and Domain Specific Languages (DSLs) to represent state machines.

Some were frameworks in a native language, including versions using the State Chart pattern. One was in C++ integrated with an event and entity framework so that entities could participate in threaded declarative workflows assembled instead of derived.

But the ones I enjoyed most were done in Lisp. The simplest was a sexpr based notation that was read by clisp and emitted Java. It was, of course, a macro. The expression of the machine was executable and the execution was to emit Java. It generated interfaces, abstract base classes, 100% of the POJO that represented the messages, and required no fences — it was a full code generator, not a wizard (no generated code was edited by hand or saved in the version control system).

I did another recently. This time, I decided to tackle the interesting problem: state machines become unbearably big and repetitive if done following the conventional model.

So I decided to toss the rules aside.

Continue reading

Getting the Words Down

I’ve a few friends that are writing novels. I spent a few months banging on what I call a “bad fanfiction” following a bit of advice I read from some professional book on writing fiction. Since it’s not mine (I don’t own the IP, yeah, I’m still a tech guy) I won’t publish it, but it was (and still is, from time to time) really amazing. I have 260,000 words into it, for instance.

And most of them, all but about 250 I think, are junk. So, 259,750 words are garbage. That’s the math.

Those who have read my blog know that I’m a software developer more than a writer. But I discovered that there are many facets that are the same and oddly, some skills that work well in both.

Continue reading

Dependency Management and Job Listings

I’ve been skimming Dice to look at the market lately. Of course, most job postings are written with a list of libraries, but I realized when the Wall Street Journal and I spoke about it in my posting on The Staffing Crisis I never mentioned the reason why this approach doesn’t actually help the companies seeking people.

I can appreciate that teams want someone that knows Spring Boot and RESTful API design. They might also want to know how to consume Kafka messages, and they might want to know how to use Redis for pubsub, streams, or state.

What does any of this have to do with dependencies?

Continue reading

The Staffing Crisis

The Wall Street Journal has an article (unfortunately pay-walled) titled Companies Need More Workers. Why Do They Reject Millions of Résumés? by Kathryn Dill on Sep 4, 2021 talking in detail about many aspects of the way modern hiring practices actually discard a huge number of qualified candidates.

Of course, the main tool for implementing those aspects are automated matching systems. I did a bit of an experiment a few months back when I was being bombarded with offers for gigs that made no sense for me. I changed my resume in an intentionally skewed way to ensure that I violated the criteria used by most computer matching systems.

In short, I intentionally broke my resume months before the article. That meant I was an unintentional test of that article.

The results were not what I expected…

Continue reading

Getting to Enterprise

Enterprise systems are very different from “applications.” It’s almost all because of scale, but scale is a qualitative difference — programs built to “enterprise” or “Internet” scale are not just bigger (key — “just”) but they are dramatically busier.

Consider a blog that receives 2000 “hits” (page-views) a day. That can be served effortlessly using any technology on any hardware platform, from Raspberry Pi to AWS or Azure. This doesn’t mean that the blog isn’t important, or valuable (it could be a blog that is used exclusively by CEOs and world leaders). But it means that the scale is not a technical challenge.

Contrast that with Facebook, Amazon, Google, Twitter, or Bloomberg. They have tens or hundreds of thousand of transactions that involve data being created and altered according to complex rules — per second. These are the companies that caused the growth of enterprise technologies, and that need them.

But how does a solution that needs to go to Enterprise/Internet scale start?

Hint: it’s not with a scalable infrastructure using Docker and Kubernetes with CI via Jenkins.

Continue reading

Serve or Control

Command the Machine

One of the reasons I love using computers is that, as a developer, the computer performs my wishes.

For most people, it wasn’t until the spreadsheet that the idea of a personal computer became really powerful. It was VisiCalc (and later Lotus 123) that gave business a reason to buy PCs.

And it’s no surprise that Excel is so heavily used today, even far outside of financial or arithmetical projections. Excel allows non-developers to “have the computer do what they want.” Excel allows people to command. They, not the machine, can choose what to enter, where to put it, what math (if any) to perform, and so forth.

The machine obeys them.

This is rarely the case in the software most IT subjects us to.

Continue reading

Leaking the Future

In a prior article I mentioned a convention of using Excel in a way that ensures a programmer can implement what the spreadsheet represents.

Since a spreadsheet is a program, obviously being interpreted (the XLSX file is being processed by Excel for instance) it doesn’t make sense that a spreadsheet can be created that can’t have its computation implemented in a language like Python.

So, how does a spreadsheet do what can’t be done in software? How is that even possible?

Continue reading

Worked Executable Requirement Example

Executable Requirements

A video game company wants a bedside lamp simulation where the player can:

  1. Plug it in (plug-in)
  2. Unplug it (unplug)
  3. Click the switch (switch)

The lamp may turn on or turn off the light based on these inputs.

Clarifying the User Story

The user story sounds simple enough. I bought a lamp in the real world to use as my basis and discovered that the real lamp didn’t work so simply as the story implied.

Now what?

I could just assume I understand what the user wants. I’ve got a very good chance of being wrong, but technical people know better, right? No, actually, we don’t.

Instead, I’m going to need to show the customer enough that they can give me a decision on what behavior they want for the lamp in their game. And I may actually need to show a few different kinds of lamp.

The question becomes, then, how do I capture their intention in such a way that all stakeholders understand the same thing? The text didn’t do it … I’ll need to do something better.

Continue reading