Skip to content

Add Phel language#6282

Open
JesusValeraDev wants to merge 10 commits into
github-linguist:mainfrom
phel-lang:add-phel-language
Open

Add Phel language#6282
JesusValeraDev wants to merge 10 commits into
github-linguist:mainfrom
phel-lang:add-phel-language

Conversation

@JesusValeraDev
Copy link
Copy Markdown

@JesusValeraDev JesusValeraDev commented Feb 10, 2023

📚 Description

Phel is a functional Lisp dialect that compiles to PHP, drawing heavily from Clojure. This PR adds Phel language support to Linguist.

Ecosystem

Editor / tooling support

Samples

Five focused samples (191 lines total) mirroring Linguist's Clojure convention of short, feature-distinct snippets:

File Demonstrates
data-pipeline.phel for [x :in xs] / :pairs bindings, threading macros
html-rendering.phel Hiccup-style HTML DSL via phel.html
interfaces.phel definterface, defstruct, polymorphic dispatch
macro-playground.phel defmacro with quasiquote / unquote-splicing
php-integration.phel PHP interop (php/->, php/::, php/new, php/sprintf)

All samples are sourced verbatim from phel-lang/docs/examples/ and have been executed against the current Phel CLI (v0.36.0-beta) — each exits 0 and produces the expected output.

Syntax highlighting

tm_scope: source.clojure reuses the Clojure grammar intentionally — Phel's surface syntax is Clojure-compatible enough that Clojure highlighting gives a good baseline. A dedicated source.phel grammar may follow once the language has its own TextMate bundle.

📓 Checklist

@JesusValeraDev JesusValeraDev requested a review from a team as a code owner February 10, 2023 16:20
Copy link
Copy Markdown

@Chemaclass Chemaclass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea! Highlighting phel files using common lisp would be a great improvement, especially people will be able to understand the code easier when reading it directly from GitHub 🧠💡

Copy link
Copy Markdown
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Popularity is not sufficient for inclusion yet, but that doesn't mean you can't address the identified issues in the mean time.

See inline comment.

Please remove the core.phel file. It's massive and waaaay too big.

Please also remove the sample.phel file as this is clearly a "Hello world" sample and not a real-world example.

Comment thread lib/linguist/languages.yml Outdated
@lildude lildude dismissed their stale review July 10, 2024 08:59

Changed applied. Pending popularity now.

@JesusValeraDev JesusValeraDev requested a review from a team as a code owner September 23, 2025 11:07
Chemaclass and others added 5 commits May 12, 2026 11:39
Phel namespaces use '.' as separator, not PHP-style '\'. Sync samples
with canonical examples in phel-lang/docs/examples/.
…tures

Adds nine samples synced from phel-lang/docs/examples/: basic types,
arithmetic, control flow, functions and recursion, data structures,
interfaces, async/concurrency, CLI, and transducers. Improves Bayesian
classifier coverage and showcases idiomatic Phel.
Aligns Phel entry with peer Lisp dialects (Hy, Fennel, Janet) which
declare their CLI binary as an interpreter.
Mirrors Clojure's approach: short snippets each showing one distinct
feature. Drops primer-level overlap (basic-types, arithmetic, control-flow,
functions-recursion) and oversized samples (data-structures 232 lines,
transducers 387 lines, cli, async-concurrency). Keeps five samples
covering PHP interop, macros, hiccup DSL, for-comprehensions, and
structs/interfaces. 191 lines total across 5 files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants