fresh-lang 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fresh_lang-0.1.0/.github/workflows/ci.yml +106 -0
- fresh_lang-0.1.0/.gitignore +40 -0
- fresh_lang-0.1.0/.vscode/extensions.json +3 -0
- fresh_lang-0.1.0/.vscode/launch.json +29 -0
- fresh_lang-0.1.0/.vscode/settings.json +9 -0
- fresh_lang-0.1.0/.vscode/tasks.json +66 -0
- fresh_lang-0.1.0/LANGUAGE_GUIDE.md +582 -0
- fresh_lang-0.1.0/LICENSE +21 -0
- fresh_lang-0.1.0/NEW_LANG/01_fibonacci.fresh +38 -0
- fresh_lang-0.1.0/NEW_LANG/02_matrix_multiply.fresh +25 -0
- fresh_lang-0.1.0/NEW_LANG/03_quicksort.fresh +34 -0
- fresh_lang-0.1.0/NEW_LANG/04_closure_counter.fresh +30 -0
- fresh_lang-0.1.0/NEW_LANG/05_calculator.fresh +11 -0
- fresh_lang-0.1.0/NEW_LANG/06_inventory.fresh +17 -0
- fresh_lang-0.1.0/NEW_LANG/07_stress_suite.fresh +236 -0
- fresh_lang-0.1.0/NEW_LANG/08_aggressive_suite.fresh +214 -0
- fresh_lang-0.1.0/PKG-INFO +283 -0
- fresh_lang-0.1.0/README.md +259 -0
- fresh_lang-0.1.0/all_features.fresh +242 -0
- fresh_lang-0.1.0/docs/COMPARISON.md +128 -0
- fresh_lang-0.1.0/docs/COMPATIBILITY_AND_VERSIONING.md +42 -0
- fresh_lang-0.1.0/docs/FRESH_SPECIFICATION.md +179 -0
- fresh_lang-0.1.0/docs/PROS.md +90 -0
- fresh_lang-0.1.0/docs/production_release_guide.md +97 -0
- fresh_lang-0.1.0/docs/project_guide.md +87 -0
- fresh_lang-0.1.0/fib.c +110 -0
- fresh_lang-0.1.0/fresh.cmd +2 -0
- fresh_lang-0.1.0/fresh.ps1 +2 -0
- fresh_lang-0.1.0/fresh.spec +38 -0
- fresh_lang-0.1.0/pyproject.toml +74 -0
- fresh_lang-0.1.0/scratch/myapp/fresh.toml +8 -0
- fresh_lang-0.1.0/scratch/myapp/src/main.fresh +5 -0
- fresh_lang-0.1.0/scratch/myapp/tests/test_basic.fresh +5 -0
- fresh_lang-0.1.0/scratch/test_app/fresh.toml +8 -0
- fresh_lang-0.1.0/scratch/test_app/src/main.fresh +5 -0
- fresh_lang-0.1.0/scratch/test_app/tests/test_basic.fresh +5 -0
- fresh_lang-0.1.0/scripts/build_release.py +60 -0
- fresh_lang-0.1.0/src/fresh/__init__.py +3 -0
- fresh_lang-0.1.0/src/fresh/__main__.py +6 -0
- fresh_lang-0.1.0/src/fresh/analyzer/__init__.py +6 -0
- fresh_lang-0.1.0/src/fresh/analyzer/resolver.py +369 -0
- fresh_lang-0.1.0/src/fresh/analyzer/symbols.py +69 -0
- fresh_lang-0.1.0/src/fresh/analyzer/type_checker.py +664 -0
- fresh_lang-0.1.0/src/fresh/cli.py +210 -0
- fresh_lang-0.1.0/src/fresh/codegen/__init__.py +9 -0
- fresh_lang-0.1.0/src/fresh/codegen/c_transpiler.py +509 -0
- fresh_lang-0.1.0/src/fresh/codegen/capabilities.py +173 -0
- fresh_lang-0.1.0/src/fresh/codegen/chunk.py +51 -0
- fresh_lang-0.1.0/src/fresh/codegen/compiler.py +700 -0
- fresh_lang-0.1.0/src/fresh/codegen/disassembler.py +127 -0
- fresh_lang-0.1.0/src/fresh/codegen/opcodes.py +71 -0
- fresh_lang-0.1.0/src/fresh/codegen/optimizer.py +120 -0
- fresh_lang-0.1.0/src/fresh/common/__init__.py +1 -0
- fresh_lang-0.1.0/src/fresh/common/errors.py +111 -0
- fresh_lang-0.1.0/src/fresh/common/span.py +43 -0
- fresh_lang-0.1.0/src/fresh/common/types.py +148 -0
- fresh_lang-0.1.0/src/fresh/formatter.py +299 -0
- fresh_lang-0.1.0/src/fresh/lexer/__init__.py +6 -0
- fresh_lang-0.1.0/src/fresh/lexer/scanner.py +384 -0
- fresh_lang-0.1.0/src/fresh/lexer/tokens.py +137 -0
- fresh_lang-0.1.0/src/fresh/modules.py +104 -0
- fresh_lang-0.1.0/src/fresh/package.py +192 -0
- fresh_lang-0.1.0/src/fresh/parser/__init__.py +5 -0
- fresh_lang-0.1.0/src/fresh/parser/ast.py +547 -0
- fresh_lang-0.1.0/src/fresh/parser/parser.py +847 -0
- fresh_lang-0.1.0/src/fresh/pipeline.py +90 -0
- fresh_lang-0.1.0/src/fresh/stdlib/__init__.py +6 -0
- fresh_lang-0.1.0/src/fresh/stdlib/builtins.py +135 -0
- fresh_lang-0.1.0/src/fresh/stdlib/math_lib.py +39 -0
- fresh_lang-0.1.0/src/fresh/vm/__init__.py +31 -0
- fresh_lang-0.1.0/src/fresh/vm/frame.py +24 -0
- fresh_lang-0.1.0/src/fresh/vm/gc.py +96 -0
- fresh_lang-0.1.0/src/fresh/vm/objects.py +158 -0
- fresh_lang-0.1.0/src/fresh/vm/value.py +36 -0
- fresh_lang-0.1.0/src/fresh/vm/vm.py +474 -0
- fresh_lang-0.1.0/tests/benchmarks/test_benchmarks.py +65 -0
- fresh_lang-0.1.0/tests/c_backend/test_c_backend.py +124 -0
- fresh_lang-0.1.0/tests/cli/test_cli.py +62 -0
- fresh_lang-0.1.0/tests/conftest.py +30 -0
- fresh_lang-0.1.0/tests/diagnostics/test_diagnostics.py +70 -0
- fresh_lang-0.1.0/tests/differential/test_differential.py +230 -0
- fresh_lang-0.1.0/tests/fmt/test_formatter.py +58 -0
- fresh_lang-0.1.0/tests/fuzz/test_fuzz.py +77 -0
- fresh_lang-0.1.0/tests/gc/test_gc.py +109 -0
- fresh_lang-0.1.0/tests/modules/test_modules.py +62 -0
- fresh_lang-0.1.0/tests/optimizer/test_optimizer.py +75 -0
- fresh_lang-0.1.0/tests/package/test_package.py +81 -0
- fresh_lang-0.1.0/tests/test_aggressive_suite.py +362 -0
- fresh_lang-0.1.0/tests/test_all_phases.py +97 -0
- fresh_lang-0.1.0/tests/test_examples.py +21 -0
- fresh_lang-0.1.0/tests/test_spec_conformance.py +112 -0
- fresh_lang-0.1.0/tests/vm/test_vm_safety.py +109 -0
- fresh_lang-0.1.0/vscode-extension/README.md +11 -0
- fresh_lang-0.1.0/vscode-extension/icon-theme.json +18 -0
- fresh_lang-0.1.0/vscode-extension/icon.png +0 -0
- fresh_lang-0.1.0/vscode-extension/language-configuration.json +29 -0
- fresh_lang-0.1.0/vscode-extension/package.json +44 -0
- fresh_lang-0.1.0/vscode-extension/syntaxes/fresh.tmLanguage.json +95 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
name: Fresh CI & Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
tags: [ "v*" ]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [ "main" ]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
name: Test on ${{ matrix.os }} (Python ${{ matrix.python-version }})
|
|
13
|
+
runs-on: ${{ matrix.os }}
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
18
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Install GCC / Clang
|
|
29
|
+
if: runner.os == 'Linux'
|
|
30
|
+
run: sudo apt-get update && sudo apt-get install -y gcc
|
|
31
|
+
|
|
32
|
+
- name: Install dependencies
|
|
33
|
+
run: |
|
|
34
|
+
python -m pip install --upgrade pip
|
|
35
|
+
pip install -e .
|
|
36
|
+
pip install pytest pytest-cov ruff mypy build twine
|
|
37
|
+
|
|
38
|
+
- name: Run Test Suite
|
|
39
|
+
run: |
|
|
40
|
+
python -m pytest
|
|
41
|
+
|
|
42
|
+
- name: Verify CLI Commands
|
|
43
|
+
run: |
|
|
44
|
+
fresh run NEW_LANG/01_fibonacci.fresh
|
|
45
|
+
fresh check NEW_LANG/01_fibonacci.fresh
|
|
46
|
+
fresh fmt --check NEW_LANG/01_fibonacci.fresh
|
|
47
|
+
fresh init sample_app
|
|
48
|
+
fresh build sample_app
|
|
49
|
+
|
|
50
|
+
build-packages:
|
|
51
|
+
name: Build PyPI Wheel & Source Distribution
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
needs: test
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@v4
|
|
56
|
+
- uses: actions/setup-python@v5
|
|
57
|
+
with:
|
|
58
|
+
python-version: "3.12"
|
|
59
|
+
- name: Install build and twine
|
|
60
|
+
run: pip install build twine
|
|
61
|
+
- name: Build packages
|
|
62
|
+
run: python -m build
|
|
63
|
+
- name: Validate distributions
|
|
64
|
+
run: python -m twine check dist/*.whl dist/*.tar.gz
|
|
65
|
+
- name: Upload dist artifacts
|
|
66
|
+
uses: actions/upload-artifact@v4
|
|
67
|
+
with:
|
|
68
|
+
name: python-dist
|
|
69
|
+
path: dist/
|
|
70
|
+
|
|
71
|
+
build-binaries:
|
|
72
|
+
name: Build Standalone Binary on ${{ matrix.os }}
|
|
73
|
+
runs-on: ${{ matrix.os }}
|
|
74
|
+
needs: test
|
|
75
|
+
strategy:
|
|
76
|
+
matrix:
|
|
77
|
+
include:
|
|
78
|
+
- os: ubuntu-latest
|
|
79
|
+
artifact_name: fresh-linux
|
|
80
|
+
binary_name: dist/fresh
|
|
81
|
+
- os: macos-latest
|
|
82
|
+
artifact_name: fresh-macos
|
|
83
|
+
binary_name: dist/fresh
|
|
84
|
+
- os: windows-latest
|
|
85
|
+
artifact_name: fresh-windows
|
|
86
|
+
binary_name: dist/fresh.exe
|
|
87
|
+
steps:
|
|
88
|
+
- uses: actions/checkout@v4
|
|
89
|
+
- uses: actions/setup-python@v5
|
|
90
|
+
with:
|
|
91
|
+
python-version: "3.12"
|
|
92
|
+
- name: Install PyInstaller & dependencies
|
|
93
|
+
run: |
|
|
94
|
+
pip install -e .
|
|
95
|
+
pip install pyinstaller
|
|
96
|
+
- name: Compile Executable
|
|
97
|
+
run: pyinstaller --onefile --clean --name fresh src/fresh/__main__.py
|
|
98
|
+
- name: Test Executable
|
|
99
|
+
run: |
|
|
100
|
+
${{ matrix.binary_name }} --help
|
|
101
|
+
${{ matrix.binary_name }} run NEW_LANG/01_fibonacci.fresh
|
|
102
|
+
- name: Upload Binary Artifact
|
|
103
|
+
uses: actions/upload-artifact@v4
|
|
104
|
+
with:
|
|
105
|
+
name: ${{ matrix.artifact_name }}
|
|
106
|
+
path: ${{ matrix.binary_name }}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.class
|
|
5
|
+
*.pyc
|
|
6
|
+
|
|
7
|
+
# Distribution / packaging
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
*.egg-info/
|
|
11
|
+
.eggs/
|
|
12
|
+
*.vsix
|
|
13
|
+
|
|
14
|
+
# Virtual Environments
|
|
15
|
+
.venv/
|
|
16
|
+
venv/
|
|
17
|
+
env/
|
|
18
|
+
ENV/
|
|
19
|
+
|
|
20
|
+
# Testing & Coverage
|
|
21
|
+
.pytest_cache/
|
|
22
|
+
.coverage
|
|
23
|
+
coverage.xml
|
|
24
|
+
htmlcov/
|
|
25
|
+
|
|
26
|
+
# Scratch & Temporary outputs
|
|
27
|
+
stress_test_temp.txt
|
|
28
|
+
fresh_demo_output.txt
|
|
29
|
+
vex_demo_output.txt
|
|
30
|
+
|
|
31
|
+
*.exe
|
|
32
|
+
*.obj
|
|
33
|
+
*.o
|
|
34
|
+
*.pdb
|
|
35
|
+
|
|
36
|
+
# Editor & OS artifacts
|
|
37
|
+
.DS_Store
|
|
38
|
+
Thumbs.db
|
|
39
|
+
*.swp
|
|
40
|
+
*.swo
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"name": "Fresh: Run Active File (F5)",
|
|
6
|
+
"type": "debugpy",
|
|
7
|
+
"request": "launch",
|
|
8
|
+
"module": "fresh",
|
|
9
|
+
"args": [
|
|
10
|
+
"run",
|
|
11
|
+
"${file}"
|
|
12
|
+
],
|
|
13
|
+
"console": "integratedTerminal",
|
|
14
|
+
"cwd": "${workspaceFolder}"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "Fresh: Run all_features.fresh",
|
|
18
|
+
"type": "debugpy",
|
|
19
|
+
"request": "launch",
|
|
20
|
+
"module": "fresh",
|
|
21
|
+
"args": [
|
|
22
|
+
"run",
|
|
23
|
+
"${workspaceFolder}/all_features.fresh"
|
|
24
|
+
],
|
|
25
|
+
"console": "integratedTerminal",
|
|
26
|
+
"cwd": "${workspaceFolder}"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0.0",
|
|
3
|
+
"tasks": [
|
|
4
|
+
{
|
|
5
|
+
"label": "Fresh: Run Active File",
|
|
6
|
+
"type": "shell",
|
|
7
|
+
"command": "python",
|
|
8
|
+
"args": [
|
|
9
|
+
"-m",
|
|
10
|
+
"fresh",
|
|
11
|
+
"run",
|
|
12
|
+
"${file}"
|
|
13
|
+
],
|
|
14
|
+
"group": {
|
|
15
|
+
"kind": "build",
|
|
16
|
+
"isDefault": true
|
|
17
|
+
},
|
|
18
|
+
"presentation": {
|
|
19
|
+
"reveal": "always",
|
|
20
|
+
"panel": "shared",
|
|
21
|
+
"clear": true
|
|
22
|
+
},
|
|
23
|
+
"problemMatcher": []
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"label": "Fresh: Type Check Active File",
|
|
27
|
+
"type": "shell",
|
|
28
|
+
"command": "python",
|
|
29
|
+
"args": [
|
|
30
|
+
"-m",
|
|
31
|
+
"fresh",
|
|
32
|
+
"check",
|
|
33
|
+
"${file}"
|
|
34
|
+
],
|
|
35
|
+
"problemMatcher": []
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"label": "Fresh: Format Active File",
|
|
39
|
+
"type": "shell",
|
|
40
|
+
"command": "python",
|
|
41
|
+
"args": [
|
|
42
|
+
"-m",
|
|
43
|
+
"fresh",
|
|
44
|
+
"fmt",
|
|
45
|
+
"${file}"
|
|
46
|
+
],
|
|
47
|
+
"problemMatcher": []
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "Fresh: Run Test Suite",
|
|
51
|
+
"type": "shell",
|
|
52
|
+
"command": "python",
|
|
53
|
+
"args": [
|
|
54
|
+
"-m",
|
|
55
|
+
"pytest"
|
|
56
|
+
],
|
|
57
|
+
"group": "test",
|
|
58
|
+
"presentation": {
|
|
59
|
+
"reveal": "always",
|
|
60
|
+
"panel": "shared",
|
|
61
|
+
"clear": true
|
|
62
|
+
},
|
|
63
|
+
"problemMatcher": []
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|