Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for sed as a programming language #4093

Merged
merged 1 commit into from
Apr 11, 2018
Merged

Add support for sed as a programming language #4093

merged 1 commit into from
Apr 11, 2018

Conversation

Alhadis
Copy link
Collaborator

@Alhadis Alhadis commented Apr 8, 2018

Description

This PR adds sed to GitHub's list of recognised programming languages. sed is Turing-complete, and has been used to program Tetris, calculators, and your average Turing machine.

In-the-wild usage

The number of sed scripts on GitHub is surprising: searching for .sed files brings back almost 600,000 results. All 959 samples I downloaded were unambiguously sed code.

Sample file

Locating an unencumbered sed script with a clear license was hard. Thankfully, FreeBSD's sed contained a decent-looking example of sed programming.

Licensed under the BSD-2-clause.

Language grammar

My own work, which I wrote especially for you guys. 😉

@Alhadis
Copy link
Collaborator Author

Alhadis commented Apr 8, 2018

Oh yeah, I took the liberty of properly documenting my harvester script, which was moved from a gist to a repo after it needed an update. It's good enough to warrant mentioning in CONTRIBUTING.md, but I couldn't figure out which section was relevant enough to include it...

@lildude Did you know that in sed, it's possible to use #, ; and plain whitespace as delimiters for y and s? I didn't either until I wrote this grammar. 😁 Suffice to say getting these right wasn't easy.

I don't think I've written such an airtight grammar in my life...

screen shot 2018-04-09 at 8 05 15 am

$ echo 'upidly delimi' | sed -e 'stupidly delimited shit'
ed shi

@pchaigno
Copy link
Contributor

pchaigno commented Apr 10, 2018

This is getting boring @Alhadis. Could you at least mess up something in one of your pull requests from time to time?

EDIT: Never mind, you made a terrible mistake! There are actually 159k results in that search request instead of the 600k advertised. So low in-the-wild usage!

Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lildude
Copy link
Member

lildude commented Apr 15, 2018

@lildude Did you know that in sed, it's possible to use #, ; and plain whitespace as delimiters for y and s?

I did and have used them many a time to avoid having to escape the nuts out of strings, though I admit to never using a space - that sounds like pure sadism 😆.

@pchaigno
Copy link
Contributor

Oh yeah, I took the liberty of properly documenting my harvester script, which was moved from a gist to a repo after it needed an update. It's good enough to warrant mentioning in CONTRIBUTING.md, but I couldn't figure out which section was relevant enough to include it...

👍 for adding it to the contribution guidelines!
I'd add it in the additional steps for both Adding an extension to a language and Adding a language, in place of "(ping @lildude to help with this)" maybe.

@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants