Skip to main content

Types Of Programming Languages

Well to understand the different types of programming languages we must first understand what a programming language is.

What is a programming language and why do we need it?

A programming language like any other language you and I speak, is a means to translate tasks or instructions to be performed from the user side to the computer side, say, you’re playing Super Mario on your computer, now you know that pressing your space bar forces Mario to jump, but your computer doesn’t understand that unless translated, it’s kind of like me saying “私はマリオです (watashi wa Mario desu)” to you, unless you know the language you have no clue as to what to make of the statement.
This is where our handy helper the programming language steps in, think of it like the google translate, you search for the statement on there to get an understandable answer in your native tongue. Similarly, the programming language is a vocabulary for you and your computer to understand one another, a dictionary if you must, it consists of a bunch of grammatical rules and instructions to be performed at certain points in a program by the developers, which in turn makes your life a tad bit easier. Can you imagine trying to type 1 0 0 0 0 0 (32 – ASCII Code for space bar) each time you want to jump in a Mario game?
So now that you have a fairly decent idea of what a programming language does for you, let’s move on to how it even came into being.

A brief look into the origin of programming languages

Around 90 years ago in a “not so friendly nation” a.k.a “Nazi Germany” lived a man named Konrad Zuse, he was particularly bright and gifted in his field of expertise, i.e., computers, back then computers weren’t the hand held devices you carried around, only a few fortunate people could even get to see a real working computer, let alone use it, mainly because it was a surprisingly costly affair to build one and not everyone knew how to use it or even needed a computer in their day to day life.

Now this curious man named Konrad was one of the few gifted people who actually understood the working of the computer, with a wealthy family to back his research Konrad had no trouble experimenting with the computer, now you should know that back then computers where specifically designed to do a single task and that single task alone, say multiplication, now you couldn’t get the computer to perform division no matter how bad you wanted it to. Then this man goes on to invent the world’s first programmable computer from his findings, changing the world one step at a time (First functional program-controlled computer – Z3 which was said to be turing complete).

Since it was the World War II going on back then and being a German, his works and publications largely went unnoticed in the United States and the United Kingdom, where in fact the brightest of minds lived and all the scientific discoveries acknowledged back then. Eventually the Nazi Government started providing him resources for his research, which you might have guessed, didn’t help his cause a lot either.
It was during this time that he came up with “Plankalkül (Plan Calculus)” the first ever high-level programming language based on a non-von Neumann concept. There you can see what a Von Neumann Architecture is.

It was only after the war that he got any recognition, which was in 1946 by IBM on one of his patents. Although when you search for the first programming language, you’ll first be directed to the world’s first commercially available programming language FORmula TRANslation or FORTRAN developed in 1956 at IBM, which was mainly because of Konrad’s Nazi relations which led to his inventions never getting the recognition it deserved.
Now I’m guessing you have a brief idea of how the concept of programming languages came into being,
well let’s move on to the types then.

Types of Programming Languages

Since the time of Konrad we have come a long way in terms of programming languages, now we have all kinds of programming languages for all specific and general purpose tasks.
If you’re fairly new to the programming world, the two major terms you might have heard would be:
Scripting Languages, and General Purpose Programming Languages.
Although there are plenty more types of programming languages like dataflow languages, data oriented languages, esoteric languages, extension languages etc. to name a few, we’ll be focusing more on the aforementioned two types.
Before we get in depth with those types you should know there are 3 basic levels of any programming language:
1. High-Level Languages: English-like languages which are fairly easy to understand and write but these are not understood by the computer. Eg: Scripting languages, Java etc.
#include <stdio.h>
main()
{
   printf(“Hello World”);
}
2. Assembly-Level Languages: There are like harder to type but easily understood by the computer, they use instructional commands to give a sense of one-to-one correspondence with the computer which often does not take place. Eg: Netwide Assemble (NASM)
global _main
extern _printf

section .text
_main:
push message
call _printf
add esp, 4
ret
message:
db ‘Hello, World!’, 10, 0
3. Machine-Level Languages: These are the codes that are machine dependent and understood by the computer. Eg: Binary code.

General Purpose Programming Languages

Now coming to general purpose programming languages, these are quite opposite to that of scripts,
although both aim to achieve the same result. These languages are usually used in codes that have a
broader sense of objectives to be performed. Programs written in these need to be explicitly compiled before execution.

Generally, compiled programs run faster than interpreted programs because they are first converted into native machine codes, since the compilers usually just compile the program just once, this does aid the cause.
Some of the prominent general purpose programming languages that you might have heard are C, C++, Java and Python.
Although Python is a general purpose programming language it is often confused as a scripting language as it can be run without the explicit compilation step, it can often act as both.

The line between a regular programming language and a scripting language is getting quite slim day by day as there are more powerful hardware and advanced optimizing techniques that allow the compilation to be so fast that you get almost the same results regardless of whether it was a script or a program.

Scripting Languages

Well the textbook definition for scripting is any high level programming language that supports scripts is a scripting language. Now what is a script? These are programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator.

In simple words a script is a piece of code that you can execute at will without having to be compiled
and are interpreted as such one command at a time, although you can compile them if you wish to. The whole purpose of scripting languages were to create functionalities to existing programs in a way such that it does not bloat the original program while doing so.

Although scripts are employed at large in the all fields of programming, they found their use much optimized in creating dynamic web pages, network interfaces in modems and terminals and game engines etc. Scripts are usually simple short codes that help increase the efficiency of the program when used in conjunction with regular programs even though scripts as such are slower than regular programs, they are also used to automate certain tasks in a program and extract information from a data set.
Some of the most widely used scripting languages are JavaScripts, VBScripts, PHP, Lua to name a few.
Unity uses C# as a scripting language. This is possible because of Mono.
Scripting an application usually exposes some of the internals of the low-level code in one way or another. Usually there are handles or object systems that are available to the scripting developer to consume. The developer of the binding will typically have to design the system to allow for the scripting language to consume it.

Game developers are some of the major users of scripting technologies, they develop the performance sensitive code in C, C++ or assembler and they take advantage of graphics-accelerated hardware, physics libraries, physics accelerated hardware and multi-cpu processing to increase the performance of a game but the interface to the end user will be a high level language like C# or JavaScript.

That's it! Hope you learnt something. Support Bitshift Programmer by leaving a like on Bitshift Programmer Facebook Page and be updated as soon as there is a new blog post.
If you have any questions that you might have about shaders / unity development / programming in general don't be shy and leave a message on my facebook page or down in the comments.
For Shader development tutorials, go : HERE
For Unity development tutorials, go : HERE

Comments

Assets Worth Checking Out

POPULAR POSTS

Pixelation Shader - Unity Shader

Pixelation Shader This is the correct way (one of many) of showing pixelation as a post-processing effect. This effect will work in any aspect ratio without any pixel size scaling issues as well as it is very minimal in terms of coding it up.

In order to get this to work 2 components have to be set up:
1) The pixelation image effect
2) The script - which will be attached to the camera

So let's get started by creating a new image effect shader.
We will take a look at our Shaderlab properties :
_MainTex("Texture", 2D) = "white" {} That's it, Everything else will be private and not shown in the editor.
Now we will see what are defined along with the _MainTex but are private.
sampler2D _MainTex; int _PixelDensity; float2 _AspectRatioMultiplier; We will pass _PixelDensity & _AspectRatioMultiplier values from the script.
As this is an image effect there is no need to play around with the vertex shader.
Let's take a look at our fragment shader:
fixed4 frag (…

How To Animate A Fish Swimming With Shaders

Animate Fish Swimming With Shaders We are going to make swimming animation by using only shader code.
By the time we are done, it's going to look like this.
You will probably need the fish model used in this tutorial, that can be found HERE. Can use your own model but the shader code might have to be modified accordingly because of the orientation of the model that you might be using ( issues with whether the X axis & Z axis is flipped ).
The shader used way out performs a similar scene with skeletal animations applied on the fish models.
On a previous benchmark I did comparing the shader animation with the skeletal animation there was a difference of 28 FPS( on average ) with 50 fish.
The shader we are going to make is really powerful and flexible and don't think that it's limited to making fishes swim😀.


So this mesh oriented like this when imported into unity and this is important to understand because this means that the model's vertices have to be moved along the X-…

Toon Liquid Shader - Unity Shader

Toon Liquid Shader This is how the shader will end up looking :
This shader is pretty neat and somewhat easy to implement as well as to understand. Since we will be adding some basic physics to the toon water as it is moved about we will have to support that in the vertex shader as well.
So let's start by looking at the properties :
Properties { _Colour ("Colour", Color) = (1,1,1,1) _FillAmount ("Fill Amount", Range(-10,10)) = 0.0 [HideInInspector] _WobbleX ("WobbleX", Range(-1,1)) = 0.0 [HideInInspector] _WobbleZ ("WobbleZ", Range(-1,1)) = 0.0 _TopColor ("Top Color", Color) = (1,1,1,1) _FoamColor ("Foam Line Color", Color) = (1,1,1,1) _Rim ("Foam Line Width", Range(0,0.1)) = 0.0 _RimColor ("Rim Color", Color) = (1,1,1,1) _RimPower ("Rim Power", Range(0,10)) = 0.0 } Just the usual stuff that we are used to. The only thing that may stand out is the [HideInInspector] tag, This works j…

Curved Surface Shader [ Unity Implementation ]

Curved Surface Shader This is the shader that we will be having at the end of this tutorial.
 The curved surface shader is capable of achieving really varied visual effects from showing space-time curve due to gravity to a generic curved world shader that is seen in endless runners like Subway Surfers.
The concepts that you learn here can open you up to a new way of looking at shaders and if you didn't think they were the coolest thing ever already, hopefully let this be the turning point.😝.

Both the examples show above use the same exact material is just that different values have been passed to the shader.
Start by creating a new unlit shader in Unity and we will work our way from there.
First we define what the properties are:
_MainTex("Texture", 2D) = "white" {} _BendAmount("Bend Amount", Vector) = (1,1,1,1) _BendOrigin("Bend Origin", Vector) = (0,0,0,0) _BendFallOff("Bend Falloff", float) = 1.0 _BendFallOffStr("Falloff s…

Access Reflection Probe Data For Custom Shaders

The Unity shader documentation regarding reflection probes is pretty minimal and not at all comprehensive.
This short tutorial is intended to bring reflection probe functionalities to the forefront your future shader writing endevors which is a fancy way of saying "Look at this cool stuff and go and use it somewhere" 😏
Here we will try just the bare minimum of making a shader that reflects the cubemap data from reflection probe and displays it on the object.

These reflection probes are basically objects that store a complete image of the environment surrounding it into a cubemap which then can be read by shaders to create various effects.
More information on how reflection probes work in Unity can be found here :
Using Reflection Probes In Unity

I am not going over how to set up Reflection Probes here only how to access them inside our custom shaders.
So this is what we will be making:
The reflection probe takes in the cubemap only if it is within it's range otherwise i…