Catalog · How the catalog works
funide
The Fun IDE: a Delphi/VCL desktop editor, debugger front-end, and TextMate grammar for the Fun programming language. Tooling for Funlang — syntax highlighting, projects, and build scripts, with the language core living in the fun repository.
- ★ 2 on GitHub
Anyone may press Interesting, signed in or not. It helps others find this project.
README
Funide
The funide IDE and editor tooling for the Fun programming language.
English (this file) · 简体中文
- Version: 9.0
- Website: https://funlang.org
- License: MIT (see LICENSE)
This repository holds only the IDE layer: the Delphi/VCL desktop editor and
the Fun TextMate grammar. The Fun language itself (interpreter, parser, runtime
library, regex) is not duplicated here; it is compiled from the neighbouring
fun project, which is released separately.
Contents
src/ide/— the IDE units: the main window and debugger glue (ide.pas/ide.dfm), the Fun/Regex/FD syntax highlighters (funsyntax.pas,regexsyntax.pas,fdsyntax.pas), and resources.src/prj/ide/— the Delphi project (funide.dpr,funide.res) and the Windows build scripts.syntaxes/fun.tmLanguage.yaml— the Fun TextMate grammar (scopeName: source.fun) used for syntax highlighting. It is derived from the Fun implementation's lexer (src/parse/bnf/lex.l), grammar (src/parse/bnf/yacc.y) and keyword table (src/parse/id.inc).
Repository layout
funide/
├── src/
│ ├── ide/ # IDE units (funide.exe)
│ └── prj/ide/ # funide.dpr + Windows build scripts
└── syntaxes/
└── fun.tmLanguage.yaml # Fun TextMate grammarRelationship to the fun project
funide does not contain a copy of the Fun language. funide.dpr and ide.pas
link directly against the fun sources:
funide.dprreferences the Fun regex engine with relative unit paths:ide in '..\..\ide\ide.pas' // this repository pcrd in '..\..\regex\pcre\pcrd.pas' // the `fun` project pcre in '..\..\regex\pcre\pcre.pas' // the `fun` projectide.pasuses the Fun units by name:uses fun, base, core, host, parse, pcre, ui, io;
Those relative paths and unit names resolve only when the IDE layer sits
inside the fun source tree. The build scripts therefore merge this
repository's src/ide and src/prj/ide into the fun checkout before
compiling:
funide/src/ide -> <FUN_ROOT>\src\ide
funide/src/prj/ide -> <FUN_ROOT>\src\prj\ideThe Fun units (src/core, src/lib, src/parse, src/regex, src/3rd,
src/utils) come from <FUN_ROOT> unchanged; the compiler unit search path
(-U) is filled from it. This keeps the Fun implementation in exactly one
place while the IDE stays in this repository.
Thus, at build time, the tree looks like:
<FUN_ROOT>/ # a checked-out `fun` project
├── src/
│ ├── core/ lib/ lib/ui/ parse/ regex/ regex/pcre/ utils/ 3rd/ # from `fun`
│ ├── ide/ # copied from funide/src/ide
│ └── prj/
│ ├── fun/ # from `fun`
│ └── ide/ # copied from funide/src/prj/ide
└── fun/ # distribution folder; funide.exe is written hereThe copied files appear as untracked files in the fun checkout. That is
expected; the IDE sources are maintained here, not there.
Building
funide.exe is a 32-bit Windows VCL application built with Delphi.
Prerequisites
| Item | Notes |
|---|---|
A fun checkout |
The language sources funide compiles against. Set FUN_ROOT to it. |
| Delphi 2006 or 2009 | DELPHI2006 / DELPHI2009 are used by make-2006.bat / make-2009.bat. The 2006 build is ANSI; the 2009 build is Unicode. |
| SynEdit | The editor component. Point SYNCEDIT at the folder containing SynEdit.inc and the SynEdit*.pas sources. |
| VirtualTrees | The tree view component. Point VST at the folder containing VirtualTrees.pas. |
| PCRE 8 (8-bit) | Required for the Fun regex engine. Build it as described in the fun project's README (src/regex/pcre/make.bat). |
SynEdit and VirtualTrees are third-party components and are not vendored here.
Toolchain configuration
All machine-specific paths live in one file,
src/prj/ide/setenv.bat, which mirrors
fun/src/prj/fun/setenv.bat. Edit it once, or pre-set the variables in your
shell:
| Variable | Meaning | Default |
|---|---|---|
FUN_ROOT |
Root of the fun checkout |
..\..\..\..\fun (a sibling of this repository) |
DELPHI2006 |
Delphi 2006 install root | D:\Borland\Delphi2006 |
DELPHI2009 |
Delphi 2009 install root | D:\Borland\Delphi2009 |
SYNCEDIT |
SynEdit source folder | D:\Delphi\SynEdit\Source |
VST |
VirtualTrees source folder | D:\Delphi\VirtualTreeviewV5.5.3\Source |
Every if not defined guard lets a value you set beforehand win.
Build steps
cd src\prj\ide
make-2009.bat # or: make-2006.batmake-2009.bat:
- loads the toolchain from
setenv.bat; - runs
sync-ide.batto copysrc/ideandsrc/prj/ideintoFUN_ROOT; - runs
dcc32 funide.dprwith the Fun unit search path and the IDE defines.
The resulting funide.exe is written to <FUN_ROOT>\fun, next to fun.exe.
Extra dcc32 switches are passed through, e.g. make-2009.bat -B.
| Target | Script | Toolchain |
|---|---|---|
| Windows 32-bit | src/prj/ide/make-2006.bat |
Delphi 2006 |
| Windows 32-bit | src/prj/ide/make-2009.bat |
Delphi 2009 |
The IDE is Windows/VCL only, so there is no Linux or Free Pascal target.
Syntax highlighting grammar
syntaxes/fun.tmLanguage.yaml is the upstream source that GitHub Linguist
vendors (as a git submodule) to provide syntax highlighting for .fun files:
vendor/grammars/funsubmodule points at this repositorygrammars.yml:vendor/grammars/fun: [source.fun]languages.yml: theFunentry'stm_scopeissource.fun
License
MIT. See LICENSE.

