NiceLanguage

From Esolang
Jump to navigation Jump to search

This is a language I quickly assembled yesterday,then painfully debugged today.
Implementation https://replit.com/@imcute-aaaa/NicerLanguage
Notepad++ highlighting https://replit.com/@imcute-aaaa/NicerLanguage#test/nl.xml
An expression is wrapped in either "(" ")" or "" ";",and "{" "}" is used to indicate a block.(i.e command ring if you use Snap!)
A function is called by putting its name,then a set of parameters.,No using , to delimit.
Strings and numbers are the same in python,except you cannot use single quotes to make strings.
"return" is used like a function,and it can return from a {}(returning from no {} would halt the program)
Lambda is spelled lamda due to it being a keyword in python.
A name mustn't start with a number,be equal to "return",or contain one of " \t\n(){}\";"
A list is made by converting a block containing the list items(just list the expressions making the list,and not add a delimiter) using the "[]" function.
The following functions require block inputs(i.e command slot if you use Snap!,if you really do,it should be immediately obvious why the following functions need block inputs,except the [] function)

  • ?:
  • loop
  • []
  • lamda(only the second input)

You can load either python modules or NiceLanguage modules.Use the loadpy or the loadnl.They both take in a single input.
You can also load stdlib modules by loadpy "../lib/stdlib/stdnl"; then stdload 31; 31 loads all of them,and 0 loads none.It is like a bitflag.(normally you would start your program with loadpy "../lib/stdlib/stdnl";stdload 31;)
You make a nl module by defining variables into the global context.(i.e same way as making python modules in a python environment)
You make a python module by using @__context__.define or __context__.invoke.Try to not make global variables and mess up with stuff.
Challenge:Make a HOF module,and a drawing module!