Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ii8 committed Oct 26, 2023
1 parent 5939b30 commit f0b8cc3
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
20 changes: 20 additions & 0 deletions benchmark/helloworld/README.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit f0b8cc3

Please sign in to comment.