Discussion on whether Rule Machine and WebCoRE are computer languages

Guys,
Programming Language is a set of instructions for the CPU. https://community.hubitat.com/t/discussion-on-whether-rule-machine-and-webcore-are-computer-languages/160438/29?u=vitaliy_kh

How you feeding these instructions to the CPU is a Very Different Story.

I see what you're saying, and sure, Eclipse (or Visual Studio, etc.) is not a programming language.

However, RM could be considered a specialized editor that only allows you to write programs in one specific programming language: its own. I realize this might be considered a stretch and RM wasn't created as a "language" per se, but it also displays its instructions in a format that looks very much like a programming language, even so far as to indent loops and conditionals, the use of parenthesis to notate order of precedence within expressions, and so on. It's not unlike Visual Basic, or any of the dBase variants.

And I still assert that you could create a formal language specification based on the various commands and expressions that RM allows you to create, and you could then use that spec to build a compiler (or parser) or whatever you wanted. Not that there would probably be any value in doing that, but I'm sure it could be done. I had to do exactly that for a compiler I wrote many years ago that had to be compatible with an existing language that didn't have any formal definition.

1 Like

In the same way that a restaurant menu is not an actual chef's kitchen, I'd have to assert RM and WC are not formal programming languages.

1 Like

You can't of course, but I believe that such a compiler could be written. Does that make it a language? Maybe it's not a language until someone writes the compiler :slightly_smiling_face:

RM might not be thought of as a "language" because RM does not formally define a language, nor does it speak of a "language" in its documentation. But you can't deny that it displays its instructions in a format that looks very much like a computer language. The intent of RM's authors wasn't to create a language, but an unnamed language was effectively created nonetheless, one that has structure, syntax and semantics like any other language.

All of this is subjective of course. It depends on how literally you want to interpret the statement that a programming language is a structured way for humans to tell computers what to do. RM certainly doesn't fit the notion of a traditional programming language that most of us are used to working with.

1 Like

I'm not sure I entirely agree with this, there isn't a formal grammar around RM, let alone trying to get that to BNF. - I'm not saying a spec couldn't be developed with additional effort, but there are bunch items missing around even describe formal text parsing (YACC) or a lexical analyzer (LEX).

IMHO, RM is NOT a formal programming language - it's really an application has 3 parts in my mind:

  1. A front end editor, that wrangles HTML and supports configuration entry (local variables, expressions, conditionals, etc.), and does some basic sanity checking - But there isn't really a grammar that's being followed here - It's just configuration rules - In a "real language" this would be a text file, that is fed into YACC.
  2. Persistent Storage of the configuration - which is the output of #1 - (rule intermediate opcodes? stored in the systems H2 DB) and registration of interest to "events" per when the configuration is completed with "Done" from #1 above
  3. Execution engine - When an event fires, the configuration is read back in as an input from the DB, (opcodes?) and this stream then executes various internal functions/routines, that loosely correspond to configuration stream. - This is conceptually similar to JVM or .Net executing the IL of their respective environments.

So while RM COULD become a formal language, it's not really close to that today, in my mind - And given that Bruce has been relatively silent these past few months, it's doubtful that that such a change would be made, or is even in HE's best interest.

The entire thread/discussion is a bit similar to the angels & sewing debate, as I really don't think such a classification (its a language or its not) is particularly consequential one way or another.

EDIT: I'm not close enough to WebCore to make such a call, by my gut instinct it that's it's CLOSER to being a "real language", but I welcome being corrected if that's way off base.

I'm 99% sure it could. I did it about 20 years ago with a real programming language that was far more complex. It wasn't easy and took a lot of time, but it wasn't rocket science, just a lot of experimenting. After it was finished and turned into a commercial product, the company I worked for acquired the rights and source code to the language we were trying to be compatible with. Turns out there was no BNF for the language at all, not even a spec document. The parser was hand-written and one of the most hideous pieces of undocumented spaghetti code I've ever seen. One of the original developers later told me that "the truth is in the code". It was, and the truth was fugly. I probably created the one and only BNF that language and its variants ever had. Ancient history now though.

But that's an implementation detail. Yes, that's how the vast majority of computer languages work, but there's nothing in the definition of a computer language that specifies any particular implementation.

Your three points are valid, IMO. They also closely resemble a language called Visual Objects that was popular in the late 90's. While the editor was a text-oriented editor closely integrated into the IDE, the contents were parsed and compiled (in real time) and stored in a database, along with intermediate code that was used by the execution engine.

Noticed that, I hope he's ok and enjoying himself.

For sure, there's absolutely no practical value whatsoever to this conversation. It's certainly better than discussing politics though :slightly_smiling_face: