logo Dorpn v0.4.1 GitHub
Help

Frequently Asked Questions

Answers to common questions about installing, compiling, and debugging Dorpn programs.

📦 Installation & Releases

How do I install Dorpn?
Download the latest release binary for your OS from the Releases page. No compilation needed!
Is the source code available?
The compiler source will be released when Dorpn reaches v1.0 or becomes self-hosted. Currently, only compiled binaries are provided.
How do I update to a newer version?
Easiest way (v0.4.1+): run dorpn --upgrade. It fetches the latest release straight from the GitHub repository and replaces your existing install automatically. You can still download the release binary manually and replace your dorpn executable if you prefer.
Can I build from source?
Not currently. The compiler is closed-source until v1.0 to ensure stability and proper documentation.

✍️ Basic Usage

How do I compile my first program?
dorpn hello.dpn creates an executable. Use dorpn hello.dpn --run to compile and run immediately.
Can I specify a different output filename?
Not directly in v0.4.1. Workaround: dorpn input.dpn && mv input custom_name
How do I compile without executing?
Just omit the --run flag: dorpn program.dpn creates the executable only.
Can I see the generated C code?
Yes! Use dorpn program.dpn --keep-c to preserve the intermediate C file.
Is there a REPL or interactive mode?
Not yet. Use this one-liner: echo 'print("test")' > temp.dpn && dorpn temp.dpn -r && rm temp.dpn or VS Code with the Dorpn extension.

🐛 Common Errors & Solutions

"gcc: command not found" error
Install GCC. Ubuntu/Debian: sudo apt install gcc. macOS: xcode-select --install
"File not found" but the file exists
Check that: (1) the file extension is .dpn, (2) you're in the right directory, and (3) there are no typos in the filename.
"Permission denied" when running the executable
Make it executable: chmod +x program_name
Compilation fails with syntax error
Use verbose mode to pinpoint the issue: dorpn file.dpn --verbose. Since v0.4.1, common causes are a missing : at the end of a block header (if, elif, else, func, loop, keep) or inconsistent indentation — only 2 or 4 spaces per level are accepted. See the Changelog for details.
"Cannot assign to constant" error
You're trying to modify a Const variable. Use tag for mutable variables instead.
"Type mismatch" in assignment
Dorpn has strict static typing. Once tag x = 10 (Int) is declared, you can't do x = "text" later.

💡 Language Questions

What's the difference between tag and Const?
tag creates mutable variables; Const creates immutable constants (cannot be reassigned).
How do I convert between types?
Conversion is automatic in some cases (IntFloat in math, any type → String with +). Manual conversion functions are planned for future releases.
Are arrays/lists supported?
Basic list literals ([1,2,3]) and indexing are supported in v0.4.1.
Can I compile the same file to both C and JavaScript?
Yes — the same .dpn source file works with both backends. Compile without flags for a native binary, or add -js (or --Javs) for JavaScript output. Some features may only be available in the native C target for now. See the Quickstart's JavaScript Target section.
Can I use external C libraries?
Not in v0.4.1. C FFI (Foreign Function Interface) is planned for future releases.
How should I structure larger projects?
Currently single-file only. A module/import system is planned for future versions.

⚡ Performance & Debugging

My program is slow. How can I optimize?
(1) Avoid string concatenation in loops. (2) Use Int instead of Float when possible. (3) Use --keep-c to examine the generated C code.
How do I debug my Dorpn code?
(1) Add print() statements. (2) Use type() to check variable types. (3) Examine the generated C code with --keep-c. (4) Use --verbose for compilation insights.
What's the maximum file size Dorpn can handle with Onload()?
Limited by available system memory. For large files, streaming or chunked reading is being considered for future versions.
Still have questions?
Open an issue on the Dorpn GitHub repository — the project is under active development and feedback shapes the roadmap.