Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    I

    Ivan Sagalaev

    softwaremaniacs.org · Personal blog · on HN since 2008

    Ivan Sagalaev, a developer and author of highlight.js, writes about Python, JavaScript, and Rust.

    Visit blogRSSHN submissions
    ProgrammingLanguages & CompilersWeb Development
    What HN says

    HN links it mainly for highlight.js, which commenters praise for automatic syntax highlighting, plus his posts on ordered Python dicts and Rust ownership.

    Stats for nerds
    38HN people shared it
    25linked in comments
    1Kstory points
    Oct 2024last shared
    2008people per year2024

    Top posts on HN

    1. 1
      Python dicts are now ordered
      3 people · 740 points · first shared 2020 · 436 comments on HN
    2. 2
      Why Rust's ownership/borrowing is hard
      3 people · 122 points · first shared 2016 · 64 comments on HN
    3. 3
      Completely unfair comparison of JavaScript syntax highlighters
      1 person · 48 points · first shared 2011 · 5 comments on HN
    4. 4
      Showdown - javascript markdown
      2 people · 47 points · first shared 2011 · 7 comments on HN
    5. 5
      The C++ Lands [png]
      1 person · 12 points · first shared 2016 · 2 comments on HN
    6. 6
      Django as a micro-framework
      1 person · 11 points · first shared 2012 · Discussion on HN
    7. 7
      Scaling Django for a Russian search engine
      1 person · 11 points · first shared 2008 · 2 comments on HN
    8. 8
      Misconception about OSS Support
      1 person · 4 points · first shared 2019 · Discussion on HN
    9. 9
      Google profile OpenID breakage
      1 person · 4 points · first shared 2011 · Discussion on HN
    10. 10
      Rainbow.js — a new kid on the highlighters' block
      1 person · 4 points · first shared 2012 · Discussion on HN

    What HN people wrote when they linked it

    • quelltextOct 2024

      This implementation was used from 3.6, right?

      It's interesting that the idea mail mentions that nothing changes about the implementation (including order) but the memory layout. Which would imply insertion order was already preserved in older versions (not the case IIRC) or the idea underwent a few more changes that did in fact impact order.

      EDIT: I couldn't quite find an answer but https://softwaremaniacs.org/blog/2020/02/05/dicts-ordered/ mentions the behavior happens since then because the implementation only tracks indices in the hash table itself and relies on maintaining entries separately in a second array that gets expanded in insertion order.

      This would also seem straightforward but it raises a few questions such as how deletion is implemented (efficiently).

      EDIT2: Okay, the talk (https://youtu.be/p33CVV29OG8) mentions they just leave holes until the next resize (at around 42:00).

      Raymond also mentions there that his original idea didn't preserve ordering but happened due to an additional compacting optimization? Should probably watch the whole thing some time to get the history. Sounds like a fun talk.

    • mehrdadnDec 2018

      Thanks, yeah, I was very careful to avoid claiming they're mutually exclusive. However, although I stopped trying to learn Rust back in 2016, unless it's changed its fundamentals radically (which I understand it hasn't), I'm not sure if it's really a counterexample here for expressiveness. Can you use different allocators for different vectors in the same function in Rust? Can you have custom move semantics for objects that might know about pointers to them? And does the compiler no longer complain about code that really should work just fine? [1] I understand the answers to most if not all such questions is still "no", at which point I stop believing it really has the same flexibility as C++ or the same ease of writing as Python, but would be happy to hear if things have changed.

      [1] http://softwaremaniacs.org/blog/2016/02/12/ownership-borrowing-hard/en/

    • obtuJul 2012

      highlight.js [1] does this, though by running highlighters rather than using some learning-based mechanism. It feels wasteful to run this on display rather than storage, though. SourceClassifier [2] also works, though with less languages. And here's [3] an implementation made with Bayes and Go.

      [1] http://softwaremaniacs.org/soft/highlight/en/ http://softwaremaniacs.org/media/soft/highlight/test.html

      [2] http://blog.chrislowis.co.uk/2009/01/04/identify-programming-languages-with-source-classifier.html

      [3] https://github.com/octplane/go-code-classifier

    • nithinbekalJun 2012

      The app depends on highlight.js which currently supports a limited set of languages, and unfortunately, Brainfuck isn't one of them.

      http://softwaremaniacs.org/media/soft/highlight/test.html

      I wonder what would happen to the accuracy of highlight.js highlightAuto method if more languages were to be supported. Highlight.js recognizes languages based on how many language constructs it can recognize. More languages = more overlap in language constructs, and therefore more likelihood of wrong matches.

    • nirmalFeb 2009

      It would be useful for Snipt to automatically detect the language being used. You could maybe do detection in a way similar to highlight.js http://softwaremaniacs.org/soft/highlight/en/

      I could imagine quickly pasting in a code, the detector running and modifying the dropdown box accordingly. If it's correct I click "Snip It", if it's not then I adjust and then click "Snip It".

    • bravuraMay 2011

      In case you are interested in fast, streaming parsing of JSON, check out the yajl library (http://softwaremaniacs.org/blog/2010/09/18/ijson/en/)

      In Python, I use the ijson bindings for yajl (http://softwaremaniacs.org/blog/2010/09/18/ijson/en/).
      Here is a blog post demonstrating ijson: http://thechangelog.com/post/1169335384/ijson-parse-streams-of-json-in-python

    Related

    Armin Ronacherlucumr.pocoo.org417 people

    996

    Armin Ronacher
    Personal · last shared 2026
    Scattered Thoughtsscattered-thoughts.net186 people

    Against SQL

    Scattered Thoughts
    Personal · last shared 2026
    Rust Blogblog.rust-lang.org533 people

    Announcing Rust 1.0

    Rust Blog
    Company · last shared 2026
    Niko Matsakissmallcultfollowing.com221 people

    Towards a Rust Foundation

    Niko Matsakis
    Personal · last shared 2026
    Forrest Smithforrestthewoods.com57 people

    Simpson’s Paradox (2016)

    Forrest Smith
    Personal · last shared 2026
    matkladmatklad.github.io237 people

    Architecture.md

    matklad
    Personal · last shared 2026
    Miguel Grinbergblog.miguelgrinberg.com94 people

    Python 3.14 is here. How fast is it?

    Miguel Grinberg
    Personal · last shared 2026
    Andrew Gallantblog.burntsushi.net141 people

    My FOSS Story

    Andrew Gallant
    Personal · last shared 2026