|
"python with jit" lives on in pypy
|
# ¿ Nov 8, 2021 22:05 |
|
|
# ¿ May 9, 2024 20:52 |
|
the monorepo is usually a good idea except at the scale google uses it at, that's what's so crazy about this
|
# ¿ Dec 15, 2021 23:37 |
|
Captain Foo posted:gom shaggar lmfao
|
# ¿ Dec 23, 2021 20:55 |
|
in those cases you can use a nonstandard json lib like orjson (rust), ultrajson (c), or rapidjson (c++) the idea that you shouldn't optimize code in a slow language is absurd
|
# ¿ Jan 3, 2022 18:26 |
|
eschaton posted:some people are so afraid of the “cognitive overhead” of a class (which has a specific purposes and is a nice, central place to consolidate both documentation and behavior) that they insist on using “raw” data structures everywhere and introducing a whole ton of dictionary keys and helper functions instead the semantics of python docstrings means that you can consolidate behavior and documentation trivially regardless of the conents of a given module, e.g. Python code:
obviously, the person or people we're talking about don't exist, and nobody ITT is arguing that you should never use classes in python because of "cognitive overhead", but it is also the case that not everything in python needs to be a class, should be in a class, or even that you should default to putting everything in a class
|
# ¿ Jan 3, 2022 18:51 |
|
Carthag Tuek posted:you can also do it like this: cinci zoo sniper posted:same, also something to type check the rest of the program on initialisation i have not used it but i understand that beartype is the new not-bad thing for this, which supplants the earlier typeguard project which was occasionally slow enough that you probably shouldnt leave it on in production
|
# ¿ Jan 3, 2022 19:22 |
|
the type checks always run but what is actually checked is based on some kind of random tree traversal thing, such that the check always executed in constant time, afaict for simple use cases -- this needs to accept and return a string -- the type check rate is 100% and the rate at which you catch invalid input or output is also 100% i am curious about more complex cases and ill prob experiment with it sometime this week.
|
# ¿ Jan 3, 2022 21:42 |
|
the triply nested list of all integers one to one billion is clearly a contrived example, but for things like "i have serialized this network request into a dataclass" you would just check that the object is of the type ThatDataclass this solves basically every runtime typecheck utility i would need, maybe a data science toucher can comment on the numpy array checks because i don't understand that library
|
# ¿ Jan 3, 2022 21:46 |
|
pointsofdata posted:Also lmao how does this even count despite this persons writing style being kind of twee, this is honestly one of the best issue responses ive seen for any computer product or library
|
# ¿ Jan 3, 2022 21:52 |
|
you will get a lot more mileage out of 200 lines of python than you would out of 200 lines of rust i have looked at 0 kotlin but since its basically a java dialect i imagine its even worse
|
# ¿ Jan 4, 2022 08:32 |
|
i don't entirely disagree but im phone posting so i have to be brief, 1- that statement asserts a level of foreknowledge that if you had, you would be rich enough to be writing 0 code in any language 2- it overestimates the difficulty in migrating away from python, substantially, and assumes the worst possible behavior from the tool authors and users you clearly have more experience living in this hell than i do, so i will take your word for it that i would regret writing an internal tool in python later when it has infinity users and i have been given 0 budget or time to rewrite a good thing about this for me specifically is that i just work here, so i can walk out the door and find a job any any one of the thousands of software firms that don't regard their staff with active malice
|
# ¿ Jan 4, 2022 10:20 |
|
i realize now that i missed the "the philosophical argument for [...]" prefix of your post and assumed that it was an argument offered in earnest, and not just an example its a bad argument, it's also "the usual" (which is boring), so i took offense. i should not have, and i am sorry that i did.
|
# ¿ Jan 4, 2022 10:41 |
|
what i was getting at with the post you quoted is that there is a continuum of potential complexity for a task that influences what you should use for it, and a joke about how if you're going to draw the line at 200 LoC then you don't want to waste those LoC in rust solving object ownership and type system sudokus for no reason if that complexity increases later, it can only be better (or same-bad) to have an example to base further iterations on. the only fixed costs are the cost of initial implementation, and the cost of carry, which should both be optimized for at the outset. it's impossible to optimize for the "cost eventually", and it's impossible to work in a place that puts unbounded demands on some code you wrote in the past while giving you no agency over it. if someone were to let either of these things influence an earnest opinion that they hold, and then proselytize that opinion to others, that would be stupid
|
# ¿ Jan 4, 2022 11:04 |
|
doesn't the packet header have a version field? i don't see how that would matter, you would just design it as a protocol that communicates over superficially similar looking packets routing devices would need an ipWhatever routing table. it doesn't have to intersect with the ip4 routing table
|
# ¿ Oct 19, 2023 20:33 |
|
it's kinda like a snapchat operating system
|
# ¿ Feb 1, 2024 19:54 |
|
if you were going to do that you would instead just `python -c`. just learn awk, its good and useful, and will save you from creating the n+1th dumb CLI tool at your organization
|
# ¿ Mar 8, 2024 02:29 |
|
normally im down with weird markup language poo poo but if you've set out to create a version of xml that is easier for humans to read and write you ought to just use yaml instead
|
# ¿ Mar 30, 2024 18:30 |
|
prisoner of waffles posted:just read more about YAML vince-falling-over-backwards.gif: all nodes have a type. ability to define custom types. schemas for placing constraints on nodes and their type.
|
# ¿ Mar 31, 2024 14:30 |
|
what do you mean sometimes? sequences like lists use indentation for scope. you can always indent however many times you feel like in YAML, the only rule is that things that share scope (items in the same list) need to be at the same indentation level. you can indent one, two, five hundred spaces, it doesn't matter because indentation is a presentation detail only
|
# ¿ Mar 31, 2024 19:47 |
|
Visions of Valerie posted:
what's your issue with this? you can indent `- absolutely` however many times you want, and it is equivalent. the only weird part of this snippet is that the mapping value must be indented by >1 blank space character (normally >0 would be fine), but this is likely an artifact of you nesting a block mapping which is distinct from a block sequence and thus has different rules for indentation.
|
# ¿ Mar 31, 2024 21:08 |
|
if you can't read a line break as a substitute closing brace or bracket you can just use one of the yaml flow styles which require them. unfortunately examples in the wild are rare, and many tools will not emit them, because most people dont have this problem
|
# ¿ Apr 1, 2024 15:09 |
|
Surprise T Rex posted:https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell this article is based on the yaml 1.1 spec which is from 2005.
|
# ¿ Apr 1, 2024 15:55 |
|
|
# ¿ May 9, 2024 20:52 |
|
pyyaml also ships with a schema + loader that loads the entire document without issuePython code:
|
# ¿ Apr 1, 2024 16:01 |