Live data from Hacker News

Glom – Restructured Data for Python

sedimental.org

51–60 of 99 posts

Re: Glom – Restructured Data for Python

#51
post #46

Earlier quoted context omitted.

In http://glom.readthedocs.io/en/latest/tutorial.html#access-gr... , > After years of research and countless iterations, the glom team landed on this simple construct: 'years of research', 'countless iterations', 'glom team ', really?

You're yellin at a tutorial man. You gotta let some flavor text slide. :) That said, I'm no liar. Kurt and I (as a team), really did write stuff leading up to glom in 2013 (years ago), and have written stuff like it enough times that I've lost count (countless :P). If this isn't research, I don't know what is. Heck, I'm even getting a fun little peer review!

don't sweat it dude. I've noticed a lot of people on hn are crabby assholes for absolutely no good reason. like on the post linking to Google's codelabs (where there are hundreds of tuts about all sorts of things in the Google ecosystem) there were only two comments and they were complaints. and recall that every time an electron app is posted almost every comment is whining about the performance. and every time a rust article is posted there's whining about how it's more complicated than js. and every time there's a js article posted there's whining about how it's not type safe like rust. and every time someone posts a personal page someone has to point out how it's "garbage on mobile" as if they're doing people a favor pointing out flaws (as if they don't understand that mobile is the most heterogeneous platform out there). I swear people don't know how to be grateful for free shit or just keep their mouths shut when something doesn't tickle their own particular fancy. I wager it's a defense mechanism because they themselves aren't making anything and so they need assert their superiority in some way (because people that are busy doing stuff don't have time to complain about things irrelevant to their own work). kudos to you and Kurt for releasing a library to the community that's different and interesting and fuck the haters.

Re: Glom – Restructured Data for Python

#53

The writing style is just insufferable. Even the API documentation is littered with hyperbole and self-congratulation. We get it, you're proud of your work and extremely proud of yourself. > "as simple and powerful as glom" > "big things come in small packages" > "small API with big functionality" > "power is only surpassed by its intuitiveness" > "simplicity is only surpassed by its utility" > "shortest-named featur…

you know what's actually insufferable? taking pot shots at someone giving you something for free. either say thank you or move on. it's like yelling at your mom for making you breakfast in the morning: downright unseemly.

Re: Glom – Restructured Data for Python

#54
post #7

This is really cool. Did you ever consider an API to do the reverse - to insert a value at a particular point in the data? My interest stems from this issue[0] on the Ruby issue tracker to make a symmetrical method to Hash#dig (which does something similar to, but more limited than glom) called Hash#bury. The problem in the issue was that inserting a value at a given index in an array proved difficult and unnatural i…

glom not only supports more than string keys, it also supports assigning to non-dictionary objects. That's a part of the API we're working on right now, actually. As for the data insertion, mutation may be in the future, but for now glom only transforms and returns new objects. Definitely something to think about though, bookmarked! :)

Check the updateIn, mergeIn, mergeDeepIn methods in immutable.js. Maybe even asMutable, asImmutable for mutation.

Re: Glom – Restructured Data for Python

#55
post #25

Earlier quoted context omitted.

My thoughts also turned to toolz. Here's a example comparison: glom glom(target, ('system.planets', ['name'])) # ['earth', 'jupiter'] toolz list(pluck('name', get_in(('system', 'planets'), target))) # ['earth', 'jupiter']

The real advantage over toolz/get_in is in the breadth of types glom can support ( http://glom.readthedocs.io/en/latest/api.html#setup-and-regi... ), the extensive fallback behavior ( http://glom.readthedocs.io/en/latest/api.html#advanced-speci... ), and "T" specifier ( https://sedimental.org/glom_restructured_data.html#true-pyth... ), which allows performing object-oriented traversals and calls. Check the post for m…

Sentinel is one of my favorite objects in Python.

Re: Glom – Restructured Data for Python

#56
post #31

Earlier quoted context omitted.

Why is writing DSLs strictly worse than writing complicated transformations built on top of the limited constructs provided by the language itself? (You said never )

The issue isn't dsls, it's string dsls. Doing it within the language can provide stronger garauntees. As a simple example, you get some syntax checking.

Precisely. Until my autocomplete, syntax highlighting, and linting engines recognize it, I'll pass.

Re: Glom – Restructured Data for Python

#57

The writing style is just insufferable. Even the API documentation is littered with hyperbole and self-congratulation. We get it, you're proud of your work and extremely proud of yourself. > "as simple and powerful as glom" > "big things come in small packages" > "small API with big functionality" > "power is only surpassed by its intuitiveness" > "simplicity is only surpassed by its utility" > "shortest-named featur…

Also, often it's better if power surpasses intuitiveness a bit. :)

Re: Glom – Restructured Data for Python

#58

Earlier quoted context omitted.

The issue isn't dsls, it's string dsls. Doing it within the language can provide stronger garauntees. As a simple example, you get some syntax checking.

Precisely. Until my autocomplete, syntax highlighting, and linting engines recognize it, I'll pass.

I think y'all might be getting a bit up in arms about a non-issue. Seasoned glommers (and experienced Pythonists), will almost always be using T: http://glom.readthedocs.io/en/latest/api.html#object-oriente...

While mentioned in the post, it's not front-and-center because that's the sort of Python superpower that can look scary to less-experienced devs.

Re: Glom – Restructured Data for Python

#59
post #44
post #41

I'm not really versed in the idioms/social mores of Python, so please take the following with a grain of salt: This seems like it usefully solves a problem, but the invocation pattern is suspect to me -- Instead of "glom" taking the target for picking-apart plus a magic little bit of DSL, what if "glom" took a single parameter, the aforementioned DSL, and returned a function that would perform the corresponding searc…

Python regex library does this, optionally

Similarly, statistical distributions in SciPy can be used in "frozen" form (pre-parameterized) or in a more general form where you supply the parameters at the same time you are requesting some attribute it the distribution. Seems to me to be a situation where one is useful if you expect reuse, and the other is useful if you don't.

Re: Glom – Restructured Data for Python

#60
post #46

Earlier quoted context omitted.

In http://glom.readthedocs.io/en/latest/tutorial.html#access-gr... , > After years of research and countless iterations, the glom team landed on this simple construct: 'years of research', 'countless iterations', 'glom team ', really?

You're yellin at a tutorial man. You gotta let some flavor text slide. :) That said, I'm no liar. Kurt and I (as a team), really did write stuff leading up to glom in 2013 (years ago), and have written stuff like it enough times that I've lost count (countless :P). If this isn't research, I don't know what is. Heck, I'm even getting a fun little peer review!

You've created something useful and it will save a lot of programmers a ton of time.

I didn't find your writing insufferable. I've written tongue in cheek (or over the top) posts about my projects in the past. If they can't see the humor and the usefulness of the project, their loss.

Thank you for creating Glom and thank you for posting it on HN. Count me in as one of your users.

Post reply on HN