Guys from kotlin stdlib/core team, can we have som...
# stdlib
e
Guys from kotlin stdlib/core team, can we have something similar to this in kotlin? https://forums.swift.org/t/pitch-regex-builder-dsl/56007
👍 1
👎 1
l
I already made a proof of concept for this actually. It's not much but I use it sometimes to generate the simple regexes that I need.
e
Could you make it appeared in stdlib, please?
l
Not as is, that's for sure. And I'm not affiliated with Jetbrains so that's not my decision. I shared more for in the meantime
z
File a more detailed feature request on youtrack
t
Why does a DSL for regex raise to the level of a stdlib feature? Why wouldn’t having it as a library be ok?
👍 1
3
e
Well, regex are as widely used as collections and date/time, which are presented in stdlib But the main reason - because Swift does that. Kotlin should be as modern as swift!
👎 1
t
I’d question that assumption that Regex is as widely used as date/time or collections. Also, the standard library already supports regular expressions, just not though a builder. I’ll leave “Kotlin should do it because Swift does it” for others to comment on.
☝️ 1
l
I do think that a Regex builder library as part of the standard library serves no better purpose than an external library. It does not benefit the language ecosystem
👍 1
👍🏻 1
e
@todd.ginsberg ok, you’re skeptical about having regex builders in stdlib, but what would you say about type safe regex patterns? https://forums.swift.org/t/pitch-regex-type-and-overview/56029
l
My personal opinion stays the same. It would make a nice library, but it doesn't have to be in associated with Jetbrains. It doesn't make Kotlin less of a programming language. That being said, I'm interested in any third party library for Regexes in Kotlin
1
t
I’m never ever going to tell somebody that there is no place for their code in a library. Want to build, release, and maintain a regex builder library? Have fun, I’m sure you’ll find a good group of people to use it. Maybe one day I’ll use it too. But “Swift does it so Kotlin should too” isn’t reason enough (in my opinion) to put it into the standard library. Putting any new feature in the standard library means support for years across many platforms. It takes away time the Kotlin team could be investing in other higher priority efforts for no discernible gain. Again, I think libraries are great. One of the things that makes Kotlin (and Java) great is that they don’t try to do everything and let libraries do the rest.
1
👍 1
e
okay 🙁
t
To be clear, I'm just some rando who uses Kotlin. I have no control over what gets into the standard lib. I'm not telling you you can't do anything. If you want to push for something, don't listen to me, per se.
🙏 1
b
@h0tk3y wrote something like this: https://github.com/h0tk3y/regex-dsl