Readit News logoReadit News
ck45 commented on T-Ruby is Ruby with syntax for types   type-ruby.github.io/... · Posted by u/thunderbong
ReflectedImage · 2 days ago
Gradual typing is the worse of both worlds.

You get the complexity and slower development times of using statically typed languages along with the bad performance of using dynamically typed languages.

ck45 · 2 days ago
Is this based on your experience or is it just an assumption? I only have anecdotes, but it does not reflect your claims, rather the exact opposite. A lot of the boilerplate code doesn’t need to be type annotated, but annotating the main business logic doesn’t take more time and is not more complicated, but instead type annotations help write code that is more clear, more obvious, and it adds some kind of documentation.
ck45 commented on Petition to stop Microsoft at government in bavaria   openpetition.de/petition/... · Posted by u/jlagetar
vintagedave · a month ago
I thought Germany was famous for moving away from Microsoft. Seems odd Bavaria would move in the opposite direction. What's the background / reason for it?
ck45 · a month ago
The HQ of Microsoft Germany is in Munich.

Edit: Compare to LiMux[1] and the rumors about some deal with MS

[1] https://en.wikipedia.org/wiki/LiMux

ck45 commented on Implementation of a Java Processor on a FPGA (2016)   mavmatrix.uta.edu/electri... · Posted by u/mghackerlady
dehrmann · a month ago
It's more like JITs got good.
ck45 · a month ago
I never understood why AOT never took off for Java. The write once run anywhere quickly faded as an argument, the number of platforms that a software package needs to support is rather small.
ck45 commented on The Pragmatic Programmer: 20th Anniversary Edition (2023)   ahalbert.com/technology/2... · Posted by u/ahalbert2
android521 · a month ago
I have read many books. If you can only read one book about how to program in your life , I would say that it is this book: A philosophy of software design: John Ousterhout. It is 10 times better than the next best book.
ck45 · a month ago
For me “the problem with software, why smart engineers write bad code” is the prequel. Not as technical, but explains a big problem
ck45 commented on New Work by Gary Larson   thefarside.com/new-stuff... · Posted by u/jkestner
thom · 2 months ago
The Far Side is like the Simpsons for me, many of the jokes have passed into everyday expressions. If I or my wife are on the loo when the other comes in, we’ll always quote one of my favourites:

https://static0.srcdn.com/wordpress/wp-content/uploads/2023/...

ck45 · 2 months ago
I've never seen it that way, but I think you are absolutely right. My favorite always has been https://www.reddit.com/r/TheFarSide/comments/179ikr2/its_a_f...
ck45 commented on Ruby Blocks   tech.stonecharioteer.com/... · Posted by u/stonecharioteer
jhbadger · 2 months ago
If you are familiar with a true object-oriented language like Smalltalk (rather than the watered-down form of OO in C++, Java, etc.), an integer like 5 having methods makes sense because it (like everything else) is an object. Objects in Ruby aren't just window dressing -- they are its core.
ck45 · 2 months ago
But then Ruby only goes half way, not unlike the "watered-down form" in your term. Why is `#times` a method of Integer, but `#if` (or `#ifTrue`) not a method of booleans like in Smalltalk? Ruby does the same cherry picking from Smalltalk like everybody else, just different cherries. When looking at Ruby, it feels like the simple examples are all nice and clean but then the weird details start to appear and the language feels more hacky than others (like Ned Flander's house in Simpsons S08E08).
ck45 commented on Earth was born dry until a cosmic collision made it a blue planet   sciencedaily.com/releases... · Posted by u/amichail
sethammons · 3 months ago
Related, a recent study suggests up to 1% of our mantle is water trapped within rock that gets released as subduction increases to higher heat and pressure. This water could account for three times the amount of water on the surface and may represent a whole-Earth water cycle.

https://www.bnl.gov/newsroom/news.php?a=111648

I wonder how this ties in with the submitted link about Theia. And it will be interesting if we ever get similar trapped water discovered in martian rock.

ck45 · 3 months ago
This reminds me of Stephen Baxter's novel "Flood"
ck45 commented on That boolean should probably be something else   ntietz.com/blog/that-bool... · Posted by u/vidyesh
ck45 · 4 months ago
One argument that I’m missing in the article is that with an enumerated, states are mutually exclusive, while withseveral booleans, there could be some limbo state of several bool columns with value true, e.g. is_guest and is_admin, which is an invalid state.
ck45 commented on Crimes with Python's Pattern Matching (2022)   hillelwayne.com/post/pyth... · Posted by u/agluszak
divbzero · 4 months ago
I suppose you could use the same trick with __ror__ and | (as long as the left-hand side doesn’t define __or__).

  x = Model.objects.all() | by_pk | call(dict.values) | to_list | get('name') | _map(str.title) | log_debug | to_json

ck45 · 4 months ago
Or overloading division like https://scapy.net/
ck45 commented on Crimes with Python's Pattern Matching (2022)   hillelwayne.com/post/pyth... · Posted by u/agluszak
btown · 4 months ago
My favorite Python "crime" is that a class that defines __rrshift__, instantiated and used as a right-hand-side, lets you have a pipe operator, regardless of the left-hand-side (as long as it doesn't define __rshift__).

It's reasonably type-safe, and there's no need to "close" your chain - every outputted value as you write the chain can have a primitive type.

    x = Model.objects.all() >> by_pk >> call(dict.values) >> to_list >> get('name') >> _map(str.title) >> log_debug >> to_json
It shines in notebooks and live coding, where you might want to type stream-of-thought in the same order of operations that you want to take place. Need to log where something might be going wrong? Tee it like you're on a command line!

Idiomatic? Absolutely not. Something to push to production? Not unless you like being stabbed with pitchforks. Actually useful for prototyping? 1000%.

ck45 · 4 months ago
Apache beam does it: https://beam.apache.org/documentation/sdks/python-streaming/

I wanted to wash my eyes the first time I saw it.

u/ck45

KarmaCake day836December 18, 2021View Original