advent-of-code-2022
cl-ppcre
Our great sponsors
advent-of-code-2022 | cl-ppcre | |
---|---|---|
17 | 13 | |
3 | 292 | |
- | 1.7% | |
10.0 | 3.7 | |
about 1 year ago | 2 days ago | |
Rust | Common Lisp | |
- | BSD 2-clause "Simplified" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
advent-of-code-2022
- 2015-2022: What solution to a problem are you the most proud of
-
[2021 Day 6 (Part 2)] [Rust] Pretty darn elegant
nice one! you can make it even faster by creating a compile time multiplication table as i have done here, so all that happens at runtime is the bucketing of similarly aged fish, 7 multiplications + a sum
- -๐- 2022 Day 22 Solutions -๐-
- -๐- 2022 Day 21 Solutions -๐-
-
[2022 Day 14 (Part 2)] Oสฐ(Nยฒ)แตแตแตแต!... OH YEAH!
you've still got some overhead in your code, my rust solution creates a dense lookup array at runtime & takes ~200us on my 10850k. are you including file IO and printing to stdout?
- -๐- 2022 Day 14 Solutions -๐-
- -๐- 2022 Day 13 Solutions -๐-
-
-๐- 2022 Day 11 Solutions -๐-
code
- -๐- 2022 Day 7 Solutions -๐-
-
-๐- 2022 Day 5 Solutions -๐-
full solution
cl-ppcre
-
Compile time regular expression in C++
I've never used cl-ppcre myself, but its docs[1] claim that it provides compile-time regexes:
> CL-PPCRE uses compiler macros to pre-compile scanners at load time if possible. This happens if the compiler can determine that the regular expression (no matter if it's a string or an S-expression) is constant at compile time and is intended to save the time for creating scanners at execution time (probably creating the same scanner over and over in a loop).
[1]: https://edicl.github.io/cl-ppcre/
- Ask HN: What are some of the most elegant codebases in your favorite language?
-
sbcl and Let Over Lambda
A few weeks back Xach recommended cl-ppcre which i found educational.
-
-๐- 2022 Day 1 Solutions -๐-
For simple string processing, there are some functions in the language, that you can find listed here (for string-specific functions) and here (for more generic sequence-handling functions). For anything involving regular expressions, cl-ppcre is the way, in particular the split and register-groups-bind functions.
-
The unreasonable effectiveness of f-strings and re.VERBOSE
I must have a serious bug in my writing about this, because this was never about regex engines -- it's about literals and domain-specific sublanguages in general. Composing DSL programs by string concatenation is such a famous source of security bugs you see it in top-10 lists. I linked to the very similar example of a PEG parsing DSL.
But any regex engine that can work with a parse tree shows the same principle, e.g. https://edicl.github.io/cl-ppcre/#create-scanner2
-
Adding Space to subst function
Take a look at - https://github.com/edicl/cl-ppcre
-
Common Lisp ASDF maintainer considers resignation
And here's what I believe represents the reality of the situation... Stas was indeed tired of ASDF's changes. Now the nature of what changes to make is a matter of judgement of course, but in this case (I'm thinking of SBCL's bug report request to update ASDF: https://bugs.launchpad.net/sbcl/+bug/1826074), it would be a different matter altogether if the discussion was centered on how best to make the new ASDF work with SBCL, but the thread reads to me like a man who had to put up with too much breakage for the upteenth time. Now, if (for the sake of argument :D) the change was of the necessary kind -- think hardware changes or security issues -- I can still see myself feeling wronged, it's human to do so. Because I don't trust ASDF anymore or I feel as if they (or other people at each step of the process) have not shared enough of the burden. But from the discussions I have read (https://github.com/edicl/cl-ppcre/pull/30) what the ASDF maintainers want to change does not seem unreasonable and they are willing to share the burden. But let us say it's truly a 50/50 deadlock. Well then Linus is right, show us the code, who dares wins. And Stas certainly has enough on his plate. But that's why we must cooperate. You don't have to be a diplomat to know the difference when two people want to work together and when one party wants out. And this setting makes more sense when you read (https://bugs.launchpad.net/sbcl/+bug/1823442) where Stas honestly states he wants nothing more to do with ASDF. I don't think it's unreasonable to surmise there's a bit more going on here than plainly technical issues.
-
Stas has alienated long-time ASDF maintainer Robert Goldman
Could you just direct me to some existing discussions, in order to save time? I already read this one.
-
#"<your literal interpretation here>" (regular expression literals)
I plan to use the regular expressions with a cl-ppcre wrapper, also emulating various clojure regular expression operations. Similar to re21, which doesn't quite support the operations in the way I'd like (or match the clojure operations), and whose regular expression literal syntax is "#//".
What are some alternatives?
jmurmel - A standalone or embeddable JVM based interpreter/ compiler for Murmel, a single-namespace Lisp dialect inspired by Common Lisp
sbcl - Mirror of Steel Bank Common Lisp (SBCL)'s official repository
aoc - Advent of Code
one-more-re-nightmare - A fast regular expression compiler in Common Lisp
advent_of_code
aoc2022
CC-AdventOfCode-2022
advents-of-code - ๐๐ Solutions for the yearly advent of code challenges
advent-of-code
advent-of-code - All my advent of code projects
advent-of-code - My solutions to all years of Advent of Code
rebar - A biased barometer for gauging the relative speed of some regex engines on a curated set of tasks.