Skip to content

Comments

Add parser for configurable workload#54

Open
erthalion wants to merge 1 commit intomainfrom
feature/parser
Open

Add parser for configurable workload#54
erthalion wants to merge 1 commit intomainfrom
feature/parser

Conversation

@erthalion
Copy link
Collaborator

Introduce a new configurable workload parser. The workload definition looks like this:

// Named work block
main (workers = 2, duration = 10) {
  // Anon work block with only one unit.
  // task(name) -- spawn a process with specified name
  // debug(text) -- log with DEBUG level
  // open(path) -- open file by path, create if needed and write something to it
  debug("run task stub");
  task(stub);
  debug("open file /tmp/test");
  open("/tmp/test");
} : exp {
  // If no distribution provided, do the unit only once.
  rate = 10.0;
}

Note that this commit only produces AST without JIT compiling it into anything that looks like an actual code.

Introduce a new configurable workload parser. The workload definition
looks like this:

    // Named work block
    main (workers = 2, duration = 10) {
      // Anon work block with only one unit.
      // task(name) -- spawn a process with specified name
      // debug(text) -- log with DEBUG level
      // open(path) -- open file by path, create if needed and write something to it
      debug("run task stub");
      task(stub);
      debug("open file /tmp/test");
      open("/tmp/test");
    } : exp {
      // If no distribution provided, do the unit only once.
      rate = 10.0;
    }

Note that this commit only produces AST without JIT compiling it into anything
that looks like an actual code.
Var { name: String },

/// Helper like random_path
Dynamic { name: String, args: Vec<Arg> },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh lord, self referential structs/enums, this is going to be fun.

Mandatory "if you get into trouble you should read https://rust-unofficial.github.io/too-many-lists/" PSA.

Copy link
Collaborator Author

@erthalion erthalion Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm? The page you've posted doesn't mention self referential structures at all, am I missing something?
And even if it's somehow bad in Rust, what is your suggestion? Parsing AST without self references is like trying to hammer a nail without an actual hammer -- you probably can do this, but it will likely be very awkward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants