HackerTrans
トップ新着トレンドコメント過去質問紹介求人

pansa2

4,068 カルマ登録 6 年前

投稿

Proposal: Generic Methods for Go

github.com
1 ポイント·投稿者 pansa2·6 か月前·0 コメント

The many advantages of dynamic languages (2020)

erik-engheim.medium.com
8 ポイント·投稿者 pansa2·6 か月前·0 コメント

Pre-PEP: Rust for CPython

discuss.python.org
2 ポイント·投稿者 pansa2·8 か月前·0 コメント

Ruby 4.0.0 Preview2

ruby-lang.org
199 ポイント·投稿者 pansa2·8 か月前·89 コメント

Why every Rust crate feels like a research paper on abstraction

daymare.net
59 ポイント·投稿者 pansa2·9 か月前·50 コメント

コメント

pansa2
·6 日前·議論
I always liked the fact that 10! (10 factorial) is exactly the number of seconds in six weeks.

  6 weeks * 7 days * 24 hours * 60 minutes * 60 seconds:

    6 * 7 * 24 * 60 * 60
  = 6 * 7 * (3 * 8) * (4 * 5 * 3) * (3 * 2 * 10)
  = 6 * 7 * 3 * 8 * 4 * 5 * (3 * 3) * 2 * 10
  = 6 * 7 * 3 * 8 * 4 * 5 * 9 * 2 * 10
  = 1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10
pansa2
·14 日前·議論
What’s a good small laptop that’ll run a recent Linux distro? I’d like to get one to have an ultra-portable machine for doing lightweight development work - I don’t need much more than a text editor and a C compiler.

Would a second-hand 11” MacBook Air or 12” MacBook be a good choice?
pansa2
·16 日前·議論
So is LuaJIT resuming active development after a decade or so of only maintenance? Great!

A lot of these changes make sense (although some of them are a bit too TIMTOWTDI for my taste) - but perhaps LuaJIT 3 would benefit from a change of name as well? Certainly with all these changes, it would be more like a separate language than merely a JIT-compiled version of Lua.
pansa2
·先月·議論
Lua is the same IIRC: open source but not open development.

It’s MIT licensed, and the maintainers are always grateful for bug reports, but all the code in the project was written by just 3 people.
pansa2
·先月·議論
> The C interface to ruby is just superb.

How does it handle garbage collection? AFAIK GC is the main reason behind Lua's stack-based API: it's designed so that C code never needs to hold a pointer to a Lua object, which means an object will never be garbage-collected while C code is still trying to use it.

OTOH Python does allow C code to hold such pointers - so it requires that code to perform error-prone manual reference-counting.

How does Ruby solve this problem?
pansa2
·先月·議論
I guess it alludes to “The Dark Side of the Moon”
pansa2
·2 か月前·議論
Mojo?
pansa2
·2 か月前·議論
`npm isntall`
pansa2
·2 か月前·議論
> they intended to make it compatible with existing Python code

That was the original claim, but it was quietly removed from the website. (Did they fall for the common “Python is a simple language” misconception?).

Now they promise I can “write like Python”, but don’t even support fundamentals like classes (which are part of stage 3 of the roadmap, but they’re still working on stage 1).

Maybe Mojo will achieve all its goals, but so far has been over-promising and under-delivering - it’s starting to remind me of the V language.
pansa2
·2 か月前·議論
> New Zealanders are forced to pay a sky high TV licence

There’s no TV license in New Zealand
pansa2
·2 か月前·議論
The PEP for this change is here [0] and discussion of it is here [1]. Both are very long and seem to represent a huge amount of complexity, apparently to make installing Python easier for novices?

But what about those of us who listened to Rich Hickey and prefer "simple" over "easy"? With the executable installer no longer available, how do I get a copy of python.exe, python316.dll etc onto my machine so that `C:\Python316\python.exe <script>` works, without having to think about `py`, `pymanager`, Windows Store etc?

[0] https://peps.python.org/pep-0773/

[1] https://discuss.python.org/t/pep-773-a-python-installation-m...
pansa2
·3 か月前·議論
In a similar vein, see this page about the performance of the interpreter for the dynamic language Wren: https://wren.io/performance.html

Unlike the Zef article, which describes implementation techniques, the Wren page also shows ways in which language design can contribute to performance.

In particular, Wren gives up dynamic object shapes, which enables copy-down inheritance and substantially simplifies (and hence accelerates) method lookup. Personally I think that’s a good trade-off - how often have you really needed to add a method to a class after construction?
pansa2
·3 か月前·議論
Yes, Smalltalk's syntax fits on a postcard - and it's possible to go even more minimal than that, e.g. Lisp or Forth.

OTOH Ruby doesn't need a postcard, it needs a full poster.
pansa2
·4 か月前·議論
> all the encoding/decoding functions default to utf-8

Languages that use UTF-8 natively don't need those functions at all. And the ones in Python aren't trivial - see, for example, `surrogateescape`.

As the sibling comment says, the only benefit of all this encoding/decoding is that it allows strings to support constant-time indexing of code points, which isn't something that's commonly needed.
pansa2
·4 か月前·議論
> Wouldn't this get the funding back?

The funding was Microsoft employing most of the team. They were laid off (or at least, moved onto different projects), apparently because they weren't working on AI.
pansa2
·4 か月前·議論
The Python devs didn’t want to make huge changes because they were worried Python 3 would end up taking forever like Perl 6. Instead they went to the other extreme and broke everyone’s code for trivial reasons and minimal benefit, which meant no-one wanted to upgrade.

Even the main driver for Python 3, the bytes-Unicode split, has unfortunately turned out to be sub-optimal. Python essentially bet on UTF-32 (with space-saving optimisations), while everyone else has chosen UTF-8.
pansa2
·4 か月前·議論
Maybe they could have two versions of the interpreter, one that’s thread-safe and one that’s optimised for single-threading?

Microsoft used to do this for their C runtime library.
pansa2
·4 か月前·議論
There isn’t a dev mailing list any more, is there? Do you mean the Discord forum?
pansa2
·4 か月前·議論
>> Python 2->3 transition

> taking backwards compatibility so seriously

Python’s backward compatibility story still isn’t great compared to things like the Go 1.x compatibility promise, and languages with formal specs like JS and C.

The Python devs still make breaking changes, they’ve just learned not to update the major version number when they do so.
pansa2
·4 か月前·議論
Crystal’s syntax is similar to Ruby’s, but AFAIK the similarity more-or-less ends there.