A beginner's guide to the thulium esolang.
Tags: esolang, typescript, showdev, githunt
Published: 2021-03-29 17:05:56

Sometimes, humans just like things being incredibly difficult. That is one of the two reasons I created thulium version 1. It is a strange language with all commands written in binary. Then I remembered that I actually had a heart and decided to make thulium 2.

Now, you probably have absolutely no idea what I am talking about and that is why I am writing this guide. So kick up you feet and get a cup of coffee because you are reading a beginner's guide to the thulium esolang. Enjoy!

# So what exactly *is* thulium?
Well, thulium is a programming language that I made to learn typescript and that makes bf look like candy floss. It has 3 times the number of commands and is much more esoteric. Plus the former has conditionals while the latter's aren't fully implemented as of the latest version (v2.0.3). Thulium is in the bf family however.

# So when did this all begin?
I made thulium 1 three months ago and from what I remember, it wasn't really the most pleasant experience. I actually made it so that I could learn typescript. I succeeded. Using that knowledge, I set out to learn another language (lua, to be exact) and thulium 2 was born.

## Credits
Of course, it wouldn't be right to talk about thulium without mentioning the language from which it was inspired. At the time, I 
had absolutely no idea what bf was so that wasn't what inspired 
thulium. What did was an esoteric language by the name of 
[jellyscript](https://github.com/nguyenphuminh/Jellyscript). Check it out!

# How do you actually *code* in thulium?
The docs are in the readme but I will give you a quick brief on how it works.

In a nutshell, thulium is divided into 3 parts:
1. 1 million normal cells arranged in a 1000x1000 square that can each hold one number. At the start of the program they are all set to 0.
2. 1 memory cell that can hold one value.
3. 5 special cells that can update to do simple arithmetic.

All 19 commands either alter one of these "registers", show you the value of the current cell or move the current cell in each register.

The 19 commands are as follows:
- mov_right -- this command moves right in the grid 
- mov_left -- left in the grid
- mov_up -- up (grid)
- mov_down -- down (grid)
- spec_right -- forward in special cells
- spec_left -- backward in special cells
- print -- prints the current cell to the console (with \n)
- SP to M -- moves the current special cell value to the memory
- M to C -- moves the memory to the current cell
- C to M -- moves the current cell's value to the memory
- add -- increases the current cell's value by 1
- sub -- opposite of add
- update -- updates the special cells
- ascii_print -- prints the current cell's ascii value
- input -- takes one byte as input and stores its ascii char code
- print2 -- prints the current cell to the console (no \n)
- cond_start -- same as brainf**k's '[' (coming soon)
- cond_end -- same as brainf**k's ']' (coming soon)
- end -- Used to denote the end of a program

## Surely a `Hello World` program can't be *that* bad right?
Think again. Hello World in Thulium (depending on the way you do it) can take up 200 lines. But if you insist:

`Hello World` in thulium (v2.0.3)
```
add
add
add
add
add
add
add
add
add
add
mov_right
add
add
add
add
add
add
add
add
add
add
mov_left
update
spec_right
spec_right
SP to M
M to C
mov_right
M to C
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
ascii_print
mov_right
M to C
add
ascii_print
mov_right
M to C
add
add
add
add
add
add
add
add
ascii_print
ascii_print
mov_right
M to C
add
add
add
add
add
add
add
add
add
add
add
ascii_print
mov_right
M to C
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
ascii_print
mov_right
M to C
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
sub
ascii_print
mov_right
M to C
add
add
add
add
add
add
add
add
add
add
add
ascii_print
mov_right
M to C
add
add
add
add
add
add
add
add
add
add
add
add
add
add
ascii_print
mov_right
M to C
add
add
add
add
add
add
add
add
ascii_print
mov_right
M to C
ascii_print
end
```
Well, you asked for it.

# Conclusion
Is thulium a good language? See for yourself!

The thulium GitHub repository:
{% github JavaCode7/Thulium %}