Skip to main content

A modern programming language with Spring Boot-style application framework and automatic database table creation

Project description

NovaLang 🚀 - Programming Language with Spring Boot-Style API Templates

PyPI version Python Support License: MIT Downloads

NovaLang is an experimental programming language with Spring Boot-style syntax and annotations. It focuses on rapid backend API development with familiar Java/Spring Boot patterns.

🎉 NEW in v2.2.5: Clean API Templates

  • Clean API Templates: Minimal Spring Boot-style server foundation
  • Spring Boot-Style Annotations: @Service, @RestController, @Entity support
  • Simple Project Structure: ApplicationConfig + HealthController base
  • IntelliJ Support: IDE recognition for .nova files
  • CLI Tool: Project generation and basic tooling

🌟 Current Features

What Actually Works

  • Project Templates: Generate Spring Boot-style API projects
  • CLI Tool: Create, build, and run NovaLang projects
  • Annotation System: Database and REST annotations (@Entity, @Table, @Column, @RestController)
  • SQL Schema Generation: Auto-generate CREATE TABLE statements from annotations
  • Lexer: Tokenize NovaLang source code
  • Basic Interpreter: Execute simple NovaLang programs

🚧 In Development

  • Full Parser: Complete AST generation (partial implementation)
  • Type System: Static type checking and inference
  • Runtime: Variable scoping, function execution, class instantiation
  • Database Connectivity: Actual connection to databases (currently only generates SQL)
  • Multi-target Compilation: Compile to Java, TypeScript, Python

📋 Development Tools

  • CLI Tool: Project lifecycle management (nova create, nova run)
  • Lexer: Full tokenization with 400+ token types
  • Annotation Processor: Parse and process database/REST annotations
  • Template System: Generate clean API project structures

🚀 Quick Start

Installation

# Install NovaLang
pip install novalang

Create Your First API Project

# Create a new API project with clean Spring Boot-style template
nova create my-backend --template api

# Navigate to project
cd my-backend

# Run the application
cd ..
python interpreter.py my-backend/src/main.nova

Example NovaLang Code

// Clean Spring Boot-style API
@Configuration
class ApplicationConfig {
    function getDatabaseConfig() {
        return {
            host: "localhost",
            port: 3306,
            database: "my_db"
        }
    }
}

@RestController
class HealthController {
    @GetMapping("/health")
    function health() {
        return {
            status: "UP",
            timestamp: new Date()
        }
    }
}

// Database Entity Example
@DatabaseEntity
@Table(name: "users")
class User {
    @PrimaryKey
    @AutoIncrement
    @Column(name: "id", type: "BIGINT")
    let id: number = 0
    
    @Column(name: "name", type: "VARCHAR", length: 50)
    let name: string = ""
}
@Document(collection: "products")
class Product {
    @Id
    private id: String
    
    @Field("name")
    @Indexed
    private name: String
    
    @Field("tags")
    private tags: List<String>
}

Graph Databases

@Neo4j
@Node("Person")
class Person {
    @Id
    private id: String
    
    @Property("name")
    private name: String
    
    @Relationship(type: "KNOWS", direction: "OUTGOING")
    private friends: List<Person>
}

Time Series Databases

@InfluxDB
@Measurement("sensor_data")
class SensorReading {
    @Time
    private timestamp: Instant
    
    @Tag("sensor_id")
    private sensorId: String
    
    @Field("temperature")
    private temperature: Double
}

Vector Databases (AI/ML)

</code></pre>
<h3>What Gets Generated</h3>
<p>When you create an API project, NovaLang generates:</p>
<ul>
<li><strong>ApplicationConfig</strong>: Configuration management class</li>
<li><strong>HealthController</strong>: Basic health check endpoints</li>
<li><strong>Main Application</strong>: Spring Boot-style entry point</li>
<li><strong>Project Structure</strong>: src/, tests/, dist/ folders</li>
</ul>
<p><strong>Note</strong>: NovaLang currently generates SQL schemas but does <strong>not</strong> automatically create or connect to databases. You need to manually set up your database and execute the generated SQL.</p>
<h2>🏗️ Architecture</h2>
<p>NovaLang current architecture:</p>
<pre><code>NovaLang
├── Lexer: Tokenization with 400+ token types
├── Parser: AST generation (partial implementation)  
├── Interpreter: Execute basic .nova programs
├── Annotation Processor: Parse @Entity, @Table, @Column annotations
├── SQL Generator: Create TABLE statements from annotations
└── CLI: Project creation and template generation

📊 How It Works

1. Write NovaLang Code with Annotations

@DatabaseEntity
@Table(name: "products")
class Product {
    @PrimaryKey
    @Column(name: "id", type: "BIGINT")
    let id: number = 0
    
    @Column(name: "name", type: "VARCHAR", length: 100)
    let name: string = ""
}

2. Run Through Interpreter

python interpreter.py your_file.nova

3. Get Generated SQL

CREATE TABLE products (
    id BIGINT PRIMARY KEY,
    name VARCHAR(100)
);

4. Manually Create Database

You must manually:

  • Install database (MySQL, PostgreSQL, etc.)
  • Create the database
  • Execute the generated SQL statements
  • Parallel Processing: Concurrent database operations
  • Memory Optimization: Zero-copy operations where possible

🧪 Testing

@Test
class UserServiceTest {
    @Mock
    private userRepository: UserRepository
    
    @InjectMocks  
    private userService: UserService
    
    @Test
    public testCreateUser() {
        // Given
        let user = User(email: "test@example.com")
        
        // When
        let result = userService.createUser(user)
        
        // Then
        assert result.isSuccess()
        assert result.get().id != null
    }
}

📚 Documentation

🤝 Contributing

Contributions welcome! NovaLang is an experimental project under active development.

Development Roadmap

  • Complete parser implementation
  • Full type system with type checking
  • Actual database connectivity (currently only generates SQL)
  • Multi-target compilation (Java, TypeScript, Python)
  • Runtime with proper scoping and execution
  • Comprehensive test suite
  • REPL/interactive mode
  • Package manager
  • Standard library

📄 License

NovaLang is released under the MIT License.

🎯 Project Status

NovaLang is an experimental programming language in early development:

  • Working: Project templates, SQL generation, basic interpreter, CLI tool
  • 🚧 In Progress: Full parser, type system, runtime execution
  • 📋 Planned: Database connectivity, multi-target compilation, standard library

Current Use Case: Rapid API project scaffolding with Spring Boot-style patterns


Made with ❤️ by Martin Maboya

NovaLang - Experimental Spring Boot-Style Programming Language 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

novalang-3.0.23.tar.gz (107.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

novalang-3.0.23-py3-none-any.whl (113.0 kB view details)

Uploaded Python 3

File details

Details for the file novalang-3.0.23.tar.gz.

File metadata

  • Download URL: novalang-3.0.23.tar.gz
  • Upload date:
  • Size: 107.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for novalang-3.0.23.tar.gz
Algorithm Hash digest
SHA256 a62b20c5c9a90e0c23a8c0ded54bff5a2bbe5c30aa990cb588474dd90423690e
MD5 0dedb9fffed8b25e9d8758d5cdc25bd8
BLAKE2b-256 1f2f9417c8b231187dea1d95e62c3ae5c3aac597fb54a0d6397f6f813e58d2c2

See more details on using hashes here.

File details

Details for the file novalang-3.0.23-py3-none-any.whl.

File metadata

  • Download URL: novalang-3.0.23-py3-none-any.whl
  • Upload date:
  • Size: 113.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for novalang-3.0.23-py3-none-any.whl
Algorithm Hash digest
SHA256 33ddf4585234d4ab9ef46ebc5a14e454c677373fa9ec5eaf0df44074f2bf1dd2
MD5 3981d71f8789e47af841422b40c6f04d
BLAKE2b-256 faf8485cf7881bb7c4b63d8413c9f33c64aa0123abebfcc123fac3320783da74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page