-
Notifications
You must be signed in to change notification settings - Fork 267
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
Implement unbounded ints/rationals in the Rust backend #4438
Conversation
5df2dda
to
66f19a6
Compare
Support subset types in the Rust backend <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small> --- Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/dafny-lang/dafny/pull/4422). * #4438 * #4429 * __->__ #4422
78a7da5
to
c408443
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question that I have, which doesn't necessarily relate to this PR, but to the approach taken in Compiler-dafny.cs
, is whether you've considered not just using ConcreteSyntaxTree
instead of string
, but to immediately generate the desired AST nodes.
I made a PR with a prototype of a SinglePassCompiler that doesn't use ConcreteSyntaxTree or string here: #3396
The idea is that SinglePassCompiler
is made generic:
public abstract class GenericSinglePassCompiler<TExpression, TStatements, TStatement, TType, etc...>
Existing backends that want to use ConcreteSyntaxTree
/ICanRender
will inherit from a new type ConcreteSinglePassCompiler
:
public abstract class ConcreteSinglePassCompiler
: GenericSinglePassCompiler<ICanRender, ConcreteSyntaxTree, ICanRender, ICanRender>, Plugins.Compiler
I think it does require more refactoring of SinglePassCompiler
then you're currently doing though, although I haven't taken the time yet to understand the BuilderSyntaxTree<T>
technique that you're currently using. For the GenericSinglePassCompiler approach, many methods have to be refactored so that the argument that is currently ConcreteSyntaxTree
becomes a result value instead, so these functions can return AST nodes.
Maybe such as refactoring is not the best investment of your time, but I think it would be awesome to have what's currently SinglePassCompiler in a state where it doesn't relate to string
or ConcreteSyntaxTree
.
Support class fields in the Rust backend Right now, we still use reference counted pointers, which means that cycles will result in memory leaks. I plan to address this with cycle collection in a later PR. <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small> --- Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/dafny-lang/dafny/pull/4429). * #4438 * __->__ #4429
@keyboardDrummer yeah, making It's effectively what the Dafny-implemented backends look like, since there we have similar methods to generate statements/expressions/etc but the implementation is free to generate strings or its own representations of the target syntax. |
5504542
to
d0305e6
Compare
<small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
<DataCollectors> | ||
<DataCollector friendlyName="XPlat Code Coverage"> | ||
<Configuration> | ||
<Exclude>[*]DAST.*,[*]DCOMP.*</Exclude> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the code blowup in the Dafny-to-C# compilation, instrumentation hangs and causes the CI to timeout. Since we ignore coverage of generated code anyways, this is safe.
64df43f
to
e06c0e5
Compare
Support subset types in the Rust backend <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small> --- Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/dafny-lang/dafny/pull/4422). * dafny-lang#4438 * dafny-lang#4429 * __->__ dafny-lang#4422
Support class fields in the Rust backend Right now, we still use reference counted pointers, which means that cycles will result in memory leaks. I plan to address this with cycle collection in a later PR. <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small> --- Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/dafny-lang/dafny/pull/4429). * dafny-lang#4438 * __->__ dafny-lang#4429
Implement unbounded ints/rationals in the Rust backend <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small> --- Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/dafny-lang/dafny/pull/4438). * dafny-lang#4450 * __->__ dafny-lang#4438
Support subset types in the Rust backend <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small> --- Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/dafny-lang/dafny/pull/4422). * #4438 * #4429 * __->__ #4422
Support class fields in the Rust backend Right now, we still use reference counted pointers, which means that cycles will result in memory leaks. I plan to address this with cycle collection in a later PR. <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small> --- Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/dafny-lang/dafny/pull/4429). * #4438 * __->__ #4429
Implement unbounded ints/rationals in the Rust backend <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small> --- Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/dafny-lang/dafny/pull/4438). * #4450 * __->__ #4438
#4568) Addresses xunit/xunit#2549 to reduce our integration test shard execution time from > 1 hour to <= 30 mins. The TL;DR is that xUnit has an extension mechanism that attempts to load every class in every available DLL to see if it extends a given interface. This manifests in a huge delay on startup before any tests begin to run, e.g. 52 mins in this case: https://github.com/dafny-lang/dafny/actions/runs/6241813664/job/16944685069#step:22:146 (make sure you turn on Show Timestamps!) This was steadily getting worse as we added more classes, especially #4438 as it added a bunch of Dafny-generated code. Fortunately xUnit 2.5.1 added a knob to switch off this discovery, which we're definitely not using. <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
#4568) Addresses xunit/xunit#2549 to reduce our integration test shard execution time from > 1 hour to <= 30 mins. The TL;DR is that xUnit has an extension mechanism that attempts to load every class in every available DLL to see if it extends a given interface. This manifests in a huge delay on startup before any tests begin to run, e.g. 52 mins in this case: https://github.com/dafny-lang/dafny/actions/runs/6241813664/job/16944685069#step:22:146 (make sure you turn on Show Timestamps!) This was steadily getting worse as we added more classes, especially #4438 as it added a bunch of Dafny-generated code. Fortunately xUnit 2.5.1 added a knob to switch off this discovery, which we're definitely not using. <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
Implement unbounded ints/rationals in the Rust backend
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT
license.
Stack created with Sapling. Best reviewed with ReviewStack.