132

Since the syntax highlighter is now highlight.js it would be great to finally get some syntax highlighting for Julia code on Stack Overflow and other sites that might need this tag. Julia is one of the supported languages in highlight.js.

With over 11k questions already, this will benefit a lot of people.


Answers to some comments to add some more motivation.

If you write a feature request please outline why this would benefit the entire community.

This question does not make sense to me; the entire community is not benefiting from Python syntax highlighting either, the Python community is. Likewise, the Julia community will benefit from Julia syntax highlighting. The Julia tag already has more activity than some other language tags that are already included in the highlight.js file loaded by the site:

Stack Overflow Insights > Trends graph

so it would definitely be worthwhile to include Julia.

Or else why would the benefits for a few users outweigh the costs for all other users?

I am not sure what (noticeable) cost there would be for adding another language, library size(?). Presumably a "one-time" cost since the browser would cache it. Anyway, here is the library built with the current supported languages with and without Julia:

Building highlight.js. (Current languages)
-----
highlight.min.js    : 136002 bytes
highlight.min.js.gz : 46091 bytes
-----


Building highlight.js. (Current languages + Julia)
-----
highlight.min.js    : 139505 bytes
highlight.min.js.gz : 47477 bytes
-----

So an approximately 1.5 KB increase. If you compare this to other content on the site (400 KB for the top question with the Julia tag) this would be less than a 0.4% increase.

6
  • 8
    The Julia grammar minified is 3.5kb (before gzip). Commented Oct 28, 2020 at 22:27
  • 7
    If you use Chrome and want to be a beta tester: github.com/joshgoebel/se_highlightjs Commented Oct 28, 2020 at 23:58
  • 1
    Feature requests for PowerShell 2022 on Stack Overflow and 2020 on Meta Stack Exchange - vote to show importance of highlighting improvement! β­πŸš€πŸŒˆ
    – cachius
    Commented Oct 20, 2023 at 8:10
  • I find it interesting that the popularity of Julia seems to have gone down from its peak! Commented Mar 10 at 21:30
  • 2
    Oh wow, if you add #powershell as a tag, you can see it has about 10x the prevalence as Julia, yet no syntax-highlighting πŸ™ˆ (see graph screenhot) Commented Jul 11 at 18:30
  • 1
    @MarcusMangelsdorf there are two separate posts asking for Powershell and CMD highlight on SO and SU but neither got as many votes as this one.
    – bad_coder
    Commented Jul 11 at 18:52

2 Answers 2

27

We were able to carve out some dev time and Julia support has been added. This fix should be live along with automatic styling which can be seen here.

2
  • 3
    thanks so much for this! it's been a major stack exchange gripe of mine for a long time. Commented Jun 27 at 20:49
  • 1
    Thank you! Let us know if the Julia community can help with anything. Commented Jun 27 at 22:29
0

Syntax highlighting happens on the client side currently. This means that if we add too many different languages, the size of the distributable gets very large and can make the site slower to load. While any one language might be a good addition, we get enough language requests that if we added them all, we'd have a long list and a big problem.

I've talked with Ben Kelly, one of our Stacks team developers and, while he really hopes to eventually support nearly all languages that highlight.js supports, it'll require some big changes to how we process syntax highlighting and we don't know when we'll be able to get this work scheduled.

In the nearer term, we're actively planning how we can expand support for really popular, newer languages that we're not currently offering syntax highlighting for.

For these reasons, I'm marking this post and we'll update the answer should anything change in the future.

10
  • 31
    "we get enough language requests that if we added them all, we'd have a long list and a big problem." Do you though? Looking at syntax-highlighting, this is the top language request β€” ever. The only other currently outstanding language request with more than 15 votes here is Fortran (32 votes, 11k SO questions).
    – mbauman
    Commented Aug 12, 2021 at 20:24
  • 13
    It's also worth noting that the client-side performance was discussed in now-deleted comments β€” including more comments by the highlights.js maintainer. archive.is/4CBRZ
    – mbauman
    Commented Aug 16, 2021 at 20:38
  • 17
    "While any one language might be a good addition, we get enough language requests that if we added them all, we'd have a long list and a big problem." But you don't have to add every language that gets requested. You can look at the popularity of the language based on the StackOverflow activity and make a decision. Here, there is a language that is significantly more active than many others that already have highlighting. If there is a strong need to keep the size of the highlight file constant, you could remove support for one of the languages that are now very inacticve. Commented Sep 23, 2021 at 7:46
  • 9
    What criteria do you use to decide which languages get added? It seems that by any reasonable metric, Julia should be added!
    – a06e
    Commented Dec 6, 2021 at 14:52
  • 1
    @Catija Do you have an update on the syntax highlighting progress? There are several languages that need it. For example, F# is still not supported.
    – bmitc
    Commented Apr 10, 2022 at 6:02
  • 1
    @bmitc There's no change and, as far as I'm aware, no immediate plans to work on this.
    – Catija StaffMod
    Commented Apr 11, 2022 at 14:36
  • 5
    It's worth noting that the lack of supported languages is ten times worse due to the known misimplementation of Highlights.js. Stop guessing/auto-detecting a language when you KNOW it will be incorrect
    – mbauman
    Commented Apr 11, 2022 at 16:08
  • 2
    hi @Catija, is there any news on this? Because I asked the same question about PowerShell, which I'd hope is one of those "really popular, newer languages" since it's now more popular than bash in terms of SO Qs. insights.stackoverflow.com/…
    – Pxtl
    Commented Aug 9, 2023 at 17:29
  • 1
    Hey @Pxtl I don't have any additional updates at this point. I can tell that there are likely several languages that would benefit from expansion of the list of languages we offer highlighting for. We acknowledged this even when I wrote this answer two years ago but the organization internally has morphed quite a bit from when I posted and the team that would have done the work to investigate this has different priorities than they did at the time.
    – Catija StaffMod
    Commented Aug 9, 2023 at 19:18
  • 2
    I think this is a poor reason. I can't imagine it being too too difficult to have the server keep track of what languages are used in a post, and then only send specific highlighting scripts as needed, and also have the client request more if inline edits happen that require them.
    – starball
    Commented Nov 3, 2023 at 2:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .