Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pansa2
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
61 ms
·
691.
▲
by
pansa2
6y ago
What might “Python, but with modern type inference” look like? Are there other existing languages that come close to matching that description?
692.
▲
by
pansa2
6y ago
David Beazley agrees with your last paragraph in a recent tweet: “Python is at least three different programming languages at this point.” https://mobile.twitter.com/dabeaz/status/1373296229711376387
693.
▲
by
pansa2
6y ago
It’s interesting how close together those percentages are. Python developers may well be split 50:50 or 60:40 on the issue of whether or not to use static typing. For the language that’s famously supposed to have “one obvious way to do it”,
694.
▲
by
pansa2
6y ago
> The generic dilemma is this: do you want slow programmers, slow compilers and bloated binaries, or slow execution times? Now that the Go team has approved a design for generics, which of these did they choose? Or did they “somehow ma
695.
▲
Adoption of Mypy for Python type checking: 45% already use it, 40% don't plan to
(twitter.com)
114 points
by
pansa2
6y ago
|
130 comments
696.
▲
by
pansa2
6y ago
AFAIK Julia doesn’t even have a well-defined syntax (there’s no specification such as a context-free grammar, only the implementation of the parser).
697.
▲
by
pansa2
6y ago
I must be missing something. “Subject has clicked the button” “Subject has scrolled down” “Subject has resized the window” etc. So what?
698.
▲
by
pansa2
6y ago
IIUC if `myfunc` is an async function, calling it will immediately return a coroutine object. None of the function’s code will run until it is `await`ed. (Unlike some other languages, async-await in Python is not “synchronous to the first a
699.
▲
by
pansa2
6y ago
-
700.
▲
by
pansa2
6y ago
Julia is dynamically typed.
701.
▲
by
pansa2
6y ago
Could you give an example? To me (I’m not a C++ programmer), “elaborate function dispatch hierarchies” sound like complexity that should be avoided.
702.
▲
by
pansa2
6y ago
See also “New fastest portable hash: wyhash” from 2019: https://news.ycombinator.com/item?id=19357895
703.
▲
by
pansa2
6y ago
> everything runs in green threads that can be suspended when IO would block AFAIK the main objection to this model is that you have to write your code so that it can handle being suspended at any point. OTOH when using async-await, th
704.
▲
by
pansa2
6y ago
The example uses `g(h2)`, not `g(h2())` - `g` takes the function `h2` as an argument, and the call(s) to `h2` are made from within `g` itself. If calling `h2` requires an `await` if and only if `h2` is async, then the function `g` can’t be
705.
▲
by
pansa2
6y ago
Despite the title, the article accepts that function colours exist in Rust. The question is, does it matter? Here’s a specific scenario to think about. If I have synchronous functions `f`, `g` and `h`, `f` can call `g(h)` and `g` can in tur
706.
▲
by
pansa2
6y ago
> I think using variables of equal lengths with opposite meanings is an anti-pattern. Perhaps the worst example of this is Kotlin’s var/val. I much prefer var/const.
707.
▲
by
pansa2
6y ago
That’s an exemption from the ban on “circumvent[ing] a technological measure”, not an exemption from copyright law as a whole. AFAIK the Internet Archive still has to ensure that its use of copyrighted software is covered by “fair use”.
708.
▲
by
pansa2
6y ago
Initial thoughts: - Seems to be using gradual typing - type annotations are optional but, if used, are enforced (at run-time if necessary). The traditional problem with this approach has been poor performance - is that an issue here? Can yo
709.
▲
by
pansa2
6y ago
The linked page describes the Toit language, but the project as a whole seems to be more than just a new language. Specifically, Toit is a “software platform for microcontrollers [...] by the team of developers that previously built V8 for
710.
▲
Python 3.10.0a6 is available, now with 100% more pattern matching
(mail.python.org)
125 points
by
pansa2
6y ago
|
79 comments
711.
▲
by
pansa2
6y ago
> I think a language in Python's niche that was created today would have a simple type system with extensive inference How do you think a “simple type system”, suitable for a Python-like language, would look? The type systems that
712.
▲
by
pansa2
6y ago
From https://mobile.twitter.com/brettsky/status/13643808111814819... : > For those that voted for "static typing, strict type hinting" as a desired feature: what did you mean by this? What are type hi
713.
▲
Python developers want static typing
(infoworld.com)
1 points
by
pansa2
6y ago
|
1 comments
714.
▲
by
pansa2
6y ago
> Go has it's own special defer which only fires on function end, otherwise defer has consistent "execute at scope end" semantics. Does anyone know why Go’s `defer` semantics is so unintuitive? Why is `defer` function-ba
715.
▲
by
pansa2
6y ago
> There's probably a long discussion about the rationale in some PEP PEP 3113 -- Removal of Tuple Parameter Unpacking: https://www.python.org/dev/peps/pep-3113/
716.
▲
by
pansa2
6y ago
> I don't know how I missed this It wasn’t added until Python 3.8 (f-strings were new in 3.6).
717.
▲
Python Developers Survey 2020 Results
(jetbrains.com)
20 points
by
pansa2
6y ago
|
0 comments
718.
▲
by
pansa2
6y ago
But when removing an item it’s not necessary to visit every element, just re-arrange the pointers (and in CPython, modify the reference count of the item that was removed).
719.
▲
by
pansa2
6y ago
Linked-lists, maybe, but `list`s in Python are just resizable arrays.
720.
▲
by
pansa2
6y ago
> You'll find that a fair amount of single-header C libraries that are explicitly C89-supporting are in use by game developers. Is that true? I thought low-level game development was almost entirely in C++. Why is there resistance
More ›