Add Phel language#6282
Conversation
Chemaclass
left a comment
There was a problem hiding this comment.
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 🧠💡
lildude
left a comment
There was a problem hiding this comment.
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.
d1fb008 to
ca7013f
Compare
ca7013f to
acc1601
Compare
70fec6c to
92773e4
Compare
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.
|
Quick adoption update since this PR was opened (Feb 2023): Core project (May 2026)
Ecosystem (official)
GitHub adoption signal
Happy to refresh grammar samples or provide any additional info. Thanks for considering! |
📚 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:
data-pipeline.phelfor [x :in xs]/:pairsbindings, threading macroshtml-rendering.phelphel.htmlinterfaces.pheldefinterface,defstruct, polymorphic dispatchmacro-playground.pheldefmacrowith quasiquote / unquote-splicingphp-integration.phelphp/->,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.clojurereuses the Clojure grammar intentionally — Phel's surface syntax is Clojure-compatible enough that Clojure highlighting gives a good baseline. A dedicatedsource.phelgrammar may follow once the language has its own TextMate bundle.📓 Checklist
samples/Phel/.source.clojure(see note above)..phelis unique to this language.