News for hackers. Stuff that matters.

judicious

I do seeing this becoming a trend more and more. A lot of open models are fairly strong and fine-tuning and other post-training techniques could easily make bespoke domain-specific inference considerably cheaper (in token usage and energy consumption) and allow for more data sovereignty.
Re:Ask HN: What're You Reading? on Tuesday September 29, 2026 @11:49AM (#49895400)
Blank Space: A Cultural History of the Twenty-First Century by W. David Marx. A fascinating and approachable read.
Re:The Weird Concept of Branchless Programming on Sunday September 28, 2025 @04:47PM (#45407851)
I’m by no means an expert on this topic, but what about using predefined hash map of value to function call/closure unless that also yields branched programming underneath? Additionally, maybe you want to use macros of some kind to generate the “magic” function you’re looking for, where it constructs a single branchless statement up to N terms, whether it’s procedural macros in Rust or C macros.
Re:Turkish language has a gossip tense on Saturday October 12, 2024 @01:34PM (#41820870)
Something like this occurs cross-linguistically: https://en.wikipedia.org/wiki/Evidentiality

Turkish has some evidentiality.

Re:Snapshot Testing for the Masses on Tuesday October 08, 2024 @07:54PM (#41783052)
Here's a link to their library in GitHub: https://github.com/tigerbeetle/tigerbeetle/blob/588123f219f1...
Re:Lesser known parts of Python standard library – Trickster Dev on Thursday September 05, 2024 @03:03PM (#41459529)
That's incredibly clever, generators are underrated. I once challenged my friend to do leetcode problems with only expressions. Here's levenshtein distance, however it's incredibly clunky.

  levenshtein_distance = lambda s1, s2: [matrix := [[0] * (len(s2) + 1) for _ in 
  range(len(s1) + 1)], [
          [
              (matrix[i].__setitem__(j, min(matrix[i-1][j] + 1, matrix[i][j-1] + 
  1, matrix[i-1][j-1] + (0 if s1[i-1] == s2[j-1] else 1))), matrix[i][-1])[1]
              for j in range(1, len(s2) + 1)
         ]
         for i in range(1, len(s1) + 1)
     ], matrix[-1][-1]][-1]
Re:Lesser known parts of Python standard library – Trickster Dev on Thursday September 05, 2024 @02:24PM (#41459200)
I guess for most purposes, OrderedDicts are then obsolete, but I believe there are some extra convenience methods that they have, but I've only really needed to preserve order.

Makes you think what other parts of Python have become obsolete.

Re:Lesser known parts of Python standard library – Trickster Dev on Thursday September 05, 2024 @02:11PM (#41459103)
I find converting things from map objects or filter objects back to lists to be a bit clunky. Not to mention chaining operations makes it even more clunky. Some syntatic sugar would go a long way.
Re:Lesser known parts of Python standard library – Trickster Dev on Thursday September 05, 2024 @11:04AM (#41457315)
Dictionary comprehensions can be very elegant. List and dictionary comprehensions are very powerful and expressive abstractions. In fact, while not good practice you can pretty much write all Python code inside comprehensions including stuff regarding mutation.

This is valid(as in it will run, but highly unidiomatic) code:

quicksort = lambda arr: [pivot:=arr[0], left:= [x for x in arr[1:] if x < pivot], right := [x for x in arr[1:] if x >= pivot], quicksort(left) + [pivot] + quicksort(right)][-1] if len(arr) > 1 else arr

print(quicksort([1, 33, -4, -2, 110, 5, 88]))

Re:Lesser known parts of Python standard library – Trickster Dev on Thursday September 05, 2024 @12:10AM (#41453390)
There in lies another reason why OrderedDicts are still useful even in 3.12
Re:Lesser known parts of Python standard library – Trickster Dev on Wednesday September 04, 2024 @11:33PM (#41453219)
I work with different versions of Python3 (and 2 unfortunately) and some code is still in 3.6, hence I used OrderedDicts.
Re:Lesser known parts of Python standard library – Trickster Dev on Wednesday September 04, 2024 @10:56PM (#41453048)
I find defaultdict, OrderedDict, namedtuple among other data structures/classes in the collections module to be incredibly useful.

Another module that's packaged with the stdlib that's immensely useful is itertools. I especially find takewhile, cycle, and chain to be incredibly useful building blocks for list-related functions. I highly recommend a quick read.

EDIT: functools is also great! Fantastic module for higher-order functions on callable objects.

https://docs.python.org/3/library/itertools.html

Re:Show HN: Fructose, LLM calls as strongly typed functions on Wednesday March 06, 2024 @05:33PM (#39622631)
Definitely very excited to see this be a thing. Genuinely liked the approach to make function calls strongly typed and rely on functional programming principles.

During my senior year, I worked on a research project very similar to this and I’m glad to see this out there for everyone. I’d love to connect with the team if possible!

Re:Signals and Threads: Performance Engineering on Hard Mode on Saturday December 02, 2023 @01:09PM (#38500553)
I’m always amazed by the level of the discussions on Signals and Threads. I especially enjoyed hearing about the challenges with performance engineering in OCaml versus C++. The work on unboxed types is very promising.
Re:Elixir at Ramp on Friday November 24, 2023 @05:22PM (#38409038)
This is unironically my plan/playbook with ideas I have for startups. Start with Python, node, or whatever. Then go to Rust once product-market fit has been established.

Rust really hits that sweet spot with memory-management, programming paradigm flexibility, and speed. It’s precisely great for what I need because it’s essentially an ML with good imperative constructs.

Re:Elixir at Ramp on Friday November 24, 2023 @04:05PM (#38408330)
I loved reading the “making of” post. I’m very interested in getting into technical writing and your post, really helped me understand your thought process behind “Elixir at Ramp”.

Older »