HNHacker News
TopNewBestAskShowJobs

pansa2

4,101 karma · joined January 24, 2020

submissionscomments
pansa2··on My “grand vision” for Rust
Crystal’s syntax is similar to Ruby’s, but AFAIK the similarity more-or-less ends there.
pansa2··on Warn about PyPy being unmaintained
You’re right, of course: even Guido seems to have been moved off working on CPython and onto some tangentially-related AI technology.

However, Faster CPython was supposed be a 4-year project, delivering a 1.5x speedup each year. AFAIK they had the full 4 years at Microsoft, and only achieved what they originally planned to do in 1 year.

pansa2··on Warn about PyPy being unmaintained
PyPy is a fantastic achievement and deserves far more support than it gets. Microsoft’s “Faster CPython” team tried to make Python 5x faster but only achieved ~1.5x in four years - meanwhile PyPy has been running at over 5x faster for decades.

On the other hand, I always got the impression that the main goal of PyPy is to be a research project (on meta-tracing, STM etc) rather than a replacement for CPython in production.

Maybe that, plus the core Python team’s indifference towards non-CPython implementations, is why it doesn’t get the recognition it deserves.

pansa2··on Index, Count, Offset, Size
Fundamentally, CPUs use 0-based addresses. That's unavoidable.

We can't choose to switch to 1-based indexing - either we use 0-based everywhere, or a mixture of 0-based and 1-based. Given the prevalence of off-by-one errors, I think the most important thing is to be consistent.

pansa2··on Index, Count, Offset, Size
The reason many languages prefer `length` to `count`, I think, is that the former is clearly a noun and the latter could be a verb. `length` feels like a simple property of a container whereas `count` could be an algorithm.

`countof` removes the verb possibility - but that means that a preference for `countof` over `lengthof` isn't necessarily a preference for `count` over `length`.

pansa2··on Lost Soviet Moon Lander May Have Been Found
At least one of them is wrong
pansa2··on I write games in C (yes, C) (2016)
Yeah, you could argue that choosing C is just choosing a particular subset of C++.

The main difference from choosing a different subset, e.g. “Google C++” (i.e. writing C++ according to the Google style guide), is that the compiler enforces that you stick to the subset.

pansa2··on I write games in C (yes, C) (2016)
There’s also CimGUI. I know the underlying C++ library is well-regarded - I’m curious to hear people’s experiences using the C wrapper.

https://github.com/cimgui/cimgui

pansa2··on Lily Programming Language
> statically-typed

> Embed/extend in C

Is Lily intended to be (or could it be used as) a statically-typed alternative to Lua?

Personally I'm happy with dynamic typing for scripting - but I suspect many people would welcome a statically-typed option, and there don't seem to be many available.

pansa2··on Sinclair C5
Second-chance pool

https://news.ycombinator.com/item?id=26998308

pansa2··on Show HN: Axis – A systems programming language with Python syntax
> You basically need two pieces of state

That’s enough for INDENT, but for DEDENT you also need a stack of previous indentation levels. That’s how, when the amount of indentation decreases, you know how many DEDENTs to emit.

The requirement for a stack means that Python’s lexical grammar is not regular.

pansa2··on Anthropic invests $1.5M in the Python Software Foundation
> It's a pretty nice best-of-both-worlds arrangement

It’s also a worst-of-both-worlds arrangement, in that you have to do the extra work to satisfy the type checker but don’t get the benefits of a compiled language in terms of performance and ease-of-deployment, and only partial benefits in terms of correctness (because the type system is unsound).

AFAIK the Dart team felt this way about optional typing in Dart 1.x, which is why they changed to sound static typing for Dart 2.

pansa2··on Anthropic invests $1.5M in the Python Software Foundation
> Never had anyone "frown" towards me for not using MyPy or any typechecker either

I’ve seen it many times. Here’s one of the more extreme examples, a highly-upvoted comment that describes not using type hints as “catastrophically unprofessional”:

https://www.reddit.com/r/Python/comments/1iqytkf/python_type...

pansa2··on Anthropic invests $1.5M in the Python Software Foundation
AFAICT Python basically is a [statically-]typed language nowadays. Most people are using MyPy or an alternative typechecker, and the community frowns on those who aren’t.
pansa2··on Fossil versus Git
> you need to [use Git] to work with everyone else

Programmers use different operating systems, editors, languages - is there any reason we all have to use the same source control tool? We weren’t doing so before Git came along.

pansa2··on OLED, Not for Me
> OLEDs make great TVs and gaming monitors [...] But on desktop monitors for still things — text and fine lines — OLEDs currently just aren’t great

It seems that LCD has long been the best technology for desktop monitors - but interestingly, despite its popularity, may never have been the best technology for TVs. CRT, plasma and now OLED have all had better image quality than contemporary LCDs.

pansa2··on Six-decade math puzzle solved by Korean mathematician
6 is the product of the members of the set {2, 3}.

3 is the product of the members of {3}.

1 is the product of the members of the empty set.

pansa2··on Tally – A tool to help agents classify your bank transactions
But can he invert a binary tree?
pansa2··on Mruby: Ruby for Embedded Systems
Syntactically: From `~=` instead of `!=`, and no support for `+=` or `continue`, to free-form syntax with no statement separators - except in that one place where they're necessary.

Semantically: Conflation of arrays and maps, conflation of `nil` and empty (both in tables and in function arguments), and the perennially-unpopular 1-based indexing.

pansa2··on Mruby: Ruby for Embedded Systems
Mruby isn’t aimed at embedded systems, it’s “lightweight Ruby” intended to be embedded within a lower-level application. The language it’s most similar to is Lua.

My gut feeling comparing the two is that mRuby is a better (or at least less “quirky”) language, but Lua has a better (more robust) implementation. I don’t know how the two compare in terms of performance or “lightweight-ness”.

Lua definitely seems to be more widely-used, at least outside Japan.

pansa2··on T-Ruby is Ruby with syntax for types
How alike actually are Ruby and Crystal? I’ve heard the similarity is only skin-deep: similar syntax but quite different semantics.

In other words, isn’t describing Crystal as “Ruby with types” similar to describing C++ as “JavaScript with types”?

pansa2··on Python 3.15’s interpreter for Windows x86-64 should hopefully be 15% faster
Unladen Swallow got a lot of hype but was only a very small project. IIRC the only people working on it were two interns.

V8 was a much higher priority - Google hired many of the world’s best VM engineers to develop it.

pansa2··on Python 3.15’s interpreter for Windows x86-64 should hopefully be 15% faster
> I would also say there’s generally less impetus to optimize CPython

Nonetheless, Microsoft employed a whole "Faster CPython" team for 4 years - they targeted a 5x speedup but could only achieve ~1.5x. Why couldn't they make a significantly faster Python implementation, especially given that PyPy exists and proves it's possible?

pansa2··on Python 3.15’s interpreter for Windows x86-64 should hopefully be 15% faster
> python - as a language - is way more "dynamic" than javascript

Very true, but IMO the existence of PyPy proves that this doesn't necessarily prevent a fast implementation. I think the reason for CPython's poor performance must be your other point:

> the ffi-bindings of python [...] limit how freely the internals can be changed

pansa2··on Ruby 4.0.0
True. Choosing between the two languages usually comes down to their library ecosystems - or more bluntly, to Rails on one hand vs NumPy on the other.

Nonetheless, it's still common for people to talk about the relative performance of the two languages, and to claim that Ruby is slower than Python. As someone who's actually tested this, it hasn't been true for 15 years.

pansa2··on Ruby 4.0.0
> that’s faster

In every test I've done, Ruby has been faster than Python. In my experience that's been the case since Ruby 1.9, with the move to YARV.

pansa2··on Ruby 4.0.0
> fastapi, pytorch, langchain, streamlit, and so on and on

It's telling that your reasons for switching are all features of Python's ecosystem, not of the language itself. A lot of developers are moving to Python because of its libraries, and in many cases they don't care for the language at all.

That's causing a problem for Python: many of these developers who'd rather be using different languages seem to want to morph Python into their language of choice. The result is that the Python language is pulled in many different directions, and with each release gets increasingly bloated and strays further from its foundations.

Ruby, on the other hand, has a community that's mostly made up of people who actually like the language. That allows it to do a much better job of staying true to its core philosophy.

pansa2··on What's New in Python 3.15
If valid `data` can be zero, an empty string, or anything else “falsy”, then your version won’t handle those values correctly. It treats them the same as `None`, i.e. not found.
pansa2··on What's New in Python 3.15
> faster-cpython project

Seems to have died the same death as Unladen Swallow, Pyston, etc:

https://discuss.python.org/t/community-stewardship-of-faster...

pansa2··on Announcing the Beta release of ty
Specifically, it's like asking if there are any studies that demonstrate benefits of static typing. Are there?
← PreviousPage 2 of 34Next →