Skip to content

Conversation

@SurfingBowser
Copy link
Contributor

1 comment not present in changes

in functions.md

As we have already done in the Hello World chapter, the minimal Inference program is a function.

Could the word minimal be replaced with "smallest" or "the most minimal"?

@0xGeorgii
Copy link
Contributor

0xGeorgii commented Dec 22, 2025

Could the word minimal be replaced with "smallest" or "the most minimal"?

With "smallest," yes.

Installation Windows

Can you please try to run infc and remember the additional libraries you installed so it works?

To validate the installation, you can use the "Hello World" tutorial.

Also, I copied the structure almost completely from the Rust book, so probably mentioning this is a good thing to do

@SurfingBowser
Copy link
Contributor Author

Okay I got it to run!
I wanted to add only each required .dll without installing full packages to make sure it runs without additional requirements.

.dll that were required:

libffi-8
libgcc_s_seh-1
libstdc++-6
libwinpthread-1
libzstd
zlib1

after adding each .dll to infc\dist the infc.exe launched without errors but the cmd window would close instantly.
Mitigated by opening cmd first and launching infc.exe
Resulted in:

  <PATH>

Usage: infc.exe <PATH>

For more information, try '--help'.```
  
  
  
Ran infc.exe --help

```The 'infc' command runs one or more compilation phases over a single .inf source file. Parse builds the typed AST; analyze performs semantic/type inference; codegen emits WASM and can translate to V when -o is supplied.

Usage: infc.exe [OPTIONS] <PATH>

Arguments:
  <PATH>


Options:
      --parse


      --analyze


      --codegen


  -o


  -v


  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

infc.exe -V,
inference-cli 0.0.1

@SurfingBowser
Copy link
Contributor Author

SurfingBowser commented Dec 22, 2025

will try the hello world tutorial now. Was updating progress first

Seems I'm stuck on step trying to create .wasm file

To compile an .inf file into an executable binary, we use the Inference compiler, which is invoked via the command line using the infc command. Open your terminal, navigate to the directory where you saved hello_world.inf, and run the following command:

On Windows:

> infc hello_world.inf

As a result, the compiler will generate a Wasm binary module named hello_world.wasm in the same directory.

When running

> infc hello_world.inf

it just opens the .inf in notepad.

infc hello_world.inf

Access is denied

Even if ran as admin is same result

2025_12_22_16-04__uHH
infc.exe hello_world.inf

Anything I am doing wrong or should change @0xGeorgii ?

@0xGeorgii
Copy link
Contributor

  1. did you add infc into PATH ?
  2. as infc --help suggests, try to use -o key

@SurfingBowser
Copy link
Contributor Author

  1. yes
  2. still access denied. but might be using wrong

I can't even run the help command anymore... access denied.
Let's try tomorrow together in office.

@0xGeorgii
Copy link
Contributor

try to inf.exe instead of PATH

@0xGeorgii
Copy link
Contributor

comments section added here: 4e16e1d

@SurfingBowser
Copy link
Contributor Author

Seems to be the steps taken for acquiring dll files manually for windows infc version @0xGeorgii

To help you document or replicate this testing scenario, here is the reconstructed chronological order of the steps taken, the logic used, and the methods employed to acquire each specific library.


Phase 1: Identifying the Source

The initial goal was to resolve dependencies for a software compiled using the GCC/MinGW-w64 toolchain. We chose the UCRT (Universal C Runtime) flavor, which is the modern standard for Windows 10/11.

1. libwinpthread-1.dll

  • Method: Manual Extraction from WinLibs.

  • Source: WinLibs.com (Standalone ZIP).

  • Step taken: Downloaded the WinLibs ZIP, navigated to the mingw64/bin folder, and copied the DLL into the application directory.

  • Logic: This is the POSIX threads library for Windows. It is almost always the first dependency required by MinGW-compiled binaries.

2. libffi-8.dll

  • Method: Package Management via MSYS2.

  • Source: MSYS2 UCRT64 Repository.

  • Step taken: After finding it missing from the initial WinLibs download, we shifted to MSYS2.

    • Command: pacman -S mingw-w64-ucrt-x86_64-libffi

    • Location: Extracted from C:\msys64\ucrt64\bin\.

  • Logic: Foreign Function Interface library. It allows different programming languages to communicate.

3. libzstd.dll & libgcc_s_seh-1.dll

  • Method: Package Management via MSYS2.

  • Step taken: Installed both packages simultaneously to satisfy the compression and runtime requirements.

    • Command: pacman -S mingw-w64-ucrt-x86_64-gcc-libs mingw-w64-ucrt-x86_64-zstd

    • Location: Copied from C:\msys64\ucrt64\bin\.

  • Logic: libzstd handles Zstandard compression; libgcc_s_seh-1 is the core GCC runtime for 64-bit exception handling.

4. zlib1.dll

  • Method: Package Management via MSYS2.

  • Step taken: This was the final missing link identified by the launch error.

    • Command: pacman -S mingw-w64-ucrt-x86_64-zlib

    • Location: Copied from C:\msys64\ucrt64\bin\.

  • Logic: A universal compression library required by a vast majority of Windows software.


Phase 2: Analysis & Execution Steps

Once all files were physically present in the application folder, we transitioned from installation to execution analysis.

1. Environment Variables Check

  • Action: Attempted to add the software directory to the System PATH.

  • Command: $env:Path += ";C:\path\to\folder" (PowerShell).

  • Result: Verified that while PATH is useful, placing DLLs in the local folder is more reliable for isolated testing.

2. Capturing the "Silent" Exit

  • Issue: The program opened and closed instantly.

  • Action: Switched from double-clicking the UI to launching via CMD.

  • Step taken: 1. Opened CMD.

    2. Navigated to the folder.

    3. Ran the .exe directly.

  • Result: Revealed that the software was not crashing, but was waiting for a required command-line argument (<PATH>).


Summary Table for Replication

Order | DLL File | Source Package (MSYS2) | Purpose -- | -- | -- | -- 1 | libwinpthread-1.dll | mingw-w64-ucrt-x86_64-libwinpthread | Threading Support 2 | libffi-8.dll | mingw-w64-ucrt-x86_64-libffi | Language Interoperability 3 | libgcc_s_seh-1.dll | mingw-w64-ucrt-x86_64-gcc-libs | GCC Runtime 4 | libzstd.dll | mingw-w64-ucrt-x86_64-zstd | Zstd Compression 5 | zlib1.dll | mingw-w64-ucrt-x86_64-zlib | Data Compression

Would you like me to generate a simple .bat script that checks for the presence of these files in a folder to automate this verification in the future?

To help you document or replicate this testing scenario, here is the reconstructed chronological order of the steps taken, the logic used, and the methods employed to acquire each specific library.

Phase 1: Identifying the Source

The initial goal was to resolve dependencies for a software compiled using the GCC/MinGW-w64 toolchain. We chose the UCRT (Universal C Runtime) flavor, which is the modern standard for Windows 10/11.

1. libwinpthread-1.dll

  • Method: Manual Extraction from WinLibs.
  • Source: [WinLibs.com](https://winlibs.com/) (Standalone ZIP).
  • Step taken: Downloaded the WinLibs ZIP, navigated to the mingw64/bin folder, and copied the DLL into the application directory.
  • Logic: This is the POSIX threads library for Windows. It is almost always the first dependency required by MinGW-compiled binaries.

2. libffi-8.dll

  • Method: Package Management via MSYS2.

  • Source: MSYS2 UCRT64 Repository.

  • Step taken: After finding it missing from the initial WinLibs download, we shifted to MSYS2.

  • Command: pacman -S mingw-w64-ucrt-x86_64-libffi

  • Location: Extracted from C:\msys64\ucrt64\bin\.

  • Logic: Foreign Function Interface library. It allows different programming languages to communicate.

3. libzstd.dll & libgcc_s_seh-1.dll

  • Method: Package Management via MSYS2.

  • Step taken: Installed both packages simultaneously to satisfy the compression and runtime requirements.

  • Command: pacman -S mingw-w64-ucrt-x86_64-gcc-libs mingw-w64-ucrt-x86_64-zstd

  • Location: Copied from C:\msys64\ucrt64\bin\.

  • Logic: libzstd handles Zstandard compression; libgcc_s_seh-1 is the core GCC runtime for 64-bit exception handling.

4. zlib1.dll

  • Method: Package Management via MSYS2.

  • Step taken: This was the final missing link identified by the launch error.

  • Command: pacman -S mingw-w64-ucrt-x86_64-zlib

  • Location: Copied from C:\msys64\ucrt64\bin\.

  • Logic: A universal compression library required by a vast majority of Windows software.


Phase 2: Analysis & Execution Steps

Once all files were physically present in the application folder, we transitioned from installation to execution analysis.

1. Environment Variables Check

  • Action: Attempted to add the software directory to the System PATH.
  • Command: $env:Path += ";C:\path\to\folder" (PowerShell).
  • Result: Verified that while PATH is useful, placing DLLs in the local folder is more reliable for isolated testing.

2. Capturing the "Silent" Exit

  • Issue: The program opened and closed instantly.
  • Action: Switched from double-clicking the UI to launching via CMD.
  • Step taken: 1. Opened CMD.
  1. Navigated to the folder.
  2. Ran the .exe directly.
  • Result: Revealed that the software was not crashing, but was waiting for a required command-line argument (<PATH>).

Summary Table for Replication

Order DLL File Source Package (MSYS2) Purpose
1 libwinpthread-1.dll mingw-w64-ucrt-x86_64-libwinpthread Threading Support
2 libffi-8.dll mingw-w64-ucrt-x86_64-libffi Language Interoperability
3 libgcc_s_seh-1.dll mingw-w64-ucrt-x86_64-gcc-libs GCC Runtime
4 libzstd.dll mingw-w64-ucrt-x86_64-zstd Zstd Compression
5 zlib1.dll mingw-w64-ucrt-x86_64-zlib Data Compression

Would you like me to generate a simple .bat script that checks for the presence of these files in a folder to automate this verification in the future?

@0xGeorgii
Copy link
Contributor

0xGeorgii commented Dec 26, 2025

Would you like me to generate a simple .bat script that checks for the presence of these files in a folder to automate this verification in the future?

yes, please but powershell

@SurfingBowser
Copy link
Contributor Author

Here you go. "I" have generated a powershell script

I tested it on my machine. Works. Added a pause command to see the result.
image

After removing a file temporarily it also noticed.

image

To help you automate the verification of these specific files in the future, I have created a PowerShell script. This script checks for the presence of the 5 DLLs we identified and verifies if the application is accessible in the current directory.

PowerShell Verification Script

You can save this code as a .ps1 file (e.g., check_deps.ps1) or simply paste it into a PowerShell window inside your software folder.

$requiredDlls = @(
    "libwinpthread-1.dll",
    "libffi-8.dll",
    "libgcc_s_seh-1.dll",
    "libzstd.dll",
    "zlib1.dll"
)

$missingCount = 0
Write-Host "`n--- Dependency Check Starting ---" -ForegroundColor Cyan

# Check for each DLL in the current directory
foreach ($dll in $requiredDlls) {
    if (Test-Path ".\$dll") {
        Write-Host "[FOUND]    $dll" -ForegroundColor Green
    } else {
        Write-Host "[MISSING]  $dll" -ForegroundColor Red
        $missingCount++
    }
}

Write-Host "---------------------------------" -ForegroundColor Cyan

# Summary Logic
if ($missingCount -eq 0) {
    Write-Host "SUCCESS: All identified dependencies are present." -ForegroundColor Green
    Write-Host "Ready to run: .\your_app.exe <PATH>" -ForegroundColor Yellow
} else {
    Write-Host "FAILURE: $missingCount files are missing." -ForegroundColor Red
}

# --- This section prevents the window from closing ---
Write-Host "`nExecution finished. Press Enter to close this window..." -ForegroundColor White
Read-Host
# ----------------------------------------------------

How to Use This Script

  1. Place the script in the same folder as your .exe.
  2. Right-click the script and select Run with PowerShell.
  3. If you get an execution policy error, run this command in your PowerShell terminal first to allow the script to run:
    Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

Final Reconstructed Workflow (PowerShell Edition)

For your records, here is the command-line path we took to acquire these files, translated entirely into PowerShell-friendly steps:

  1. Initialize MSYS2 Environment:
    Open the MSYS2 UCRT64 terminal (essential for ensuring the DLLs match the 64-bit SEH architecture).
  2. Bulk Acquisition Command:
    Instead of individual steps, you can now acquire all of them at once with:
    pacman -S --needed mingw-w64-ucrt-x86_64-libwinpthread mingw-w64-ucrt-x86_64-libffi mingw-w64-ucrt-x86_64-gcc-libs mingw-w64-ucrt-x86_64-zstd mingw-w64-ucrt-x86_64-zlib
  3. Deployment via PowerShell:
    From a PowerShell window, you can copy them all to your project folder instantly:
$msysPath = "C:\msys64\ucrt64\bin"
$files = "libwinpthread-1.dll", "libffi-8.dll", "libgcc_s_seh-1.dll", "libzstd.dll", "zlib1.dll"
foreach ($f in $files) { Copy-Item "$msysPath\$f" -Destination "." }
  1. Final Execution:
    Run the program with the required argument:
    .\your_program.exe "C:\path\to\your\input_file"

SurfingBowser added a commit that referenced this pull request Dec 29, 2025
@0xGeorgii 0xGeorgii deleted the edit-suggestions branch December 29, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants