Add Phel language#6282
Open
JesusValeraDev wants to merge 10 commits into
Open
Conversation
Chemaclass
approved these changes
Feb 10, 2023
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
previously requested changes
Feb 17, 2023
Member
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📚 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.