Skip to content

Instantly share code, notes, and snippets.

@hugosenari
Created June 8, 2024 06:32
Show Gist options
  • Save hugosenari/4a8acfa9a14ba536c1a60cc26dc649eb to your computer and use it in GitHub Desktop.
Save hugosenari/4a8acfa9a14ba536c1a60cc26dc649eb to your computer and use it in GitHub Desktop.
Draft of a parallel programing language

Paraugol

One syntax to write parallel algorithms.

Origins

This syntax comes from the observation that arrays are representation of sequences, but sequences could be represented by linkded list or trees.

In this case, if we draw a tree like this:

  • a
    • b
      • c
  • d
    • e
      • f
    • g
      • h

We are sure that a, is a requirement for b, and b a requirement for c.

And d doesn't require a, b, or c.

But but e and g, requires d.

With that, the only missing part is tell that next expression i will depend on a and d, by adding a barrier instruction.

  • a
    • b
      • c
  • d
    • e
      • f
    • g
      • h

  • i

That means:

  • New line with indentation is sequential;
  • New line without indentation is parallel;
  • Except for the expecial barrier instruction;
  • This is a continuation passing style by identation;
  • Ultra wide monitors are not enough anymore;
  • It could be paralellized, doesn't mean it will be.

TODO:

  • Exceptions handling
  • Loops
  • Early returns
  • Shared data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment