one-more-re-nightmare
cl-ppcre
Our great sponsors
one-more-re-nightmare | cl-ppcre | |
---|---|---|
11 | 13 | |
133 | 291 | |
1.5% | 2.1% | |
4.2 | 0.0 | |
9 months ago | 10 months ago | |
Common Lisp | Common Lisp | |
BSD 2-clause "Simplified" License | 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.
one-more-re-nightmare
-
When a young programmer who has been using C for several years is convinced that C is the best possible programming language and that people who don't prefer it just haven't use it enough, what is the best argument for Lisp vs C, given that they're already convinced in favor of C?
One trick is that Common Lisp can generate and compile code at runtime, whereas static languages typically do not have a compiler available at runtime. This lets you make your own lazy person's JIT/staged compiler, which is useful if some part of the problem is not known at compile-time. Such an approach has been used at least for array munging, type munging and regular expression munging.
-
Tutorial Series to learn Common Lisp quickly
> One of my favorite examples is the regex library cl-ppcre. Thanks to the nature of Lisp, the recognizer for each regex you create can be compiled to native code on compiler implementations of CL.
That is not true - cl-ppcre generates a chain of closures. Experimental performance is in the same ballpark as typical "bytecode" interpreting regex implementations.
(Disclosure: I wrote another regex library at <https://github.com/telekons/one-more-re-nightmare>, which does do native code compilation.)
-
The self-hosted Zig compiler can now successfully compile itself
Someone else didn't tell me that before, so it can't be true. But I don't publish papers on toys, nor do I think toy projects are awfully fast. Though the x86-64 backend I wrote was in someone else's repository and thus was several PRs :(
-
Most interesting languages to learn (from)?
Regular expressions
-
Why You Should Learn Lisp In 2022?
A Common Lisp system has the compiler around at runtime, so if you can figure out how to profitably stage/specialise a computation, then you can roll your own cheap JIT of sorts. This can be useful for array munging and regular expressions at the least. You can do this in C, of course but you would need to use another compiler as a library (e.g. LLVM, TCC, libgccjit) or write your own (e.g. PCRE2's sljit).
-
The one-more-re-nightmare regular expression compiler
It's all part of the library. Everything about regular expression types is in this file.
-
[Question] Projects Ideas For the Slightly Unmotivated
Write a faster regex engine? Admittedly regular expression engines tend to be fast enough, but if you can use macros and compiling at runtime to compile them (indirectly) to machine code, they can go faster than fast enough.
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).
This has been available in Lisp since at least 2004.
- 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
If the regular expression engine accepted tree structures instead of just strings, you could have first class definitions of fragments of regular expressions. Even better, you could define them as functions, so you could have parameterized fragments. So then you could just do something like http://edicl.github.io/cl-ppcre/#create-scanner2 without the bizarre definition syntax above.
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
-
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.
That thread is not complete context; see also e.g. https://github.com/edicl/cl-ppcre/pull/30 and https://github.com/edicl/cl-fad/pull/24.
-
#"<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?
sbcl - Mirror of Steel Bank Common Lisp (SBCL)'s official repository
Revise.jl - Automatically update function definitions in a running Julia session
zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
SICL - A fresh implementation of Common Lisp
aoc2022
Petalisp - Elegant High Performance Computing
oakc - A portable programming language with a compact intermediate representation
advent-of-code-2022 - back to rust, except i'll use libs where it makes sense
julia - The Julia Programming Language
advent-of-code - All my advent of code projects
advents-of-code - 🎄🎁 Solutions for the yearly advent of code challenges
OhMyREPL.jl - Syntax highlighting and other enhancements for the Julia REPL