Skip to content

Vocabulary: propose "script" in compiler#13301

Merged
MarcusDenker merged 7 commits intopharo-project:Pharo12from
privat:compile-script
Apr 20, 2023
Merged

Vocabulary: propose "script" in compiler#13301
MarcusDenker merged 7 commits intopharo-project:Pharo12from
privat:compile-script

Conversation

@privat
Copy link
Contributor

@privat privat commented Apr 5, 2023

OpalCompiler>>noPattern is historic and bad:

  • it conflicts with pattern code the thing with ` and @ to match AST (in rewriting tools for instance)
  • it has a negation, and you should not have a negation in the name of boolean flag
  • I'm not sure that all people understand what the method pattern is

I tried to look at various parts of the Pharo tools to see what is the used vocabulary.

  • RBParser use expression, like in parseExpression That is ok but misleading since sequences of statements (|x| x:=self. x bar) or return statements (^ 42) are parsed the same but technically aren't expressions. See Parse expression should never return a sequence node #7233
  • ExpressionEvaluated is a SystemAnnouncement used when someone runs a DoIt (or other action). (I do not understand why you need to announce them, but it's not the focus here)
  • CodeImport use DoIt, like in DoItChunk. That is better than noPattern but maybe too specific?
  • Various GUI editor seems to use isScripting, or beForScripting I kind of like it (see title)
  • Monticello use script, like in MCScriptDefinition and related
  • but Metacello seems to use DoIt, as in preLoadDoIt
  • SHRBTextStyler have isForWorkspace, that can be used to highlight source code outside the workspace :) and seems the only one to use "workspace" this way.
  • Surprisingly, playground seems not used
  • script: is also a pragma, that takes a string to evaluate

Since I'm cleaning up the compiler API, I would like to have your input.
And if nobody cares, I will go ahead with "script".
The commit is a simple preview of what it might look like.

@jecisc
Copy link
Member

jecisc commented Apr 5, 2023

Workspace is the ancestor of the playground.
It would not surprise me that #beForWorkspace was to highlight the code of this old playground.

I don’t like #noPattern either and prefer what you proposed. I like the “scripting” vocabulary!

@Ducasse
Copy link
Member

Ducasse commented Apr 6, 2023

Yes script or snippet is good.

It would be good to effectively clean all the API because this is confusing in many places.
Thanks for all the jobs you are doing.

Copy link
Member

@MarcusDenker MarcusDenker left a comment

Choose a reason for hiding this comment

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

Yes, it is good to unify the terms. Both "notPattern" and "Workspace" are not good. "script" is nice (and we use it already in some places)

@MarcusDenker
Copy link
Member

There is now a conflict

@privat
Copy link
Contributor Author

privat commented Apr 20, 2023

I did a rebase with improvements:

  • adapt clients
  • add deprecation
  • add Context>>compiler and use it

@privat
Copy link
Contributor Author

privat commented Apr 20, 2023

Tests are green, please review

@MarcusDenker MarcusDenker merged commit 6fc8438 into pharo-project:Pharo12 Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants