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

Simplify K definitions #38

Merged
merged 20 commits into from
Dec 4, 2024
Merged

Simplify K definitions #38

merged 20 commits into from
Dec 4, 2024

Conversation

tothtamas28
Copy link
Contributor

@tothtamas28 tothtamas28 commented Nov 29, 2024

  • Remove calls.k: can be integrated later with a corresponding target
  • Replace variables.k by calc.k: defines sort Stmt, no need to redefine variable rules that way
  • Rename files an modules: shorter names
  • Simplify EXPR-SYNTAX: reduce the number of concepts to be explained during a demo
  • Add target imp-semantics.expr

@tothtamas28 tothtamas28 self-assigned this Nov 29, 2024
Copy link
Member

@jberthold jberthold left a comment

Choose a reason for hiding this comment

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

Not sure about this...
The modules were split , with some repetition, in order to get a good course progression in a tutorial. It enables talking about only some of the concepts isolated in their individual file and running an exercise on that ifle without giving out too much unknown other code .
We can of course depart from this approach and make things more compact but we would lose this work and re-do it when/if someone runs a basic tutorial again.

@tothtamas28
Copy link
Contributor Author

tothtamas28 commented Dec 3, 2024

The modules were split , with some repetition, in order to get a good course progression in a tutorial. It enables talking about only some of the concepts isolated in their individual file and running an exercise on that ifle without giving out too much unknown other code .

I did this refactoring in preparation for a tutorial I made last week. I tried to keep modularity, but wanted to reduce the number of unintuitive concepts to be explained (i.e. make K look user friendly). In particular, I inlined VARIABLES for the following reasons:

  • The semantic rule for variable lookup had be repeated in STATEMENTS anyways, which is not really modular.
  • The let rule does not seem to be correct (but I might be wrong).

So the course progression can still be:

  1. Create an expression language
  2. Create a "programming language" with only assignments and sequential statements
  3. Extend the programming language with control structures

jberthold
jberthold previously approved these changes Dec 3, 2024
Copy link
Member

@jberthold jberthold left a comment

Choose a reason for hiding this comment

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

After discussing this, maybe we merge your new structure and the next person holding a tutorial can again modify it.
Or you re-instate the intermediate step without statements as a file?

@tothtamas28
Copy link
Contributor Author

Or you re-instate the intermediate step without statements as a file?

I added an intermediate definition calc.k that defines assignment and variable rules. imp.k then extends this language with control structures.

Does this variant enable the course progression you have in mind? If not, I'll restore the original module structure.

@tothtamas28 tothtamas28 requested a review from jberthold December 3, 2024 12:58
@tothtamas28 tothtamas28 dismissed jberthold’s stale review December 3, 2024 12:58

Intermediate definition WIP

@jberthold
Copy link
Member

Does this variant enable the course progression you have in mind? If not, I'll restore the original module structure.

Yes, that works, thank you!

BTW We could collect links to tutorial slides in the repo itself if you think this is useful. https://docs.google.com/presentation/d/1mx34lFnJ8niRPM7flcV_0sdSZ81BaTUV4YhiAacnbAY/edit#slide=id.p

@tothtamas28 tothtamas28 merged commit 95665c8 into master Dec 4, 2024
3 checks passed
@tothtamas28 tothtamas28 deleted the simplify-defs branch December 4, 2024 09:20
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