Measures Concepts
GitHub icon

Shen

Shen - Programming language

< >

Shen is a programming language created in 2011 by Mark Tarver.

Source code:
git clone https://github.com/Shen-Language/shen-sources
#846on PLDB 13Years Old 50Repos


Example from hello-world:
(pr "Hello World")
\\ Hello world in Shen (0-) (pr "hello world")
Example from Linguist:
(load "grammar.shen") \* JSON Lexer 1. Read a stream of characters 2. Whitespace characters not in strings should be discarded. 3. Whitespace characters in strings should be preserved 4. Strings can contain escaped double quotes. e.g. "\"" *\ (define whitespacep \* e.g. ASCII 32 == #\Space. *\ \* All the others are whitespace characters from an ASCII table. *\ Char -> (member Char ["c#9;" "c#10;" "c#11;" "c#12;" "c#13;" "c#32;"])) (define replace-whitespace "" -> "" (@s Whitespace Suffix) -> (@s "" (replace-whitespace Suffix)) where (whitespacep Whitespace) (@s Prefix Suffix) -> (@s Prefix (replace-whitespace Suffix))) (define fetch-until-unescaped-doublequote [] -> [] ["\" "c#34;" | Chars] -> ["\" "c#34;" | (fetch-until-unescaped-doublequote Chars)] ["c#34;" | Chars] -> [] [Char | Chars] -> [Char | (fetch-until-unescaped-doublequote Chars)]) \* (define strip-whitespace-chars *\ \* [] -> [] *\ \* ["c#34;" | Chars] -> ["c#34;" | ( *\ \* [WhitespaceChar | Chars] -> (strip-whitespace-chars Chars) where (whitespace? WhitespaceChar) *\ \* [Char | Chars] -> [Char | (strip-whitespace-chars Chars)]) *\ (define tokenise JSONString -> (let CharList (explode JSONString) CharList))

Language features

Feature Supported Token Example
Comments ✓
MultiLine Comments ✓
Line Comments ✓
Integers ✓
Floats ✓
Strings ✓ "
"Hello world"
Print() Debugging ✓ pr

View source

- Build the next great programming language · Search · Add Language · Features · Creators · Resources · About · Blog · Acknowledgements · Queries · Stats · Sponsor · Day 605 · feedback@pldb.io · Logout