Lingo: A Go micro language framework for building Domain Specific Languages
31–40 of 54 posts
Re: Lingo: A Go micro language framework for building Domain Specific Languages
#32When I think of a DSL, I think of a language with specialized syntax , grammar , or constructs suited to the problem domain. Think SQL, AWK, or regular expressions. This is just a LISP variant with a typical host-side API for registering function names. I'll never get how merely having function names that reflect the use case, plus a stripped down or absent standard library, qualifies as a DSL. I know some people hav…
Any naming of types, functions or variables that you do while solving a problem in software is creating a "language" of terms that are specific to the domain.
A well-constructed fluent API can read a lot like what you would call a DSL. A configuration language in YAML is both YAML and a DSL for config.
Re: Lingo: A Go micro language framework for building Domain Specific Languages
#33This seemed like nuclear overkill for most problems I can think of. And where it should be used, I can't imagine you can't find a pre existing language (Cuelang maybe) instead. I was expecting a section at the end where they demonstrate which services need a new language written just for it's configuration, but nope, just general examples. Also, this should have a (2022) in the title.
Is there something about the current state of world that has invalidated some or all of the content in the article?
Re: Lingo: A Go micro language framework for building Domain Specific Languages
#34When I think of a DSL, I think of a language with specialized syntax , grammar , or constructs suited to the problem domain. Think SQL, AWK, or regular expressions. This is just a LISP variant with a typical host-side API for registering function names. I'll never get how merely having function names that reflect the use case, plus a stripped down or absent standard library, qualifies as a DSL. I know some people hav…
Without those function names that you talk about, you wouldn't really recognize a language. Those standard library function names give the "batteries included" kind of feeling. The size of the community libraries furthers that accessibility and productivity feeling of the language. Furthermore, you can certainly create control flows via libraries--with callbacks specifically--and create any kind of novel branching structure your domain had need of.
A good API is a sort of DSL. If it well reflects how you think about the domain and helps you express instructions within that domain. The language can be very different. We experience that in our own language when we hear people talking with heavy use of jargon we don't recognize: they might as well be speaking another language.
But overall I agree with you that I would probably save the use of the jargon term DSL for novel syntax targeted at a specific domain.
Re: Lingo: A Go micro language framework for building Domain Specific Languages
#35> Some popular DSLs most software developers use on a regular basis include Regular Expressions for pattern matching, AWK for text transformation or Standard Query Language for interacting with databases. Isn't it Structured Query Language? Or are both variants used?
"Structured Query Language" is a so-called backronym. "Standard Query Language" fits the pattern as well. As does "Super Quick Lookup", if you want to have some fun with it.
Re: Lingo: A Go micro language framework for building Domain Specific Languages
#36When I think of a DSL, I think of a language with specialized syntax , grammar , or constructs suited to the problem domain. Think SQL, AWK, or regular expressions. This is just a LISP variant with a typical host-side API for registering function names. I'll never get how merely having function names that reflect the use case, plus a stripped down or absent standard library, qualifies as a DSL. I know some people hav…
This is basically a lib with some extra syntax to parse CSV Files.
A 'proper' DSL would require a very specific domain where it is applied to. Like document creation, or solving a certain problem and only that but not much else. Turing completeness is usually not required as well.
For example Matlab or LaTex are domain specific as well as SQL. Those are used to do math, create documents or do mangle tables.
Imho just renaming forEach to Map to parse CSV files does not fit the bill so the linked example is not that great.
This project basically a DSL builder thingy with a text processor demo.
As an aside:
I am missing the most important thing when it comes to CSV which is configuration of the input.
Might be because this is more of an example but it is usually a sign of a lets say more academic project.
Working with CSV, is usually a source of a lot of "good fun" where many hours can be spent.
Because your average CSV is often a SSV or TSV in some ISO that is everything but not UTF8. It usually contains line breaks which have been renamed to funny icons by some combo of tool and operating system. Also there are weird escape character in orders which are not consistent on every row. Also sometimes you have titles sometimes not. Dates make no sense, are language depended and in a weird format the intern made up 10 years ago. And even numbers are weird too, like 12e^-25 or '0.00' or '10.000,0'. Then you get columns which really should be 2 or more, or there are lines which span multiple rows.
Ihmo it is way better for robust CSV parsing to have a really low level approach where you rigorously check for everything (and return everything to sender that does not fit).
Re: Lingo: A Go micro language framework for building Domain Specific Languages
#37This seemed like nuclear overkill for most problems I can think of. And where it should be used, I can't imagine you can't find a pre existing language (Cuelang maybe) instead. I was expecting a section at the end where they demonstrate which services need a new language written just for it's configuration, but nope, just general examples. Also, this should have a (2022) in the title.
> Also, this should have a (2022) in the title. Is there something about the current state of world that has invalidated some or all of the content in the article?
Re: Lingo: A Go micro language framework for building Domain Specific Languages
#38Disclaimer: this is a neat project. DSLs are such a trap for most projects that think they need them. Use lua or something off the shelf for scripting. CEL exists for Go and (safely) solves many of the problems you might also want a DSL for. The case for DSLs is often hard to justify in a project that has to be maintained for years.
As a DSL CEL is kinda pointless, since it does not create any additional convenience beyond the usual mainstream programming language syntax. It therefore leaves potential on the table, and as a tradeoff appeals to familiarity of syntax. As a configuration language it is usable, probably with reduced risk, compared to using Golang itself (no turing-completeness!).
I don't think it actually appeals to anyone, who considers creating a DSL for a good reason.
Re: Lingo: A Go micro language framework for building Domain Specific Languages
#39Or probably grule? [1] https://github.com/hyperjumptech/grule-rule-engine
Re: Lingo: A Go micro language framework for building Domain Specific Languages
#40Not to be confused with the Lingo programming language that was used in Macromedia Director to create Shockwave content ;) https://en.wikipedia.org/wiki/Lingo_(programming_language) https://en.wikipedia.org/wiki/Adobe_Shockwave https://en.wikipedia.org/wiki/Adobe_Director