Live data from Hacker News

Lingo: A Go micro language framework for building Domain Specific Languages

about.gitlab.com

11–20 of 54 posts

Re: Lingo: A Go micro language framework for building Domain Specific Languages

#11
When 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 have long used "DSL" in this way, especially among LISP fans, but... I just don't get it. If I want a DSL it's because I want something that gives me, e.g., novel control flow constructs a la AWK, or highly specialized semantics a la regular expressions, that directly suit the problem domain. If I'm not getting that kind of power, why tie myself to some esoteric dependency? Either way you're adopting a tremendous maintenance burden; it better be worth your while.

I'm a huge fan of Lua and have used it for many projects in different roles, but never once thought of any particular case as having created a DSL, even when stripping the environment to just a few, well-named, self-describing functions.

I don't mean to criticize this particular project. Good code is good code. It's just the particular conceptualization (one shared by many others, to be fair) of what a "DSL" means that bugs me.

Re: Lingo: A Go micro language framework for building Domain Specific Languages

#12
post #11

When 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 a very good and interesting point, but what if the point itself is to reduce the power and increase things like legibility.

If I create this kind of mapped functions DSLs I can assure that things will be done a a certain way vs the borderline infinite possibilities of code.

Re: Lingo: A Go micro language framework for building Domain Specific Languages

#13
post #11

When 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…

I don’t think there’s need to have such strict requirements. No need to invent a whole new paradigm, you can go with the usual ones as long as it works well. More often than not the domain is not that complex or flexible to require a language, it may only requires a few algorithms (libraries) ie even if you do invent a language, few programs will be built with it. You may as well tweak an existing language for a nicer DX

Re: Lingo: A Go micro language framework for building Domain Specific Languages

#14
Disclaimer: 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.

Re: Lingo: A Go micro language framework for building Domain Specific Languages

#15
post #2

This 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.

> 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.

Heh that was my first instinct as to why they built this as well but more for providing ergonomic ways to generate k8s objects for complex gitlab specific CRDs.

Re: Lingo: A Go micro language framework for building Domain Specific Languages

#16

Disclaimer: 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.

CEL seems to be for proto-buffers[1], not text?

[1] https://github.com/google/cel-spec/blob/master/doc/intro.md

CEL-go:

https://github.com/google/cel-go

Re: Lingo: A Go micro language framework for building Domain Specific Languages

#17
post #11

When 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…

Lisp macros can make their own control flow: it's like the relation of LinQ to F#.

Re: Lingo: A Go micro language framework for building Domain Specific Languages

#18
Not 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

Re: Lingo: A Go micro language framework for building Domain Specific Languages

#19

Disclaimer: 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.

CEL seems to be for proto-buffers[1], not text? [1] https://github.com/google/cel-spec/blob/master/doc/intro.md CEL-go: https://github.com/google/cel-go

Yes, cel-go. But it is all the same expression language. It is used in a number of places in GCP for example. Attribute based ACLs, and such.

Re: Lingo: A Go micro language framework for building Domain Specific Languages

#20
post #11

When 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…

> When I think of a DSL, I think of a language with specialized syntax, grammar, or constructs suited to the problem domain.

I think that's too strict. For example, JAX is (imo) an eDSL, but it doesn't have a specialized syntax, grammar or constructs - on the contrary, it's meant to feel just like Numpy. The thing that makes it special is the interpretation of those constructs.

Post reply on HN