Skip to content

Add B programming language#8056

Open
aceinetx wants to merge 7 commits into
github-linguist:mainfrom
aceinetx:b
Open

Add B programming language#8056
aceinetx wants to merge 7 commits into
github-linguist:mainfrom
aceinetx:b

Conversation

@aceinetx

@aceinetx aceinetx commented Jul 5, 2026

Copy link
Copy Markdown

Added the B programming language (C predecessor)

Checklist:

@aceinetx
aceinetx requested a review from a team as a code owner July 5, 2026 20:11
@DecimalTurn

Copy link
Copy Markdown
Contributor

Related issue: #6717

@DecimalTurn

Copy link
Copy Markdown
Contributor

For the search results, it might be better to use the same regex as used in the heuristic to illustrate that we have reached the 2k file threshold. Eg.: https://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.b+%2F%28%3F%3Aextrn%7Cauto%7Cgoto%29%2F (7.2k files)

rules:
- language: B
pattern: '^\s*(?:extrn|auto|goto)\b'
negative_pattern: '^\s*(?:implement|include|load|ref)\b'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ideally, we'd also include a rule for Limbo and Brainfuck (Bf).

There's already rules inside the heuristics.yml file that we can re-use:

  - language: Brainfuck
    pattern: '(>\+>|>\+<)'

and

  - language: Limbo
    pattern: '^\w+\s*:\s*module\s*\{'

@DecimalTurn

Copy link
Copy Markdown
Contributor

B doesn't have an official logo

What about this one?

image

From here: https://github.com/bext-lang/b

The color of the logo is already close enough with what is suggested here (#da7666), so I'm not saying it has to be changed, but at least this logo could be used as a rationale for the color.

- ".b"
tm_scope: none
ace_mode: text
language_id: 700792152

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For some of these fields, like for tm_scope, it's worth considering if using the same values as the C programming language would be beneficial. You can check how the C syntax highlighing of a B file would look like using https://novalightshow.netlify.app/

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Apart from the extrn keyword it looks pretty much the same as C

@lildude lildude left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The samples added do not match the list in the template. They are also mostly illustrations of using the language rather than real world examples of usage of the language. Please correct this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants