Code Examples
Explore HudHudScript examples in 23 languages. Click any flag to see the same code in that language!
Development Environment
Code execution runs on the server with basic security measures (timeout, resource limits). For production use, proper sandboxing (Docker, Firejail) is required.
Basic Example
A simple "Hello World" program showing variables and functions.
Functions
Function definitions, parameters, return values, and arrow functions.
Control Flow
Conditional statements and loops in HudHudScript.
Arrays
Working with arrays and data structures.
Objects
Working with objects and properties.
Modules
Import and use external modules like math, physics, and chemistry.
Code Organization
Real project structure with interactive file explorer. Click files to view, click "Make Package" to download.
Project: my-project
// Click a file in the explorer to view its content
// Try clicking on different files to see the code
"src/models/user.hudhud" User olarak kullan;
"src/services/auth.hudhud" Auth olarak kullan;
değişken user = User.create({
name: "Davut Süleyman",
email: "Davut@mysite.com"
});
değişken result = Auth.register(user);
yaz(result);
Full Example Code
Package System
Complete package management system: create, install, publish, and use packages with dependencies, versioning, and security features.
AI Agents
Creating and using AI agents with LLM providers.
Classes & OOP
Object-oriented programming with classes, inheritance, and access modifiers.
Async/Await
Asynchronous programming with promises and async functions.
Governance System
Constitutional AI with laws, councils, and rules.
Conditionals
If-else statements and conditional logic.
Loops
For loops, while loops, and iteration patterns.
Switch Statements
Pattern matching and switch-case statements.
Error Handling
Try-catch blocks and error management.
Return Values
Function return values and early returns.
Data Processing
Array methods, filtering, mapping, and data transformation.
Real-World: Customer Service Bot
A practical example of an AI-powered customer service chatbot.