I'm very much in favor of interoperability and am happy to work in that 
direction. Does this imply that we need a #lang for each highlighting target? 
What happens if you want to highlight code mixtures? Some snippets of interest 
to me can include Javascript, Markdown, CSS, HTML and Racket all within 20 
lines.

-------- Original Message --------
On Feb 19, 2020, 11:37 PM, Sorawee Porncharoenwase wrote:

> In my opinion, it would be very cool if the project is based on DrRacket’s 
> color-lexer ecosystem. So instead of writing an ad-hoc lexer for, say, 
> Python, we instead help improving the existing #lang python‘s color-lexer.
>
> Pro:
>
> - The result will look just like what DrRacket displays.
> - Integrate well with #lang. Potentially useful for Scribble, since right now 
> Scribble really only displays Racket code well.
> - Push the community to improve/write more color-lexer
>
> Con:
>
> - Token styles are pretty limited (only 8 categories), but then again, 
> perhaps this will push DrRacket to support more than 8 categories.
>
> It looks like we can programmatically extract information from color-lexer 
> via 
> [module-lexer](https://docs.racket-lang.org/syntax-color/index.html?q=syntax%20color#%28def._%28%28lib._syntax-color%2Fmodule-lexer..rkt%29._module-lexer%29%29).
>  See [this 
> file](https://github.com/racket/syntax-color/blob/master/syntax-color-test/tests/syntax-color/module-lexer.rkt)
>  for its usage.
>
> And since we use DrRacket’s ecosystem, we can go further than just syntax 
> highlighting. E.g., showing a binding arrow interactively when hovering mouse 
> over an identifier. The code example at [this 
> link](https://docs.racket-lang.org/drracket-tools/Accessing_Check_Syntax_Programmatically.html#%28def._%28%28lib._drracket%2Fcheck-syntax..rkt%29._annotations-mixin%29%29)
>  shows how we can extract such information.
>
> -
>
> On Wed, Feb 19, 2020 at 5:19 PM Sage Gerard <s...@sagegerard.com> wrote:
>
>> Thank you for the reference, Martin. After looking at skylighting I ended up 
>> reading some XML specs in [1] after visiting Kate's.
>>
>> I can some potential shortcuts with the XML specs, but I'm seeing a lot of 
>> data-entry that won't really know how to highlight things like "->" in 
>> Racket or "X Y(Z);" in C++. I'm hoping parsack can handle these nuances. 
>> Still, the implementation burden is high and writing parsers means not 
>> having a syntax-highlighting data format.
>>
>> I'm thinking about writing the package such that a pre-installer builds an 
>> isolated Docker instance and runs a container for an existing 
>> highlighter--The goal being to provide what feels like a pure Racket package 
>> with no extra install steps. From there I can add parsack implementations 
>> over time. No clue how that will go.
>>
>> [1]: https://github.com/KDE/syntax-highlighting/tree/master/data/syntax
>>
>> ~slg
>>
>> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>> On Wednesday, February 19, 2020 4:11 PM, Martin DeMello 
>> <martindeme...@gmail.com> wrote:
>>
>>> Nice, I'll be following this with interest! What are the pros and cons of 
>>> developing a new syntax highlighting format from scratch, versus e.g. 
>>> parsing and reusing the kate style files? For the latter route this haskell 
>>> package is a good source of inspiration: 
>>> https://hackage.haskell.org/package/skylighting
>>>
>>> martin
>>>
>>> On Tue, Feb 18, 2020 at 10:27 AM Sage Gerard <s...@sagegerard.com> wrote:
>>>
>>>> Hi folks,
>>>>
>>>> I'm starting a syntax highlighter project here: 
>>>> https://github.com/zyrolasting/syntax-highlighting
>>>>
>>>> There seems to be a precedent for using an existing highlighter from 
>>>> another ecosystem. I understand the pragmatism behind that, but a syntax 
>>>> highlighter seems to me a missing battery in Racket.
>>>>
>>>> Without funding I am unable to compete with the implementations with 200+ 
>>>> languages supported. So I merely intend to provide two renderers (Terminal 
>>>> and HTML [XML syntax]), some palettes, and a sensible extension to parsack 
>>>> that classifies characters using Pygments' token classes. This should 
>>>> provide a strong, familiar core on which to add features according to 
>>>> community interest.
>>>>
>>>> That being said, I invite feedback and collaboration to add support for 
>>>> languages once the core mechanisms are established.
>>>>
>>>> ~slg
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups 
>>>> "Racket Users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>>> email to racket-users+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> [https://groups.google.com/d/msgid/racket-users/GC9QAolNyNFBE-KrDXfvA0q0P5_7jBWs7DEger3xGw5sYRmKg0rowpzyLIlyb1hrDOg_2xxTLn74TR5pCDIPhOzqIN5baGHoO7TU4GuaLDI%3D%40sagegerard.com](https://groups.google.com/d/msgid/racket-users/GC9QAolNyNFBE-KrDXfvA0q0P5_7jBWs7DEger3xGw5sYRmKg0rowpzyLIlyb1hrDOg_2xxTLn74TR5pCDIPhOzqIN5baGHoO7TU4GuaLDI%3D%40sagegerard.com?utm_medium=email&utm_source=footer).
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> [https://groups.google.com/d/msgid/racket-users/LKOhymlNe9MueHZQB8ErdJH7ySw_pTxDtsbZvNuXKWqEmGrFoOJl7SewhmwcS__qZunT6M6tzaMn_a-CjRFWEwfHhdrS2jfoKIBQkhkAzjM%3D%40sagegerard.com](https://groups.google.com/d/msgid/racket-users/LKOhymlNe9MueHZQB8ErdJH7ySw_pTxDtsbZvNuXKWqEmGrFoOJl7SewhmwcS__qZunT6M6tzaMn_a-CjRFWEwfHhdrS2jfoKIBQkhkAzjM%3D%40sagegerard.com?utm_medium=email&utm_source=footer).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/YxJncQYX5airz9tTs6E9CLdIZy1aD0felC28XirOFVCXJDoQKBlye82rp2GKbRGCGgCblFGe9DbIZHXZKPX1zyLWIGl1PcARZLynObJ70_o%3D%40sagegerard.com.

Reply via email to