Programming Language Project (MMO)

This project is the beginning of a series where I shall compare programming languages to find out which ones are best suited for ‘general purpose’ programming.

I am taking on this project both to try out many different programming languages and to counteract a phenomenon I call the ’noise effect’.

If you are a developer who works in multiple languages you may have encountered this phenomenon; where the syntax and features begin to ‘blur’ together. You start trying to declare arrays with an ‘@’ in languages where that symbol has no meaning, or mixing up which language caches its arrays in row major and column major order.

My hope is to choose a few core languages and learn them well, since the longer you practice in that language, the more skilled you become; and to keep this ’noise effect’ to a minimum.

I have come up with the following metrics to both qualitatively and quantitatively test and benchmark each language inspired by Rosetta code the programming chrestomathy site, The benchmarks game, and programming language benchmarks.

Each language will be scored on a ‘Tier List’ style list.

The nice thing about this style is that it allows for multiple subjects to be of equal score, instead of arbitrarily picking one over the other.

The following is a list of the criteria, which will be scored from F being terrible, to A being the best, and S being a sort of ’transcendent’ example in that category.

  1. Ease to setup development environment

  2. Portability (i.e. what architectures/os’s can it run on)

    • For these I will only try on hardware I actually own, maybe later we can do emulation for 68k and PowerPC.
    • Target Architectures
      • x86_64
      • Arm
      • Arm 64
      • Mips
    • Target OSs
  3. how descriptive is the grammar?

    • how much do I need to write for it to do anything useful
  4. how friendly is the compiler?

    • does it give good error messages?
    • does the compiler do what its supposed to do
    • can the compiler optimize things for you?
    • how much is built into the compiler and/or standard library to solve problems? vs needing a library to do it?
  5. How good is the documentation?

  6. How easy / fun is it to

    • deal with data
      • describe
      • store
      • create
      • read
      • write
      • update / transform / manipulate
      • delete
      • display
    • interact with the user
    • re-use code
    • code read the code
    • document code (comments, etc)
    • create and run tests
    • find what chunk of code you are looking for
    • do stuff asynchronously / concurrently
    • scale the solution
    • parallelize the solution
    • work with common protocols / formats
  7. What development tools exist?

    • Ideally you would not need development tools to use the language and it could be done in a simple text editor, but development tools are essential for real world things, so this should be bonus points
  8. What libraries does it have?

  9. how easy is it to integrate a library/package/etc.

  10. How good is the language on its hardware?

    • how many resources does the language take up on your local machine?
    • how fast are the programs created by the language?

I will be creating a example program to test each language out. The language will be scored by how easy and how many features can be implemented by them.

This test program will be a simple multiplayer chat room style game, as games tend to have the largest number of problems you need to solve in order to produce a ‘minimum viable product’ for them.

For the GUI I will be using the built in UI if it has it. If not I will be taking advantage of either the excellent raylib and raygui libraries, or the equally excellent imgui library

  • Website
    • Information about the game
    • Signup page
      • webform
    • For our purposes we will be hosting this website on a microcontroller with a wifi chip to include embedded development
  • Client
    • built in windowing, 2d, and 3d graphics work (if any), and/or its integration into existing systems like Vulkan/OpenGL/etc.
    • how good the language is at math, testing floating point, trigonometry, liner algebra, and others
    • file I/O, i.e. loading configs and or models, textures, and the like.
    • real time text chat, probably using sockets
    • using data interchange formats for config files
    • macro/scripting for client side mods, ui changes, chatting etc.
  • Server
    • async/concurrent computing since you will be handling multiple clients
    • socket communication
    • command line arguments
    • file I/O again
    • handling user info in a database, encrypting data, creating a CRUD/simple api
      • username
      • password
      • email?
      • creation timestamp
      • update timestamp
    • user statistics / admin page
      • displaying data in a graphic of some sort

Here I have a table of the languages we will be testing, and links to either the description of the language or a compiler/interpreter for that language. If the cell is blank it is because either it is not compatible or I could not find an example for that language/platform.

Language Documentation Desktop Embedded Plan9 Specific
Fortran https://fortranwiki.org/fortran/show/HomePage https://gcc.gnu.org/wiki/GFortranSource
Lisp documentation depends on implementation http://www.sbcl.org/ http://www.ulisp.com/ https://t3x.org/s9fes/
COBOL https://gnucobol.sourceforge.io/ https://sourceforge.net/projects/gnucobol/files/
BASIC https://www.freebasic.net/wiki/DocToc https://sourceforge.net/projects/fbc/files/ https://github.com/slviajero/tinybasic
Forth https://gforth.org/manual/ https://gforth.org/ https://github.com/philburk/pforth can compile pforth for
Pascal https://www.freepascal.org/ https://www.freepascal.org/download.html https://wiki.lazarus.freepascal.org/Portal:Embedded
C https://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html https://gcc.gnu.org/ https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads https://wiki.xxiivv.com/site/plan9_c.html
ML http://mlton.org/Documentation https://github.com/MLton/mlton
Ada https://ada-lang.io/ https://www.gnu.org/software/gnat/ https://www.adacore.com/download
Objective-C Apple Objective-C Documentation https://gnustep.github.io/ Embedded GNUStep
C++ GNU C++ Manual https://gcc.gnu.org/
Eiffel https://www.liberty-eiffel.org/ https://download.savannah.gnu.org/releases/liberty-eiffel/
Perl https://www.perl.org/ https://www.perl.org/get.html https://9p.io/sources/extra/perl.iso.bz2
Tcl https://tkdocs.com/tutorial/index.html https://www.tcl.tk/ https://9p.io/sources/contrib/fgb/root/sys/src/cmd/tcl/
Haskell http://learnyouahaskell.com/chapters https://www.haskell.org/ https://wiki.haskell.org/Arduino https://9p.io/sources/contrib/fernan/nhc98/
Python https://docs.python.org/3/ https://www.python.org/ https://github.com/micropython http://git.9front.org/plan9front/pyhg/HEAD/info.html
Lua https://www.lua.org/manual/5.1/ https://luajit.org/ https://github.com/kevinboone/luapico https://sr.ht/~kvik/lu9/
R https://www.r-project.org/ https://cran.r-project.org/mirrors.html
Java https://docs.oracle.com/en/java/ https://openjdk.org/ https://hg.openjdk.org/aarch32-port maybe?
PHP https://phplang.org/
Limbo http://doc.cat-v.org/inferno/4th_edition/limbo_language/limbo https://bitbucket.org/inferno-os/inferno-os/src/master/limbo/ limbo compiles for plan9 using inferno os
Ruby http://ruby-doc.com/docs/ProgrammingRuby/ https://www.ruby-lang.org/en/ https://microruby.com/
JavaScript https://developer.mozilla.org/en-US/docs/Web/JavaScript/Language_overview https://bun.sh/ https://www.espruino.com/ maybe could do something with Netsurf?
OCaml https://ocaml.org/ https://ocaml.org/install https://github.com/stevenvar/omicrob http://caml.inria.fr/pub/distrib/ocaml-4.07/ocaml-4.07.1.tar.gz
var’aq https://www.oocities.org/connorbd/varaq/index.html https://git.alfrescocavern.com/zongor/varaq-interpreter-go Maybe compile using tinygo? works natively
C# https://learn.microsoft.com/en-us/dotnet/csharp/ https://dotnet.microsoft.com/en-us/download https://www.nanoframework.net/
D https://dlang.org/ https://dlang.org/download.html https://forum.dlang.org/thread/giigcnoyxfoxxaevjmxy@forum.dlang.org
Rust https://www.rust-lang.org https://www.rust-lang.org/tools/install https://lib.rs/crates/rp-pico
Nim https://nim-lang.org/ https://nim-lang.org/install.html https://github.com/EmbeddedNim/picostdlib
Chapel https://chapel-lang.org/ https://chapel-lang.org/download.html
Go https://go.dev/doc/effective_go https://go.dev/ https://tinygo.org/ works natively
Julia https://docs.julialang.org/en/v1/ https://julialang.org/ https://github.com/Julia-Embedded
Elixir https://elixir-lang.org/docs.html https://elixir-lang.org/ https://embedded-elixir.com/
Kotlin https://kotlinlang.org/docs/home.html https://kotlinlang.org/ https://kotlinlang.org/docs/native-target-support.html#tier-3
Elm https://guide.elm-lang.org/ https://elm-lang.org/ maybe compile haskell? https://github.com/elm/compiler
Wren https://wren.io/
TypeScript https://www.typescriptlang.org/docs/ https://www.typescriptlang.org/ https://microsoft.github.io/devicescript/
Swift https://www.swift.org/ https://www.swift.org/download/ https://github.com/Cosmo/awesome-embedded-swift
Raku https://docs.raku.org/ https://raku.org/
Crystal https://crystal-lang.org/reference/1.8/getting_started/ https://crystal-lang.org/
Zig https://ziglang.org/documentation/master/ https://ziglang.org/ https://github.com/ZigEmbeddedGroup/microzig
Myrddin https://myrlang.org/ https://github.com/oridb/mc might be able to compile using arm toolchain? works natively
Odin https://odin-lang.org/docs/ https://odin-lang.org/
Ballerina https://ballerina.io/learn/ https://ballerina.io/ currently targets the jvm, so maybe embedded java might work?
V https://github.com/vlang/v/tree/master/tutorials https://vlang.io/ theoretically could compile for microcontroller
Mojo https://docs.modular.com/mojo/ https://www.modular.com/mojo Mojo is a ‘superset’ of Python, so eventually a mojo-like micropython might exist?

I hope to start this project in the upcoming weeks, so expect a post soon for our first programming language Fortran!