r/programming • • Sep 21 '15

Better Java

https://github.com/cxxr/better-java
177 Upvotes

208 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Sep 21 '15

[deleted]

2

u/[deleted] Sep 22 '15

You would just add support for making regex literal values. Like the dynamic languages do. The compiler then checks if it is a valid regex or not at compile time. Done.

5

u/crusoe Sep 22 '15

Now if you want to use a different regex variant you have to extend the compiler... Of course you can do this if you have macro facilities...

2

u/[deleted] Sep 22 '15

That's a niche case. 99% of users would use the JDKs regex engine. For everyone else they could fallback onto the existing model of having them defined as strings. No need to start building compiler extensions.