News for hackers. Stuff that matters.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by thom on Friday March 07, 2025 @06:42AM (#43289382)
Delighted to discover this kind of breakthrough is based on a gnarly regular expression:

https://github.com/Svensson-Lab/pro-hormone-predictor/blob/m...

Re:Natural occurring molecule rivals Ozempic in weight loss,... by karolinepauls on Friday March 07, 2025 @07:34AM (#43289660)
The exception handling (by print-and-continue) that follows is another ge(r)m.

https://github.com/Svensson-Lab/pro-hormone-predictor/blob/c...

Re:Natural occurring molecule rivals Ozempic in weight loss,... by aitchnyu on Friday March 07, 2025 @08:08AM (#43289862)
Sonnet 3.7 explains it thusly: https://pastebin.com/43wrZvK0
Re:Natural occurring molecule rivals Ozempic in weight loss,... by xrisk on Friday March 07, 2025 @08:16AM (#43289909)
I’m not sure what this brings to the conversation. Are you able to attest to the correctness of what Sonnet claims?
Re:Natural occurring molecule rivals Ozempic in weight loss,... by JKCalhoun on Friday March 07, 2025 @08:33AM (#43290008)
I think we can be chill about it. For someone on the sidelines, mildly interested in the topic, an AI summary of the regex might be useful — and the person getting downvotes is saving some of us the time.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by crote on Friday March 07, 2025 @09:46AM (#43290588)
If I'm feeling ill, should I trust Google when it says that I am probably having "internet connectivity problems", or should I go to a proper doctor instead?

"LLM says X" is the new "I Googled it and here's a copy/paste of the top result". It adds literally nothing of value to the discussion.

Unless of course the discussion is specifically about the quality of LLMs - in which case you should be vetting the answer yourself so you can actually say something meaningful about it.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by SketchySeaBeast on Friday March 07, 2025 @09:32AM (#43290467)
Yes, it might be misinformation, but it's convenient misinformation, is that the idea? And yes, it's true that a source like wikipedia could be too, but that has to withstand scrutiny to remain on the site, no such checks or balances in AI.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by andershaig on Friday March 07, 2025 @09:49AM (#43290607)
It's clearly labeled as the output of Sonnet 3.7, not truth. We all need to apply our own critical analysis of anything we read, whether it's claimed to be from an LLM or from Wikipedia. The possibility of inaccuracy isn't a reason to withhold comment.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by SketchySeaBeast on Friday March 07, 2025 @10:00AM (#43290702)
So what do we do with that information? If I apply a critical framework around interpreting the LLM output, the answer is to reject it for being both not necessarily true but also knowing that the LLM isn't even trying to be correct, it's strictly trying to produce convincing sentences.

What value does a link to a source that's not held to any standard to be informative do? Seems a waste of everyone's time to me.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by gs17 on Friday March 07, 2025 @10:51AM (#43291154)
Yes, I'd rather have it cited as an unreliable source than uncited. Every human will happily regurgitate misinformation they've absorbed unknowingly, so it's not that much worse than a confident human comment with no real citation besides themself.

However, I also think it's valid to question what it adds to a conversation if someone is quoting it verbatim. Would we be happier if HN was like Quora and automatically added an AI response to everything?

Re:Natural occurring molecule rivals Ozempic in weight loss,... by JKCalhoun on Friday March 07, 2025 @11:10AM (#43291348)
Convenient misinformation? Well that's one way to put way too fine a point on it.

That or I must be a lot more LLM-accepting than most of HN.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by jillyboel on Friday March 07, 2025 @08:28AM (#43289969)
my grandma always said her knee hurts when it's about to rain
Re:Natural occurring molecule rivals Ozempic in weight loss,... by __jonas on Friday March 07, 2025 @09:54AM (#43290657)
Not sure what this adds, I believe your grandma over any LLM
Re:Natural occurring molecule rivals Ozempic in weight loss,... by genewitch on Saturday March 08, 2025 @02:20AM (#43298251)
parse this in the way that makes it so I'm not being a jerk. Are you as prejudiced against weather models or just large-language ones?

I have been waiting to ask someone this.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by __jonas on Saturday March 08, 2025 @05:55AM (#43299200)
I just value any persons lived experience over the output of a large language model and therefore don't think that the comparison makes a good point. If this is not a hypothetical but referring to a real grandma it's also pretty rude.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by genewitch on Saturday March 08, 2025 @02:20AM (#43298248)
Ive heard it has to do with barometric pressure. But I guess that's hard to test. I don't know if they make vacuum room facilities.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by mkoubaa on Friday March 07, 2025 @07:27AM (#43289615)
Beautiful yet terrifying. I'm glad that regex isn't something I'll ever have to touch.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by dleeftink on Friday March 07, 2025 @07:47AM (#43289727)
It's not that bad. AutoRegex[0] and regex gen [1] make it more accessible than ever.

[0]: https://www.autoregex.xyz/

[1]: https://regex-generator.olafneumann.org

Re:Natural occurring molecule rivals Ozempic in weight loss,... by janfoeh on Friday March 07, 2025 @08:20AM (#43289927)
Heh, I just fed autoregex a regex from one of my projects, and it simply times out. It comforts me to know that billion dollar LLMs have to chew on those just as much as I do.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by dleeftink on Friday March 07, 2025 @09:36AM (#43290496)
A proper litmus test, what's causing the hang in your case?

Regex to me, is pattern finding and abstraction taken to the extreme. I like the challenge

Re:Natural occurring molecule rivals Ozempic in weight loss,... by tclancy on Friday March 07, 2025 @10:19AM (#43290851)
I think what's causing the hang is using the site. I gave it [a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12} and it sat thinking about things for a few minutes. So I tried the reverse and asked it "Match a UUID" and it sat and thought about things.

Now I am enlightened.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by janfoeh on Friday March 07, 2025 @10:56AM (#43291202)
Aww shucks, and here I was feeling a wee bit proud of myself for managing to break it.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by janfoeh on Friday March 07, 2025 @09:51AM (#43290629)
Good question. The regex I tried is for extracting amounts in EUR and USD:

  /
  (?<=^|[ \t])
  (?<currency_prefix_with_space>
    (?<currency_prefix>
      €|EUR|\$|USD
    )
    [ \t]?
  )?
  (?<number>
    (?<integral>
      -?
      \d{1,3}
      (?:[\.,]\d{3}|\d*)
    )
    [\.,]
    (?<fraction>
      \d{2,3}
    )
  )
  (?<currency_postfix_with_space>
    [ \t]?
    (?<postfix_or_ending>
      (?<currency_postfix>
        €|EUR|\$|USD
      )
    ) | (?<ending>
          [ \t]|$|\n
        )
  )/x
Re:Natural occurring molecule rivals Ozempic in weight loss,... by dleeftink on Friday March 07, 2025 @10:13AM (#43290792)
I'd imagine many nested named capturing groups may trip even the best automated system! I do like the solution though.

I would've probably approached it differently, trying to first get the 'inverted' match (i.e. ignore anything that isn't a currency-like pattern) and refine from there. A bit like this one I did a while back, to parse garbled strings that may occur after OCR [0]. I imagine the approach does not translate fully, because it's pattern extraction rather than validation.

[0]: https://observablehq.com/@dleeftink/never-go-nuts

Re:Natural occurring molecule rivals Ozempic in weight loss,... by janfoeh on Friday March 07, 2025 @10:54AM (#43291185)
Thanks for sharing! I have to admit I do not have the necessary brain cycles to spare today, but OCR processing is indeed of interest to me, and I will take a more in-depth look in the upcoming days.

The idea of an exclusionary approach sounds interesting as well. I'll have to think about that a bit.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by dleeftink on Saturday March 08, 2025 @12:12AM (#43297663)
Check out WordNinja in case regex doesn't cut it! [0]

[0]: https://github.com/keredson/wordninja

Re:Natural occurring molecule rivals Ozempic in weight loss,... by janfoeh on Saturday March 08, 2025 @06:23AM (#43299321)
Will do, thanks again!
Re:Natural occurring molecule rivals Ozempic in weight loss,... by jagged-chisel on Friday March 07, 2025 @07:46AM (#43289720)
The good news is it’s read only- if you’re reading for understanding, you’re doing it wrong :-D
Re:Natural occurring molecule rivals Ozempic in weight loss,... by sgc on Friday March 07, 2025 @09:28AM (#43290444)
Regex is one of my favorite things to work with. It's surgery. I love having a very specific problem and a very sharp knife. What I hate is chasing down language or library bugs, or undocumented limitations. Of course I would hate it if I had never used it extensively. Its terseness is harder if you only have to pick it up occasionally.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by dleeftink on Friday March 07, 2025 @09:34AM (#43290478)
Re:Natural occurring molecule rivals Ozempic in weight loss,... by sgc on Friday March 07, 2025 @10:18AM (#43290833)
I have done something similar before, to help form an index for a large book. This is what I would consider a relatively simple regex.

The harder ones I have dealt with are those looking for malformed syntax where the closing mark that might be missing could be several thousand characters after the opening mark, or the opening mark itself might be missing, across a data set that is several hundred million characters. So you need something very complex to find all the distinctive characteristics of the content that is supposed to be enclosed - while avoiding the many similar structures that give false positives. Sometimes the technically easier solution is too slow to run (look ahead and look behind, etc), so you need to pivot and use other regex features. It can take a day or two to get right.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by trehalose on Friday March 07, 2025 @10:13AM (#43290788)
That regex detects things like "eeieiieeeiA __ 1 2 3__" as a proper noun. I'm confused by the decision to accept any number of leading [ei] and any number of trailing (?:\s+[_\d]+).
Re:Natural occurring molecule rivals Ozempic in weight loss,... by jcl on Friday March 07, 2025 @10:49AM (#43291124)
It only looks for a single leading “e” or “i”, not any number. I’m guessing those tweaks were added to capture specific proper nouns that weren’t captured by simpler “leading capital letter” regexes, like “iPad” or “eBay”.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by Izkata on Friday March 07, 2025 @03:34PM (#43294288)
"*" is "0 or more" and "+" is "1 or more", it looks for any number of "e" or "i" at the beginning and at least one capital letter. The diagram below the regex is wrong.

Instead of

  [ie]*-?[A-Z]+
it looks like they wanted

  [ie]?-?[A-Z]
Re:Natural occurring molecule rivals Ozempic in weight loss,... by genewitch on Saturday March 08, 2025 @02:11AM (#43298201)
There was a product called the eeePC or so. It was a "netbook."
Re:Natural occurring molecule rivals Ozempic in weight loss,... by card_zero on Saturday March 08, 2025 @02:22AM (#43298257)
The Asus product line, yes (all three Es apparently stand for "easy"). But Asus write it with a capital E on the front. Still, somebody else might not.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by dleeftink on Friday March 07, 2025 @10:15AM (#43290801)
It's not perfect for sure, but perfectly suitable for a first pass and then a dictionary sweep or another set of regexes. I guess I like the compactness of it!
Re:Natural occurring molecule rivals Ozempic in weight loss,... by jpc0 on Friday March 07, 2025 @09:49AM (#43290606)
Remember to get a license for your code

https://regexlicensing.org/

Re:Natural occurring molecule rivals Ozempic in weight loss,... by jasonjayr on Friday March 07, 2025 @09:58AM (#43290685)
On the list of disasters, they forgot "parsing html":

https://stackoverflow.com/questions/1732348/regex-match-open...

Re:Natural occurring molecule rivals Ozempic in weight loss,... by joseda-hg on Friday March 07, 2025 @10:32AM (#43290961)
Huh, I tried sharing the Zalgo answer here, but it didn't quite work, never knew HN wouldn't render those kinds of characters
Re:Natural occurring molecule rivals Ozempic in weight loss,... by qingcharles on Friday March 07, 2025 @01:03PM (#43292437)
It did, but I kinda went over the top with it once and dang had to tell me off, so it might be they added filtering.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by genewitch on Saturday March 08, 2025 @02:12AM (#43298204)
o, there's your problem. Only half is supposed to go over the top. The rest is supposed to go below.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by binarymax on Friday March 07, 2025 @10:28AM (#43290914)
> Licenses: “No regex licenses have been issued at this time.”

Perfect

Re:Natural occurring molecule rivals Ozempic in weight loss,... by sgc on Friday March 07, 2025 @01:32PM (#43292798)
Just license 007: License to kill.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by alienbaby on Friday March 07, 2025 @12:41PM (#43292219)
Yes, once you have a scalpel, everything looks like a very specific problem ;)
Re:Natural occurring molecule rivals Ozempic in weight loss,... by sgc on Friday March 07, 2025 @01:31PM (#43292775)
That is the temptation! No requirements, no conventions, no best practices, no nagging boss, just me and total root access to all the files :)
Re:Natural occurring molecule rivals Ozempic in weight loss,... by sumtechguy on Friday March 07, 2025 @10:04AM (#43290722)
I think it comes down to the syntax being used to make regex. It is borderline an assembly language level of making them. Better language tools would make it easier for people to grok. Basically instead of using chars like ?^()$ and the like lets use words people understand.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by aranchelk on Friday March 07, 2025 @10:25AM (#43290898)
It’s not just the syntax. Regex isn’t directly composable (unless you just mash together strings). They cannot define nested structures, I.e. no recursion. They can’t maintain context.

We don’t need better language tools. Better parsers can, and already have, been implemented in libraries.

I’d have a look at parser combinators.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by dur-randir on Friday March 07, 2025 @11:04AM (#43291276)
(?R) is very much recursion in there.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by johnisgood on Friday March 07, 2025 @11:47AM (#43291711)
> They can’t maintain context.

Is true though, or perhaps "state"? I know I had to come up with an algorithm because regexp alone couldn't do what I wanted (not even advanced features like lookahead, lookbehind, etc.)

Re:Natural occurring molecule rivals Ozempic in weight loss,... by davidwritesbugs on Saturday March 08, 2025 @06:37AM (#43299404)
I played with parser combinators in Elm and found it very useful c.f. regexes - the issues were mainly down to the Elm implementation. Not sure how effective they are in Rust or Go
Re:Natural occurring molecule rivals Ozempic in weight loss,... by rstuart4133 on Friday March 07, 2025 @07:36PM (#43296366)
As @aranchelk said LL and LR grammars are literally that. They allow you to assign names to regexs and compose them.

Libraries like python's lrparsing [0] let you assign regex's (aka tokens) to variables, then build grammars by combining them using python expressions. For example:

    while_statement = Keyword('while') + '(' + expression + ')' + block
    statement = while_statement | ....
    block = Token('{') + Repeat(statement + ';') + Token('}')
These grammars are more complex, with more rules you have to follow, but also more checking is done when they are compiled. They tend to mostly work once they do compile. So they are what you asked for, but there is no free lunch.

On the down side, lrparsing is pure python so it's slower than python's inbuilt regex's.

[0] https://lrparsing.sourceforge.net/

Re:Natural occurring molecule rivals Ozempic in weight loss,... by badc0ffee on Friday March 07, 2025 @12:08PM (#43291920)
I'm comfortable with it (having previously been paid to write Perl for several years), but what I don't like is how many other people I have worked with aren't, and just blindly paste in (totally incorrect) regexes from Stack Overflow.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by UltraSane on Friday March 07, 2025 @04:30PM (#43294936)
Writing one that does exactly what you want is very satisfying. And with Python you can have named groups extracted into a dict and it just feels like magic.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by choxi on Friday March 07, 2025 @10:02AM (#43290715)
Is this AGI?
Re:Natural occurring molecule rivals Ozempic in weight loss,... by cropcirclbureau on Friday March 07, 2025 @10:51AM (#43291156)
Ask Deepseek to generate a regex for detecting python import statements.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by ch4s3 on Friday March 07, 2025 @10:33AM (#43290969)
oh god, can you even imagine?
Re:Natural occurring molecule rivals Ozempic in weight loss,... by ricardonunez on Friday March 07, 2025 @09:12PM (#43296923)
After using a regex that creates AGI researcher will see the world like Neo sees the matrix.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by crazygringo on Friday March 07, 2025 @10:12AM (#43290785)
Please, if you write regexes like these, comment them...

A great way to do it is to split them up by concatenating them across a bunch of lines, and put a brief explanation at the end of each non-obvious part (to the right, on the same line).

Plus that also lets you indent within nested parentheses, making it that much more understandable.

I'm baffled when I come across a file like this where the code itself is heavily commented, but a gnarly regex is not. Regexes are not strings, they are code -- and with their syntax, they need comments even more.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by loginx on Friday March 07, 2025 @10:30AM (#43290938)
One thing I always appreciated about CoffeeScript was its [heregex syntax](https://coffeescript-cookbook.github.io/chapters/regular_exp...), which made regexes clear and easy to document.

Many CoffeeScript constructs were adopted into JavaScript and TypeScript, but unfortunately, heregexes weren't among them.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by yesbabyyes on Friday March 07, 2025 @10:42AM (#43291052)
I agree. I'm pretty sure jashkenas got it from Ruby, which got it from Perl, with the `/x` flag (for extended regular expressions).

Later languages have added support for the `x` flag, including C# and Rust. There is also a stage 1 proposal for JavaScript: https://github.com/tc39/proposal-regexp-x-mode

Re:Natural occurring molecule rivals Ozempic in weight loss,... by loginx on Friday March 07, 2025 @10:55AM (#43291194)
Nice roundup, and thanks for sharing that proposal!
Re:Natural occurring molecule rivals Ozempic in weight loss,... by genewitch on Saturday March 08, 2025 @02:17AM (#43298232)
Notepad++ has /x mode as well.

I probably use regexes the most in notepad++

Re:Natural occurring molecule rivals Ozempic in weight loss,... by rtkwe on Friday March 07, 2025 @10:45AM (#43291083)
regex101.com is a lifesaver for parsing esoteric regexes after you've forgotten what they're supposed to do.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by PickledChris on Friday March 07, 2025 @12:31PM (#43292133)
Great advice that is a bit redundant with LLMs, no? They're pretty great at all forms of translation.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by crazygringo on Friday March 07, 2025 @05:48PM (#43295642)
First, I don't want to waste time feeding something into an LLM that should be commented in the first place.

Second, not at all. An LLM can tell you how the regex works (hopefully). It can't tell you what each piece means in terms of the program's logic. Or at least not always and not reliably.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by flobosg on Friday March 07, 2025 @10:47AM (#43291105)
Welcome to the fascinating world of academic code!
Re:Natural occurring molecule rivals Ozempic in weight loss,... by ge96 on Friday March 07, 2025 @10:59AM (#43291229)
Is that an anti-pattern to put the comment inside the function vs above
Re:Natural occurring molecule rivals Ozempic in weight loss,... by TheRealPomax on Friday March 07, 2025 @11:04AM (#43291269)
Function documentation goes inside functions in Python, explicitly making them self-documenting. That can then be automatically picked up by any other code (like tooling for automatically generating API documentation) formalized as PEP 257, https://peps.python.org/pep-0257

Python will literally assign the content of your docstring (a triple-quoted string at the start of a function) to a special double underscored ("dunder") property called `__doc__` that any code can access; not just docs generators, but your own code as well (pretty dang useful for generating on-the-fly help output!).

Which also means that if you run into weird behaviour where a function doesn't do what you think it should do, you can just fire up the REPL, import that function, type `print(function_name.__doc__)` and presto, you have the documentation right there, specifically for the exact version you're using. You don't even need to leave your IDE if it comes with an integrated terminal.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by Wilduck on Friday March 07, 2025 @11:57AM (#43291809)
> type `print(function_name.__doc__)`

Or even easier: `help(function_name)`!

Re:Natural occurring molecule rivals Ozempic in weight loss,... by TheRealPomax on Friday March 07, 2025 @08:35PM (#43296700)
https://news.ycombinator.com/item?id=43266546 just got posted about that =D
Re:Natural occurring molecule rivals Ozempic in weight loss,... by lelandfe on Friday March 07, 2025 @11:15AM (#43291398)
TIL __doc__! Pretty nifty.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by ge96 on Friday March 07, 2025 @11:14AM (#43291383)
interesting TIL too bad we don't have auto doc gen (fastapi what I'm working with atm)

edit: not saying it can't be done but our org isn't using auto docs

Re:Natural occurring molecule rivals Ozempic in weight loss,... by TheRealPomax on Friday March 07, 2025 @11:30AM (#43291552)
Yeah, it's one of those "Once you're used to writing doc strings, you have no reason to ever use anything else" but if you don't use them, it can be prohibitively laborious to move whatever alternative you're using over to "PEP-compliant".

(lots of fun dunder functions in Python that make metaprogramming a lot easier, but someone needs to tell you about)

Re:Natural occurring molecule rivals Ozempic in weight loss,... by disgruntledphd2 on Friday March 07, 2025 @01:40PM (#43292893)
Fluent Python covers a bunch of this stuff.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by Der_Einzige on Friday March 07, 2025 @12:37PM (#43292188)
How is this not more well known? I thought I was a god for discovering dir() but you’re showing that I was nothing but a peon!!!
Re:Natural occurring molecule rivals Ozempic in weight loss,... by TheRealPomax on Friday March 07, 2025 @06:13PM (#43295856)
There's a bunch of "all dunder properties" pages online, any one of them is well worth reading through at least once. So much hidden goodness.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by wiml on Friday March 07, 2025 @08:32PM (#43296685)
The actual docs on python.org are quite readable and probably a lot more accurate than random blogspam / LLM glurge pages
Re:Natural occurring molecule rivals Ozempic in weight loss,... by TheRealPomax on Friday March 07, 2025 @08:37PM (#43296716)
Why would you assume it's LLM slop when Python's been around for decades? Lots of folks are enthusiastic enough about "Python magic" to have done excellent writeups of literally ever dunder function under the sun on a single page, at a level of detail and excellence that the python documentation, bless its heart, cannot ever hope to match.

- The python docs are there to give you the information you need.

- Passion pages are there to do a deep dive into all the crazy shit you can do with that information =D

Re:Natural occurring molecule rivals Ozempic in weight loss,... by Izkata on Friday March 07, 2025 @03:29PM (#43294229)
> Python will literally assign the content of your docstring (a triple-quoted string at the start of a function)

Any string. Triple-quoted is just multiline strings and works anywhere.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by TheRealPomax on Friday March 07, 2025 @06:14PM (#43295862)
True, I forget some people think a single line is function documentation; any function that's worth documenting is worth documenting properly, and needs multiline ;)
Re:Natural occurring molecule rivals Ozempic in weight loss,... by fire_lake on Saturday March 08, 2025 @02:29AM (#43298283)
Annoyingly it pushes the type definitions away from the function body when you have a particularly long doc. It’s a cute trick but docs above would have been better.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by TheRealPomax on Sunday March 09, 2025 @06:10PM (#43314424)
You know what's cool: IDEs. They can do block folding. The really good ones just auto-fold function docs because you don't need to see those until you do.

It's not just a good trick: it's the right way to do it, and tooling can be (trivially) made to show you only what you need to see until you need to see more.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by fire_lake on Tuesday March 11, 2025 @06:23PM (#43337753)
If we’re assuming an IDE that can arbitrarily change text layout and rendering I don’t see why it matters where the comment goes
Re:Natural occurring molecule rivals Ozempic in weight loss,... by nilstycho on Friday March 07, 2025 @11:02AM (#43291251)
I got lost at (?R). IIUC, this is a feature of the "regex" module that "tries to match the entire regex recursively". Fun.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by hedora on Friday March 07, 2025 @11:19AM (#43291439)
That’s only the tip of the iceberg. Here’s “How Perl saved the human genome project” from 1996:

https://bioperl.org/articles/How_Perl_saved_human_genome.htm...

(And of course all the articles about excel renaming genes, and then people trying to clean up the mess…)

Re:Natural occurring molecule rivals Ozempic in weight loss,... by vlovich123 on Friday March 07, 2025 @11:45AM (#43291686)
> The study would not have been possible without the use of artificial intelligence to weed through dozens of proteins in a class called prohormones.

I see we’re being fast and loose with the term “artificial intelligence”?

Re:Natural occurring molecule rivals Ozempic in weight loss,... by cosmie on Friday March 07, 2025 @11:49AM (#43291723)
Could be that they relied on AI to generate the gnarly regex ¯\_(ツ)_/¯
Re:Natural occurring molecule rivals Ozempic in weight loss,... by ddalex on Friday March 07, 2025 @11:50AM (#43291735)
Any sufficiently advanced regex is indistinguishable from AI.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by wslh on Friday March 07, 2025 @11:55AM (#43291794)
Even simple regex ones, since we don't know if they were created by a human or an AI.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by readthenotes1 on Friday March 07, 2025 @01:12PM (#43292549)
I'm trying to think of a funny way to cite Clark's Law, but failing...
Re:Natural occurring molecule rivals Ozempic in weight loss,... by Izkata on Friday March 07, 2025 @03:00PM (#43293864)
Regexes occasionally get called "black magic", and there is is an inverse of Clarke's Third Law: Any sufficiently advanced magic is indistinguishable from technology.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by xeonmc on Saturday March 08, 2025 @10:58AM (#43301163)
I think you meant “any sufficiently commoditized magic is indistinguishable from technology”, or “any sufficiently analyzed magic is indistinguishable from science.”
Re:Natural occurring molecule rivals Ozempic in weight loss,... by J_Shelby_J on Friday March 07, 2025 @02:04PM (#43293155)
With enough if statements, you could create a LLM.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by jajko on Friday March 07, 2025 @05:11PM (#43295343)
I am still waiting for an LLM trained to focus on effin' regexes and their variants like sed, somebody please do a page with ads for this and you will have a nice little side income and warm fuzzy feeling on top of it.

Natural language -> fully working one, I don't mean some email validators but way more complex stuff. Although, I've recently had a case which was too much even for regexes in any form or spec, then sort of grammar-based parser needed to be done from scratch.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by vlovich123 on Saturday March 08, 2025 @12:49AM (#43297826)
I haven’t had the need for super complicated regexes, but ChatGPT and Claude both worked fine to generate a regex to extract markdown code blocks.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by Taylor_OD on Friday March 07, 2025 @12:19PM (#43292004)
AI is the new, “Algorithm”. It is an overly broad term that basically means, “Technology” to people who use it.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by swat535 on Friday March 07, 2025 @02:05PM (#43293167)
For non-technical people, terms like Machine Learning, Algorithm, Automation, AI, Neural Networks and 'Magical Powers' are synonymous.. Journalists, marketing teams, and executives choose whichever term generates the most hype and clicks.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by RandallBrown on Friday March 07, 2025 @02:12PM (#43293273)
I like to describe my job as a software engineer as "wizardry" to people. With the way LLMs are writing code, it's only getting closer to writing actual spells.
Re:Natural occurring molecule rivals Ozempic in weight loss,... by Terr_ on Friday March 07, 2025 @05:26PM (#43295482)
> "Formerly, when religion was strong and science weak, men mistook magic for medicine; now, when science is strong and religion weak, men mistake medicine for magic."

— Thomas Szasz

Re:Natural occurring molecule rivals Ozempic in weight loss,... by ahazred8ta on Saturday March 08, 2025 @08:39AM (#43300175)
"Like a magic crystal mirror, My computer lets me know Of the other world within it Where my body cannot go / The computer is a gateway To a world where magic rules Where the only law is logic Webs of words the only tools" https://mindstalk.net/filk/world.html
Re:Natural occurring molecule rivals Ozempic in weight loss,... by hahajk on Friday March 07, 2025 @07:02PM (#43296169)
My understanding is that the original use of AI was to describe algorithms that solved complicated problems, but only sometimes, and usually through heuristics. As opposed to provably correct algorithms like Dijkstra's.

I think that's how we still use it.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by sporkland on Friday March 07, 2025 @01:16PM (#43292591)
It is a somewhat though provoking question for me where you LLM's fall in automata theory? Are they non-deterministic finite automatons which would make regex's a cousin? Or does it require pushdown automata levels of capability?
Re:Natural occurring molecule rivals Ozempic in weight loss,... by scarmig on Friday March 07, 2025 @03:06PM (#43293932)
Regexes were invented by Kleene in 1951, to describe McCulloch-Pitts neural nets. So, artificial intelligence!

https://www.rand.org/content/dam/rand/pubs/research_memorand...

Re:Natural occurring molecule rivals Ozempic in weight loss,... by nextos on Friday March 07, 2025 @05:51PM (#43295668)
Jokes aside regexes being AI, lots of protein motifs can be elegantly described by simple regexes. And their classification performance is sometimes perfect.

See the Eukaryotic Linear Motif resource: http://elm.eu.org/elms.

Re:Natural occurring molecule rivals Ozempic in weight loss,... by escapecharacter on Friday March 07, 2025 @05:36PM (#43295555)
unfortunately, if you do anything computational, when you need to explain it to a journalist/public audience/young person you want to hire/investor/trendchasing early user, you are incentivized to call it "AI".
Re:Natural occurring molecule rivals Ozempic in weight loss,... by sunrunner on Friday March 07, 2025 @12:11PM (#43291940)
Neat. I always thought Advent of Code 2015's Day 19 (Medicine for Rudolph) was just an exercise in parsing and validation of production rules against a grammar, and any use of regex in that puzzle solution was purely coincidental ;)
Re:Natural occurring molecule rivals Ozempic in weight loss,... by y33t on Friday March 07, 2025 @01:11PM (#43292539)
Obligatory xkcd:

https://xkcd.com/208/

Re:Natural occurring molecule rivals Ozempic in weight loss,... by rendang on Friday March 07, 2025 @01:37PM (#43292852)
A very early one at that