Live data from Hacker News

DSLs are a waste of time

leebriggs.co.uk

141–150 of 165 posts

Re: DSLs are a waste of time

#141
post #81
post #71

Earlier quoted context omitted.

I think your examples are spurious and wrong, when compared with the specific kind of DSL the article talks about. SQL is a "Fourth Generation Language", much like Prolog, which is quite different to what is being discussed. HTML isn't a DSL; it's a type of SGML, a specific document markup language - you can't just shout "DSL" and squint a bunch and assume "All sort-of-languages are DSLs". Regular expressions, sure,…

Untyped lambda calculus FTW!

It is. But nobody listens. Ever.

Re: DSLs are a waste of time

#142

Earlier quoted context omitted.

> Is SQL a “waste of time?” It certainly wastes a lot of my time because it is considered just a DSL and not a "real" programming language, and therefore doesn't get the same kind of attention towards making it better that "real" programming languages get. Maybe there is something to the original thesis. Like, why can't I import shared query modules to compose into my queries? I can't imagine any other programming la…

I feel like the things you don't like about SQL are explicit design choices that make it well suited for many tasks, but perhaps not whatever you are trying to do. It's like, "Geez, regular expressions sure do suck. They don't come with a package manager, concurrency, or a way to make system calls." I only feel comfortable embedding regular expressions or SQL in code because they are inherently restricted "DSLs." If…

> why is the feature better handled within SQL as opposed to in the general purpose query language managing the DB queries and making the calls?

If the environment hosting and managing the queries (e.g. psql) is open source, maybe you can hack in support. Often that is not the case. Even when you are able, then your work becomes non-standard and thus not easily shared with other analysts, which kind of defeats the whole sharing of modules.

If you are writing a full-fledged application, using "real" programming languages, then a lot of people build their own query languages on top of SQL, treating SQL as just an "assembly language" that their query language compiles to, to add what SQL lacks. That's all well and good, but totally overboard when you just want to answer some questions about your data.

I do think you make a point that SQL tries to be too many things to too many people. No question, it is useful being able to embed SQL strings into other code without needing to worry about complex dependencies... Except you still have that worry as we already tried adding that composition through stored procedures, views, etc. which are dependent on a particular database state being true. It's there, just not very well thought out from a developer ergonomic perspective. Indeed, SQL is confused.

Re: DSLs are a waste of time

#143

Earlier quoted context omitted.

The point is that the config gets more and more complex, requiring more and more features, until you get a rather ugly turing-complete programming language. And the further point is that with Lisp, you don't need any of that. Code is data. Data is code.

But then you're moving towards less of an app with configuration, and more of a "Here's a new programming language and frameworks to write your own app!" Situation. If possible I'd rather examine why people need so many config options, and design from the start so that things don't need to be manually configured as much. If a turning complete config really is the way to go, I'd rather just use JS or Python, not somet…

I think that you really have to use some Lisp to get the point here. The point is it's the best of both worlds, and the problem somewhat vanishes. But I don't know if I can convey that to you in words.

Re: DSLs are a waste of time

#144
post #131

Earlier quoted context omitted.

>You can pry vim from my cold dead hands. I won't need to, you're already giving yourself carpal tunnel with all the :wQ! INSERT-MODE :wmkGDonzn zz CWSFD, these hands are already marked for death.

actually the opposite is true. esc-meta-alt-ctrl-shift[0] is more likely to give you carpal tunnel, than vi where you switch modes and then type commands with single keys instead of twisted key combos. i actually get annoyed at how many ctrl-key combos vim has. [0] i don't know if emacs is that bad, but that's a classic pun that just fit here.

I used vim for 10 years (not really an advanced user, but comfortable with it), and I just learned Emacs for the last 6 months...

I am now completely confused by the Emacs vs Vim religious war.

The two programs excel at completely different layers of productivity.

I can't think of any software that radically approaches improving your workflow like either vim or Emacs, and they are both wholly unique.

I also use evil mode in Emacs and while it feels like a great match, it has some impedance mismatch in some emacs packages.

It really makes me wonder if there is a deeper layer of integration that can be done here to really allow people to take the reigns off their interaction with computers.

Re: DSLs are a waste of time

#145
My favorite example of Terraform being a terrible DSL for infrastructure: code to find ipv6 addresses in a list of v4/v6 addresses

  [for x in x.addresses: x if length(regexall(".*[:].*", x))>0]

Re: DSLs are a waste of time

#146
post #9

Why don't we have a tool that lets us associate monetary budgets to concrete hardware specs, and then generates a cross-cloud (or cloud-agnostic) configuration? budget: $23000 pricing: cheapest cpu: preferred: xeon cores: 8 mem: 64gb disk: preferred: ssd And some --import-usage flag to specify a folder of historical CPU and memory usage from Grafana.

Found a great option for you at $23000. Amazingly we managed to accommodate your budget. /s

It does sound foolish to share that directly to the cloud provider. They have an incentive to maximize spend--although they may also provide more than enough oomph with that much spend. It would lie on the payor to collect on all the available discounts (multi-year commitment, etc).

Assuming the tool is more or less one step removed from an elaborate spreadsheet and more of a crowdsourced, open optimizer, do you feel there would be any gains to generating multi-cloud setups, or just unnecessary complexity?

Is it possible to have a good-faith network of operators reporting monetary info along optimal routes?

Routes less like distances, and more like "given your compute and memory profile, a tier 2 storage bucket in AWS and 4gb VM in GCP would fit your budget."

Re: DSLs are a waste of time

#147

Why don't we have a tool that lets us associate monetary budgets to concrete hardware specs, and then generates a cross-cloud (or cloud-agnostic) configuration? budget: $23000 pricing: cheapest cpu: preferred: xeon cores: 8 mem: 64gb disk: preferred: ssd And some --import-usage flag to specify a folder of historical CPU and memory usage from Grafana.

This is backwards. What you want is to specify resource limits and then have the maximum possible bill calculated for you. If you want services to turn off if they exceed a threshold then you will need some sort of priority scheme.

A capped resource limit and/or budget does sound easier to manage. Here is your possible max; after that, shut stuff down in this order.

If it were any easier, it would likely be automated as a layer above Infra as Code (IaC). Someone may need to manually check on teams and ensure critical apps are not throttled before less critical ones.

Re: DSLs are a waste of time

#148

Earlier quoted context omitted.

Regular expressions, as used in practice in programming are mathematically general for interacting with strings, but they are in no way fundamental. They are a DSL for generating NFAs and DFAs (depending on the underlying engine). There is nothing fundamental about them, they are just a shorthand (a DSL) for those abstractions. Indeed, the very article you posted notes that anything able to be implemented as a finite…

You're grasping at straws now. Just admit that regex is a much more fundamental technology than some ad-hoc, badly specified commercialware and we can be done. Go on, you can find it in yourself ;-D. Sure, Makefiles are a DSL. Just a horrible one. They just make my point in a different way. Have you used a Makefile recently? They are AWFUL . Brittle, complex, half-bash, invisible-tab-prefixed, abominations, sent from…

You seem to have fundamentally misunderstood my purpose for engaging you. I tried repeatedly to move the conversation from a poorly supported absolutist statement from you to a productive discussion about what makes a DSL good or bad, but you're only interested in defending yourself and your over encompassing statement, not in actually having a discussion. Such as why does being fundamental in some way make it a good DSL? Are all fundamental concepts worthy of a DSL?

In any case it's clear you're uninterested in engaging on that and nor are you willing to consider your statement carefully and actually support it with additional examples (beyond some puzzling critiques of makefiles which make me think you don't understand the point of a DSL at all) or walk it back to a reasoned examination. So I'm not sure we'll get much out of continuing this.

Re: DSLs are a waste of time

#149
post #60

Earlier quoted context omitted.

it's kind of a catch-22, right? SQL is declarative. And while people seem to love declarative DSLs, they are generally really only awesome on the happy path. For SQL, sometimes, it can be incredibly obtuse when something goes horribly wrong (in terms of query speed) -- even with great tools like EXPLAIN. And a query that is fast on one SQL might not be so fast on another SQL. For other declarative DSLs, I've definite…

> the biggest players (MySQL, Postgres, Sqlite) have actually done a reasonably good job of making the 98% paths very good and 90% of the rest "good enough". Exactly - Unless you are doing something really unusual (or wrong), the vendors of these engines have almost certainly encountered and optimized for some shape approximating your scenario. If you want to get into some extreme ends of the practice, "ancient" engi…

Eh, if you're at the point where you're doing stuff like "give me all records where a one-to-many has exactly two entries, and a different one to many has at least one record with property x" it gets VERY hard to do the correct performant SQL. I don't think that sort of query is too bizzare.

Re: DSLs are a waste of time

#150

Hyperbolic blog posts are so annoying. Really, if OpenTF happens, you’ll be back to square one? “ When the maintainers of OpenTF inevitably decide that they want to add enhancements that require language changes, you as the end user end up in a situation where you’re effectively back to square 1, learning (potentially) a new DSL.”

The post is from 2021

September 4th.
Post reply on HN