Obratnaya
h
TheForArkLD (734)

Obratnaya repl
Source
@SixBeeps @RaidTheWeb @NoNameByProgram Here is post!

Table for features

JavaScriptC#Obratnaya
No undefined⭕️⭕️
Null⭕️⭕️⭕️
Library⭕️⭕️⭕️
Function or Section⭕️⭕️⭕️
Class⭕️⭕️
Type⭕️⭕️
Type Generic⭕️
Goto⭕️⭕️
Data section⭕️
Section⭕️
Function⭕️⭕️
Readable⭕️⭕️⭕️
Word for operator⭕️
Exact equality operator⭕️⭕️

Samples

Hello world

#include <stdout.oba>
.main:
    push Hello, world!
    push msgln
    call @
    ret

What does this program do?

  1. Include stdout.oba (It contains section for output text with \r\n)
  2. Declare "This is main section"
  3. Push "Hello, world!"
  4. Push "msgln"
  5. Call "msgln"
  6. End program by exit code 0

99 Bottles of beer

#include <stdout.oba>
.data:
    .empty
    .empty
    .empty
    .decimal 100
.main:
    mov 3,@
    sub @,1
    movd @,3
    mov 3,@
    push  bottles of beer on the wall, 
    concat @,@
    mov 3,@
    push  bottles of beer,
    concat @,@
    concat @,@
    push msgln
    call @
    mov 3,@
    sub @,1
    movd @,3
    push Take on down, pass it around,
    push msgln
    call @
    mov 3,@
    push  bottles of beer on the wall
    concat @,@
    push msgln
    call @
    jmp 5

What does this program do?

  1. Include stdout.oba
  2. Declare "This is data section"
  3. Push empty / empty / empty / 100 to data section
  4. Declare "This is main section"
  5. Get value from Index 3
  6. Subtract it by 1
  7. Move value to data section
  8. Get value from Index 3
  9. Push " bottles of beer on the wall,"
  10. Concat
  11. Get value from Index 3
  12. Push " bottles of beer,"
  13. Concat
  14. Concat
  15. Push "msgln"
  16. Call "msgln"
  17. Get value from Index 3
  18. Subtract it by 1
  19. Move value to data section
  20. Push "Take on down, pass it around,"
  21. Push "msgln"
  22. Call "msgln"
  23. Get value from Index 3
  24. Push " bottles of beer on the wall"
  25. Concat
  26. Push "msgln"
  27. Call "msgln"
  28. Jump to line 5
You are viewing a single comment. View All
CSharpIsGud (639)

Oh yeah something I didn't notice before, this only has instructions for things like mathematics and outputting to the terminal.

If you want to do anything other than that then you couldn't use this even if you wanted to.

TheForArkLD (734)

@CSharpIsGud No, it has (not math) things.

k9chelsea2 (689)

what theforark said ot has other stuff

CSharpIsGud (639)

@TheForArkLD it has outputting to the screen, thats about it

TheForArkLD (734)

@CSharpIsGud yes(this program), but it(lang) has other commands.
did you read document? you can read document from github.

CSharpIsGud (639)

@TheForArkLD yeah and the only thing the instructions do is

  • math instructions like add sub mul div
  • output things to the terminal
  • store things in some data section to be outputted to the terminal since thats basically all that can be done with it
CSharpIsGud (639)

@TheForArkLD What it needs to be something you can use for a real project:

  • A way to import C# functions to be able to interact with APIs like file io
  • Standard libraries to interact with basic things like file io using the above

It's too late to add these things now but when the judging ends and you don't throw it away it needs them.

TheForArkLD (734)

@CSharpIsGud huh, you didn't read document. read document again.

CSharpIsGud (639)

@TheForArkLD I am not talking about sections, it does not matter how many sections you make, there aren't any instructions for anything but stack, basic terminal output and math

TheForArkLD (734)

@CSharpIsGud huh, talk to you is waste of time.
because you aren't reading document.

CSharpIsGud (639)

@TheForArkLD I READ THE DOCUMENT AND THAT IS WHAT IM POINTING OUT

TheForArkLD (734)

@CSharpIsGud HUHHHH DID YOU SEE and, or, xor, AND not etc???

CSharpIsGud (639)

@TheForArkLD I count those as mathematical operators, they are bitwise operations. I am talking about instructions to import a C# function and call it, to make it possible to do things other than simply manipulating numbers

fuzzyastrocat (1208)

@CSharpIsGud A agree that it would be nice to have an FFI.

However, would you call x86 useless since it can only manipulate numbers?

fuzzyastrocat (1208)

@TheForArkLD x64 is really x86-64, so I just consider all those under the umbrella of "x86"

CSharpIsGud (639)

@fuzzyastrocat x86 can edit memory, interact with serial ports, etc. It defines the basics of what everything can do, if all you could do is write numbers to the screen it would be useless

fuzzyastrocat (1208)

@CSharpIsGud Ah, I didn't realize Obratnaya was incapable of syscalls. Yes, I agree with you then.

CSharpIsGud (639)

@fuzzyastrocat Since obratnaya compiles to .NET bytecode even if he adds some way to import C# code it will be limited to what the .NET runtime can do.