|
|
Subscribe / Log in / New account

Grok the GIL (opensource.com)

Grok the GIL (opensource.com)

Posted Apr 21, 2017 16:40 UTC (Fri) by niner (subscriber, #26151)
In reply to: Grok the GIL (opensource.com) by quietbritishjim
Parent article: Grok the GIL (opensource.com)

So which native library do you recommend as replacement for http://pygments.org/?


to post comments

Grok the GIL (opensource.com)

Posted Apr 25, 2017 1:33 UTC (Tue) by sciurus (guest, #58832) [Link] (5 responses)

If you're building a web application, consider doing syntax highlighting client-side using a library like http://prismjs.com/

Grok the GIL (opensource.com)

Posted Apr 25, 2017 3:55 UTC (Tue) by pabs (subscriber, #43278) [Link] (4 responses)

Please don't, you will alienate people who do not allow JavaScript to run.

Grok the GIL (opensource.com)

Posted Apr 25, 2017 10:47 UTC (Tue) by jond (subscriber, #37669) [Link] (3 responses)

One could argue that losing syntax highlighting is still consistent with using Javascript in a "gracefully degrade" fashion.

Grok the GIL (opensource.com)

Posted Apr 25, 2017 11:41 UTC (Tue) by karkhaz (subscriber, #99844) [Link]

Slightly orthogonal issue: it seems ridiculous to have client-side computation for something that will compute exactly the same result on every client's machine. Why not do the syntax highlighting once on the server and serve the result to everybody, saving their battery life and cutting an iota from the page latency?

Grok the GIL (opensource.com)

Posted Apr 25, 2017 17:24 UTC (Tue) by pboddie (guest, #50784) [Link] (1 responses)

Except that Hipster 2.0 sites - those that use JavaScript for everything, which is where this ends up - don't tend to gracefully degrade, instead leaving a jumble of elements or even a blank page since the text and graphics aren't able to glide in smoothly from off the sides of the screen without scripts activated (or whatever special effect it is that is inevitably needed to spice up the ten to twenty words of actual content). On my rather old machine, such animations are wasted anyway: by the time the browser has woken up to the task of animating, the end of the animation timeline is upon it, and it might as well just put things in their final positions.

Also, while I'm impressed with things like PDF.js, I find myself using a native viewer like Okular for documents of any size, purely because the performance difference is significant. So, JavaScript-based equivalent solutions certainly have their limitations.

Grok the GIL (opensource.com)

Posted Apr 28, 2017 15:30 UTC (Fri) by mstone_ (subscriber, #66309) [Link]

And pdf.js tends to print like crap.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds