Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pansa2
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
61.
▲
by
pansa2
10mo ago
> faster-cpython project Seems to have died the same death as Unladen Swallow, Pyston, etc: https://discuss.python.org/t/community-stewardship-of-faster...
62.
▲
by
pansa2
10mo ago
Specifically, it's like asking if there are any studies that demonstrate benefits of static typing. Are there?
63.
▲
by
pansa2
10mo ago
Rv, a new kind of Ruby management tool: https://news.ycombinator.com/item?id=45023730
64.
▲
by
pansa2
10mo ago
I still don’t understand how a single language can have multiple (what is it now, half a dozen?) different type checkers, all with different behaviour. Do library authors have to test against every type checker to ensure maximum compatibili
65.
▲
by
pansa2
10mo ago
> do the build process on alpine linux and […] statically link musl libc IIRC it used to be common to do builds on an old version of RHEL or CentOS and dynamically link an old version of glibc. Binaries would then work on newer systems
66.
▲
by
pansa2
10mo ago
>>> hash([1, 2]) TypeError: unhashable type: 'list' >>> t = ([1, 2], [3, 4]) >>> print(t) ([1, 2], [3, 4])
67.
▲
by
pansa2
10mo ago
> ImmutableFoo as a subclass of Foo is never going to work. And, indeed, `set` and `frozenset` don't have an inheritance relationship. Theoretically, could `set` be a subclass of `frozenset` (and `dict` of `frozendict`)? Do other
68.
▲
by
pansa2
10mo ago
There was a previous PEP (in 2012) with the exact same title: https://peps.python.org/pep-0416/ Also one in 2019 for a "frozenmap": https://peps.python.org/pep-0603/
69.
▲
by
pansa2
10mo ago
> The values in tuples cannot change. The values that keys point to in a frozen dict can? The entries of a tuple cannot be assigned to, but the values can be mutated. The same is true for a `frozendict` (according to the PEP they don&#
70.
▲
by
pansa2
10mo ago
I wonder whether Raymond Hettinger has an opinion on this PEP. A long time ago, he wrote: "freezing dicts is a can of worms and not especially useful". https://mail.python.org/pipermail/python-dev/2006-Fe
71.
▲
by
pansa2
10mo ago
> Jack Crenshaw's tutorial takes the syntax-directed translation approach, where code is emitted while parsing, without having to divide the compiler into explicit phases with IRs. Is "syntax-directed translation" just a
72.
▲
by
pansa2
10mo ago
> 90% of the horses in the US disappeared Where did they go?
73.
▲
by
pansa2
10mo ago
> Limitations […] No mutual recursion: Only direct self-recursion is optimized
74.
▲
by
pansa2
10mo ago
I’d say it’s more common for iterator-based loops to run to completion than to hit a `break` statement. The `StopIteration` exception is how the iterator signals that completion.
75.
▲
by
pansa2
10mo ago
In Python, it’s common to use exceptions for control flow. Even exiting a loop is done via an exception: `StopIteration`.
76.
▲
by
pansa2
10mo ago
> people should rather use EcmaScript name instead of JavaScript Or go back to calling it “LiveScript”
77.
▲
by
pansa2
10mo ago
> Using `lea` […] is useful if both of the operands are still needed later on in other calculations (as it leaves them unchanged) As well as making it possible to preserve the values of both operands, it’s also occasionally useful to u
78.
▲
by
pansa2
10mo ago
> Unlike other partial register writes, when writing to an e register like eax, the architecture zeros the top 32 bits for free. I’m familiar with 32-bit x86 assembly from writing it 10-20 years ago. So I was aware of the benefit of xo
79.
▲
by
pansa2
10mo ago
> Python is now sufficiently powerful and complex, that many proposed additions are a net loss for the language due to the additional complexity. […] Python was once described as “Python Fits Your Brain”, but that becomes less and less
80.
▲
by
pansa2
10mo ago
> 2**1000 = 2^1000 The reason for using `**` is that `^` is widely used for bitwise exclusive-or. So commonly `2**1000 != 2^1000`!
81.
▲
by
pansa2
11mo ago
Is this the same as the distinction between a model in which async functions "run synchronously to the first await" vs one in which they "always yield once before executing", as discussed here? https://www.red
82.
▲
by
pansa2
11mo ago
> Copying large objects like lists […] can be costly in both time and memory. > modify[ing] objects in place […] improves performance by avoiding the overhead of allocating and populating new structures. AFAIK the poor performance
83.
▲
Pre-PEP: Rust for CPython
(discuss.python.org)
2 points
by
pansa2
11mo ago
|
0 comments
84.
▲
Ruby 4.0.0 Preview2
(ruby-lang.org)
199 points
by
pansa2
11mo ago
|
89 comments
85.
▲
by
pansa2
11mo ago
Yeah, LuaJIT and PyPy run it in about 2 seconds. I haven't tried a Ruby JIT though.
86.
▲
by
pansa2
11mo ago
> How fast is Ruby, lately? I did recent testing that showed it to be faster than Python but slower than Lua: Lua, Ruby and Python ran my benchmark in 12, 18 and 25 seconds respectively. This was measured using the latest versions of e
87.
▲
by
pansa2
11mo ago
> To find hot spots, YJIT counts how many times your program calls each function or block At first glance this seems too simple. Compare it to JavaScript JITs, which IIRC can compile hot spots even in functions that are only called a
88.
▲
by
pansa2
11mo ago
You could also use a normal class, a direct translation of the Ruby example: @functools.total_ordering class AppVersion: def __init__(self, version_string): parts = [int(x) for x in str(version_string).split('.&
89.
▲
by
pansa2
11mo ago
> in a language subset you're always encountering things you would have in the full language Exactly. I once pitched the idea of a Python subset (with a different focus, not performance like SPy), and almost every reaction was &qu
90.
▲
by
pansa2
11mo ago
> with the simplicity of Python So, not simple at all, then? Python is a very complex language hiding behind friendly syntax. Do you just mean “with the syntax of Python”? Or does Nim’s similarity to Python go more than skin-deep?
More ›