Skip to content

Conversation

@clonker
Copy link
Member

@clonker clonker commented Mar 14, 2025

This is so that the numerical id integration is more seamless.

  • As the label registry will yield string_views, ordinary string concatenation does not work anymore. I have replaced respective calls with format strings.
  • Refactored function call analysis to use visitor over if-else. This has the additional benefit that we will get compile-time errors should the variant be extended but no respective visitor was added.

std::optional<size_t> numReturns;
std::vector<std::optional<LiteralKind>> const* literalArguments = nullptr;

if (BuiltinFunction const* builtin = resolveBuiltinFunction(_funCall.functionName, m_dialect))
Copy link
Member Author

Choose a reason for hiding this comment

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

this returns non-null IFF the _funCall.functionName variant holds a BuiltinName

cameel
cameel previously approved these changes Mar 15, 2025
Copy link
Collaborator

@cameel cameel left a comment

Choose a reason for hiding this comment

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

Just minor stuff. Overall it looks good.

@clonker clonker force-pushed the asm_analysis_fmt branch 2 times, most recently from a77493e to 1caff77 Compare March 17, 2025 07:17
"An object name is only acceptable."
fmt::format(
"Data name \"{}\" cannot be used as an argument of eofcreate/returncontract. "
"An object name is only acceptable.",
Copy link
Member Author

Choose a reason for hiding this comment

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

Re-reading this, the word order is a bit off. I'd rather say "Only an object name is acceptable." Should we fix this here?

Copy link
Collaborator

@cameel cameel Mar 19, 2025

Choose a reason for hiding this comment

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

Yeah, this wording is pretty awkward. Your version is much more comprehensible :) Let's fix it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we could do something to make messages more consistent and comprehensible in general. They're often pretty bad. And they're the part of the compiler's UI that users see a lot, so it affects how users see us.

In PRs I usually have an urge to just rewrite all of them :) Though normally I try to limit myself to just to those where I can actually point to an actual issue (rather than just vaguely not liking how they sound).

Maybe at least for bigger features it would be good to go over them again when the feature is complete and we're adding docs? Especially putting them all side by side in a comment in such a PR could let us catch weirdness like this before it goes out to the world.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I think it is important to streamline them. As you said, they are user-facing and good error messages are super important. They make or break me wanting to continue using a software.
At some point it comes down to taste of course, I know the urge well :) Putting them into a comment and/or at least having a pass over them before releasing a feature into the wild sounds like a good idea. Besides the functionality itself, I would say it is one of the more important things to get right.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good. Let's try that next time we do a feature that adds new messages.

@cameel cameel force-pushed the asm_analysis_fmt branch from 0e11b9f to 29b6b09 Compare March 19, 2025 13:41
cameel
cameel previously approved these changes Mar 19, 2025
@cameel cameel force-pushed the asm_analysis_fmt branch from 814eb76 to b9cbf1e Compare March 21, 2025 17:07
@clonker clonker merged commit e134620 into develop Mar 21, 2025
74 checks passed
@clonker clonker deleted the asm_analysis_fmt branch March 21, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants