From 4823eb61396bafdbd05106ac0903456caee3ae3a Mon Sep 17 00:00:00 2001 From: murray Date: Fri, 27 Oct 2023 00:07:59 +0100 Subject: [PATCH] add readme --- Makefile | 2 +- README.md | 54 ++++++++++++++++++++++++++++++++++ benchmark/helloworld/README.md | 20 +++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 README.md create mode 100644 benchmark/helloworld/README.md diff --git a/Makefile b/Makefile index a6b1a4b..366e08e 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ clean: benchmark: helloworld.bench $(MAKE) -B Bench.gren -helloworld.bench: $(addsuffix /result,$(wildcard benchmark/helloworld/*)) +helloworld.bench: $(addsuffix result,$(wildcard benchmark/helloworld/*/)) cat $^ > helloworld.bench benchmark/helloworld/%/result: diff --git a/README.md b/README.md new file mode 100644 index 0000000..55c30a6 --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# [every programming language](https://ii8.github.io/every-language/) + +Parametric search for programming languages. + + +## Building and running locally + +Prerequisites: + +- make +- m4 +- sed +- [gren](https://gren-lang.org/install) +- [tailwind](https://tailwindcss.com/docs/installation) +- Any http server like [mighty](https://github.com/kazu-yamamoto/mighttpd2) + or [darkhttpd](https://github.com/emikulic/darkhttpd) + +Optional (to run benchmarks): + +- docker + +Building: +``` +make benchmark # optional +make +``` + +To run just serve the page: +``` +darkhttpd . +``` +and visit `localhost:8080` + + +## Adding a new language + +Create a new file in the `lang` directory, you can just copy `lang/lua` and +modify the values. Ensure there exists a corresponding svg for it in `icon`. +The `language` value should be set the same as the filename, and the `name` can +be set to a nice printable version. For example: +``` +language = "cpp" +name = "C++" +... +``` +The available parameters and their meanings are listed in `Lang.gren.in`. +The `example` should be idiomatic, concise and demonstrate the most important +or unique language features. + +If applicable, create a benchmark dockerfile for the language for each +subdirectory in `benchmark`. Look at the readme in each benchmark subdirectory +to see what it has to do. + +Run make again and the language should appear on the web page. diff --git a/benchmark/helloworld/README.md b/benchmark/helloworld/README.md new file mode 100644 index 0000000..8c00855 --- /dev/null +++ b/benchmark/helloworld/README.md @@ -0,0 +1,20 @@ +# Hello, World! + +The purpose of this benchmark is to estimate executable size overhead incurred +by language runtimes by measuring the size of simple executables. + +The rules are: + +- The program must print "Hello, World!" to stdout +- The program should be built inside an alpine:latest docker container. +- The source code of the hello world program should be idiomatic. +- The program must be statically linked. If external runtime components are + required and the language does not support bundling them their size must be + added to the final result as well. +- The program may be stripped of debug symbols. +- If a libc is linked it should be musl if possible. +- The final result should be stored in the root directory of the container in + a file called `result`, the format is `"coolang" -> 35352` where `coolang` + is the language being benchmarked and `35352` is the size in bytes of the + hello world binary. +