GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Modular structure by jeff5 · Pull Request #375 · jython/jython

Conversation

@jeff5

@jeff5 jeff5 commented Mar 14, 2025

Copy link
Copy Markdown
Member

This PR, when it has all its change sets, will restructure the Jython 3 code into a Java module core. The objective is to control visibility of objects that will become API, while allowing us to use package structure internally to the project. (Without Java modularity, everything we make public for re-use between packages internally, becomes public externally.)

It is intended that there be more than one module eventually, but always a small number.

We are applying some off-repo learning (in VSJ4). The first step (adding module definitions) does not achieve the objective: public classes must be allocated to packages that are either exported or not, and in some cases a class must be divided between them. The off-repo work also advanced the functional state of the implementation so we shall bring that in too.

This gets quite difficult so the PR will be draft for a while.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

wfouche reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
jeff5 added 2 commits March 14, 2025 08:12
@jeff5
Update Gradle wrapper to 8.13
c6d5f43
@jeff5
Preparatory changes to Gradle scripts
63c81f4
Script changes preparatory to introducing modules (in the layout we
found to work in VSJ4).
@jeff5
jeff5 marked this pull request as draft March 14, 2025 09:16
jeff5 added 3 commits March 14, 2025 18:17
@jeff5
Fix Javadoc irregularities
f314ca7
This allows us to test creation of the several kinds of Javadoc
publication.
@jeff5
Add a module-info file for the core module
3e8215e
@jeff5
Code motion to target structure without real change
75eef16
We approximate the package structure we need for safe type system
construction and control of visibility developed in the VSJ prototype.
We reduce the breakage this causes by temporarily making some things
public (opposite to the goal).
@jeff5

jeff5 commented Oct 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

The modularisation that seemed initially a structural question, led to functional improvements and new thoughts: you just can't control visibility as desired and bring the type system into existence in the old way. So the change developed in the prototype repo is extensive.

I'm going to merge a lot of it to this branch. Unfortunately, this will look like a big change all at once. It is really the product of a lot of false starts and re-work, that I'm sparing future readers.

Objects like PyFloat in the main repo carry a lot of Jython 2 code not in the off-repo prototype. It needs revision but I'd like to preserve it for now (e.g. the implementation of __new__ is commented out). I don't want to overwrite it by casually copying in files, although that is a safe approach for many.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jeff5 jeff5 mentioned this pull request Oct 23, 2026
Generate Opcode3xx.java instead of hand coding. #461
Merged
jeff5 added 10 commits October 24, 2026 11:59
@jeff5
Structure of the type system [skip ci]
f674318
This is a batch of changed and new files supporting the re-worked type
system. It is not a consistent state, so don't test it.
@jeff5
Some built-in types and abstract API [skip ci]
7f66af7
The core types have evolved with the type system. These changed and new
files relate to that. It is not a consistent state, so don't test it.
@jeff5
More built-in types and support [skip ci]
a27417f
@jeff5
Revised exceptions framework [skip ci]
75ac225
Exceptions have changed to be more like their implementation in CPython.
They cannot all be distinct Java types because of the need for
class-assignment, but some can.
@jeff5
Module and type support [skip ci]
8af3093
We add/update descriptors and exposure mechanisms that have not already
slipped through, and a two actual modules. Many classes lack their full
set of features.

This is not yet a coherent state we can test.
@jeff5
Implementation of code-frame-function [skip ci]
d498f33
We commit support for 3.11 byte code. Developing support for JVM byte
code leads to some refactoring of these classes.

This is the last of the core runtime code, so we include some updated
tests. The test suite as a whole should not be expected to pass on this
commit.
@jeff5
Updates to existing tests
17d52ad
We update the existing tests to match changes in the core. We have some
tests still to add.

The test suite as a whole (as currently committed) ought to pass.
@jeff5
New tests of exposure and subclasses
0835ead
@jeff5
Tests of type system initialisation
93a6d0d
The type system springs into existence when needed. We have a battery of
tests to check that it does so in full working order, irrespective of
the trigger (even concurrent and re-entrant triggers).
@jeff5
Test concurrent modification of type objects
7615e5b
Type attribute access is not correctly synchronised yet, so it's a
mystery that this test doesn't fail.
@jeff5
jeff5 marked this pull request as ready for review October 25, 2026 07:20
@jeff5

jeff5 commented Oct 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

I added my changes in batches that do not correspond to the order of development but have something to do with each other. However, it is not possible to run (or even compile, I expect) until where I take off the "skip ci" marker. After that, code is all additional and (as you can see) the unit tests run.

The last set contains one test. It is interesting because, to my mind, the feature tested is incorrectly synchronised. It should fail, but doesn't on platforms I have tried (x86).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jeff5 jeff5 mentioned this pull request Oct 25, 2026
Add a simple REPL. #460
Merged
@jeff5
Merge branch 'main' into modular-structure
4407ca8
As well the files git merge cannot merge, some classes have moved and
other features (exceptions for example) have changed. We address those
changes during the merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@jeff5
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.