« first day (2407 days earlier)      last day (1064 days later) » 

9:59 AM
I made a thing with proc macros. lazy-regex 2, a macro for lazy static regular expressions checked at compile time, and facilities for concise capturing
 
> [...] with a familiar suffix syntax [...]
Why? Familiar to whom? JS devs?
Why aren't those flags passed down as separate arguments?
 
For example.
It's a literal. Having them as a separate argument doesn't make anything simpler IMO
And Rust already has string literal suffixes in the language
 
No, it makes self-documenting though.
 
In a proc macro ?
 
@DenysSéguret Suffixes, really? I was only aware of prefixes.
 
10:05 AM
Not yet used, I think, but in the language
 
@DenysSéguret Whichever macro / function invocation.
 
The "familiar suffix syntax" part is probably not improving the description. I'll change it
 
E.g. In Python I love that I can use it as follows: compile(<regex-literal>, VERBOSE | MULTILINE)
 
For me the flags are inherently part of the regex literal. Having 2 literals isn't better
@PeterVaro Yes but it's not a literal
 
Because the flags are NOT part of the literal.
They are part of the compiled expression / matcher.
The same for JS, IIRC the RegExp constructor takes them as separate args
(and the syntax for it is just sugar)
 
10:09 AM
It's far from just sugar. It's checked at compile time
 
Yup, I just double checked
@DenysSéguret I mean in JS, when you add the suffix, it is just sugar for the constructor invocation.
 
I like sugar.
 
The flags change the way the regex is compiled. They change the NFA/DFA. I don't understand why you think they're not an inherent part of the regex
 
@E_net4thejanitor It is very bad for you though.. especially in an unbalanced diet.
 
@PeterVaro Ah well.
 
10:13 AM
@DenysSéguret That's not what you said. They are part of the regex, but not part of the literal. You said the word, literal. And I argue, that no, they are not part of the (let's use a different expression) pattern, but part of the arguments you pass down to the compiler which produces the regex (or matcher).
Thus for me, semantically the two things, pattern and flags are separate entities
If you would use expressions like (?i) and (?m) then they would be part of the pattern.
(Which expressions are not supported by most regex-engines in the Rust world AFAIK)
@DenysSéguret Don't get me wrong, you did what for example the JS devs / ECMAScript committee did. And what I'm saying could be interpreted as "personal preference". I'm just arguing about how I would've done it, not saying objectively which one is correct.
 
The real reason I did the new version with proc macros is I wanted a simpler way to capture groupes. It's horrible with just the regex crate
(I was curious about proc macros, too)
 
That part is fine, I'm not arguing about that bit :) Good for you, and likely you made something great -- I yet to try it should the need arose ;)
 
10:33 AM
I'm kind of a regex fanatic. Almost all my programs use them at some point. Even if I convince nobody to use lazy-regex, it will be used a lot, by me.
Damn... "more easier" ^^
 
Me too, I never understood people with the opinion of introducing regex will introduce more problems and not solutions. I'm the author of some of the most popular syntax highlighters of SublimeText, each of which are hundreds of lines of regexes, I literally read and write them without thinking. (I know, I know, no need to flex.)
Yet, I tend to only use them, when they are justified and use simple manual parser when they suffice.
 
10:52 AM
In other news, functional proc macros aren't easy to learn IMO. I din't find any good doc.
I understand why we got this strange design but it's not obvious initially and not intuitive
 
11:03 AM
@DenysSéguret that your biggest default :p
 
If that's my biggest default, I'm better than I thought :)
 
11:14 AM
denys on his way of checking his mails:
 
 
2 hours later…
1:35 PM
posted on May 17, 2021 by The Rustup Working Group

The rustup working group is happy to announce the release of rustup version 1.24.2. Rustup is the recommended tool to install Rust, a programming language that is empowering everyone to build reliable and efficient software. If you have a previous version of rustup installed, getting rustup 1.24.2 is as easy as closing your IDE and running: rustup self update Rustup will also automatically u

 
 
4 hours later…

« first day (2407 days earlier)      last day (1064 days later) »