Languages

Appendix 3 - Programming Languages #

for (🥚 = 1; 🥚 < 🐔; 🥚++){
   //whatever
}

Hello nerds,

Before you get on my case, I know this isn’t a complete list, so it’s possible your favorite language isn’t on it. Hell, a complete list can’t even really exist. Still, there are a lot of cool languages I didn’t put here, so if you’re looking for some weird but not incredibly weird languages see Awesome Programming Languages (GitHub), though note even it doesn’t include the obvious - like C and Java.

[TODO] talk about to why there are so many, pros & cons per domain, etc

https://esoteric.codes

Why OO Sucks (Joe Armstrong)

0-based vs. 1-based indexing (Hisham Hm)

Stop Writing Dead Programs (YouTube)

https://cs.lmu.edu/~ray/notes/syntaxdesign/

Low Level #

The C Family #

[TODO] - a lot, talk about the varieties and differences of C and C++ and C# and why thery’re good and bad, etc.

C #

[TODO] Briefly mention that compliers are effectively dilects - GCC vs Clang vs MSVC vs TCC due to their varied support for different preprocessor macros and library functions.

C++ #

C# #

Best-of-C

https://www.learncpp.com

https://nedbatchelder.com/code/cog/ for making plain C suck a bit less.

https://arobenko.github.io/bare_metal_cpp/

Assembly #

Assembly code is specific to an Instruction Set Architecture or ISA, that means it is written for a specific family of processors. Most laptops and desktops today run on x86_64 processors made by either AMD or Intel, while most tablets and phones use processors that use ARM. Of course, there are many, many other instruction sets than these two. For example, 6502 assembly is particularly easy to write, as it’s from an era (1) when programming at the assembly level was still common. On the other hand, RISC-V is a newer ISA that has been gaining a lot of traction due to its open nature. Knowing ASM can allow you to do some black magic, like pushing out FizzBuzz at 57.2GiB/s.

x86 ASM: #

x86 Assembly: Hello World! (YouTube, John Hammond)

Say hello to x86_64 Assembly 1-8 by 0xAX

or

Let’s Learn x86-64 Assembly! Part 0 - Setup and First Steps

Part 1 - Metaprogramming in Flat Assembler

Part 2 - We’re Writing a Virtual Machine

or for the very adventurous

Linux-kernal-module-cheat [Github], has a nice guide to ASM

6502 #

‘Furby’ Source Code

Rust #

Rust’s rich type system and ownership model guarantee memory-safety and thread-safety — enabling you to eliminate many classes of bugs at compile-time.

Basically, Rust doesn’t let you screw up. It enforces writing code that’s safe (except when you specify you want to do something unsafe). It has a lot of other really nice features and makes using efficient data structures easy. Another really nifty thing about Rust is that it has a sort of at compile time garbage collection of sorts, for lack of a better way to put it. Read more on that here.

While I think Rust is great for desktop programs, for embedded, When Zig is safer and faster than Rust from ZackOverflow makes a good argument for why you may want to oxidize everything.

I really recommend A half-hour to learn Rust

Nannou, is a creative coding framework for Rust that’s pretty nifty, too.

To show the maturity, just check out https://www.redox-os.org/, a full OS written in Rust!

Also, it’s worth noting Rust can be used to generate Web Assembly (more about that below)

Other sources to lean rust:

You may also want to check out CXX for C++<-> Rust interop

Go #

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

The big claim to fame for go is, well go, which lets you do really easy threading. (https://gobyexample.com/goroutines)

Other sources to learn Go:

Zig #

A general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

https://ziglang.org/

Zig: A programming language designed for robustness, optimality, and clarity – Andrew Kelley (YouTube)

Writing a small ray tracer in Rust and Zig

A Half hour to Learn Zig (Github Gist)

Zig, The Small Language (Serge Zaitsev)

When Zig is safer and faster than Rust (Zachoverflow)

If you’re going to use Zig, make sure to set up the Zig Language Server

Odin #

Odin is a general-purpose programming language with distinct typing built for high performance, modern systems and data-oriented programming.

Odin is the C alternative for the Joy of Programming

https://odin-lang.org

https://graphitemaster.github.io/odin_review/

Crystal #

Crystal’s big thing is a Ruby (a very fast to write language) that’s compiled and fast. From the home page:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# A very basic HTTP server
require "http/server"

server = HTTP::Server.new do |context|
  context.response.content_type = "text/plain"
  context.response.print "Hello world, got #{context.request.path}!"
end

puts "Listening on http://127.0.0.1:8080"
server.listen(8080)

Seriously, check it out at https://crystal-lang.org/

D #

A lesser used competitor to C++ mostly. It’s very syntactically similar. Might be worth looking at.

https://dlang.org

Nim #

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula.

https://nim-lang.org/

Further, Nim allows for easy ‘metaprogramming’ which basically means you can [TODO]

Nim’s syntax is python-like-ish

Red #

To be honest, I’m not sure Red belongs in the low level category, as it can be run as a JIT language.

Red is a next-gen programming language, strongly inspired by REBOL. Main features are:

  • Human-friendly syntax
  • Homoiconic (Red is its own meta-language and own data-format)
  • Functional, imperative, reactive and symbolic programming
  • Prototype-based object support
  • **Gradual and multi-**typing
  • Macros system
  • Rich set of built-in datatypes (50+)
  • Both statically and JIT-compiled to native code
  • Cross-compilation done right
  • Produces executables of less than 1MB, with no dependencies
  • Concurrency and parallelism strong support (actors, parallel collections)
  • Low-level system programming abilities through the built-in Red/System DSL
  • Powerful PEG parser DSL included
  • Cross-platform native GUI system, with a UI DSL and drawing DSL
  • Bridging to the JVM
  • High-level scripting and REPL console included
  • Visual Studio Code plugin, with many helpful features
  • Highly embeddable
  • Low memory footprint, garbage collected
  • Single-file (~1MB) contains whole toolchain, full standard library and REPL.
  • No install, no setup
  • Fun guaranteed!

https://www.red-lang.org/p/about.html

If you’re interested, check out Red’s ‘Getting Started’ page.

Haxe #

Haxe is an open source high-level strictly-typed programming language with a fast optimizing cross-compiler.

https://haxe.org/

Java & Kotlin #

!> This is Opinionated Guides, so let me be clear, I really, really hate Java. It’s a language that didn’t even become popular on its own merit, instead Sun Microsystem paid a fuck ton of money to push it- hence the “3 Billion Devices Run Java” Thing. I’m hopeful (albeit probably naively) that Oracle (Which bought Java from Sun) making Java a mess of licensing as the ‘main’ Java Virtual Machine goes paid (Read on Wikipedia) and suing Google will be the nail in the coffin for education using it and that it will die out with time. Criticism of Java (Wikipedia)

don’t. but, here’s why not to use Java:

https://jakewharton.com/shrinking-a-kotlin-binary/

WebAssembly #

WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable target for compilation of high-level languages like C/C++/Rust, enabling deployment on the web for client and server applications.

https://webassembly.org/

While not technically a programming language, I wanted to bring it up and encourage you to look into it to be used instead of JavaScript for real projects.

https://www.assemblyscript.org is a TypeScript variant that can generate Web ASM.

https://webassembly.studio

Vult #

Vult Language Homepage

“The Vult Language is a transcompiler to write high-performance DSP code”

Call for Contribution #

If I missed a language you think I should have mentioned or would like to write a nice guide to your language of choice to be included in this Opinionated Guide please submit a pull request. I’d love to expand the Rust, Go, and Zig sections significantly!


High Level #

[TODO] probably going to need to break this out into its own chapter

Python #

Cython

Cython is an optimizing static compiler for both the Python programming language and the extended Cython programming language (based on Pyrex). It makes writing C extensions for Python as easy as Python itself.

https://github.com/exaloop/codon

JavaScript #

Fine. I’ll talk about JS. But, please. For the love of god, do not use this to make an Electron App.

Before going too far, I do want to mention that a chunk of my hatred for JS is solved using frameworks and that I totally acknowledge the utility of JS for making quick, often very cool, ‘sketches’. The creative coding community is amazing. Further, JS, as much of a total dumpster fire as it is, is responsible for the Internet as it is today, whether that’s a good thing or not.

CoffeeScript #

https://coffeescript.org/

TypeScript #

https://www.typescriptlang.org/

Frameworks #

https://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks

Angular #
React #
Vue #
Node #

PHP #

don’t. but, here’s why not to use PHP: If you must, you might want to check out Hack: https://hacklang.org/

Ruby #

A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.

https://www.ruby-lang.org/en/

Perl #

“Perl” is a family of languages, “Raku” (formerly known as “Perl 6”) is part of the family, but it is a separate language which has its own development team.

… I’m not a big Perl fan, but I have to mention it only because of how bizzare it is that they used the ⚛ character for atomics . (Though that, among other choices, lead to it being split into another language, raku )

Scallop #

“Scallop is a neurosymbolic programming language, solver, and framework. Based on Datalog, it supports discrete, probabilistic, and differentiable modes of reasoning.”

Basically, it’s really nice for AI/CV/probabilistic computations

For the Skript Kidd3s #

In programming and hacking cultures, a script kiddie, skiddie, or skid is an unskilled individual who uses scripts or programs developed by others to attack computer systems and networks and deface websites, such as a web shell. It is generally assumed that most script kiddies are juveniles who lack the ability to write sophisticated programs or exploits on their own and that their objective is to try to impress their friends or gain credit in computer-enthusiast communities. However, the term does not relate to the actual age of the participant. The term is considered to be derogatory.

from https://en.wikipedia.org/wiki/Script_kiddie

But, really, some absolutely incredible code has been written in the following languages. They more than serve their purpose and are generally some of the fastest “I just need a quick and dirty solution” options out there. Not everything needs a blazing fast hand optimized C implementation, and code that’s really just for personal use, to accomplish a one-off task, or that runs inside a bigger program (3D modeling software like Blender, Video editing software like Premier, Game development editors, etc.) should probably be easy to read and modify quickly. Rapid prototyping certainly has its place.

Just don’t think you should use these to write efficient, safe code.

LUA #

MoonScript #

AHK #

https://github.com/phil294/AHK_X11

Tasker (Android) #

CMD.exe #

Bash, ZSH, Fish, Xonsh, wut? #

Node-Red #

n8n #

Is this even Programming anymore? #

Pure-Data #

vvvv #

tooll.io #

ORCΑ #

Esolangs, the hole goes deeper #

An esoteric programming language (sometimes shortened to esolang) is a programming language designed to test the boundaries of computer programming language design, as a proof of concept, as software art, as a hacking interface to another language (particularly functional programming or procedural programming languages), or as a joke.

- Wikipedia - Esoteric Programming Languages


Brainfuck Designer

As a quick tour of esolangs, here are some of my favorites:

0@v*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v
*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^
v
^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v=
***^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^
*
**********v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^##
*^v*^v*^v*^v*^v*^v*^v*^v*^v#######################
v
^*v^*v^*v^**************v^*v^*v^*v^*v^*v^**********
#########^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v*^v****
#
###############v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*v^*
                         v*^v*^v*^v**************^v
 ====               X    @
 i:vX==:====     u@vX=@v i!  ==XX  ===v^==
    X vs.vuv     @===        s=vv=X=$v=  v
                             =X     X =  #
                                    ===@v@X

ROT13 implemented in Spiral

      ^
    ^^|^^
   ^^\|/^^
   H^ |/^^^
     \| e
      |/
   ol~|
     \|
  , 32|
   \/ |
    \ |  W
 l   \| /
 \  d |/  o
  \/ !|r /  
   \/ |\/
    \ |/
     \|

Hello World implemented in Tree

Hello World implemented in Ziim


If you’re looking to learn more, check out Awesome Esolangs (Github) and https://esolangs.org. Also, the Esoteric IDE may be of use.

Graphics Programming #

look to Chapter 19: Shaders + GpGPU for programming involving graphics, including node based shader editors, general purpose computation on the GPU, and more. As for languages, this includes, GLSL, HLSL, Futhark, and a few others. There are, many, many other graphics languages depending on the platform though.

Functional Programming #

Look at Chapter 21: (((())(()((()(())))))) for Functional Programming. You’ll probably want to look into Lisp, Haskell, and Futhark. There’s a nice tutorial for Haskell programming if you want to learn more.

Database #

Look at Chapter 39: Databases for information on Databases, including languages like SQL


If you would like to support my development of OpGuides, please consider supporting me on GitHub Sponsors or dropping me some spare change on Venmo @vegadeftwing - every little bit helps ❤️