PD# Language Support, Compiler & Academy (v0.2.3)
Official Visual Studio Code extension for PD# (PD Sharp), the modern, lightweight native programming language featuring first-class Win32 desktop GUI, real-time 2D/3D graphics, process/file automation, and standalone native binary compilation.
🌟 Highlights & Features
⚡ 100% Self-Contained — Zero Setup:
- The interpreter (
pdsharp.exe) and compiler (pdcomp.exe) are built directly into the extension.
- No manual binary configuration, SDK installations, or workspace setup required. Simply write
.pd scripts and press F5!
🎓 Interactive PD# Academy:
- Press
Ctrl+F1 or click 🎓 PD# Academy in the status bar at any time to open the built-in learning hub.
- Interactive modules with one-click "Open in Editor", "Run Script", and "Compile to EXE" actions.
- Complete project showcases including Notepad PD# Dark Edition, Native Win32 Calculator, 3D Pong, and Meteor Defense 3D.
- Searchable syntax and API Cheat Sheets.
🎨 Full Syntax Highlighting & Grammar (v0.2.3):
- Directives & Menu Bars:
#link, #Win, #Menu, menu, item, separator, #include, #define
- Theming & Window Types:
Gen, Graphics, Text, Notice, Confirm, Filedialog, winops = dark, borderless, rounded, cr
- Subroutines & Jumps:
gosub, return, goto, call
- Handles & Labels:
:handle: and ::label::
- UI Controls & Resizing:
button, textbox, label, checkbox, onclick, dimen, winops, trapclose, trapresize
- Control Styling & Mutators:
set_bg(), set_color(), set_bounds(), win_width(), win_height(), get_text(), set_text(), append_text(), get_check(), set_check()
- Editor & Clipboard Helpers:
get_caret_pos(), set_caret_pos(), get_line_count(), clipboard_get(), clipboard_set()
- Canvas Input Stream & Cursors:
get_char_input(), mouse_wheel(), set_cursor(), capture_mouse, hide_cursor
- 2D Canvas & 3D Graphics:
draw_rect, draw_round_rect, draw_circle, draw_line, draw_text, camera3d, draw_solid_box3d, draw_solid_cube3d, draw_sphere3d, flush3d
- System & File I/O:
file_read(), file_write(), file_append(), file_exists(), file_open_dialog(), file_save_dialog(), spawn(), exec_output()
- Control Flow:
if...then...elseif...else...endif, while...endwhile, for...to...step...endfor, repeat...until
🚀 Instant Execution & Native Compilation:
F5 or ▶ Run PD#: Runs the active script directly in the interpreter.
Ctrl+Shift+B or ⚙ Compile .EXE: Compiles the script into a standalone native Windows .exe binary via PDCOMP with pre-compilation AST validation.
🚀 Quick Examples
#Win "Notepad PD# - Dark Edition" for Gen as :mainWin: = {
dimen = 800, 600
winops = dark
};
#Menu :mainWin: {
menu "File" {
item "New" onclick ::on_new::
item "Open..." onclick ::on_open::
item "Save..." onclick ::on_save::
separator
item "Exit" onclick ::on_exit::
}
menu "Edit" {
item "Clear" onclick ::on_clear::
item "Word Count" onclick ::on_stats::
}
}
textbox :mainWin: "Welcome to Notepad PD#!" as :txtEditor: at 10, 10, 765, 520
# Style editor with dark colors
set_bg(:txtEditor:, "#1e1e2e")
set_color(:txtEditor:, "#f8f8f2")
# Set up dynamic layout resizing
print :mainWin: { trapresize ::on_resize:: }
print :mainWin: { trapclose ::on_exit:: }
hold
::on_resize::
w = win_width(:mainWin:)
h = win_height(:mainWin:)
set_bounds(:txtEditor:, 10, 10, w - 20, h - 20)
return
::on_new::
set_text(:txtEditor:, "")
return
::on_open::
path = file_open_dialog("Text Files (*.txt)|*.txt|PD# Files (*.pd)|*.pd|All Files (*.*)|*.*")
if path != "" then
set_text(:txtEditor:, file_read(path))
endif
return
::on_save::
path = file_save_dialog("Text Files (*.txt)|*.txt|PD# Files (*.pd)|*.pd|All Files (*.*)|*.*")
if path != "" then
file_write(path, get_text(:txtEditor:))
endif
return
::on_clear::
set_text(:txtEditor:, "")
return
::on_stats::
content = get_text(:txtEditor:)
print "Length: " + str_len(content) + " chars | Lines: " + get_line_count(:txtEditor:)
return
::on_exit::
kill :mainWin:
end
2. Real-Time 3D Rotating Scene
#Win "3D World" for Graphics as :gWin: = { dimen = 800, 600 winops = cr }
rot = 0.0
running = 1
while running then
print :gWin: { clear "black" }
print :gWin: { camera3d 0, -20, 600, 450 }
print :gWin: { draw_solid_cube3d 0, 0, 0, 100, rot, rot * 0.7, 0, "cyan", 1.0 }
print :gWin: { draw_text 20, 20, "PD# 3D Depth-Sorted Engine", "white" }
pump
sleep 16
rot = rot + 0.03
if key("ESC") then
running = 0
endif
endwhile
kill :gWin:
end
⌨️ Shortcuts & Commands
| Action |
Shortcut |
Command |
| Open PD# Academy |
Ctrl+F1 |
PD#: Open PD# Academy |
| Run Script (Interpreted) |
F5 |
PD#: Run Script (Interpreted) |
| Compile to Standalone .EXE |
Ctrl+Shift+B |
PD#: Compile to Standalone .EXE |
🛠️ System Requirements
- Windows 10 / 11 (x64 / x86).
- MinGW-w64 G++ (only required if compiling native
.exe binaries with PDCOMP).
- The
pdsharp.exe interpreter runs standalone out-of-the-box without any compilers or prerequisites.
📄 License & Publisher
MIT License © 2026 PDDEVELOPMENT.
| |