Computer Languages Characters Frequency

By Xah Lee. Date: . Last updated: .

All Languages Combined

the frequency of punctuation characters used in programing languages.

char freq 2013 XW4vB

Percentage of languages:

JavaScript

char freq js 2018-08-27 d9cf0
2018-08-27 Source: React v16.4.1 react.development.js react-dom.development.js d3js Version 5.0.0
All these are actually generated pre ES2015 code.
char freq react js 2018-08-27 96d1a
2018-08-27 Source: React v16.4.1 react.development.js react-dom.development.js
char freq d3js 2018-08-27 f84db
2018-08-27 Source: d3js Version 5.0.0
char freq js FYDZ
Date 2013-05. • JavaScript code in git source repo. • JavaScript in nodejs repo. • Angular.js YUI3 Backbone.js Dojo JQuery prototype.js

Sample syntax JS: Raining Hearts

Java

comp lang char frequency java
Date 2013-05. Google Web Toolkit

Sample syntax Complex Numbers in Java

golang

char freq golang 2020-06-29 7498t
char freq golang 2020-06-29
lines starting with the comment “// ” are moved.

using other source have similar result.

Sample syntax Golang: Script to Find Replace Multi-Pairs of Regex in a Directory

C++

comp lang char frequency cpp
Date 2013-05. • nodejs repo.

C

comp lang char frequency c
Date 2013-05. • git repo. • nodejs repo. • gnu emacs repo.

PHP

comp lang char frequency php
Date 2013-05. PHP Sympony

Sample syntax PHP: Send Mail with Attachment

Python

comp lang char frequency python
Date 2013-05. • Python 3.2 default libs. • python code in git source repo. • python code in nodejs source repo. • DJango

Sample syntax Python: Script to Find Replace Multi-Pairs Regex in a Directory

Ruby

comp lang char frequency ruby
Date 2013-05. Ruby 1.9 default libs. Ruby on Rails

Sample syntax Ruby Tutorial

Perl

comp lang char frequency perl
Date 2013-05. • Perl 5.14 default libs. • perl code in nodejs source repo. • perl code in git source repo.

Sample syntax Perl: Find Replace String Pairs in Directory

Bash

comp lang char frequency bash
Date 2013-05. • Ubuntu Linux /etc/init.d shell scripts • bash code in git source repo.

CSS

comp lang char frequency css

Sample syntax Atomic CSS

WolframLang

comp lang char frequency wl
comp lang char frequency wl

Sample syntax Geometric Inversion, 2D Grid, Polygon

Emacs Lisp

comp lang char frequency elisp 2024-04-03 vXp
comp lang char frequency elisp 2024-04-03 vXp

source is dired.el in emacs 29.

Haskell

comp lang char frequency haskell 2019-05-14 gs527
haskell 2019-05-14

About Source Input

After this study, i realized that the size of input does not matter much. It is not necessary to gather thousands of source code files. 20 or 50 files from a generic project is sufficient.

For certain languages, different projects do favor certain chars, but again, not overall significant.

For example, for python, just pick 20 files from standard library is good enough. No need to go out of the way to get source from different projects.

Plot Your Own