Live data from Hacker News

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

about.gitlab.com

51–54 of 54 posts

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

#51
post #45
post #6

Earlier quoted context omitted.

It is nuclear overkill for most problems you can think of. But when you hit a problem that you need something like this for... you need something like this. The attempts to get around it or avoid it or do some unbelievably hacky thing leads to piles and piles of terrible, terrible code. In 2024, though, I do try very hard to embed my DSLs in an existing serialization. It doesn't always work out, but, the case they sh…

To be clear, my problem isn't with requiring a single DSL, it's with writing so many DSL's at work that there's need for a DSL writing framework to crap them out even faster. At what point do you sit back and ask, is there a way to reduce complexity here? Is it not until you're joining a team where the last guy made dozens of DSL's for all his tools? That was the main reason I was expecting more than a few real world…

> is there a way to reduce complexity here?

Yes, you can generate your test data in the host language. That dramatically reduces upfront complexity.

But that doesn't come free. Now it is not easily transferrable to other languages. If you recall rsc's somewhat recent talk on testing, they benefited greatly by being able to use similar DSLs from other projects in tests to ensure feature parity. It can be a huge boon to have your test data scripts in an "agnostic" language for 30 years down the line when you are no longer working in the same environment.

Tradeoffs, as always.

> I was expecting more than a few real world use cases

Maybe that's the only use-case they know of? The project was clearly built for a specific purpose.

That's not to say that it cannot be found useful elsewhere, but that doesn't mean they have found it to be. If someone else finds it useful in other applications, I'm sure they'll write their own document about it. That's what the web is for, after all.

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

#52

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 exists for Go and (safely) solves many of the problems you might also want a DSL for.

Seems like it would be difficult to use for what they are trying to achieve. Lua would be a better fit, however it is noted that they tried it first, but ran into some kind of issue with it. So now Limbo is among the "off the shelf" options.

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

#53
post #20

Earlier quoted context omitted.

> 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

I don't think it has to "obey Python semantics" at all to be an eDSL.

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

#54
A generic structure is not a notation. XML or S-expressions are a generic structure. A good practical test that shows limitations of this approach would be to try to write something like a picture description similar to Pikchr (PIC). It is possible, but the result will be far more verbose and obtuse than what you get with a real grammar and parser in Pikchr.
Post reply on HN