โ Frequently Asked Questions - FluxSharp
Complete answers to common questions about FluxSharp.
Table of Contents
- Getting Started
- Language Features
- Compilation & Build
- Performance & Security
- Troubleshooting
- Community & Support
Getting Started
Q: What is FluxSharp?
A: FluxSharp is a modern, type-safe programming language designed for security, performance, and developer experience. It combines the power of languages like Rust and C# with a clear, intuitive syntax. Key Features:
๐ Security-first design
โก High performance (compiled to native code)
๐ฆ Modern syntax inspired by Rust and C#
๐ก๏ธ Automatic bounds checking
๐ Built-in async/await support
๐ Comprehensive documentation
Q: How do I get started with FluxSharp?
A: Follow these steps:
Clone/Download: Get the FluxSharp compiler
Build:
cd flux_compiler && cargo build --release
Create: Write your first program in a
.fsh
file
Compile: Run
./build.sh yourprogram.fsh
Learn: Read the Quick Start Guide
๐ Read:
docs/01-quickstart/README.md
Q: Can I use FluxSharp on my operating system?
A: Yes! FluxSharp supports:
โ Linux (primary platform)
โ Windows (via WSL or native compilation)
โ macOS (Intel and ARM)
โ Other Unix-like systems
Q: Is FluxSharp free?
A: Yes! FluxSharp is open source and free to use for any purpose.
Q: Do I need to install anything else?
A: You need:
Rust toolchain (to build the compiler)
A C/C++ compiler (backend compilation)
Standard development tools (git, make, etc.)
Full setup instructions are in the documentation.
Language Features
Q: What data types does FluxSharp support?
A: FluxSharp supports all common data types: Integers:
int
- 64-bit signed integer
uint
- 64-bit unsigned integer
long
- Longer integers
ulong
- Unsigned longer integers
byte
- 8-bit value
Floating Point:
float
- 32-bit (use
3.14f
syntax)
double
- 64-bit
Other:
string
- Text
bool
- true/false
Custom classes and structures
๐ Read:
docs/02-language/TYPES.md
Q: How do I declare variables in FluxSharp?
A: Use this syntax:
int age = 25;
string name = "Alice";
float pi = 3.14f;
bool active = true;
Variable types are required (no type inference for declarations). ๐ Read:
docs/02-language/VARIABLES.md
Q: What are the control flow structures?
A: FluxSharp supports: Conditionals:
if (condition) {
// ...
} else if (other_condition) {
// ...
} else {
// ...
}
Loops:
for (int i = 0; i < 10; i = i + 1) { }
while (condition) { }
do { } while (condition);
๐ Read:
docs/02-language/CONTROL_FLOW.md
Q: Can I define functions in FluxSharp?
A: Yes! Functions must be defined inside classes:
class Calculator {
public int add(int a, int b) {
return a + b;
}
}
Features:
Parameters with types
Return type (or void)
Visibility modifiers (public/private)
Optional default parameters
๐ Read:
docs/02-language/FUNCTIONS.md
Q: How do I create and use classes?
A: Classes are the main organizational unit:
class Person {
string name;
int age;
public void setName(string n) {
name = n;
}
}
// Usage
Person p = new Person();
p.setName("Alice");
Features:
Properties and methods
Constructors
Inheritance
Access modifiers
๐ Read:
docs/02-language/CLASSES.md
Q: Does FluxSharp support arrays?
A: Yes, with bounds checking (safety feature):
int[] numbers = new int[10];
numbers[0] = 42;
print(numbers[0]); // Output: 42
// Out of bounds access is caught!
numbers[100] = 1; // Error!
Features:
Multi-dimensional arrays
Automatic bounds checking
Array iteration
Dynamic sizing (limited)
๐ Read:
docs/02-language/ARRAYS.md
and
docs/02-language/BOUNDS_CHECKING.md
Q: How do I handle errors in FluxSharp?
A: Use try/catch blocks:
try {
// risky operation
} catch (Exception e) {
// handle error
print("Error: " + e);
} finally {
// cleanup
}
๐ Read:
docs/02-language/EXCEPTION_HANDLING.md
Q: Does FluxSharp support async/await?
A: Yes! Modern asynchronous programming:
public async void fetchData() {
try {
string data = await getRemoteData();
print(data);
} catch (Exception e) {
print("Failed: " + e);
}
}
Features:
async methods
await expressions
Error handling
Concurrent operations
๐ Read:
docs/03-advanced/ASYNC_AWAIT.md
and
docs/03-advanced/ASYNCAWAITIMPLEMENTATION.md
Compilation & Build
Q: How does the build process work?
A: FluxSharp compilation happens in stages:
Lexical Analysis - Parse the source code
Syntax Analysis - Build abstract syntax tree
Type Checking - Verify types and constraints
Code Generation - Generate intermediate representation
Compilation - Compile to native code
Linking - Link with standard library
๐ Read:
docs/04-compiler/BUILD_SYSTEM.md
Q: What does the
build.sh
script do?
A: It:
Compiles your FluxSharp code
Generates a C# intermediate representation
Compiles to native executables
Runs the program (if no errors)
./build.sh yourprogram.fsh
Q: What compiler errors might I see?
A: Common errors include:
Type Mismatch: Wrong type used
Undefined Variable: Using a variable not declared
Missing Return: Function missing return statement
Bounds Violation: Array access out of bounds
Syntax Error: Invalid syntax
๐ Read:
docs/04-compiler/COMPILER_ERRORS.md
and
docs/04-compiler/ERROR_GUIDE.md
Q: How do I fix compilation errors?
A: Step-by-step:
Read the error message carefully
Find the line number mentioned
Look up the error in the error guide
Apply the fix
Recompile
Tips:
Read compiler errors completely
Multiple errors often relate
Check recent changes first
๐ Read:
docs/04-compiler/ERROR_GUIDE.md
Q: Can I use external libraries?
A: Yes, through the import system:
import System.Collections;
import System.Linq;
๐ Read:
docs/03-advanced/CSHARPIMPORTSUPDATE.md
Performance & Security
Q: Is FluxSharp fast?
A: Yes! FluxSharp is compiled to native code, providing:
Performance comparable to C/C++
Fast startup times
Minimal memory overhead
Optimized machine code
Optimization Tips:
Compile in release mode
Avoid unnecessary allocations
Use appropriate data structures
Profile your code
๐ Read:
docs/05-reference/IMPLEMENTATION_SUMMARY.md
Q: How secure is FluxSharp?
A: Security is built-in: Features:
๐ Type-safe design
๐ก๏ธ Automatic bounds checking
๐ Memory safety
โ Input validation support
๐ No buffer overflows
๐ Read:
docs/02-language/ADVANCED_SECURITY.md
and
docs/05-reference/FLUXSHARPVSCSHARP.md
Q: What about buffer overflows?
A: FluxSharp prevents them automatically:
int[] arr = new int[10];
arr[15] = 42; // Error! Bounds checked at runtime
๐ Read:
docs/02-language/BOUNDS_CHECKING.md
Q: Is there bounds checking?
A: Yes! Automatic array bounds checking: Features:
Runtime bounds verification
Clear error messages
Zero overhead in trusted code paths
Optional compiler optimizations
๐ Read:
docs/02-language/BOUNDS_CHECKING.md
and
docs/02-language/BOUNDSCHECKINGIMPLEMENTATION.md
Troubleshooting
Q: My program compiles but doesn't run correctly
A: Debug by:
Add print statements to trace execution
Check variable values at key points
Verify logic step by step
Use simple test cases first
Example:
print("Debug: x = " + x);
print("Debug: entering function");
Q: I'm getting a "Main" class not found error
A: FluxSharp requires a Main class with a main() method:
class Main {
public void main() {
print("Hello!");
}
}
Q: Type checking errors are confusing
A: Tips:
Check variable declarations
Ensure function return types match
Verify parameter types in function calls
Use the type system intentionally
๐ Read:
docs/02-language/TYPES.md
Q: Arrays are giving bounds errors
A: Verify:
Array size is sufficient
Indices are within bounds
Off-by-one errors (0-indexed)
int[] arr = new int[5];
// Valid indices: 0, 1, 2, 3, 4
arr[4] = 100; // โ OK
arr[5] = 100; // โ Error!
Q: Async/await not working as expected
A: Ensure:
Methods are marked
async
Await is used for async operations
Error handling is in place
Methods return async-compatible types
๐ Read:
docs/03-advanced/ASYNCAWAITIMPLEMENTATION.md
Q: Performance is slow
A: Optimize by:
Profiling to find bottlenecks
Reducing object allocations
Using appropriate algorithms
Compiling in release mode
Checking bounds-checking overhead
๐ Read:
docs/05-reference/IMPLEMENTATION_SUMMARY.md
Q: I can't find a specific feature
A: Check:
Documentation index (
docs/INDEX.md
)
Quick navigation guide
Search by topic
Browse by category
๐ Read:
docs/INDEX.md
Community & Support
Q: Where can I get help?
A: Resources:
Documentation - Comprehensive guides
Error Guide - Compiler error explanations
Examples - Working code samples
Community - GitHub discussions
๐ Read:
docs/LEARNING_GUIDE.md
Q: How do I report bugs?
A: Steps:
Reproduce the issue
Write minimal example
Check if already reported
Open GitHub issue with:
Code that reproduces it
Expected vs actual behavior
Environment details
Q: Can I contribute?
A: Yes! Contributions welcome:
Code - Bug fixes, features
Documentation - Guides, examples
Testing - Find and report bugs
Community - Help others
๐ Read:
docs/CONTRIBUTING.md
Q: Is there a community forum?
A: Check:
GitHub Discussions
GitHub Issues
Community channels (if available)
Q: How do I stay updated?
A: Follow:
Release notes
Documentation updates
GitHub watch/star
Community announcements
More Resources
Official Documentation
๐ Quick Start
๐ Language Reference
๐ Advanced Topics
๐ง Compiler Guide
๐ Reference Materials
Learning Paths
๐ถ Beginner Guide
๐ Intermediate Guide
๐ Advanced Guide
Still have questions? Check the relevant documentation or reach out to the community! Last Updated: April 9, 2026 Status: Complete โ