and what to learn from them
in increasing order of length
viral in 2008:
Computer languages and facial hair 🔗
│ EqualsVerifier │ jqno.nl │ jqno
#fantasticlanguages
Appeared in | 1995 |
Used for | Enterprise back-end, Android |
Paradigm | object-oriented |
Typing | strong, static |
Runtime | JVM |
James Gosling
Beard: ✅
public class Program {
public static void main(String...args) {
for (int i = 1; i <= 100; i++) {
if (i % 15 == 0) {
System.out.println("FizzBuzz");
}
else if (i % 3 == 0) {
System.out.println("Fizz");
}
else if (i % 5 == 0) {
System.out.println("Buzz");
}
else {
System.out.println(i);
}
}
}
}
Appeared in | 1964 |
Used for | teaching |
Paradigm | imperative |
Typing | weak, static with sigils |
Runtime | interpreted |
John Kemeny & Thomas Kurtz
Beard: ❌❌
10 FOR I = 1 to 100
20 LET S$ = ""
30 IF I % 3 = 0 THEN LET S$ = S$ + "FIZZ"
40 IF I % 5 = 0 THEN LET S$ = S$ + "BUZZ"
50 IF S$ = "" THEN LET S$ = I
60 PRINT S$
70 NEXT I
from my master’s thesis
Appeared in | 16th century CE |
Used in | UK, America, the internet |
Family | germanic |
Script | roman |
Native speakers | ±380mln |
Let’s just say it was this guy
Beard: ✅
1, 2, fizz, 4, buzz, fizz, 7, 8, fizz, buzz, 11, fizz, 13, 14, fizzbuzz, 16, 17, fizz, 19, buzz, fizz, 22, 23, fizz, buzz, 26, fizz, 28, 29, fizzbuzz
🇪🇺 | → | 🇬🇧 |
---|---|---|
a | → | e |
e | → | i |
i | → | ay |
The Great Vowel Shift
Appeared in | 1995 |
Used for | simple back-end |
Paradigm | imperative |
Typing | weak, dynamic |
Runtime | interpreted |
Rasmus Lerdorf
Beard: ❌
<?php
for ($i = 1; $i <= 100; $i++)
{
if (!($i % 15))
echo "FizzBuzz\n";
else if (!($i % 3))
echo "Fizz\n";
else if (!($i % 5))
echo "Buzz\n";
else
echo "$i\n";
}
?>
Appeared in | 2012 |
Used for | front-end |
Paradigm | functional |
Typing | strong, static |
Runtime | compiled to JavaScript |
Evan Czaplicki
Beard: 🤷
import Html exposing (text)
import List exposing (map)
main =
List.range 1 100 |> map getWordForNum |> String.join " "
getWordForNum num =
if modBy num 15 == 0 then
"FizzBuzz"
else if modBy num 3 == 0 then
"Fizz"
else if modBy num 5 == 0 then
"Buzz"
else
String.fromInt num
I got to the end of the line without seeing the closing double quote:
6| helloworld = "Hello world
^
Strings look like "this" with double quotes on each end. Is the closing double
quote missing in your code?
Note: For a string that spans multiple lines, you can use the multi-line string
syntax like this:
"""
# Multi-line Strings
- start with triple double quotes
- write whatever you want
- no need to escape newlines or double quotes
- end with triple double quotes
"""
Appeared in | 1958 |
Used for | AI |
Paradigm | functional |
Typing | strong, dynamic |
Runtime | compiled to native |
John McCarthy
Beard: ✅ ✅ ✅
(define (fizzbuzz x y)
(println
(cond ((= (modulo x 15) 0) "FizzBuzz")
((= (modulo x 3) 0) "Fizz")
((= (modulo x 5) 0) "Buzz")
(else x)))
(if (< x y) (fizzbuzz (+ x 1) y)))
(fizzbuzz 1 100)
Scheme dialect
Minimal syntax, maximal power
(println "Hello world")
(+ 1 (* 2 3) 4)
(define Y
(lambda (f)
(f (lambda (x) ((Y f) x)))))
Appeared in | 5th century CE |
Used in | Northern Africa, Middle-East |
Family | semitic |
Script | arabic |
Native speakers | ±350mln |
Unknowable
Beard:
١ ،٢، فيز، ٤، بوز، فيز، ٧، ٨، فيز، بوز، ١١، فيز، ١٣، ١٤، فيزبوز، ١٦، ١٧، فيز، ١٩، بوز، فيز، ٢٢، ٢٣، فيز، بوز، ٢٦، فيز، ٢٨، ٢٩، فيزبوز
hll wrld | hello world |
مرحبا بالعالم | مَرحَبًا بِالعَالَم |
From The Arab of the Future 2 by Riad Sattouf
Appeared in | 1995 |
Used for | scripting, simple back-end |
Paradigm | object-oriented |
Typing | strong, duck |
Runtime | interpreted |
Yukihiro Matsumoto
Beard: ✅
1.upto 100 do |i|
puts "FizzBuzz" if i % 15 == 0
puts "Fizz" if i % 3 == 0 and i % 5 != 0
puts "Buzz" if i % 3 != 0 and i % 5 == 0
puts i if i % 3 != 0 and i % 5 != 0
end
class Integer
def to_xml
"<int>#{self}</int>"
end
end
puts 10.to_xml
class Module
alias private_old private
alias public_old public
alias private public_old
alias public private_old
end
Appeared in | 1995 |
Used for | Windows GUIs |
Paradigm | object-oriented |
Typing | strong, static |
Runtime | compiled to native |
Anders Hejlsberg
Beard: ❌
program FizzBuzz;
var
i: Integer;
begin
for i := 0 to 100 do
begin
if i mod 15 = 0 then
WriteLn('FizzBuzz');
else if i mod 3 = 0 then
WriteLn('Fizz');
else if i mod 5 = 0 then
WriteLn('Buzz');
else
WriteLn(IntToStr(i));
end;
end.
Appeared in | 2000 |
Used for | Windows GUIs, back-end |
Paradigm | object-oriented |
Typing | strong, static |
Runtime | .NET |
Anders Hejlsberg
Beard: ❌
using System;
class Program
{
static void Main(string[] args)
{
for (int i = 1; i <= 100; i++)
{
if (i % 15 == 0)
{
Console.WriteLine("FizzBuzz");
}
else if (i % 3 == 0)
{
Console.WriteLine("Fizz");
}
else if (i % 5 == 0)
{
Console.WriteLine("Buzz");
}
else
{
Console.WriteLine(i);
}
}
}
}
using System;
using System.Linq;
class Program
{
static void Main(string[] args)
{
var result = from i in Enumerable.Range(1, 100)
select (i % 15 == 0) ? "BuzzFizz" :
(i % 5 == 0) ? "Buzz" :
(i % 3 == 0) ? "Fizz" :
i.ToString();
result.ForEach(Console.WriteLine);
}
}
Appeared in | 2012 |
Used for | front-end |
Paradigm | object-oriented |
Typing | gradual, structural |
Runtime | compiled to JavaScript |
Anders Hejlsberg
Beard: ❌
for (let i = 1; i < 101; i++) {
if (i % 15 === 0) {
console.log('FizzBuzz')
}
else if (i % 3 === 0) {
console.log('Fizz')
}
else if (i % 5 === 0) {
console.log('Buzz')
}
else {
console.log(i)
}
}
for (let i: number = 1; i < 101; i++) {
if (i % 15 === 0) {
console.log('FizzBuzz')
}
else if (i % 3 === 0) {
console.log('Fizz')
}
else if (i % 5 === 0) {
console.log('Buzz')
}
else {
console.log(i)
}
}
// Lodash's pick() function
function pick(object, paths)
pick({ a: 1, b: 2, c: 3, d: 4 }, ['a', 'd'])
===> { a: 1, d:4 }
// Lodash's pick() function
function pick(object, paths)
pick({ a: 1, b: 2, c: 3, d: 4 }, ['a', 'd'])
===> { a: 1, d:4 }
function pick<O extends object, Keys extends keyof O>
(object: O, paths: Keys[]): { [K in Keys]: O[K] }
Appeared in | 2021 |
Used for | fun |
Paradigm | functional |
Typing | weak, dynamic |
Runtime | Java annotations 🤯 |
Me!
Beard: ✅
import nl.jqno.annotationscript.AnnotationScript;
import nl.jqno.annotationscript.Annotations.*;
@Zero("begin")
@Zero(list={@One("define"), @One("fizz-buzz"), @One(list={@Two("lambda"), @Two(list=@Three("n")), @Two(list={
@Three("cond"),
@Three(list={@Four("="), @Four(list={@Five("%"), @Five("n"), @Five("15")}), @Four("0")}), @Three("'fizzbuzz'"),
@Three(list={@Four("="), @Four(list={@Five("%"), @Five("n"), @Five("3")}), @Four("0")}), @Three("'fizz'"),
@Three(list={@Four("="), @Four(list={@Five("%"), @Five("n"), @Five("5")}), @Four("0")}), @Three("'buzz'"),
@Three("else"), @Three("n")})})})
@Zero(list={@One("map"), @One("println"), @One(list={@Two("map"), @Two("fizz-buzz"), @Two(list={@Three("range"), @Three("1"), @Three("101")})})})
public class FizzBuzz {
public static void main(String[] args) {
AnnotationScript.run(FizzBuzz.class);
}
}
@Autowired @Bean
@Column(name = "id")
@PostMapping("/endpoint/new")
@Test
public void waitwhat() { ... }
(begin
(define fizz-buzz (lambda (n) (cond
(= (% n 15) 0) 'fizzbuzz
(= (% n 3) 0) 'fizz
(= (% n 5) 0) 'buzz
else n)))
(map println (map fizz-buzz (range 1 101))))
jqno.nl/talks/fantasticlanguages
#fantasticlanguages
image credits: see website