Hacker News new | ask | show | jobs
by ZoomZoomZoom 14 days ago
I suspect you're talking about heterogenous containers which are antithetical to a strongly typed language but nevertheless are supported via std/json's JsonNode dynamic data.

In Nim regular hash maps (called tables here) have pretty regular accessors via `[]` `[]=` overloads (`foo["frob"]=42`), plus additional routines such as `.get(otherwise)`.

https://nim-lang.github.io/Nim/tables.html

Don't know why are you conflating objects in your question.

1 comments

I'm 'conflating' them because they're called objects in javascript, so people unfamiliar with Python know what I mean. Ok thanks.
The difference isn’t between JS/Python; objects exist in many languages with various representations, JS happens to model objects using dictionaries.

So it’s really the case that JS conflates objects/dictionaries, so only people familiar with only JS would know what you mean

Edit: actually thinking about it, I’m fairly positive python also models objects as dictionaries; it just puts more effort into hiding it