examples/languages/abc test failures #178

Closed
Benabik opened this Issue Oct 20, 2011 · 4 comments

Comments

Projects
None yet
4 participants
Member

Benabik commented Oct 20, 2011

Although abc is old, it's simple and a reasonable thing to expect new people to PCT to try to learn from. There are currently five tests failing tests involving pow fail with error:imcc:syntax error, unexpected NREG, expecting '(' ('$N102'). This is because the pow opcode was moved to trans.ops. All abc programs should load that oplib. Bonus points for only loading it when needed. This should be fairly simple for someone to do.

(A test used to fail fail because variables were referenced in the same namespace as the compiler, causing abc to mean the full namespace. This was fixed in bacd9dd.)

Contributor

coke commented Oct 20, 2011

pow was migrated to a dynamic opcode some time ago: see src/dynoplibs/trans.ops

Owner

leto commented Oct 20, 2011

I think pow is a dynop now. math_ops maybe?

On Oct 19, 2011 7:09 PM, "Brian Gernhardt" <
reply@reply.github.com>
wrote:

Although abc is old, it's simple and a reasonable thing to expect new
people to PCT to look at. There are currently 6 failing tests:

  • All tests involving pow fail with error:imcc:syntax error, unexpected NREG, expecting '(' ('$N102'). This appears to be because there is no
    pow opcode anymore. This should be replaced with a runtime function.
  • One test fails because the variable abc gets aliased to the variable
    last somehow. Solving this one involves digging deeper into the PAST and
    PIR generated by the language.

Reply to this email directly or view it on GitHub:
#178

Member

Benabik commented Oct 20, 2011

Thanks for pointing out where pow went, I updated the issue.

pmichaud added a commit that referenced this issue Oct 20, 2011

[abc] Fix issue with accessing a variable named 'abc' (TT #161 / GH #178
)

Previously, all variables were being stored in the 'abc' hll root namespace,
but this namespace also contained entries for parts of the compiler itself.
Therefore, requesting 'abc' as a variable would return a namespace instead
of null/zero.

I fixed the problem by creating a special abc::vars namespace for holding
all variables (and only variables).

This patch also tries to fix exponentiation by loading the 'trans_ops'
library, but for some reason that isn't working.  I'll file a new ticket
for that.
Owner

pmichaud commented Oct 20, 2011

The 'abc' issue is now fixed in bacd9dd. The problem wasn't that the 'abc' symbol was aliasing to the 'last' symbol -- it was aliasing to something (likely the abc:: namespace) that was somehow stringifying to "last".

Resolved by creating a separate namespace for holding abc variables.

There's still a problem with the pow opcode, and adding ".loadlib 'trans_ops'" doesn't seem to fix that. I've entered this as a new issue (#179) to be resolved.

Closing ticket.

Pm

@pmichaud pmichaud closed this Oct 20, 2011

nbrown pushed a commit to nbrown/parrot that referenced this issue Oct 21, 2011

abc: Load trans_ops in compiled program
Attempting to .loadlib in the compiler doesn't work because if you
don't use any ops from the library, it doesn't end up in the final PBC
file.  So instead use the loadlibs option on PAST::Block to have the
compiled program do it.

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