Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Intro:
- Seabass was designed as an extension of Deadfish into a language that is:
- 0. true to Deadfish, to the point of being DF-compatible
- 1. functional (i.e. you can do lotsa stuff in it)
- 2. easy to use (relatively to Malbolge/Brainf***)
- Exactly in that order.
- It may also serve as proof that any task, no matter how complex, can be broken down to 2-number operations.
- You can also view Seabass as a minimal language, that is easier to program in than THE MOST minimal lang.
- About Seabass virtual machine:
- SVM consists of three main units you're going to operate with:
- - ACCUMULATOR STACK
- - DECCUMULATOR STACK
- - EXTENDED STACK
- Imagine accumulator stack as an infinite tower of bricks put onto eachother one by one.
- Each of them has value of 0.0 and you can focus only on one at a time, making that brick the accumulator.
- From the start, you're focused on the value #0.
- Same is true for deccumulator. Accumulator and deccumulator (stacks) are identical in all ways except for their role in Seabass functions.
- Extended Stack is a way of storing variables in Seabass. It is an infinite tape with cells, each holding 0 by default, it starts with cell #0.
- Through several functions you can update cells of EXTST or load to accumulator from them.
- Because typically this loading requires you to specify the number of the item, the only way to access variables in Seabass is through "pointers".
- Data types allowed in the EXTendedSTack:
- BOOLEAN INTEGER FLOAT STRING
- All functions operate with [a]ccumulator or [d]eccumulator.
- All names in Seabass are integers.
- List of functions:
- i/I - Increment accumulator by 1 / Increment accumulator by deccumulator
- d/D - Same as above but negative
- s/S - Square accumulator / Accumulator^deccumulator
- o/O - Output accumulator / output variable to which accumulator points
- m/M - multiply a=a*d / a=a%d
- v/V - divide a=a/d / divide a=d/b
- r/R - root of deccumulator or accumulator
- x/X - exchange accumulator with deccumulator
- a/A - move up in accumulator by 1 / move up in accumulator by deccumulator
- b/B - same as above but for deccumulator
- % - a = a//d
- l/L - load deccumulator pointer to accumulator / load d'th character from string #a to accumulator, works identically to "#" ((not yet), same with numbers)
- n/N - save accumulator in d'th position as an integer / same, but reverse
- t/T - save accumulator as character in position d (or save a value as an integer at d if a<0)/ grow string in position D by accumulator char (or save a value as a float at d if a<0)
- f/F - save accumulator as a float in position d / same, but reverse
- e/E - save a as bool in position d / save d as bool in pos a
- g/G - neGative a or d
- w/W - write text file named d pointer with content pointer a, if a is negative - character -a/ append file named pointer d with pointer a, if a is negative - append with -a
- y/Y - same as above but it stores to var named pointer a from text pointer d
- c/C - copy d to a / copy a to d###
- p/P - |d| / |a|
- z/Z - go to original dec/acc
- k/K - function between k and k, all commands between K and K refer to public Extended Stack
- :/; - create goto pointe named a / create a permanent goto point named a
- j/J - jump to goto point named a / store code after goto point d at variable by pointer a
- h/H - execute pointer a / execute function a, input is value of d, it is iserted into the function as a, at the end of execution the function's a is put out into d
- q/Q - store input as a / save input as variable pointed by a and input text as pointed by d
- # - save d'th character of string pointed by a as a (this works same as "L"), bad index returns -1.0
- № or $ - extract d'th number found in pointer a string and output it to a
- @ - halt(not universally supported)
- ? - save a random number from a to d as a
- = - if a == d (=dostuff()=)
- < - if a < d
- ! - if a != d
- { - if a <= d
- [/] - if boolean pointed by a == True/ if boolean pointed by a == False
- ,/. - elif (following statement) / else()
- All complex functions (such as "=") require being closed with >.
- Example in Python:
- if a==d:
- a+=1
- elif a<d:
- a-=1
- else:
- a*=a
- print(a)
- Example in Seabass:
- =i>,<d>.s>o
- Note:
- ExtSt-based functions might work differently if you use a negative pointer to an extst value
- * All unregistered symbols are considered to be comments, also characters between two "/", "/" and a newline, "/" and end of file.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement