How is this considered remotely acceptable in 2024?
$ deno # same with node. It's really V8
> let r = /.*foo.*bar/
undefined
> let s = "no".repeat(100000)
undefined
> console.log(performance.now()); r.test(s); console.log(performance.now())
22362.667416
93954.182416
@renniezen@cscheid warning: what you get in computers these days only looks as a regex, and in reality has exponential complexity instead of linear, because perl
@cscheid@renniezen well yes, that's what I said, even if you choose to intentionally pick an interpretation that doesn't make sense instead -- what you see in modern computing called "regex" has nothing to do with finite automata these days
I sometimes wonder if I should teach a project course (like raft or compilers) where you don't even know what programming language will be used until you show up. That would certainly be one way to make things even more exciting.
@dabeaz I'm not a teacher, so I don't know how hard it would be, but I imagine you would only use syntax and structures that are shared by many languages, and perhaps use an online service for running the code, so you don't really know what is used underneath... Could even fill in some boilerplate for you, a bit like Arduino does for C++, so you can't guess by that.
Remember that automation is not about removing effort, it's all about packaging it in convenient ways so that it can be stored and moved around. Sometimes you get some savings due to bunching up of similar things or economy of scale, but most of the time the perceived savings are simply because the real effort is hidden away or deferred. Whether it's Jacquard looms, language models, github actions, self-driving cars, or robot food delivery, someone is doing (or has done, or will do) the work.
@dcz Ah, but what about the effort needed to build the loom, to operate it, to load it with materials, to monitor it, operate the steam engine that powers it, to maintain it all in good repair, and to fix things when they break? And the cost of changing the patterns as the fashions change becomes huge, when it was a trifle before. All this effort is hard to see by just looking at the loom running for a few minutes, but it's still there, hidden by the technology, moved out of sight.
Amazon improvement idea: give me a slower delivery option. Like I want to buy the thing now, but I won’t be ready to use it until next week, so save me the hassle of dealing with it until then.