this post was submitted on 05 Jul 2024
866 points (97.9% liked)

Programmer Humor

32715 readers
659 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 120 points 5 months ago (13 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>
[–] [email protected] 61 points 5 months ago

This deserves to be added to the list of human rights violations

[–] [email protected] 46 points 5 months ago (2 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>
[–] [email protected] 13 points 5 months ago (2 children)

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

[–] [email protected] 19 points 5 months ago (1 children)

They probably have experience with Spring

[–] [email protected] 10 points 5 months ago (1 children)

I imagined what an Elasticsearch query style Python XML syntax would look like.You must share my pain.

[–] [email protected] 7 points 5 months ago

That's grotesque and you have my condolences

[–] [email protected] 5 points 5 months ago* (last edited 5 months ago) (1 children)

Welcome to the world of abusing the shit out of Ant. My first full time job was developing Ant in unholy ways. Tens of thousands of lines of Ant at least, doing significant logic. If-then-else, for loops, math, procedures, date-time math. I stuck it out for a year. It was a year too long.

[–] [email protected] 1 points 5 months ago

Thankfully we have Gradle now.

[–] [email protected] 30 points 5 months ago (2 children)

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

[–] [email protected] 10 points 5 months ago

Calm down, Satan

[–] [email protected] 8 points 5 months ago (1 children)

Compiler rolls the dice if your only required indentation is accepted as space or tab. Per line.

[–] [email protected] 2 points 5 months ago

But stores this information as a metadata file, which gets invalidated when a new file is added/removed from the program muhahaha!

[–] [email protected] 19 points 5 months 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] 19 points 5 months 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?

[–] [email protected] 10 points 5 months ago (1 children)

Make sure to make ample use of mixed content elements.

<statement><var>bar</var> = <int>0</int></statement>
[–] [email protected] 5 points 5 months 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
[–] [email protected] 2 points 5 months ago (1 children)
[–] [email protected] 2 points 5 months ago (1 children)
[–] [email protected] 3 points 5 months ago

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

[–] [email protected] 7 points 5 months ago
[–] [email protected] 5 points 5 months ago

Who hurt you :(

[–] [email protected] 5 points 5 months ago

Oh my, I feel woozy …

[–] [email protected] 4 points 5 months ago

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

[–] [email protected] 2 points 5 months 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.

[–] [email protected] 2 points 5 months 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] 2 points 5 months ago (1 children)

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] 4 points 5 months ago

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