parser | awk | |
---|---|---|
5 | 34 | |
1,557 | 1,919 | |
- | - | |
8.4 | 8.3 | |
8 days ago | 13 days ago | |
Yacc | C | |
GNU General Public License v3.0 or later | GNU General Public License v3.0 or later |
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.
parser
-
Inko Programming Language
I have mixed feelings on Rust's syntax, especially around generics, lifetimes, and the `modifier -> keyword` syntax (i.e. `async fn` or `pub fn`). For Inko, I wanted something that's easy to parse by hand, and no context specific parsing (e.g. `QUOTE -> something` being the start of a lifetime in one place, but a char literal in another place).
Another motivator for that is that years ago I worked on Rubinius for a while (an implementation of Ruby), and helped out with a parser for Ruby (https://github.com/whitequark/parser). The Ruby developers really liked changing their already impossible syntax in even more impossible ways on a regular basis, making it a real challenge to provide syntax related tools that support multiple Ruby versions. I wanted to avoid making the same mistake with Inko, hence I'm actively trying to keep the syntax as simple as is reasonable.
As for the specific examples:
- `fn async` means your parser only needs to look for `A | B | fn` in a certain scope, instead of `A | B | fn | async fn`. This cuts down the amount of repetition in the parser. An example is found at https://github.com/inko-lang/inko/blob/8f5ad1e56756fe00325a3..., which parses the body of a class definition.
- Skipping parentheses is directly lifted from Ruby, because I really like it. Older versions took this further by also letting you write `function arg1 arg2`, but I got rid of that to make parsing easier. It's especially nice so you can do things like `if foo.bar.baz? { ... }` instead of `if foo().bar().baz?()`, though I suspect opinions will differ on this :)
- Until recently we did in fact use `::` as a namespace separator, but I changed that to `.` to keep things consistent with the call syntax, and because it removes the need for remembering "Oh for namespaces I need to use ::, but for calls .".
- `[T]` for generics is because most editors automatically insert a closing `]` if you type `[`, but not when you type `<`. If they do, then trying to write `10<20` is annoying because you'd end up with `10<>20`. I also just like the way it looks more. The usual ambiguity issues surrounding `<>` (e.g. what leads to `foo::()` in Rust) doesn't apply to Inko, because we don't allow generics in expressions (i.e. `Array[Int].with_capacity(42)` isn't valid syntax) in the first place.
-
Marc-André Lafortune on the abstract syntax tree and rewiring Rubocop
So there was this really awesome gem called parser written by someone not on the core team that gives you a super clean understanding of the Ruby code. Not only does it not care if the parentheses are there or not, but there's a really well structured and precise mapping of where the information comes from and it is completely semantic. So if you've got parentheses or not, it's not gonna make any difference in the structure of your abstract syntax tree, but you can actually ask where are the locations. That is taken care of, but the understanding of the code, what's going on in the code is completely independent of if you wrote those parentheses or not.
-
Where is keyword behavior defined?
Working with those things, possibly with the help of reading books, tends to be how it's learned I'd say. I'm not the one you asked, but I personally worked with Ruby for 10 years, worked on a system to improve coverage reports, which relied on rewriting ruby code. Doing so was done using the Parser gem, which is a ruby parser that has a different abstract syntax tree (https://github.com/whitequark/parser). I'm also interested in programming languages development, so I try to read on this / develop my own language in my free time.
-
Bad Ruby: Hash Value Omission
Changes like this have been going on for years. I remember that back when I was still helping out with https://github.com/whitequark/parser, the author on a regular basis had to deal with Ruby making yet more non-trivial syntax changes. IIRC they eventually burned out on the project because of that, but my memory is a bit fuzzy.
-
Tree-sitter: an incremental parsing system for programming tools
This is more a function of Ruby than of tree-sitter. The tree-sitter grammars for other languages are hopefully less inscrutable. For Ruby, we basically just ported whitequark's parser [1] over to tree-sitter's grammar DSL and scanner API.
[1] https://github.com/whitequark/parser
awk
-
Csvlens: Command line CSV file viewer. Like less but made for CSV
Awk now supports a `--csv` flag for processing csv's. https://github.com/onetrueawk/awk/blob/master/README.md
-
Perl first commit: a “replacement” for Awk and sed
Right, "the one true awk" corresponds to a book written in 1988, very explicity. https://github.com/onetrueawk/awk
You were the one that that said POSIX awk to begin with, I was using your terms.
As far as shitting on the GMU tools, I don't think I've seen someone do that for over 20 years.
This is not a productive conversation. You can live life however you want
-
[2022 all days][Awk] AoC in 101 lines of Awk
I also wrote a small program to benchmark and check the solutions across different Awk implementations (see the image). I use the macos system awk (which is pretty close to https://github.com/onetrueawk/awk if I'm not mistaken) as a reference (the first column), so all solutions had to work with that.
-
Where is keyword behavior defined?
A simpler Yacc grammar is awk/awkgram.y.
-
-🎄- 2022 Day 11 Solutions -🎄-
Neat, this is now the third year I'm using awk and still learning new tricks. (I'm using awk as the reference, so I don't use gnu extensions.)
-
Capitalizing words in awk
I did this in nawk, which doesn't support extended regular expressions. If instead you're using gawk, which does, check out \b for word boundaries in extended regular expressions. The [^a-z][a-z] approach you showed consumes the prior character.
-
Coffee with Brian Kernighan – Computerphile [video]
BWK’s commit and test files (mentioned in the video)
https://github.com/onetrueawk/awk/commit/d3a19e6f2533d479841...
-
ลอง awk ภาษาไทยใช้ได้แล้วแต่ต้องใช้ branch ชื่อ unicode-support
git clone -b unicode-support https://github.com/onetrueawk/awk.git
-
anon has a wholesome family
This is dumb as fuck. Brian Kernighan of K&R (The C Programming Language) is 80 and he’s still more intelligent than any of you retards. Mf just submitted a patch to awk a couple months ago https://github.com/onetrueawk/awk
-
Unix legend Brian Kernighan, who is the "k" in "awk" and is 80 years old, keeps fixing things. He has added Unicode support to awk, but he couldn't figure out how use git, so he just emailed his changes to the current maintainer
The Unicode branch: https://github.com/onetrueawk/awk/tree/unicode-support
What are some alternatives?
tree-sitter-ruby - Ruby grammar for tree-sitter
frawk - an efficient awk-like language
tree-sitter-kotlin - Kotlin grammar for Tree-sitter
tectonic - A modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive.
lsif-os - A (mostly) language-agnostic indexer for generating LSIF data.
goawk - A POSIX-compliant AWK interpreter written in Go, with CSV support
Moose - MOOSE - Platform for software and data analysis.
awesome-c - A curated list of awesome C frameworks, libraries, resources and other shiny things. Inspired by all the other awesome-... projects out there.
nvim-treesitter - Nvim Treesitter configurations and abstraction layer
AwkUnicodeSplit - An awk(1) fragment for reassembling Unicode characters after a split()
csharp-mode - A major-mode for editing C# in emacs
calendar - print upcoming events