Live data from Hacker News

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

about.gitlab.com

21–30 of 54 posts

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

#21
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…

lingo is a _framework_ for building your own DSL for your go application.

and by DSL they mean "extension language". like vimscript or emacs lisp. or guile or python...

so you can easily add primitives to your application specific language, in go, specifically.

https://gitlab.com/gitlab-org/vulnerability-research/foss/li...

I think this fits nearly with the common understanding "DSL" doesn't it?

https://en.m.wikipedia.org/wiki/Domain-specific_language

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

#23
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 know some people have long used "DSL" in this way, especially among LISP fans

generally this would be called an "embedded domain specific language". Some languages are relatively flexible to change the syntax. For example Common Lisp has reader macros to change the token syntax and macros to change the Lisp syntax. With that one can create all kinds of embedded languages, incl. domain specific languages (languages which are specific to a special domain). Examples would be embedded logic languages, query languages, rule based languages, languages to describe user interfaces, etc. The Common Lisp standard has a notorious example for that, a complex LOOP construct, which uses a very different syntax: https://www.lispworks.com/documentation/HyperSpec/Body/m_loo...

There are other real-world examples out there, for example an embedded domain specific language to describe 3d objects in the domain of parametric CAD, for description of technical things like turbines or other parts of an aircraft.

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

#24

Earlier quoted context omitted.

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.

Kubernetes too: https://kubernetes.io/docs/reference/using-api/cel/

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

#25
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…

Well, could you give some good examples of how is lua used in your projects in different roles? I'm curious.

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

#26

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.

[deleted]

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

#27

Regarding the Ruby example, why did they use Float("...") instead of #to_f?

Probably because `Float()` is stricter and will raise an error if the string isn't a valid number, whereas `#to_f` will silently return 0.0 or do a best-effort conversion (e.g. "1.2abc".to_f => 1.2)

Ohhh!

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

#28

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.

[deleted]

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

#30
post #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.

JAX isn't an eDSL, because it doesn't obey full Python semantics (namely, changing what a method does at runtime).

Mojo just discovered it ain't happening: https://news.ycombinator.com/item?id=41927000

Post reply on HN