Oshd

From Esolang
Jump to navigation Jump to search

IMPORTANT INFORMATION

If you need a humorous description or something that works quickly, then feel free to click "Random Page".

What is OSHD?

OSHD is a stack-based programming language with Reverse Polish Notation (RPN). It has the addition of functions, conditions (albeit simple) and loops (also quite simple). When programming in it, I recommend that you be as careful as possible when writing code, because any mistake can stop the interpreter. But okay, now let's get down to the syntax.

Syntax and builtins

Since this language is a stack language, then, as I said earlier, it has RPN, don't blame all the developers of stack languages, it's just a faster way to implement the idea, and basically the most logical for a stack architecture. Let's not talk about sad things, here is an example of code that displays "Hello, world!" on the user's screen:

Hello,|world! print

You probably realized that a large table is waiting for you here, your feeling did not let you down:

buitltin What it does
+ Takes the last two numbers from the stack, adds them up, and puts the result back.
- Takes the last two numbers from the stack, subtracts them, and puts the result back.
* Takes the last two numbers from the stack, multiplies them, and puts the result back.
/ Takes the last two numbers from the stack, if the second number is 0, it simply adds 0 to the stack, if not, it puts their quotient on the stack.
% ...
! Takes the last value from the stack and then puts it on the "memory".
@ Takes the last value from "memory" and puts it on the stack.

P.S. I'm going to try to wrap up this table, just adding each object individually is a long time, so you'll have to wait.

It also has its built-in variables, all of which are:

__version Retrieves the version of this interpreter, changes manually when changes.
__platform Returns the platform on which the interpreter was run.
true Returns bool to True, I do not recommend using it because the conditions do not support the execution format when true or false.
false Returns False.
null Returns None (since the language is written in py, and there is no null there, we return None).

Code Examples

Simple function example:

fun hii 
    hi print 
end
hii // Calls function */

More soon!

Links

OSHD Source Code