Skip to content

mps.blutil: add new operations to BaseLanguage#1607

Closed
alamqadem wants to merge 31 commits intoJetBrains:maintenance/mps20223from
dalbrecht1:feature/baseLanguageExtensions
Closed

mps.blutil: add new operations to BaseLanguage#1607
alamqadem wants to merge 31 commits intoJetBrains:maintenance/mps20223from
dalbrecht1:feature/baseLanguageExtensions

Conversation

@alamqadem
Copy link
Copy Markdown
Collaborator

@alamqadem alamqadem commented Sep 25, 2025

Add the following new BaseLanguage extensions to the blutil language:

  • x?:y allows to specify an alternative expression y when the expression x is null
  • [x..y] allows to create a finite/infinite sequence of integers starting from x including y with increments of 1
  • [x..inf] allows to create an infinite sequence of integers starting from x with increments of 1
  • seq.groupBy(keySelector) allows given a sequence seq to group the elements of a sequence using the keySelector closure on each element
  • seq1.zip(seq2) creates a sequence tuples where each element is a tuple from the element in the two sequences at that index
  • seq.selectIdx({~it, int index => ...}) seq.whereIdx({~it, int index => ...}) seq.forEachIdx({~it, int index => ...}) similar to select , where and foreach already present in the collections language, but the index of the current element is also an argument of the closure

@alamqadem alamqadem changed the title BaseLanguage Extensions mps.BaseLanguageExtensions: Sep 25, 2025
@alamqadem alamqadem changed the title mps.BaseLanguageExtensions: mps.BaseLanguageExtensions: New language with extensions to BaseLanguage Sep 25, 2025
@alamqadem alamqadem changed the title mps.BaseLanguageExtensions: New language with extensions to BaseLanguage mps.baseLanguageExtensions: New language with extensions to BaseLanguage Sep 25, 2025
dalbrecht1 and others added 5 commits September 25, 2025 14:56
…seq-operations-with-index

Add sequence operations with index to new BaseLanguage extensions
The following `[0..10].zip([10..inf]).zip([0..inf])` was returning the wrong
result.
@sergej-koscejev
Copy link
Copy Markdown
Collaborator

Can/should this language be integrated with com.mbeddr.mpsutil.blutil, located in the blutil folder?

@sergej-koscejev
Copy link
Copy Markdown
Collaborator

Also, the 2022.3 MPS version is quite old, are you prepared to handle cascading merges up to master?

@alexanderpann
Copy link
Copy Markdown
Collaborator

I didn't take a look at the implementation, but please don't forget the data flow aspect for the new concepts.

@arimer
Copy link
Copy Markdown
Collaborator

arimer commented Nov 19, 2025

Is there a schedule for when this feature should be ready? @dalbrecht1 , @alamqadem

@dalbrecht1
Copy link
Copy Markdown
Collaborator

Is there a schedule for when this feature should be ready? @dalbrecht1 , @alamqadem

I realized that I would need a few things that I only have access to downstream to make that pretty (so I will probably contribute some more than initially planned), as well as there are some housekeeping things still open to do on that branch. On top other responsibilities were more important. I'll see what I can do in the next days. But I'd really want to target prior to end of year to get this off my plate.

@alexanderpann
Copy link
Copy Markdown
Collaborator

Maybe this PR could be split into multiple PRs so that some of the features could be merged earlier, or we could merge it as an experimental feature. I feel like without such an approach, this PR won't get merged.

@alamqadem
Copy link
Copy Markdown
Collaborator Author

Maybe this PR could be split into multiple PRs so that some of the features could be merged earlier, or we could merge it as an experimental feature. I feel like without such an approach, this PR won't get merged.

I and maybe @dalbrecht1 plan to get back and work on it in the next +1 week in the first week of March and get it merged as a whole or split it, whatever we can get done during that week.
Would that be ok @alexanderpann ?

alamqadem and others added 5 commits March 9, 2026 15:37
* move ElvisOperation to blutil
* move IntegerRange concepts to blutil
* move ZipOperation to blutil
* move GroupBy to blutil
* move select/where/foreach with indexes to blutil
* move scope functions to blutil
* move remaining actions from baseLanguageExtensions to blutil
* move generator from baseLanguageExtensions to blutil
* move reduction rules into separate mapping configurations
* move runtime code to blutil.rt
* move tests from baseLanguageExtensions to test.blutil
* move sandbox to new blutil.sandbox solution
* delete baseLanguageExtensions language and solutions
* move tests to NodeTests instead of BTestCase
* rename test model to remove baseLanguageExtensions prefix
* add dataflow for integer range and scope function
* fix generator for scope functions
- apparently while moving the code something was accidentally deleted
* fix scope functions example in sandbox
…lutions (#18)

- remove baseLanguageExtensions references from the build script
- remove cyclic dependency between blutil and blutil.rt
@alamqadem alamqadem changed the title mps.baseLanguageExtensions: New language with extensions to BaseLanguage mps.blutil: add new operations to BaseLanguage Mar 10, 2026
@alamqadem
Copy link
Copy Markdown
Collaborator Author

Following the suggestion from @sergej-koscejev , I rebased the changes on maintenance/mps20251 in this PR #1768 , I will close this PR and I will then backport these changes from there.

@alamqadem alamqadem closed this Mar 10, 2026
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.

5 participants