Skip to content

Commit d223b9f

Browse files
authored
Merge pull request #16 from ProgrammerKR/master
Master
2 parents 1b5ba31 + ace0193 commit d223b9f

95 files changed

Lines changed: 4280 additions & 76 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/benchmarks.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
2+
name: Comprehensive Benchmarks
3+
4+
on:
5+
push:
6+
paths:
7+
- 'benchmarks/**'
8+
- 'src/**'
9+
- 'include/**'
10+
- 'CMakeLists.txt'
11+
pull_request:
12+
paths:
13+
- 'benchmarks/**'
14+
- 'src/**'
15+
workflow_dispatch:
16+
17+
jobs:
18+
benchmark:
19+
name: Benchmark on ${{ matrix.os }}
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ubuntu-latest, windows-latest, macos-latest]
25+
26+
steps:
27+
- name: Checkout source
28+
uses: actions/checkout@v4
29+
30+
# --- Language Setups ---
31+
- name: Setup Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: '3.x'
35+
36+
- name: Setup Node.js
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: '20'
40+
41+
- name: Setup Go
42+
uses: actions/setup-go@v5
43+
with:
44+
go-version: '1.21'
45+
46+
- name: Setup Java
47+
uses: actions/setup-java@v4
48+
with:
49+
distribution: 'temurin'
50+
java-version: '21'
51+
52+
# --- Build Dependencies (LLVM) ---
53+
- name: Install LLVM (Ubuntu)
54+
if: matrix.os == 'ubuntu-latest'
55+
run: |
56+
sudo apt-get update
57+
sudo apt-get install -y llvm-dev libclang-dev clang build-essential
58+
59+
- name: Install LLVM (macOS)
60+
if: matrix.os == 'macos-latest'
61+
run: |
62+
brew update
63+
brew install llvm
64+
echo "LLVM_DIR=$(brew --prefix llvm)/lib/cmake/llvm" >> $GITHUB_ENV
65+
echo "$(brew --prefix llvm)/bin" >> $GITHUB_PATH
66+
67+
- name: Setup LLVM (Windows)
68+
if: matrix.os == 'windows-latest'
69+
shell: pwsh
70+
run: |
71+
choco install llvm --version 17.0.6 -y --force
72+
$llvmRoot = "C:\Program Files\LLVM"
73+
if (-not (Test-Path $llvmRoot)) { $llvmRoot = "C:\Program Files (x86)\LLVM" }
74+
Add-Content $env:GITHUB_PATH "$llvmRoot/bin"
75+
Add-Content $env:GITHUB_ENV "LLVM_ROOT=$llvmRoot"
76+
# Helper for CMake to find LLVM
77+
Add-Content $env:GITHUB_ENV "LLVM_DIR=$llvmRoot/lib/cmake/llvm"
78+
79+
# --- Build ProXPL ---
80+
- name: Configure CMake
81+
shell: bash
82+
run: |
83+
cmake -S . -B build \
84+
-DCMAKE_BUILD_TYPE=Release \
85+
-DBUILD_TESTS=OFF \
86+
-DBUILD_BENCH=OFF
87+
88+
- name: Build ProXPL
89+
shell: bash
90+
run: cmake --build build --config Release
91+
92+
# --- Run Benchmarks ---
93+
- name: Run Comparison Benchmarks
94+
shell: bash
95+
run: |
96+
if [ "${{ matrix.os }}" == "windows-latest" ]; then
97+
EXE_PATH="build/Release/proxpl.exe"
98+
else
99+
EXE_PATH="build/proxpl"
100+
fi
101+
102+
echo "Running benchmarks with $EXE_PATH"
103+
# Run with buffered output explanation or simple run
104+
python benchmarks/run_benchmarks.py --executable "$EXE_PATH"

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
*.exe
1414
*.out
1515
*.app
16+
<<<<<<< HEAD
17+
*.obj
18+
*.lib
19+
*.exp
20+
*.pdb
21+
*.ilk
22+
=======
23+
>>>>>>> fix-ci-build
1624
build/
1725
cmake-build-debug/
1826
cmake-build-release/
@@ -114,6 +122,18 @@ htmlcov/
114122
*.cover
115123

116124
# ============================================
125+
<<<<<<< HEAD
126+
# Node.js
127+
# ============================================
128+
node_modules/
129+
extension/node_modules/
130+
npm-debug.log
131+
yarn-error.log
132+
package-lock.json
133+
134+
# ============================================
135+
=======
136+
>>>>>>> fix-ci-build
117137
# Project-Specific
118138
# ============================================
119139
.internal_ignore

CHANGELOG.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
---
88

9+
<<<<<<< HEAD
10+
## [1.0.0] - 2026-01-06
11+
12+
### Added
13+
- **Object-Oriented Programming**: First-class support for Classes, Objects, Single Inheritance (`extends`), and Interfaces.
14+
- **Keywords**: `class`, `new`, `this`, `extends`, `interface`, `static`.
15+
- **Runtime**:
16+
- `ObjClass`, `ObjInstance`, `ObjBoundMethod` structures.
17+
- Opcodes: `OP_CLASS`, `OP_METHOD`, `OP_INHERIT`, `OP_GET_PROPERTY`, `OP_SET_PROPERTY`, `OP_GET_SUPER`.
18+
- **Stability**: Finalized v1.0.0 release.
19+
20+
### Fixed
21+
- **Build**: Resolved CMake configuration issues and compilation errors.
22+
- **VM**: Fixed object instantiation and method binding logic.
23+
924
## [0.8.0] - 2026-01-04
1025

1126
### Added
@@ -52,6 +67,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5267
- **Runtime**:
5368
- Implemented `OP_USE` opcode for dynamic module loading.
5469
- Added `std.io` and standard library module resolution fixes.
70+
=======
71+
## [Unreleased]
72+
73+
### Added
74+
>>>>>>> fix-ci-build
5575
- Comprehensive documentation suite (400+ pages)
5676
- Professional README with architecture diagrams
5777
- Complete ARCHITECTURE.md with compiler pipeline details
@@ -78,8 +98,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7898
- Refactor report documenting all changes
7999

80100
### Changed
101+
<<<<<<< HEAD
81102
- **CLI**: Updated CLI version to match project version.
82103
- **Build**: Fixed CMake finding LLVM and compiler paths on Windows.
104+
=======
105+
>>>>>>> fix-ci-build
83106
- Reorganized repository structure for clarity and scalability
84107
- Upgraded CMakeLists.txt to modern best practices
85108
- Improved Makefile with multiple build targets
@@ -100,7 +123,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
100123

101124
---
102125

126+
<<<<<<< HEAD
103127
## [0.1.0] - 2024-12-11
128+
=======
129+
## [0.9.0] - 2024-12-11
130+
>>>>>>> fix-ci-build
104131
105132
### Initial C-Based Release
106133

@@ -197,7 +224,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
197224
- Async/await implementation
198225
- Pattern matching
199226
- Generic types
227+
<<<<<<< HEAD
200228
- Module system (Initial support in v0.5.0)
229+
=======
230+
- Module system
231+
>>>>>>> fix-ci-build
201232
- Debugger integration
202233

203234
### Phase 4: Ecosystem (Q3 2025)
@@ -230,15 +261,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
230261
1. **Type Checker**: Partial implementation, needs refinement for complex types
231262
2. **Object System**: Basic inheritance, needs method binding optimization
232263
3. **Memory Management**: Mark-and-sweep GC not yet implemented
264+
<<<<<<< HEAD
233265
4. **Module System**: Partial implementation (`use` keyword support added, std lib in progress)
266+
=======
267+
4. **Module System**: Not yet implemented
268+
>>>>>>> fix-ci-build
234269
5. **Standard Library**: 44/75 functions (58% complete)
235270
6. **Error Messages**: Could be more detailed with suggestions
236271
7. **REPL**: Basic implementation, no history or autocompletion
237272

238273
### Workarounds
239274

240275
- For GC: Short-lived programs work fine with basic allocation
276+
<<<<<<< HEAD
241277
- For modules: Use the new `use` keyword or compile with single-file strategy
278+
=======
279+
- For modules: Use single-file programs or compile with preprocessor
280+
>>>>>>> fix-ci-build
242281
- For missing functions: Implement in ProXPL or use system() calls
243282

244283
---
@@ -339,6 +378,12 @@ This project is licensed under the MIT License.
339378

340379
---
341380

342-
**Current Version**: 0.8.0
343-
**Last Updated**: January 04, 2026
381+
<<<<<<< HEAD
382+
**Current Version**: 1.0.0
383+
**Last Updated**: January 06, 2026
344384
**Next Release**: 1.1.0 (Q1 2026)
385+
=======
386+
**Current Version**: 0.9.0 (Development)
387+
**Last Updated**: December 11, 2024
388+
**Next Release**: 1.0.0 (Q2 2025)
389+
>>>>>>> fix-ci-build

CMakeLists.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
cmake_minimum_required(VERSION 3.15)
2+
<<<<<<< HEAD
23
project(ProXPL VERSION 1.0.0 LANGUAGES C CXX)
4+
=======
5+
project(ProXPL)
6+
>>>>>>> fix-ci-build
37

48
# Enable C and C++
59
enable_language(C CXX)
@@ -15,6 +19,7 @@ else()
1519
endif()
1620

1721
# --- LLVM Configuration ---
22+
<<<<<<< HEAD
1823
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
1924

2025
# --- LLVM Configuration ---
@@ -44,14 +49,22 @@ else()
4449
message(WARNING "LibFFI not found. FFI features will be disabled.")
4550
endif()
4651

52+
=======
53+
find_package(LLVM CONFIG)
54+
55+
>>>>>>> fix-ci-build
4756
if (LLVM_FOUND)
4857
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
4958
include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
5059
add_definitions(${LLVM_DEFINITIONS})
5160
link_directories(${LLVM_LIBRARY_DIRS})
5261

5362
# Map generic components to specific libs
63+
<<<<<<< HEAD
5464
llvm_map_components_to_libnames(llvm_libs core support executionengine native ipo analysis transformutils bitwriter)
65+
=======
66+
llvm_map_components_to_libnames(llvm_libs core support executionengine native ipo)
67+
>>>>>>> fix-ci-build
5568
else()
5669
message(WARNING "LLVM not found. Building without LLVM backend.")
5770
set(llvm_libs "")
@@ -74,13 +87,17 @@ list(FILTER LIB_SOURCES EXCLUDE REGEX ".*main\\.c$")
7487
list(FILTER LIB_SOURCES EXCLUDE REGEX ".*vm_v2\\.c$")
7588
list(FILTER LIB_SOURCES EXCLUDE REGEX ".*vm_dispatch\\.c$")
7689
list(FILTER LIB_SOURCES EXCLUDE REGEX ".*instr_handlers_template\\.c$")
90+
<<<<<<< HEAD
7791
# Exclude prototype VM register which has its own main
7892
list(FILTER LIB_SOURCES EXCLUDE REGEX ".*vm_register\\.c$")
93+
=======
94+
>>>>>>> fix-ci-build
7995

8096
if (NOT LLVM_FOUND)
8197
list(FILTER LIB_SOURCES EXCLUDE REGEX ".*backend_llvm\\.cpp$")
8298
endif()
8399

100+
<<<<<<< HEAD
84101

85102
# --- Build Configuration ---
86103
# --- Build Configuration ---
@@ -119,17 +136,36 @@ endif()
119136
if (LIBFFI_FOUND)
120137
target_link_libraries(proxpl PRIVATE ${LIBFFI_LIBRARIES})
121138
endif()
139+
=======
140+
# --- Core Library ---
141+
add_library(proxpl_lib SHARED ${LIB_SOURCES})
142+
if (LLVM_FOUND)
143+
target_link_libraries(proxpl_lib PRIVATE ${llvm_libs})
144+
endif()
145+
146+
# --- Main Executable ---
147+
add_executable(proxpl src/main.c)
148+
target_link_libraries(proxpl PRIVATE proxpl_lib ${llvm_libs})
149+
>>>>>>> fix-ci-build
122150

123151
if(UNIX)
124152
if(APPLE)
125153
target_link_libraries(proxpl PRIVATE pthread dl z)
154+
<<<<<<< HEAD
155+
else()
156+
target_link_libraries(proxpl PRIVATE pthread dl z tinfo)
157+
=======
158+
target_link_libraries(proxpl_lib PRIVATE pthread dl z)
126159
else()
127160
target_link_libraries(proxpl PRIVATE pthread dl z tinfo)
161+
target_link_libraries(proxpl_lib PRIVATE pthread dl z tinfo)
162+
>>>>>>> fix-ci-build
128163
endif()
129164
endif()
130165

131166
# --- IR Test Executable ---
132167
add_executable(ir_gen_test tools/ir_gen_test.c)
168+
<<<<<<< HEAD
133169
if(PROX_STATIC_BUILD)
134170
# Link directly to sources for static build since proxpl_lib doesn't exist
135171
target_sources(ir_gen_test PRIVATE ${LIB_SOURCES})
@@ -148,10 +184,14 @@ else()
148184
target_link_libraries(ir_gen_test PRIVATE ${LIBFFI_LIBRARIES})
149185
endif()
150186
endif()
187+
=======
188+
target_link_libraries(ir_gen_test PRIVATE proxpl_lib)
189+
>>>>>>> fix-ci-build
151190

152191
# --- LLVM Gen Test Executable ---
153192
add_executable(llvm_gen_test tools/llvm_gen_test.c)
154193

194+
<<<<<<< HEAD
155195
if(PROX_STATIC_BUILD)
156196
target_sources(llvm_gen_test PRIVATE ${LIB_SOURCES})
157197
if (LLVM_FOUND)
@@ -166,13 +206,19 @@ else()
166206
target_link_libraries(llvm_gen_test PRIVATE ${LIBFFI_LIBRARIES})
167207
endif()
168208
endif()
209+
=======
210+
target_link_libraries(llvm_gen_test PRIVATE proxpl_lib ${llvm_libs})
211+
>>>>>>> fix-ci-build
169212

170213
# --- PRM Executable ---
171214
add_executable(prm
172215
tools/prm_main.c
173216
src/prm/manifest.c
174217
src/prm/builder.c
218+
<<<<<<< HEAD
175219
src/prm/commands/cmd_core.c
220+
=======
221+
>>>>>>> fix-ci-build
176222
)
177223
# PRM doesn't strictly need proxpl_lib unless it uses core types?
178224
# For now, it's standalone, but let's link it if needed later.

Doxyfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
# Generated documentation will be in build/docs/
33

44
PROJECT_NAME = ProXPL
5+
<<<<<<< HEAD
56
PROJECT_NUMBER = 0.7.0-pre
7+
=======
8+
PROJECT_NUMBER = 0.1.0
9+
>>>>>>> fix-ci-build
610
PROJECT_BRIEF = "A Modern Programming Language Compiler"
711
PROJECT_LOGO =
812

0 commit comments

Comments
 (0)