News for hackers. Stuff that matters.

diegojromero

Re:Gemini 4 Argon on Thursday October 01, 2026 @08:50AM (#49920956)
Could you recommend some lectures/reads about the use of formal methods in LLMs, I'm interested in the area.
Something I've learned is that your specification is as solid as your validation harness. If you have added strong e2e tests, with the critical scenarios covered, then you are safe. If not, sometimes it's rolling dices.
On what dataset was the AI trained?
Sure, in my workflow I make use of mypy and ruff extensively (but ruff does not allow plugins). So I decided to create several plugins with the intention of improving the developer experience and understanding of the code.

Now, what I am asking is, could we expand this by having static annotations that enforce runtime behaviours before running the code? I'm not advocating for the removal of the tests or some manual testing phase, but in the same vein of type errors being shown in our IDE, could we have static checks like contracts for functions or class invariants?

Full disclaimer: I leveraged AI technologies to create them.

Ask HN: What's stopping us from having full static validation of Python code?

I have developed two mypy plugins[1][2] for Python to help with static checks.I was wondering, how far are we with providing such a high level of static checks for interpreted languages that almost all issues can be catch statically? Is there any work on that on any interpreted programming language? What would you like to be statically-checked in Python?[1]...

( Read More... | 2 comments | 2 points | on HN )
Re:Ask HN: When it's too much observability? on Sunday September 07, 2025 @12:27PM (#45159631)
Well, I was so worried about boilerplate that I created a Python decorator for avoiding polluting the code with so much of that (https://github.com/diegojromerolopez/otelize).

About the cost, AFAIK it is not prohibitive.

I will continue working as I was, thanks for your opinion!

Ask HN: When it's too much observability?

I have been adding observability (via OpenTelemetry) to some web applications for almost a year. I tend to add a span for each function with its input arguments (if possible), besides other data like information about the flow or the return value. Being able to see the function call cascade has been useful for debugging applications.Having said that, I have two questions for the community:1....

( Read More... | 2 comments | 2 points | on HN )
Re:What Are Traces and Spans in OpenTelemetry? on Sunday August 31, 2025 @12:55PM (#45084719)
Thanks for your comment! It has given me an idea for a project: a simple library that provides a Python decorator that can be used to include basic telemetry for functions in Python code (think spans with the input parameters as attributes): https://github.com/diegojromerolopez/otelize

Feedback welcome!

Interesting, maybe adding a decorator @freeze_final could be a good idea? I'll take a look at it later.

Thank you for your input!

I knew about dataclasses when I started writting gelidum, but I wanted to make the immutable objects be from any classes, those under my control or not.

Having said that, I think dataclasses are a better solution for making immutable objects if the class is going to be made from the start.

I'd really love if that could checked statically.

Performance is bad, I mean, all params are deep-copied because I assume frozen then "inplace" is not intended as they could be objects used by other parts of code.

Yes, you're right with your concerns.

I added this feature yesterday. Note the default value is "exception". With "nothin" I was thinking in passing some frozen object through a pipeline of unsafe/inherited/bad code, but without polluting the console with warnings or stopping the execution with exceptions.

Exactly my main issue. I see this code as something that asserts that an object is not modified by that "bad" code, but I fail to see more use-cases. I've been thinking about doing some kind of dictionary datastore with these frozen objects but I'm not sure if it is actually useful.
Interesting idea, instead of a deep clone, would it be something similar to the copy-on-modify pattern?
Per advice from Daniel from HN (thank you!), I have reposted this Ask HN I made earlier about immutability. [1]

I was thinking the other day about my days working with Ruby On Rails and how the strings are mutable in Ruby and the freeze method. My mind wandered about that, the several freeze packages that exist (even the frozendict [2] package) that make frozen classes of objects.

I haven't worked professionally with Haskell or Erlang, but some of their functional capabilities are nice and have ejerced a big influence in my work with Ruby on Rails and Python. Specially the ideas of having immutable objects and keeping updates at minimum.

I thought on doing a freeze package that could make frozen objects recursively in Python. The idea is to make easier to share objects between threads without having to worry about updates inside threads.

However, I'm not sure that this package is useful at all. Maybe is because Python is not a well-suited language for this? Maybe is because my lack of knowledge about functional programming? Maybe is because it doesn't make sense to "freeze" objects?

Some ideas I have in the back of my mind for this package are:

- Some kind of basic datastore-server where data is immutable (threaded server?). - Storing all updates some kind of super-object by storing all history as immutable objects.

What are some sources to learn about immutability on programing languages? How could you use a freeze package in Python or other languages? Would it be useful to share information between threads?

Any advice/idea/feeback/criticism or comment on this matter is appreciated.

[1] https://news.ycombinator.com/item?id=27503947

[2] https://pypi.org/project/frozendict/

Thank you, going to take a look to that talk!

Ask HN: Thoughts on immutability in programming languages?

I have developed a proof-of-concept Python package to freeze objects [1]I've developed it for the fun of doing it, without any useful use-case in mind, and to tell you all the truth, I can't find any. I have some idea of what a functional language is (have developed a bit with Haskell and Erlang), but I've not used them in any job. I suppose that's why I can't find a way to use this package to...

( Read More... | 3 comments | 2 points | on HN )
Re:Running GitHub on Rails 6.0 on Monday September 09, 2019 @05:47PM (#20922825)
Could you expand on why do you prefer ActiveRecord over Django ORM?

When I started with Rails I was so frustrated with ActiveRecord that I develop some of the Django QuerySet API as a gem[0].

[0] https://github.com/diegojromerolopez/babik

Re:Ask HN: What is the future of programming? on Tuesday August 07, 2018 @02:21PM (#17709135)
'The future of Programming' by Bret Victor (https://www.youtube.com/watch?v=8pTEmbeENF4). Seems a pun about OP title but it really is related with his/her question. Take a look and you will be amazed of how good (or revolutionary by our standards) some old technologies were.
Re:Ask HN: What are you working on this weekend? on Saturday July 28, 2018 @05:39PM (#17635203)
I'm working in a Django's Queryset port to Ruby on Rails: https://github.com/diegojromerolopez/babik

I really miss Django and its way of making queries and I think it could be a good add-on for Rails.

Besides what others have commented, I'd like to point some more metrics that help you model your board:

- Task classes.

- Lead time.

- Cycle time.

- Number of backward movements for any list.

- Cumulative card evolution.

There are some good books about this subject:

- David J. Anderson's Kanban (https://www.amazon.com/Kanban-Successful-Evolutionary-Techno...)

- Actionable Agile Metrics for Predictability: An Introduction (https://www.amazon.com/Actionable-Agile-Metrics-Predictabili...)

Shameless plug: checkout my personal project DjangoTrelloStats that measures these metrics for you: https://github.com/diegojromerolopez/django-trello-stats (include a somewhat Trello synchronization tool).