Nearoh is a Python-inspired programming language written in C, focused on real usability, clean architecture, and long-term growth into a serious everyday language.
Nearoh is not a toy parser or throwaway syntax project. It is being built as a practical language/runtime I would genuinely want to use, while keeping full control over internals, runtime behavior, memory paths, imports, diagnostics, and future low-level expansion.
Website: https://nearoh-coding-language.base44.app
GitHub: https://github.com/ReeceGilbert/Nearoh-Coding-Language
Nearoh aims to combine the productivity and readability of Python with the control and extensibility of a C-backed runtime.
The goal is to create a language that feels familiar and productive at the surface, but remains understandable, inspectable, and expandable underneath.
Nearoh is being built toward a future where the language can grow from a clean interpreted core into a practical personal-use language with its own libraries, tooling, native bridge, and eventually a dedicated editor / IDE.
- Familiar Python-style workflow
- Clean, readable syntax
- Functions, classes, objects, methods, and scripting productivity
- Runtime written in C for control and future performance work
- Expandable native bridge for machine-facing systems
- Ability to build higher-level libraries on top of a small native core
- Stable imports and multi-file program structure
- Source-aware diagnostics that point to the correct file, line, and column
- Long-term editor / IDE environment built around the language
- Strong architecture over rushed features
This project is being built to become a serious personal-use language, not just a demo.
Nearoh now supports real multi-feature programs, expanded native builtins, file I/O, and multi-file execution through a tracked import system.
The language can run larger examples from the command line, inspect tokens and AST output, execute classes and object systems, mutate lists and dictionaries, use built-in utility functions, read and write files, import other .nr files, detect circular imports, skip duplicate imports, and report runtime errors with source-aware file/line/column diagnostics.
Implemented systems currently include:
- Lexer
- Parser
- AST generation
- Runtime evaluator
- Scope / environment model
- Variables and reassignment
- Arithmetic
- Strings
- Numbers
- Booleans
if / elif / elsewhileloopsfor ... inlist iteration- Functions
- Return values
- Classes
- Automatic
__init__constructors - Object fields
- Member access
- Bound
selfmethods - Lists
- List indexing
- List index assignment
- Dictionaries
- Dictionary indexing
- Dictionary index assignment
- Member assignment
- Instance member container mutation
- File I/O
- Tracked imports
- Duplicate import skipping
- Circular import detection
- Import path normalization
- File-relative imports
- Compatibility fallback for older working-directory-style import paths
- Source-aware AST annotation
- Runtime file/line/column error reporting
- Expected-failure regression tests
- Debug / token / AST CLI modes
- Core runtime safety checks
Nearoh currently includes the following native builtins:
print()len()type()str()num()append()range()keys()has()read_file()write_file()append_file()
Example:
items = []
items = append(items, "compiler")
items = append(items, "debugger")
print(len(items))
print(items[0])
print(items[1])
stats = {
"runs": 1,
"language": "Nearoh"
}
print(has(stats, "runs"))
print(keys(stats))Nearoh supports basic file reading, writing, and appending through native builtins.
write_file("nearoh_file_test.txt", "Hello")
append_file("nearoh_file_test.txt", " Nearoh")
text = read_file("nearoh_file_test.txt")
print(text)Expected output:
Hello Nearoh
This is an important step toward Nearoh becoming a practical scripting language instead of a single-file interpreter demo.
Nearoh now has a tracked import system for multi-file programs.
Example:
import "utils.nr"
say_hello("Reece")
print(favorite)Example imported file:
def say_hello(name):
print("Hello", name)
favorite = "Nearoh"Current import behavior:
- Reads another
.nrfile - Lexes it
- Parses it into an AST
- Annotates the imported AST with its source file path
- Executes it in the current runtime environment
- Tracks imported files in the runtime
- Skips duplicate imports
- Detects circular imports
- Normalizes path separators
- Supports leading
./path normalization - Resolves relative imports from the file doing the importing
- Falls back to working-directory-style paths for older examples
- Reports failed imports with the attempted path
Example missing import error:
Runtime error at examples/modules/missing_main.nr line 1 col 1: Could not read imported file: examples/modules/missing_utils.nr
Example imported-file runtime error:
Runtime error at examples/modules/bad_utils.nr line 1 col 7: Undefined variable.
This means Nearoh can now point to the correct imported source file when runtime errors happen across multi-file programs.
Namespaces and true module objects are still future work, but the current import system is now a real foundation instead of a one-off include-style loader.
nearoh examples/hello.nr
nearoh --tokens examples/hello.nr
nearoh --ast examples/hello.nr
nearoh --debug examples/hello.nr- Run -> executes the program normally
- --tokens -> prints lexer output
- --ast -> prints parsed AST
- --debug -> prints source, tokens, AST, diagnostics, then execution
Nearoh includes a PowerShell regression test runner:
.\run_tests.ps1The runner checks both successful programs and expected-failure programs.
Pass tests must exit successfully.
Expected-failure tests must fail and include specific expected error text.
Currently tested behavior includes:
- Basic program execution
- Functions
- Classes
- Dictionaries
- Import-once behavior
- Path normalization
- File-relative imports
- Nested imports
- Core stress behavior
- Arena showcase behavior
- Circular import failure
- Runtime errors inside imported files
- Missing import path diagnostics
Expected ending:
ALL TESTS PASSED
This gives Nearoh a safety net before adding larger systems like namespaces, more builtins, standard library utilities, or the future IDE.
The repository includes runnable examples such as:
examples/hello.nrexamples/variables.nrexamples/functions.nrexamples/classes.nrexamples/lists.nrexamples/loops.nrexamples/objects_and_lists.nrexamples/dictionaries.nrexamples/arena_showcase.nrexamples/core_stress.nrexamples/builtins.nrexamples/file_io.nrexamples/import_once_main.nrexamples/import_path_normalize_main.nrexamples/import_cycle_a.nrexamples/import_cycle_b.nrexamples/modules/main.nrexamples/modules/main_nested.nrexamples/modules/bad_main.nrexamples/modules/missing_main.nr
class Vector2():
def __init__(self, x, y):
self.x = x
self.y = y
points = [Vector2(1, 2), Vector2(3, 4)]
for p in points:
print(p.x)
print(p.y)
items = [10, 20, 30]
items[1] = 99
print(items[1])
print(len(items))
print(len("Nearoh"))Expected output:
1
2
3
4
99
3
6
core_stress.nr is a larger regression-style example that proves several language systems work together.
It tests:
- Classes
- Constructors
- Instance fields
- Methods
- Bound
self - Lists
- Dictionaries
- List mutation
- Dictionary mutation
- Functions
- If / else logic
- For loops
- While loops
- Builtins
- Object state changes
Example pattern:
class Player():
def __init__(self, name, hp):
self.name = name
self.hp = hp
self.inventory = []
def add_item(self, item):
self.inventory = append(self.inventory, item)
stats = {
"runs": 1,
"language": "Nearoh"
}
stats["runs"] = stats["runs"] + 1This test helps verify that multiple runtime systems continue working together as the language grows.
arena_showcase.nr is a larger demonstration proving Nearoh can coordinate multiple systems together.
It uses:
- Classes
- Lists of objects
- Constructors
- Object state mutation
- Functions
- Conditional logic
- While loops
- For loops
- Runtime score tracking
- Multi-round battle simulation logic
This moves Nearoh beyond syntax demos into real executable projects.
Recent cleanup and stabilization work included:
- Cleaner
main.cCLI architecture - Improved parser structure and error handling
- AST cleanup and memory handling fixes
- Source-path annotation for AST nodes
- Value / list / dictionary system improvements
- Environment system cleanup
- Better runtime diagnostics with source file, line, and column
- Runtime import tracking
- Duplicate import skipping
- Circular import detection
- Import path normalization
- File-relative import resolution
- Missing import errors that show the attempted path
- Safer project-wide organization
- Fixed instance member container index assignment
- Fixed dictionary mutation persistence
- Added expanded utility builtins
- Added string/number conversion builtins
- Added basic file I/O
- Added regression-style example programs
- Added expected-failure tests
- Added
run_tests.ps1
Nearoh now has a stronger foundation for future growth.
Many hobby language projects stop at parsing expressions.
Nearoh already includes real runtime behavior:
- Executable programs
- User-defined functions
- Object-oriented systems
- Dynamic lists
- Dictionaries
- Scope handling
- Builtins
- File I/O
- Imports
- Multi-file execution
- Source-aware diagnostics
- Structured examples
- Command-line tooling
- Debugging modes
- Regression tests
That means the project is moving into genuine language engineering territory.
Nearoh is still early, but it is already capable of running meaningful programs across multiple interacting systems.
- Continue improving diagnostics and error UX
- Add more runtime safety checks
- Improve builtin error behavior
- Add more standard-library utilities
- Clean up import memory ownership further
- Begin designing module namespaces / module objects
- Expand regression tests
- Add more example programs
- Namespaced modules
- Expanded builtins
- Better performance paths
- Improved memory systems
- More complete standard library
- File and path utilities
- Tooling improvements
- Cleaner automated test workflow
- Minimal editor / IDE shell
- Native graphics / window bridge
- Input / timing systems
- Larger standard library built in Nearoh
- Bytecode VM or compiled backend research
- Dedicated Nearoh editor / IDE
- Possible self-hosted growth path
Nearoh is being built carefully and intentionally.
The goal is not to copy Python line-for-line. The goal is to preserve what makes Python productive while gaining deeper ownership of the machine underneath it.
Readable high-level development on top. Low-level power underneath.
Nearoh code because it lets you be near the code.
Built by Reece Gilbert.
ChatGPT was used as a coding assistant during planning, debugging, documentation, and implementation work. The project direction, repository, testing, integration, and final design decisions are owned by Reece Gilbert.
This project reflects years of programming curiosity, systems experimentation, graphics work, simulation building, and the drive to create something real from scratch.
Nearoh is early, active, and growing quickly.
The current stage is centered on strengthening the runtime, improving imports, expanding diagnostics, growing the builtin layer, adding regression tests, and preparing the project for more serious tooling and editor work.
Every milestone is focused on turning Nearoh into a real usable language rather than a superficial prototype.