this post was submitted on 05 Jul 2024
13 points (93.3% liked)

Programmer Humor

35334 readers
1 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] manucode@infosec.pub 4 points 2 years ago (5 children)

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>
[–] JackbyDev@programming.dev 2 points 2 years ago (1 children)

Make sure to make ample use of mixed content elements.

<statement><var>bar</var> = <int>0</int></statement>
[–] aphlamingphoenix@lemm.ee 2 points 2 years ago (1 children)
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
[–] JackbyDev@programming.dev 0 points 2 years ago (1 children)
[–] aphlamingphoenix@lemm.ee 0 points 2 years ago (1 children)
[–] JackbyDev@programming.dev 1 points 2 years ago

Don't apologize, it's beautiful in its horribleness

[–] VitaminF@feddit.org 2 points 2 years ago (1 children)
<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>
[–] manucode@infosec.pub 0 points 2 years ago (2 children)

How did you come up with such a ****ingly stupid syntax?!

[–] hedgehog@ttrpg.network 1 points 2 years ago

They probably have experience with Spring

[–] Pilon23@feddit.dk 1 points 2 years 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?

[–] notabot@lemm.ee 1 points 2 years 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.

[–] _stranger_@lemmy.world 1 points 2 years ago

The whitespace is not only required, but it must be tabs and spaces.