[HN Gopher] Show HN: Gelidum - My Python library to freeze objects
___________________________________________________________________
Show HN: Gelidum - My Python library to freeze objects
Author : diegojromero
Score : 4 points
Date : 2021-06-14 20:00 UTC (3 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| diegojromero wrote:
| 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/
___________________________________________________________________
(page generated 2021-06-14 23:01 UTC)