We welcome contributions! This guide will help you get started.
- Report bugs - Open issues on GitHub
- Fix bugs - Submit pull requests
- Add features - Implement missing Perl features
- Improve docs - Fix typos, add examples, clarify explanations
- Port modules - Help port CPAN modules to PerlOnJava
- Write tests - Add test coverage
# Clone repository
git clone https://github.com/fglock/PerlOnJava.git
cd PerlOnJava
# Build and run tests
make # Build + fast unit tests
make dev # Force clean rebuild
# Run comprehensive tests
make test-allBefore making changes:
- Create a feature branch:
git checkout -b feature-name - Read the Architecture Guide
- Check Roadmap for planned features
While coding:
- Follow existing code style
- Run
makefrequently to ensure tests pass - Add tests for new features in
src/test/resources/unit/
Before committing:
- Ensure
makepasses (fast unit tests) - Run
make test-allfor comprehensive testing - Write clear commit messages
- Push your branch:
git push origin feature-name - Open a PR on GitHub
- Describe what your PR does and why
- Link related issues
The #1 priority is keeping make working. All unit tests must pass.
src/main/java/org/perlonjava/
├── astnode/ # AST node representations
├── parser/ # Parser implementation
├── lexer/ # Tokenization
├── codegen/ # Bytecode generation and class creation
├── astvisitor/ # AST traversal (EmitterVisitor, PrinterVisitor)
├── runtime/ # Runtime implementations (RuntimeScalar, RuntimeArray, etc.)
├── operators/ # Operator implementations
├── regex/ # Regex engine integration
├── perlmodule/ # Java implementations of Perl modules
└── scriptengine/ # JSR 223 scripting API
src/main/perl/lib/ # Perl module implementations
src/test/resources/ # Test files
- Lexer (
lexer/Lexer.java) - Tokenizes Perl source - Parser (
parser/Parser.java) - Builds AST from tokens - EmitterVisitor (
astvisitor/) - Traverses AST and coordinates bytecode generation - Emit classes (
codegen/) - Generate JVM bytecode using ASM library - Runtime (
runtime/) - RuntimeScalar, RuntimeArray, RuntimeHash, RuntimeCode - Operators (
operators/) - Perl operator implementations
src/test/resources/
└── unit/ # Fast unit tests (run in seconds)
perl5_t/ (at project root)
├── t/ # Perl 5 core test suite
└── [Module]/ # Perl 5 module tests
# Build with incremental compilation
make build
# Force clean rebuild (during active development)
make dev
# Run fast unit tests (default)
make test
# Run all tests including Perl 5 core tests
make test-all
# Run single test
./jperl path/to/test.t- Create
.tfile insrc/test/resources/unit/ - Use TAP format (Test::More compatible)
- Test should complete in < 1 second
- Run with
./jperl path/to/test.t
Example test:
print "1..3\n"; # Plan
print "ok 1 - basic test\n";
my $x = 1 + 1;
print $x == 2 ? "ok 2\n" : "not ok 2\n";
print "ok 3 - done\n";# Show debug information
./jperl --debug -E 'code'
# Check syntax only
./jperl -c script.pl
# Show disassembled bytecode
./jperl --disassemble script.pl
# Run lexer only
./jperl --tokenize -E 'code'
# Run parser only
./jperl --parse -E 'code'User-facing documentation is in docs/:
- getting-started/ - Installation, quick start, Docker
- guides/ - How-to guides (database, Java integration, modules)
- reference/ - Technical reference (features, testing, architecture)
- about/ - Project information (why, roadmap, support)
Developer documentation is in dev/:
- architecture/ - Internal architecture docs
- implementation/ - Implementation notes (regex, tie, overload)
- maintenance/ - Maintenance procedures
- Check if it's in Feature Matrix
- Review Roadmap
- Open an issue to discuss the approach
- Read relevant design docs in
dev/
When modifying these, test extensively:
- String parsing (
parser/StringDoubleQuoted.java) - Lexer (
lexer/Lexer.java) - Unicode handling - Surrogate pairs, identifier parsing
- Control flow - die/eval, loop control
- Bytecode generation (
codegen/,astvisitor/EmitterVisitor.java)
- Implement in
operators/package - Add parser support in
parser/ - Add tests in
src/test/resources/unit/ - Update Feature Matrix
See Module Porting Guide for:
- How to port pure-Perl modules
- Implementing XS modules in Java
- Using XSLoader mechanism
- GitHub Issues - Bug reports and feature requests
- Pull Requests - Code contributions
- Discussions - Questions and design discussions
- Be respectful and constructive
- Focus on technical merit
- Help newcomers
- Keep discussions on-topic
- Read the Architecture Guide
- Check existing Issues
- Ask in Discussions
- See Support for more resources
By contributing, you agree that your contributions will be licensed under the Artistic License 2.0.