Seabass Readme

RasterPython May 30th, 2019 (edited) 140 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Intro:
  2. Seabass was designed as an extension of Deadfish into a language that is:
  3. 0. true to Deadfish, to the point of being DF-compatible
  4. 1. functional (i.e. you can do lotsa stuff in it)
  5. 2. easy to use (relatively to Malbolge/Brainf***)
  6. Exactly in that order.
  7. It may also serve as proof that any task, no matter how complex, can be broken down to 2-number operations.
  8. You can also view Seabass as a minimal language, that is easier to program in than THE MOST minimal lang.
  10. About Seabass virtual machine:
  11. SVM consists of three main units you're going to operate with:
  15. Imagine accumulator stack as an infinite tower of bricks put onto eachother one by one.
  16. Each of them has value of 0.0 and you can focus only on one at a time, making that brick the accumulator.
  17. From the start, you're focused on the value #0.
  18. Same is true for deccumulator. Accumulator and deccumulator (stacks) are identical in all ways except for their role in Seabass functions.
  19. 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.
  20. Through several functions you can update cells of EXTST or load to accumulator from them.
  21. Because typically this loading requires you to specify the number of the item, the only way to access variables in Seabass is through "pointers".
  22. Data types allowed in the EXTendedSTack:
  25. All functions operate with [a]ccumulator or [d]eccumulator.
  26. All names in Seabass are integers.
  28. List of functions:
  29. i/I - Increment accumulator by 1 / Increment accumulator by deccumulator
  30. d/D - Same as above but negative
  31. s/S - Square accumulator / Accumulator^deccumulator
  32. o/O - Output accumulator / output variable to which accumulator points
  33. m/M - multiply a=a*d / a=a%d
  34. v/V - divide a=a/d / divide a=d/b
  35. r/R - root of deccumulator or accumulator
  36. x/X - exchange accumulator with deccumulator
  37. a/A - move up in accumulator by 1 / move up in accumulator by deccumulator
  38. b/B - same as above but for deccumulator
  39. % - a = a//d
  40. l/L - load deccumulator pointer to accumulator / load d'th character from string #a to accumulator, works identically to "#" ((not yet), same with numbers)
  41. n/N - save accumulator in d'th position as an integer / same, but reverse
  42. 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)
  43. f/F - save accumulator as a float in position d / same, but reverse
  44. e/E - save a as bool in position d / save d as bool in pos a
  45. g/G - neGative a or d
  46. 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
  47. y/Y - same as above but it stores to var named pointer a from text pointer d
  48. c/C - copy d to a / copy a to d###
  49. p/P - |d| / |a|
  50. z/Z - go to original dec/acc
  51. k/K - function between k and k, all commands between K and K refer to public Extended Stack
  52. :/; - create goto pointe named a / create a permanent goto point named a
  53. j/J - jump to goto point named a / store code after goto point d at variable by pointer a
  54. 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
  55. q/Q - store input as a / save input as variable pointed by a and input text as pointed by d
  56. # - save d'th character of string pointed by a as a (this works same as "L"), bad index  returns -1.0
  57. № or $ - extract d'th number found in pointer a string and output it to a
  58. @ - halt(not universally supported)
  59. ? - save a random number from a to d as a
  60. = - if a == d (=dostuff()=)
  61. < - if a < d
  62. ! - if a != d
  63. { - if a <= d
  64. [/] - if boolean pointed by a == True/ if boolean pointed by a == False
  65. ,/. - elif (following statement) / else()
  67. All complex functions (such as "=") require being closed with >.
  68. Example in Python:
  69. if a==d:
  70.     a+=1
  71. elif a<d:
  72.     a-=1
  73. else:
  74.     a*=a
  75. print(a)
  76. Example in Seabass:
  77. =i>,<d>.s>o
  79. Note:
  80. ExtSt-based functions might work differently if you use a negative pointer to an extst value
  81. * All unregistered symbols are considered to be comments, also characters between two "/", "/" and a newline, "/" and end of file.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand