• manucode
    link
    fedilink
    11625 days ago

    It uses XML-like syntax:

    <fun>
      <name>sum</name>
      <in>
        <int>foo</int>
        <int>bar=0</int>
      </in>
      <out><int>foo+bar</int></out>
    </fun>
    
    • @[email protected]
      link
      fedilink
      4425 days ago
      <fun>
        <name>sum</name>
        <in>
          <int>
            <name>foo</name>
          </int>
          <int>
            <name>bar</name>
            <default_value>
              <int>0</int>
            </default_value>
          </int>
        </in>
        <out>
          <int>
            <calculation>
              <numerical_operation>
                <operator_plus>
                  <operand>
                    <var>foo</var>
                  </operand>
                  <operand>
                    <var>bar</var>
                  </operand>
                </operator_plus>
              </numerical_operation>
            </calculation>
          </int>
        </out>
      </fun>
      
    • @[email protected]
      link
      fedilink
      1825 days ago

      I like it, this is clearly very enterprisey and solution focused, but I would like to suggest a couple of amendments if I may?

      • Namespaces We should make full use of namespaces. Make the structural tags be in a language specific namespace (to be referenced in every function spec, obviously) but change the in an out params to use the parameter name as the tag, namespaced to the function they’re for, with a type attribute.

      • In memory message queues Have all function invocations be marshaled as xml documents posted to an in memory message queue. Said documents should use a schema that validates the structure and a function specific schema to validate the types of arguments being passed. Namespace everything.

      I reckon we could power a medium sided country if we could generate energy from the programmers despair.

    • @[email protected]
      link
      fedilink
      1825 days ago

      Can you please link to a medium article on how this will help utilize AI blockchain so i can show it to management on Monday?

    • JackbyDev
      link
      English
      825 days ago

      Make sure to make ample use of mixed content elements.

      <statement><var>bar</var> = <int>0</int></statement>
      
      • A Phlaming Phoenix
        link
        fedilink
        325 days ago
        statement: 
          comparison:
            - kind: libcompare.EQUALS
              comparators:
                - foo
                - bar
              whentrue:
                statement: 
                  streaming: 
                    - kind: libstreams.PRINT
                       content: foo equals bar
              whenfalse:
                statement: 
                  streaming: 
                    - kind: libstreams.PRINT
                       content: foo does not equal bar
        
    • @[email protected]
      cake
      link
      fedilink
      425 days ago

      The tag indentation is a required part of the syntax and don’t forget colons at the end of the tag

    • @[email protected]
      link
      fedilink
      English
      225 days ago

      That’s basically how the Android app Tasker works. You do the programming through its UI, but when you export/share your tasks, they’re saved as xml

    • @[email protected]
      link
      fedilink
      English
      225 days ago

      I took every coding class my highschool offered, and the only thing that drove me more crazy than this syntax was trying to use CSS.

      • @[email protected]
        link
        fedilink
        425 days ago

        That’s because you didn’t try our lord and savior SASS. Vanilla CSS should be illegal at this stage.

    • @[email protected]
      link
      fedilink
      224 days ago

      I almost did similar with SDLang as I was very desperate for a scripting language, but now I have a wasmtime API for D.