Skip to content

Commit 9ff5cca

Browse files
committed
2 parents d267788 + 307e4ba commit 9ff5cca

File tree

36 files changed

+943
-36
lines changed

36 files changed

+943
-36
lines changed

docs/languages/algol68/index.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,23 @@ Welcome to the Algol68 page! Here, you'll find a description of the language as
1414

1515
## Description
1616

17-
No 'Description' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).
17+
[According to Wikipedia][1], ALGOL 68, also known as Algorithmic Language 68, is a
18+
successor to the ALGOL 60 language. As the name suggests, ALGOL 68 first appeared
19+
in 1968 as an imperative programming language.
20+
21+
That said, ALGOL 68 has a much wider scope than ALGOL 60. For instance, ALGOL 68
22+
includes user-declared types, expression-based syntax, concurrency, and even slicing.
23+
24+
Of course, I think the most interesting language feature is the overwhelming list of
25+
reserved words which includes 60 different symbols. Most of these symbols I couldn't
26+
even guess their purpose. For example, what do you think `esac` does? How about
27+
`ouse`? [James Jones offers a great explanation][2].
28+
29+
In general though, I find that most of the symbols are pretty typical. Many of which
30+
provide either control flow or iteration. Meanwhile, others provide typing. So,
31+
overall the language seems pretty tame. Feel free to check out the Wikipedia page
32+
for the full syntax and features list.
33+
1834

1935
## Articles
2036

docs/languages/bash/index.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,23 @@ Welcome to the Bash page! Here, you'll find a description of the language as wel
1414

1515
## Description
1616

17-
No 'Description' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).
17+
According to Wikipedia, Bash is a command language first released back in 1989.
18+
Despite its age, Bash is till heavily maintained with changes tracked in git.
19+
20+
In terms of features, Bash supports variables, piping, globbing, control flow,
21+
and even iteration. Of those features, perhaps the coolest is globbing, also
22+
known as wildcard matching. Globbing can be used to retrieves sets of files that
23+
match a wildcard expression.
24+
25+
Beyond that, Bash is ubiquitous in the Linux/Unix/Mac communities. After all,
26+
it's the standard shell on most systems. In fact, it even has support on
27+
Windows 10. That means shell scripts are fairly portable. However, users will
28+
have to pay attention to code that doesn't conform the Bourne shell standards.
29+
30+
You'd be hard pressed to find a popular system that doesn't support Bash today.
31+
Even Jenkins, a continuous integration utility, supports Bash scripting during
32+
builds.
33+
1834

1935
## Articles
2036

docs/languages/befunge/index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ Welcome to the Befunge page! Here, you'll find a description of the language as
1414

1515
## Description
1616

17-
No 'Description' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).
17+
Befunge is a programming language with some very unusual standards, as a two-dimensional, self-modifying, stack-based programming language. [Wikipedia][2] has it that it was designed in 1993 by Chris Pressey, merely to be as difficult to compile as possible.
18+
19+
All operations in Befunge are limited to a single character, and the source text can be traversed in any direction through the file. The "Instruction Pointer" starts in the upper left corner and proceeds to the right, running every character it crosses. When it reaches an arrow, `< > ^ v`, that pointer will turn and travel in the new indicated direction.
20+
21+
Instead of variables, all operations act on one global stack of integers, similar to [Forth][3]. 0-9 will just push their value, `+ - * / %` pop the top two values and push their normal result, `.` prints out the top number, and `,` prints the corresponding character instead.
22+
1823

1924
## Articles
2025

docs/languages/brainfuck/index.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,26 @@ Welcome to the Brainfuck page! Here, you'll find a description of the language a
1414

1515
## Description
1616

17-
No 'Description' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).
17+
[According to Wikipedia][1], Brainfuck is an esoteric programming language created in
18+
1992, and notable for its extreme minimalism. As people have implemented more and
19+
more ridiculous programs with the language, it has become relatively well-known
20+
over the years. Nowadays some see it as the ultimate coding challenge to create
21+
something useful in Brainfuck.
22+
23+
At the core of the language is a more-than-compact instruction set, comprising
24+
of a whopping eight instructions. Brainfuck uses a machine model consisting of
25+
an infinite list of one-byte cells, an instruction pointer, and a cell pointer.
26+
The instructions can be used to interact with this environment: `<` and `>`
27+
move the cell pointer, `+` and `-` increment or decrement the value of the cell
28+
at the current pointer, and `[` and `]` denote a loop.
29+
30+
A loop only starts when the value of the current cell is non-zero, otherwise
31+
execution jumps to the end of the loop. Likewise, a loop ends when the value is
32+
zero, otherwise the program jumps to the beginning of the loop. The remaining
33+
two instructions, `,` and `.` read one character from the input into the current
34+
cell and write one character from the current cell to the output, respectively.
35+
That's it!
36+
1837

1938
## Articles
2039

docs/languages/c/index.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,18 @@ Welcome to the C page! Here, you'll find a description of the language as well a
1414

1515
## Description
1616

17-
No 'Description' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).
17+
As usual, I decided to dive into the history of C with [Wikipedia][1].
18+
19+
According to Wikipedia, C is a general-purpose programming language that
20+
was developed as early as 1969 at Bell Labs by Dennis Richie. Today, the
21+
C language has influenced the design of many languages such as C++, C#,
22+
Go, Java, and many, many more.
23+
24+
Features of C include static typing, lexical variable scope, and recursion.
25+
In addition, function parameters are passed by value, not reference, but
26+
pass-by-reference can be accomplished by explicitly using pointers. Also,
27+
while C has static typing, variables are weakly typed and can be converted implicitly.
28+
1829

1930
## Articles
2031

docs/languages/crystal/index.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,22 @@ Welcome to the Crystal page! Here, you'll find a description of the language as
1313

1414
## Description
1515

16-
No 'Description' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).
16+
Like Julia, Crystal is another open-source language with a nice Wikipedia
17+
page, so we'll be using that to get some language background.
18+
19+
According to Wikipedia, Crystal is a general-purpose language that first
20+
appeared in 2014. As of today, Crystal is self-hosted meaning the compiler
21+
is written in an earlier version of Crystal.
22+
23+
That said, Crystal was inspired by Ruby which is the language Crystal was
24+
originally written in. However, as previously mentioned, Crystal is a compiled
25+
language, so many of the dynamic features of Ruby no longer exist.
26+
27+
Despite the lack of dynamic features, Crystal leverages strong type inference
28+
to allow for implicit typing. As a result, the language looks like a high-level
29+
scripting language. However, the language's efficiency is much closer to
30+
lower-level languages like C.
31+
1732

1833
## Articles
1934

docs/languages/d/index.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,37 @@ Welcome to the D page! Here, you'll find a description of the language as well a
1414

1515
## Description
1616

17-
No 'Description' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).
17+
If you haven't heard of D, I'm hardly surprised. After all, it's
18+
not exactly a popular language. In fact, it currently ranks 39th by
19+
popularity on GitHub. For reference, languages ahead of D include
20+
Visual Basic .NET (31st), Haskell (21st), Swift (18th), and C (8th).
21+
Meanwhile, D sits narrowly ahead of newer languages like Julia (43rd)
22+
and Elixir (45th).
23+
24+
That said, according to Wikipedia, D is still a pretty interesting
25+
language. As you can probably imagine, D is supposed to be an
26+
improvement on C++. Apparently, the designers weren't a fan of the
27+
practical issues surrounding C++ (surprise, surprise!). As a result,
28+
D includes features like design by contract, garbage collection,
29+
associative arrays, array slicing, and lazy evaluation.
30+
31+
Perhaps the most interesting feature to me has to be the inline
32+
assembler. Apparently, developers can write assembly code directly
33+
in D source code:
34+
35+
```d
36+
void *pc;
37+
asm
38+
{
39+
pop EBX ;
40+
mov pc[EBP], EBX ;
41+
}
42+
```
43+
44+
By adding an asm block, developers can quickly tap into the hardware
45+
with assembly code. Now, I think that is a pretty cool programming
46+
language feature.
47+
1848

1949
## Articles
2050

docs/languages/dart/index.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,38 @@ Welcome to the Dart page! Here, you'll find a description of the language as wel
1414

1515
## Description
1616

17-
No 'Description' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).
17+
Dart is a general-purpose language that was designed with five goals:
18+
19+
- Productive
20+
- Dart's syntax is clear and concise, its tooling simple yet powerful.
21+
Sound typing helps you to identify subtle errors early. Dart has
22+
battle-hardened [core libraries][1] and an [ecosystem][2] of thousands of packages
23+
- Fast
24+
- Dart provides optimizing ahead-of-time compilation to get predictably
25+
high performance and fast startup across mobile devices and the web.
26+
- Portable
27+
- Dart compiles to ARM and x86 code, so that Dart mobile apps can run natively
28+
on iOS, Android, and beyond. For web apps, Dart compiles to JavaScript.
29+
- Approachable
30+
- Dart is familiar to many existing developers, thanks to its unsurprising
31+
object orientation and syntax. If you already know C++, C#, or Java, you can
32+
be productive with Dart in just a few days.
33+
- Reactive
34+
- Dart is well-suited to reactive programming, with support for managing
35+
short-lived objects, such as UI widgets, through Dart's fast object allocation
36+
and generational garbage collector. Dart supports asynchronous programming
37+
through language features and APIs that use [Future][3] and [Stream][4] objects.
38+
39+
Since its inception, Dart has gone through different phases as Google tried to
40+
sell its potential to developers. Google has rebuilt it's advertising service
41+
AdSense with Dart. That demonstrate's Google's commitment to Dart by depending
42+
on the language for it's main method of generating revenue.
43+
44+
The language also has many great features like garbage collection and a strong
45+
typing system ([as of Dart 2.0][5]). All of it sits on top of a VM like Java, which
46+
allows there to be less configuration between the test side and the source code.
47+
A programmer can just get started from the get-go!
48+
1849

1950
## Articles
2051

docs/languages/elixir/index.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,52 @@ Welcome to the Elixir page! Here, you'll find a description of the language as w
1414

1515
## Description
1616

17-
No 'Description' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).
17+
18+
According to Wikipedia, Elixir is yet another general-purpose language
19+
with functional tendencies. That said, Elixir is quite a bit different
20+
from some of our recent languages. For starters, Elixir runs on the
21+
Erlang virtual machine known as BEAM. This means that Elixir actually
22+
compiles down to bytecode much like Java.
23+
24+
In terms of features, Elixir has a lot to offer. For instance, Elixir
25+
has support for macros which modify the abstract syntax tree. You may
26+
recall that Rust has the same feature.
27+
28+
In addition, Elixir offers Python-like doc strings which leverage Markdown.
29+
This is a great feature for automatically generating documentation.
30+
31+
Another cool feature of Elixir is exactly what I found interesting about
32+
Scala: everything is an expression. In other words, everything evaluates
33+
to a value.
34+
35+
Finally, my favorite feature of Elixir has to be pattern matching. In
36+
Elixir, we can match patterns using the same operator most languages use
37+
for assignment: `=`. For example:
38+
39+
```elixir
40+
myVal = 5
41+
5 = myVal # A valid match
42+
6 = myVal # (MatchError) no match of right hand side value: 5
43+
```
44+
45+
In this example, we assign myVal a value of 5. Or in Elixir terminology,
46+
we actually bind a value of 5 to myVal through pattern matching. Then, we
47+
compare 5 to myVal which is a valid match. With that in mind, it's clear
48+
why we get an error when we try to match 6 to myVal.
49+
50+
Of course, pattern matching gets much more fun than that. We can also use
51+
pattern matching to destructure other data types:
52+
53+
```elixir
54+
{x, y, z} = {:hi, 117, "some string"}
55+
x # :hi
56+
y # 117
57+
z # "some string"
58+
```
59+
60+
In addition, there are several other ways pattern matching can be used, but
61+
we have to get to our implementation of Hello World in Elixir.
62+
1863

1964
## Articles
2065

docs/languages/elm/index.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,71 @@ Welcome to the Elm page! Here, you'll find a description of the language as well
1414

1515
## Description
1616

17-
No 'Description' section available. [Please consider contributing](https://github.com/TheRenegadeCoder/sample-programs-website).
17+
According to Wikipedia, Elm is a functional programming language
18+
used for building web-based graphical user interfaces.
19+
20+
In terms of features, Elm offers immutability, static typing, and
21+
a module system.
22+
23+
## Static Typing
24+
25+
At this point in the series, we've seen a lot of languages which
26+
support static typing. Because of that, I'm slowly starting to draw
27+
a distinction between statically and dynamically typed languages.
28+
29+
Originally, my understanding of static typing came from languages
30+
like Java and C where we have to explicitly state the types of our
31+
variables:
32+
33+
```java
34+
// Java Explicit Typing Example
35+
int x = 5;
36+
String helloWorld = "Hello, World!";
37+
```
38+
39+
Meanwhile, my understanding of dynamically typed languages came
40+
from Python where variables don't need type annotations:
41+
42+
```python
43+
# Python Implicit Typing Example
44+
x = 5
45+
hello_world = "Hello, World!"
46+
```
47+
48+
Because of this rather naive distinction, I was under the impression
49+
that Elm couldn't actually be statically typed because the language
50+
supports type annotations. Instead, I thought that maybe Elm was more
51+
like Hack, a gradually typed language.
52+
53+
Of course, the true distinction between static and dynamic typing is
54+
at what point the type checking occurs: before or at runtime. In other
55+
words, languages don't need explicit typing to be statically typed.
56+
Likewise, languages don't need implicit typing to be dynamically typed.
57+
58+
In the case of Elm, type inference is used to determine value types.
59+
However, type annotations can be used to improve program readability.
60+
And, the compiler will even verify the annotations are correct. However,
61+
the annotations, in this case, have nothing to do with gradual typing.
62+
63+
## Immutability
64+
65+
While debating type systems is great, Elm's most interesting feature
66+
to me is immutability. Immutability, a byproduct of value semantics, describes
67+
a value's inability to be changed. In other words, immutable values are
68+
values that cannot be changed after creation.
69+
70+
To me, the concept of immutability is interesting because code like the
71+
following will fail in Elm:
72+
73+
```elm
74+
a = 10
75+
a = a - 5
76+
```
77+
78+
Because a is immutable, the code above will actually cause a recursion
79+
error. You can read more about that in Elm's documentation. At any rate,
80+
let's get to the solution!
81+
1882

1983
## Articles
2084

0 commit comments

Comments
 (0)