ULSAL

From Esolang
Jump to navigation Jump to search
This is still a work in progress. It may be changed in the future.

ULSAL (ultlang's stack apiolanguage) is a heavily wip stack-based programming language by User:Ultlang.

types

each item of the stack has one of these types:

  • mrk / marker
  • str / string
  • num / number
  • fnc / function

commands

command arguments function
` 0 pushes a marker to the stack
0123456789 0 pushes the respective integer to the stack as a num
' or ´ varies concatenates items on the stack until a marker is hit. if all components are nums, the result is a num, otherwise it is a str. this, along with both alphabetic characters and spaces pushing themselves, makes `string example' the way to express strings.
+-×÷ 2 executes the operation on the two top numbers on the stack (95- returns 4). if any of the arguments is not a number, bees may occur, along with apioforms.
² 1 pushes the top item twice
2 pushes the top item [floor of second from top item value] times. if that value is not a number, bees could arise, followed by beeoids.
1 "splits" the top item on the stack. this has varying behavior depending on the type and characteristics of the item:
  • str: pushes each character of the string as a separate string
  • integer num: pushes the prime factorisation of the number, smallest to largest, with an additional -1 in case it is negative
  • non-integer num: pushes the floor and then the fractional part of the number
· 0 does nothing (as opposed to the space, which does ¬nothing)
[…] bees pushes anything between the brackets as a fnc. works as matching brackets, not the first ] after the [: a[b[c]] should make the stack a: str; b[c]: fnc.

note that as opposed to `…', what is between brackets doesn't get executed, thus `88+a'16a: str, whereas [88+a]88+a: fnc.

ε 1 executes the code in the top stack item. if it's not a function item, bees will happen, and apioids might too.
2 executes the code in the top stack item [floor of second from top item value] times. if it's not a number or the top item is not a function, bees can be expected to take place, and apēs melliferæ could as well.
0 pushes the stack length as a number
σ 2 swaps the last two items of the stack
any other 0 pushes the character to the stack as a str

implementations

there are approximately "0" implementations of ulsal. sina ale li utterly trolled