โ“ Frequently Asked Questions - FluxSharp

Complete answers to common questions about FluxSharp.


Table of Contents

  1. Getting Started
  2. Language Features
  3. Compilation & Build
  4. Performance & Security
  5. Troubleshooting
  6. 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:

  1. Clone/Download: Get the FluxSharp compiler

  2. Build:

    cd flux_compiler && cargo build --release

  3. Create: Write your first program in a

    .fsh

    file

  4. Compile: Run

    ./build.sh yourprogram.fsh

  5. 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:

  1. Lexical Analysis - Parse the source code

  2. Syntax Analysis - Build abstract syntax tree

  3. Type Checking - Verify types and constraints

  4. Code Generation - Generate intermediate representation

  5. Compilation - Compile to native code

  6. Linking - Link with standard library

๐Ÿ“– Read:

docs/04-compiler/BUILD_SYSTEM.md

Q: What does the

build.sh

script do?

A: It:

  1. Compiles your FluxSharp code

  2. Generates a C# intermediate representation

  3. Compiles to native executables

  4. 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:

  1. Read the error message carefully

  2. Find the line number mentioned

  3. Look up the error in the error guide

  4. Apply the fix

  5. 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:

  1. Add print statements to trace execution

  2. Check variable values at key points

  3. Verify logic step by step

  4. 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:

  1. Check variable declarations

  2. Ensure function return types match

  3. Verify parameter types in function calls

  4. Use the type system intentionally

๐Ÿ“– Read:

docs/02-language/TYPES.md

Q: Arrays are giving bounds errors

A: Verify:

  1. Array size is sufficient

  2. Indices are within bounds

  3. 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:

  1. Methods are marked

    async

  2. Await is used for async operations

  3. Error handling is in place

  4. Methods return async-compatible types

๐Ÿ“– Read:

docs/03-advanced/ASYNCAWAITIMPLEMENTATION.md

Q: Performance is slow

A: Optimize by:

  1. Profiling to find bottlenecks

  2. Reducing object allocations

  3. Using appropriate algorithms

  4. Compiling in release mode

  5. Checking bounds-checking overhead

๐Ÿ“– Read:

docs/05-reference/IMPLEMENTATION_SUMMARY.md

Q: I can't find a specific feature

A: Check:

  1. Documentation index (

    docs/INDEX.md

    )

  2. Quick navigation guide

  3. Search by topic

  4. Browse by category

๐Ÿ“– Read:

docs/INDEX.md


Community & Support

Q: Where can I get help?

A: Resources:

  1. Documentation - Comprehensive guides

  2. Error Guide - Compiler error explanations

  3. Examples - Working code samples

  4. Community - GitHub discussions

๐Ÿ“– Read:

docs/LEARNING_GUIDE.md

Q: How do I report bugs?

A: Steps:

  1. Reproduce the issue

  2. Write minimal example

  3. Check if already reported

  4. Open GitHub issue with:

  • Code that reproduces it

  • Expected vs actual behavior

  • Environment details

Q: Can I contribute?

A: Yes! Contributions welcome:

  1. Code - Bug fixes, features

  2. Documentation - Guides, examples

  3. Testing - Find and report bugs

  4. 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

Learning Paths


Still have questions? Check the relevant documentation or reach out to the community! Last Updated: April 9, 2026 Status: Complete โœ