Re: [racket-users] Starting syntax highlighter project

2020-02-19 Thread Philip McGrath
You don't need a `#lang` to use `color:text<%>`: I've used it to do basic syntax highlighting for XML. In fact, you don't even need a GUI for the relevant part of the protocol, which is what `#lang`s implement. The requirements are described in the documentation

Re: [racket-users] Starting syntax highlighter project

2020-02-19 Thread Sorawee Porncharoenwase
On Wed, Feb 19, 2020 at 11:55 PM Sage Gerard wrote: > 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? With my approach, yes, but note that technically, the #lang doesn't need to be function

Re: [racket-users] Starting syntax highlighter project

2020-02-19 Thread Sage Gerard
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 wi

Re: [racket-users] Starting syntax highlighter project

2020-02-19 Thread Sorawee Porncharoenwase
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. - Integr

Re: [racket-users] Typed Racket: Casting to types containing type variables

2020-02-19 Thread Ben Greenman
On 2/19/20, unlimitedscolobb wrote: > > [] > > ;Type Checker: Type a could not be converted to a contract because it > contains free variables. > ; in: a > > Does this mean that I can never cast to types containing type variables? Yes > My original problem comes from playing around with ev

Re: [racket-users] Starting syntax highlighter project

2020-02-19 Thread Sage Gerard
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);"

Re: [racket-users] Starting syntax highlighter project

2020-02-19 Thread Martin DeMello
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/sk

[racket-users] Typed Racket: Casting to types containing type variables

2020-02-19 Thread unlimitedscolobb
Hello, I'm trying to get something similar to the following code working: #lang typed/racket (: f (-> Integer Any)) (define (f x) (+ 1 x)) (: g (All (a) (-> Integer a))) (define (g x) (f x)) Of course, this gets me a type error: ;Type Checker: type mismatch ; expected: a ; given: Any ;