Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbolic parser #21

Open
3 tasks
adeeconometrics opened this issue Jun 7, 2024 · 2 comments
Open
3 tasks

Symbolic parser #21

adeeconometrics opened this issue Jun 7, 2024 · 2 comments
Assignees

Comments

@adeeconometrics
Copy link
Owner

adeeconometrics commented Jun 7, 2024

Write a symbolic wrapper to get metadata about the object's content

Requirements

struct Symbol {
   std::string name;
  std::size_t value;
};
  • Write a parse method
  • Write simplify method
  • Think about wrapping objects to symbols that are more ergonomic e.g. generative assignment to_symbol(object) -> symbol(name, value)
@adeeconometrics adeeconometrics self-assigned this Jun 8, 2024
@adeeconometrics
Copy link
Owner Author

For now, settle with a dumb symbolic instance assignment

template <typename T, std::size_t Row, std::size_t Col> struct Symbol {

  Symbol() { m_counter++; }

  auto name() const noexcept -> std::string {
    return m_name + "_" + std::to_string(m_counter);
  }

private:
  static std::string m_name;
  static std::size_t m_counter;
};

template <typename T, std::size_t Rows, std::size_t Cols>
std::size_t Symbol<T, Rows, Cols>::m_counter = 0;

template <typename T, std::size_t Rows, std::size_t Cols>
std::string Symbol<T, Rows, Cols>::m_name = "x";

@adeeconometrics
Copy link
Owner Author

adeeconometrics commented Jun 17, 2024

  • Feature is put on hold. Expression optimization turns out to be more complicated than it seems.
  • Sympp is a project that currently carries on the efforts of exploring expression-level simplifications

Checkout Embedded DSL efforts in Cpp Talk: https://www.youtube.com/watch?v=XH00wB_bbU4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review/OnHold
Development

No branches or pull requests

1 participant