We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Talk:Lingua Indeterminatum

From Esolang
Jump to navigation Jump to search

I think you shouldn't copy Septem Lingua directly. In this language(project?), we'll build the language STEP BY STEP. -- i  s  l  p  t  n  g  07:37, 22 June 2026 (UTC)

First of all, let's figure out the data types.

  1. Integers. Integers are just integers and there is no limit of it. For example, 8, 9, or 114514.
  2. Floating-Point numbers. All real numbers are valid floating-point numbers, if the includes a dot. For example, 1.41421356.
  3. Document. Quoted in double quotation mark. Escape same as Python.
  4. Rune. A character quoted in [| |].
  5. Logical Value. Either true or false.
  6. NULL. Just null value, nothing much.
  7. Lambda. A lambda is a special type; it has parameters, a code block, can return a value, but has no name. It can be assigned to a label, so the lambda becomes a real function in the true sense.
  8. A list. It's just a list enclosed in square brackets. You can store anything in it.
  9. Ordered pairs. Two data enclosed in parentheses.
  10. Complex numbers. I mean complex numbers in the mathematical sense.
  11. Type. Type is just type itself. For example, if we cast 1 into type type, then we will got integer.

--PSTF

And by the way, I'd like to have a unique yet friendly syntax.

Accepted, except the Rune type initialization. Why not just use a single quotation mark, or @ like Uiua and SletScript? -- i  s  l  p  t  n  g  08:03, 22 June 2026 (UTC) P.S. Where is the Type type, or how do you deal with typeof and isinstance?

The next part is the syntax.

  • Variables:
  • List:
  • Code block:
  • Function call:
  • Lambda Notation:
  • Operators:

By the way, do you have a GitHub account or a QQ/WeChat one? So that we can discuss off wiki.

Yes, both WeChat and GitHub, and I have also an email one.

Variable

A variable consists of a label, a type, and a value. When assigning a value to a variable, you need to use a left-pointing arrow (<-).

Unless otherwise specified, "" represents an empty string, and ∅ represents an empty list.

When initializing, you also need to specify the variable type, but when reassigning later, you don’t need to. If there’s no explicit type but a value is given, the type will be inferred from the value. If there’s no initial value but a type is given, the variable will be assigned an empty value (number 0, float 0.0, complex 0+0i, "", ∅, pair (0, 0), a do-nothing code block, or the logical value false).

Comment

<!-- I'm a comment block -->

Code Block

Code blocks, unless they're the very bottom main block, should be enclosed in curly braces, and each line of code should end with a semicolon. This means Lingua Indeterminatum doesn't recognize the end of a line, which also makes Code Golfing easier.

For example, this is a valid code block which asks for length and width, and calculate the area of the rectangle.

a = Int(read);
b = Int(read);
write a*b;

Alright, now: Figure out all the keywords, and go implement the lexer and parser. [CraftingInterpreters.com Crafting Interpreters] is a great book. -- i  s  l  p  t  n  g  09:03, 23 June 2026 (UTC)

Keyword List

This list is sorted in functional order.

Constants

False
Infinity
NaN
NULL
True

Conditional Flow

if
elif
else

Looping

for
while
until
forever

Function

function

Data type

Int
Float
Rune
Doc
Bool
Void
Lambda
List
Pair
Comp
Type

Logical Calculation

and
or
!
xor

Breaking

break
continue
halt

Variable-related

const
volat
private
protected
public

Overturn

I feel like I might need to overturn the design I once made. This is a new EBNF grammar I came up with after thinking it over again and spent a night writing (not an interpreter).

(* ----------------------------------------- *)
(* Lexical tokens (simplified)                *)
(* ----------------------------------------- *)

letter   = "A" | "B" | ... | "Z" | "a" | ... | "z" | "_" ;
digit    = "0" | "1" | ... | "9" ;
hex      = digit | "A" | "B" | "C" | "D" | "E" | "F" | "a" | "b" | "c" | "d" | "e" | "f" ;
alphanum = letter | digit ;
unicode  = (All Unicode Characters without undefined ones) ;

identifier = letter, alphanum ;

integer = digit, { digit } ;
float   = digit, { digit }, ".", digit, { digit }, [ ("e" | "E"), [ "+" | "-" ], integer ] ;
real    = integer | float
rune    = "'@", character, "'" ;        (* @ followed by a single character, with escapes *)
string  = '"', { character | escape | ("{", expression, "}") }, '"' ;
escape  = "\", ( "n" | "t" | "r" | "\" | "'" | '"' | "0" | "x", hex, hex, hex, hex | digit, digit, digit, digit, digit ) ;

imagine = float, "i" | integer, "i" ;   (* imaginary unit, e.g., 3i, 2.5i *)
complex = real, "+", imagine ;          (* full complex literals are formed by addition: 3+4i *)

bool    = "true" | "false" ;

(* ----------------------------------------- *)
(* Comments                                   *)
(* ----------------------------------------- *)

comment = "/*", { unicode except "*/" }, "*/" ;

(* ----------------------------------------- *)
(* Types (as values)                         *)
(* ----------------------------------------- *)

type = "Int" | "Float" | "Doc" | "Rune" | "Bool" | "List" | "Pair" | "Complex"
     | identifier ;                        (* user-defined class names *)

(* ----------------------------------------- *)
(* Literals                                  *)
(* ----------------------------------------- *)

literal = integer | float | string | rune | bool | complex
        | "[", [ expression, { ",", expression } ], "]"
        | "(", expression, ",", expression, ")"
        | type ;                            (* type literals are also values *)

(* ----------------------------------------- *)
(* Expressions                               *)
(* ----------------------------------------- *)

expression = logical_or ;

logical_or  = logical_xor, { "or", logical_xor } ;
logical_xor = logical_and, { "xor", logical_and } ;
logical_and = comparison, { "and", comparison } ;

comparison = bitwise_or, { ("==" | "!=" | "<" | "<=" | ">" | ">="), bitwise_or } ;

bitwise_or  = bitwise_xor, { "|", bitwise_xor } ;
bitwise_xor = bitwise_and, { "`", bitwise_and } ;   (* backtick *)
bitwise_and = shift, { "&", shift } ;
shift       = additive, { ("<<" | ">>"), additive } ;

additive = multiplicative, { ("+" | "-"), multiplicative } ;
multiplicative = exponent, { ("*" | "/" | "//" | "%"), exponent } ;
exponent = unary, { "^", unary } ;                  (* right‑associative *)

unary = [ ("+" | "-" | "~" | "not") ], primary ;

primary = literal
        | identifier
        | "(", expression, ")"
        | call
        | member_access
        | "self"                                 (* or "this" *)
        | "(", expression, ")"                   (* grouping, distinct from pair *)
        | "input(", string, ")"                  (* User input *)
        ;

call = primary, "(", [ argument_list ], ")" ;
argument_list = expression, { ",", expression } ;

member_access = primary, ".", identifier
              | primary, ".", identifier, "(", [ argument_list ], ")" ;  (* method call *)

(* ----------------------------------------- *)
(* Statements                                *)
(* ----------------------------------------- *)

statement = import_statement
          | print_statement
          | assignment_statement
          | declaration_statement
          | if_statement
          | while_statement
          | for_statement
          | forever_statement
          | skip_statement
          | stop_statement
          | halt_statement
          | return_statement
          | block
          | expression_statement
          | empty_statement
          ;
import_statement = "import", identifier, { ".", identifier }, [ "as", identifier ] ;
print_statement = "print", [ "(", expression, ")" ] ;

block = "{", { statement, [ ";" ] }, "}" ;   (* semicolons separate statements, optional after last *)

empty_statement = ;

(* Assignment *)
assignment_statement = identifier, "<-", expression ;   (* mutates existing variable *)

(* Declaration with visibility *)
declaration_statement = [ visibility ], ("var" | "const"), identifier, [ ":", type ], [ "=", expression ] ;

visibility = "public" | "protected" | "private" ;

(* Conditionals *)
if_statement = "if", "(", expression, ")", block
               { "elif", "(", expression, ")", block }
               [ "else", block ] ;

(* Loops *)
while_statement = "while", "(", expression, ")", block ;
for_statement   = "for", identifier, "in", expression, block ;
forever_statement = "forever", block ;

skip_statement = "skip" ;
stop_statement = "stop" ;
halt_statement = "halt" ;

return_statement = "return", [ expression ] ;

expression_statement = expression ;

(* ----------------------------------------- *)
(* Functions                                 *)
(* ----------------------------------------- *)

function_definition = [ visibility ], "func", identifier,
                      "(", [ parameter_list ], ")",
                      [ "->", type ],
                      block ;

parameter_list = parameter, { ",", parameter } ;
parameter = identifier, [ ":", type ] ;

(* ----------------------------------------- *)
(* Classes                                   *)
(* ----------------------------------------- *)

class_definition = [ visibility ], "class", identifier,
                   [ "extends", identifier ],
                   "{", { class_member }, "}" ;

class_member = declaration_statement
             | function_definition
             | constructor_definition
             ;

constructor_definition = "func", "new",
                         "(", [ parameter_list ], ")",
                         [ "->", type ],   (* typically the class type *)
                         block ;

(* ----------------------------------------- *)
(* Top‑level program                         *)
(* ----------------------------------------- *)

program = { (declaration_statement | function_definition | class_definition | statement), [ ";" ] } ;

By the way, I heard someone say that if 'The Wandering Earth 3' doesn't get released soon, it'll turn into a documentary.

--北国风光,千里冰封,万里雪飘。望长城内外,惟余莽莽;大河上下,顿失滔滔。山舞银蛇,原驰蜡象,欲与天公试比高。须晴日,看红装素裹,分外妖娆。江山如此多娇,引无数英雄竞折腰。惜秦皇汉武,略输文采;唐宗宋祖,稍逊风骚。一代天骄,成吉思汗,只识弯弓射大雕。俱往矣,数风流人物,还看今朝。 2026年8月5日(星期三), 13:25 农历六月廿三 (CHN)