Skip Navigation
InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)LE
levovix @programming.dev
Posts 0
Comments 2
June 2023 monthly "What are you working on?" thread
  • I was trying to create a programming language that doesn't have a parser. It has only AST nodes. The program is edited only inside a special editor.

    Nodes in the language are defined as

    type Node = ref object
      kind: Node
      childs: seq[Node]
      data: seg[byte]
    

    That is, the node type is literally another node, which allows you to create as many types of nodes as you want without changing the program in any way. Some nodes may be functions.

    For example, this is what the "function" and looks like:

    note that and contains recursion to itself in the error.
    also note that string "false" is just representation of what this constant means, there is no need to create new string "false" every time.

    And this is what the "function" x looks like, the use of which can be seen in and: