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
    F

    Fredrik Lundh

    effbot.org · Personal blog · on HN since 2007

    Fredrik Lundh, a Python developer, wrote tutorials and reference notes on Python internals, parsing, regular expressions and language semantics.

    Visit blogHN submissions
    ProgrammingLanguages & Compilers
    What HN says

    HN commenters cite it as a Python reference, for example in explaining why Python requires an explicit self in methods.

    Stats for nerds
    64HN people shared it
    26linked in comments
    96story points
    Nov 2020last shared
    2008people per year2020

    Top posts on HN

    1. 1
      Simple Top-Down Parsing in Python
      9 people · 35 points · first shared 2008 · 1 comments on HN
    2. 2
      Compiling Python Code
      2 people · 27 points · first shared 2010 · 7 comments on HN
    3. 3
      Understanding Python's "with" statement
      8 people · 6 points · first shared 2010 · Discussion on HN
    4. 4
      Understanding how Python's "for" statement works
      2 people · 5 points · first shared 2010 · Discussion on HN
    5. 5
      Effbot.org on Hiatus
      4 people · 4 points · first shared 2015 · 1 comments on HN
    6. 6
      Using Regular Expressions for Lexical Analysis
      2 people · 3 points · first shared 2008 · Discussion on HN
    7. 7
      Some Notes on Tim Bray's Wide Finder Benchmark in Python
      1 person · 3 points · first shared 2007 · Discussion on HN
    8. 8
      Default Parameter Values in Python
      7 people · 2 points · first shared 2012 · Discussion on HN
    9. 9
      What kinds of global value mutation are thread-safe?
      1 person · 2 points · first shared 2015 · Discussion on HN
    10. 10
      More Top Down parsing - JSON
      1 person · 2 points · first shared 2010 · Discussion on HN

    What HN people wrote when they linked it

    • jerfAug 2012

      There's always a serialization step. The type of the resulting data is a consequence of the serialization technique, not the data format. I demonstrated the part you seemed to most strongly claim didn't exist, JSON <-> strong typing, but I can show you "weakly-typed" XML too. In addition to the DOM, which is a standardized "weak type" XML representation, you also have things like ElementTree http://effbot.org/zone/element-index.htm .

      It is the case that JSON has a simple default weak serialization in many popular languages, and that it is a great deal of the reason for its popularity, but it is worth pointing out this is a local effect in the Javascript/Python/Perl/Ruby space, and that it hasn't got anything to do with strongly or weakly typed but rather what the target languages shipped with. There is no natural mapping for JSON in C++, C#, Erlang, Haskell, Prolog, SQL, or a wide variety of other languages (and Erlang and SQL are both fairly "weakly typed"), and even in JS/Python/Perl/Ruby there are some edge cases that can bite you if you aren't careful about exactly what the "just_decode_some_json_man()" is really doing with Unicode and numbers that may not fit into 32 bits.

      (Also, I scarequote all my "weakly typed" because the term is basically ill-defined. I'm coming around to prefer "sloppy type", which is a language where all values are perfectly well strongly typed but the language and/or library is shot through with automatic coercions and/or extensive duck…

    • kernel_sandersMar 2013

      This isn't uncommon in the python community for long running processes - especially those that frequently that create large amounts of small objects. An application server sitting in front of mongodb does exactly this. It forwards queries to mongo, then pymongo json loads the result for you, the application server does what it wants with the objects, then json dumps them to serve to clients. The json loads/dumps calls create tons of objects and memory bloat. The GC cleans them all up, yet memory isn't returned to the OS. See here:

      http://effbot.org/pyfaq/why-doesnt-python-release-the-memory-when-i-delete-a-large-object.htm

      In my tests of python 2.6.6, 2.7.3, and 3.3, python 2.7.3 was by far the worst in hanging on to memory. Yet the performance increase (due to integration of simplejson) is worth the memory penalty. We use gunicorn with sync workers to serve our WSGI app and a memory watchdog to signal the worker to gracefully retire after it handles a query large enough to leave it with a large memory footprint.

      Performance has been awesome and we're very happy with the result.

    • dalkeJul 2014

      This depends completely on your needle and your haystack. If it's the string "ABC" in "QABC" then certainly the naive algorithm will be the fastest.

      "Mechanical sympathy" unfortunately is easily misinterpreted to mean to only listen to the machine. Remember though that Martin Thompson is alluding to Jackie Stewart and Formula One racing. All of the cars competed on the same track. But you wouldn't enter a Formula One car for the Baja 1000.

      In fact, I don't think you should use term unless you have a specific goal in mind. KMP is only best for certain classes of searches. Boyer-Moore is used for others. And there are plenty of other algorithms with there own pros and cons. See http://www-igm.univ-mlv.fr/~lecroq/string/index.html for descriptions.

      Python, for example, uses (or used?) the algorithm described at http://effbot.org/zone/stringlib.htm , for the reasons listed therein.

    • arnoldschwJul 2015

      Blogs/websites in no particular order:

      * http://blog.codinghorror.com/ (Jeff Atwood)

      * http://www.catonmat.net/ (Pete Krumins)

      * http://blog.fogus.me/ (Mike Fogus)

      * http://research.swtch.com/ (Russ Cox)

      * http://effbot.org/ (Fred Lundh)

      * http://adam.herokuapp.com/ (Adam Wiggins)

      Podcasts in no particular order:

      * http://www.dotnetrocks.com/ (NET Rocks)

      * http://herdingcode.com/ (NET focused podcast with Scott Allen, Kevin Dente, Scoot Koon and Jon Galloway)

      * http://www.coreint.org/ (A podcast about indie software development)

      * http://www.talkpythontome.com/ (Python podcast)

      * http://www.binpress.com/blog/category/podcast/ (Binpress podcast about digital products)

      Magazines in no particular order:

      * http://www.hackernewsletter.com/ (HN in PDF)

      * http://www.codemag.com/magazine (Tech/coding news)

      * http://www.drdobbs.com/ (Dr. Dobbs)

      and many more.

    • paulddraperOct 2016

      Only one thread runs at a time because of the GIL, but the threads can preempt each other wherever between opcodes (http://effbot.org/zone/thread-synchronization.htm#atomic-operations)

      Imagine two threads running

      a += 1

      That's four opcodes. Only one operation will run at a time, but one thread might preempt the other midway through the four operations, and `a` will have been incremented by 1, not two.

      In some sense, mulithreading with Python's GIL is the worst of both worlds: you can use only one CPU, but you still need to account for concurrent state mutation. (Of course, it doesn't have the function color problem of asyncio http://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/)

    • inklesspenApr 2008

      a) There are excellent reasons why Python requires passing 'self' to each method. The article linked to three of them; I'll just link to one: http://effbot.org/pyfaq/why-must-self-be-used-explicitly-in-method-definitions-and-calls.htm

      b) form_for(Model.new) is great. That's why I've successfully gotten it added in the next version of Pylons. SQLAlchemy is a zillion times more powerful than ActiveRecord, but if you need hand-holding, you can use an AR-ish layer on top of it, such as Elixir: http://elixir.ematia.de/trac/wiki

      I've been using Rails for a year and a half, and every time I get a chance to work in Pylons, it's like a breath of fresh air.

    Related

    Mark Pilgrimdiveintomark.org100 people

    Simplicity is hard. Let’s go shopping

    Mark Pilgrim
    Personal · last shared 2014
    Lambda the Ultimatelambda-the-ultimate.org615 people

    Simon Peyton Jones Elected into the Royal Society Fellowship

    Lambda the Ultimate
    Publication · last shared 2026
    Zed Shawsheddingbikes.com90 people

    Common Programmer Health Problems

    Zed Shaw
    Personal · last shared 2012
    John Wiegleynewartisans.com49 people

    Monads in pictures

    John Wiegley
    Personal · last shared 2026
    Kragen Javier Sitakercanonical.org/~kragen93 people

    The Memory Models That Underlie Programming Languages

    Kragen Javier Sitaker
    Personal · last shared 2026
    Hillel Waynehillelwayne.com294 people

    1/0 = 0

    Hillel Wayne
    Personal · last shared 2026
    Valued Lessonsvaluedlessons.com19 people

    Monads in Python (with nice syntax)

    Valued Lessons
    Personal · last shared 2019
    Andrew Brehautbrehaut.net18 people

    A Brief Overview of the Clojure Web Stack

    Andrew Brehaut
    Personal · last shared 2013