FadeBasic.Lang.CommandSourceGenerator
0.0.64.1
dotnet add package FadeBasic.Lang.CommandSourceGenerator --version 0.0.64.1
NuGet\Install-Package FadeBasic.Lang.CommandSourceGenerator -Version 0.0.64.1
<PackageReference Include="FadeBasic.Lang.CommandSourceGenerator" Version="0.0.64.1" />
<PackageVersion Include="FadeBasic.Lang.CommandSourceGenerator" Version="0.0.64.1" />
<PackageReference Include="FadeBasic.Lang.CommandSourceGenerator" />
paket add FadeBasic.Lang.CommandSourceGenerator --version 0.0.64.1
#r "nuget: FadeBasic.Lang.CommandSourceGenerator, 0.0.64.1"
#:package FadeBasic.Lang.CommandSourceGenerator@0.0.64.1
#addin nuget:?package=FadeBasic.Lang.CommandSourceGenerator&version=0.0.64.1
#tool nuget:?package=FadeBasic.Lang.CommandSourceGenerator&version=0.0.64.1
<img src="https://github.com/cdhanna/fadebasic/blob/main/images/ghost_lee.png?raw=true" width="100" alt="The ghost of Lee">
Fade Basic
Fade's actually Dotnet embeddable
FOR n = 1 to 10
PRINT n
NEXT n
Fade Basic is a dialect of BASIC inspired by my personal love for Dark Basic Pro. My father downloaded Dark Basic sometime circa 2003 and showed a then-kid version of me how to program a FOR-LOOP. That moment sparked a life long obsession with programming and game development. I wanted to create something that kindled the same joy for programming that Dark Basic did all those years ago. I created Fade Basic for myself, to fuel my inner nostalgia for a bygone era of my own life. And I figured I'd share it, because I think it is cool.
Fade is a scripting language for dotnet. Fade code runs inside a dotnet process. It is debuggable. It does not use Reflection. The Fade code gets compiled into a custom byte-code, and then that byte-code is interpreted by a custom state machine. The language has almost no dependencies, which means it can run wherever dotnet can run. For now, I have been focusing on stand-alone applications that bootstrap a Fade script as their primary execution, but it is possible to embed Fade scripts into any dotnet compatible program, such as Godot, Unity, an ASP.NET Server, or a custom program.
This project is under active development and is only available in a preview-capacity.
Getting Started
Prerequisites
Before you can get started,
dotnet 8 SDK (or later) installed on your machine. Verify the installation by opening a terminal and checking the
dotnetversion,dotnet --versionDownload Visual Studio Code, because it is the only IDE I have added developer tooling for.
Install Fade Basic
- Download the templates package from nuget using the following command,
dotnet new install FadeBasic.Templates.Common - In Visual Studio Code, install the Fade Basic Extension.
Your first Fade program
Create a new folder and use
dotnetto create a new project from the templates you just installed.mkdir tunaFade cd tunaFade dotnet new fadebasic-project-console -n tunaFadeOpen Visual Studio Code to the folder containing your project,
code .You should see a few files, | filename | description | | -------- | ----------- | |
main.fbasic| This is where your program source code is! | |tunaFade.csproj| By default, this template creates a standalone dotnet console application, and this.csprojfile is the build configuration file for the console application. This file contains the version of Fade you are using. |Open the
main.fbasicfile, and you should see the following contents...remstart tunaProject main entry point remend print "hello world"Click on the run and debug tab in Visual Studio Code, and select the big blue Run and Debug button. You shouldn't need to specify any new launch configuration, because one should appear automatically. The
.vscode/launch.jsonfile should look like the following,{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "fadeBasicDebugger", "request": "launch", "name": "Fade Debug", "program": "${workspaceFolder}/${command:AskForProgramName}" } ] }Now, click the green play button to run the
Fade Debuglaunch configuration. You should see"hello world"appear in the Terminal tab of Visual Studio Code.Congratulations! You just ran your first Fade program!
Bonus: If you hover your mouse over the
printcommand, you should see a popup that provides a small amount of documentation for the command. Click the link that says,Full Documentation, and a web browser should open to alocalhostaddress showing a list of all available commands.
Run it as a script
So far, you've run the Fade program as something that appears to be a standalone program. However, Fade's actually Dotnet embeddable, so you can run the Fade script directly from existing C# code. For now, just read along.
You could create a brand new C# Console application and reference the Fade Nuget libraries. Then, inside that C# application, you could write some code like this,
var commands = new CommandCollection(
new ConsoleCommands(),
new StandardCommands()
);
var path = "/tunaFade/tunaFade.csproj";
Fade.TryFromProject(path, commands, out var ctx, out _);
ctx.Debug(); // run the Fade program in debug mode
The last line boots up the Fade code as a runtime script within the C# application. Back in Visual Studio Code, you can attach the debugger to the running script and inspect the program or modify the state.
Fade has almost no dependencies, so you could run this code from a more complex C# environment, like Unity...
Next Steps
Now that you have Fade running locally, you should check out the full language specification! Or learn how to debug your program? Maybe even create a custom command collection.
- Language Specification
- Project Structures
- The SDK
- Custom Commands
- Differences between Dark Basic and Fade
Contact and Help
Fade Basic is in active development. As such, I am sure there are many bugs I don't know about yet. If you find one of them, please tell me about it! Feel free to join the Discord, or post a Github Issue.
License
Fade Basic has many parts, and at the moment, all of them are MIT licensed. I plan on keeping the core language and tooling systems open sourced under the MIT license. However, at some point in the future, I reserve the right to release closed-source extensions or domain specific command collections.
Contributing
I welcome feedback, but at the moment, I am not expecting to accept contributions to the project. I have a vision for Fade, and I want to see that vision to completion. Thank you for your consideration.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- FadeBasic.Lang.Core (>= 0.0.64.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.64.1 | 94 | 4/28/2026 |
| 0.0.63.1 | 94 | 4/21/2026 |
| 0.0.62.1 | 95 | 4/19/2026 |
| 0.0.61.1 | 99 | 4/17/2026 |
| 0.0.60.1 | 100 | 4/4/2026 |
| 0.0.59.1 | 102 | 4/2/2026 |
| 0.0.58.1 | 100 | 3/25/2026 |
| 0.0.57.1 | 98 | 3/25/2026 |
| 0.0.56.1 | 98 | 3/25/2026 |
| 0.0.55.1 | 97 | 3/25/2026 |
| 0.0.54.1 | 96 | 3/24/2026 |
| 0.0.53.1 | 95 | 3/24/2026 |
| 0.0.52.1 | 92 | 3/23/2026 |
| 0.0.51.1 | 97 | 3/21/2026 |
| 0.0.50.1 | 101 | 3/7/2026 |
| 0.0.49.1 | 102 | 2/24/2026 |
| 0.0.48.1 | 101 | 2/24/2026 |
| 0.0.47.1 | 105 | 2/22/2026 |
| 0.0.46.1 | 192 | 11/26/2025 |
| 0.0.45.1 | 190 | 6/19/2025 |
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.0.64] - 2026-04-28
### Added
- Rider IDE Plugin Support
### Fixed
- Using `:` as statement separator no longer creates implicit label
- Debugger JSON transport code streams small byte payloads correctly
- `DebugSession` allows a host to disconnect and reconnect gracefully
## [0.0.63] - 2026-04-21
### Fixed
- commands with string ref parameters no longer allocate unless new string is written to parameter
## [0.0.62] - 2026-04-19
### Fixed
- xml docs that would fail to parse during doc generation will log warnings instead of failing the build
- ref commands work for `float` args
## [0.0.61] - 2026-04-16
### Added
- Fade.Build generates markdown file for command docs unless `<FadeDisableAutoDocs>` is set to true
### Fixed
- generated docs allow slashes
## [0.0.60] - 2026-04-03
### Added
- debug session supports dynamic restarts without losing connection to DAP
### Fixed
- launcher under debug no longer exits on first debug message
## [0.0.59] - 2026-04-01
### Fixed
- debugger shows hover values when looking at struct fields and array fields
- debugger statement eval shows output
## [0.0.58] - 2026-03-24
### Fixed
- debugger handles suspended vm correctly
- debugger sorts through tokens using binary search and dense `int` array
## [0.0.57] - 2026-03-24
### Fixed
- debugger suspends execution when a debug message is received
- debugger can re-pause at breakpoint
## [0.0.56] - 2026-03-24
### Changed
- `DebugSession` is mostly virtual, and can be overriden
## [0.0.55] - 2026-03-24
### Fixed
- debugger no longer uses infinite budget
## [0.0.54] - 2026-03-24
### Fixed
- completion handler shows correct casing for variables
- completion handler supports #constant values
## [0.0.53] - 2026-03-23
### Added
- debugger has repl
### Fixed
- debugger hover statements work for strings
- debugger issue when stepping over `return` statement
## [0.0.52] - 2026-03-23
### Fixed
- debugger hits breakpoints with instruction indexes mid-token
- debugger can modify last field
- debugger evals properly resize register buffers
## [0.0.51] - 2026-03-21
### Added
- LSP supports text completions
- LSP supports basic rename support
- LSP supports signature helper
### Fixed
- debugger program performance greatly improved
- type tokens appear highlighted in declaration statements
## [0.0.50] - 2026-03-06
### Fixed
- `not` appears highlighted as keyword instead of comment
- command help appears again in LSP
- load `.dll` files into memory before streaming, to avoid file locking
## [0.0.49] - 2026-02-24
### Fixed
- Build tasks copies files into shadow directory
## [0.0.48] - 2026-02-24
### Fixed
- able to use variable in `REPEAT` conditionals that was defined within the `REPEAT` block
## [0.0.47] - 2026-02-22
### Added
- `defer` functionality
- `#macro` functionality
### Fixed
- `gosub` and `goto` work inside functions
- memory ref-counts strings returned from commands
## [0.0.46] - 2025-11-25
### Fixed
- expressions can be multiline
## [0.0.45] - 2025-06-19
### Fixed
- `FadeSdk` errors use source maps to include file location in error messages
- Parser reports error when an object initializer includes non assignment statements
- Parser reports error when invalid-cast occurs in the variable assignment of for-loops
- Usage of global variables before they are declared reports a different error than simply an undefined symbol
### Added
- Simple array assignment
- `redim` keyword allows arrays to be resized
## [0.0.44] - 2025-06-05
### Fixed
- Debugger can open arrays of structs
## [0.0.43] - 2025-06-04
### Fixed
- String concatenation no longer causes virtual memory leak
- Debugger can receive large payloads
## [0.0.42] - 2025-05-29
### Added
- `FadeRuntimeContext` is now an `ILaunchable` implementation
- new `Fade.GetFadeFilesFromProject()` function allows user to find fade files in a csproj file
## [0.0.41] - 2025-05-20
### Fixed
- Object initializers can be used inside all program blocks
## [0.0.40] - 2025-05-08
### Fixed
- Constant values appear as macros in Language Server Protocol (LSP)
## [0.0.39] - 2025-04-27
### Fixed
- Object initializers can be used inside function blocks
## [0.0.38] - 2025-03-07
### Added
- The `default` keyword
- Object initializer pattern
## [0.0.37] - 2025-03-02
### Changed
- VM register max count increased from `byte` to `ulong`.
- VM heap max size increased from ~ 2^31 to ~ 2^64.
## [0.0.36] - 2025-02-26
### Fixed
- Debugger would emit exit event during partial budget runs.
- Debugger can render `byte` variables.
- Debugger can set non `int` and non `float` values.
- Debugger can discovery variables declared through `ref` commands, such as
`INC` or `INPUT`
- Commands with `ref` parameters can access globally scoped variables.
### Added
- `SKIP` keyword for skipping iterations of looping control structures.