Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pansa2
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
25 ms
·
361.
▲
by
pansa2
2y ago
> convert [dicts] immediately to data structures providing semantics [...] You can simplify your work by employing a library that makes “better classes” for you Python seems to have many different kinds of "better classes" -
362.
▲
by
pansa2
2y ago
> Wow ... big part of my childhood ... those robot ball things! Yes! And the noughts-and-crosses game they played during the credits: https://www.youtube.com/watch?v=6nJ2vyXKOOE
363.
▲
by
pansa2
2y ago
Yeah, the past tense on the What’s New page isn't (yet) accurate: > Python 3.13 was released on October 7, 2024
364.
▲
by
pansa2
2y ago
Python versions 3.11, 3.12 and now 3.13 have contained far fewer additions to the language than earlier 3.x versions. Instead the newest releases have been focusing on implementation improvements - and in 3.13, the new REPL, experimental JI
365.
▲
by
pansa2
2y ago
> “Just rewrite the hot function in rust, bro” and “just import multiprocessing, bro” are functionally identical to rewriting most of the application for these. Isn't "just use threads, bro" likely to be equally difficul
366.
▲
by
pansa2
2y ago
A while ago, when thinking about syntax design for a new language, I considered this combination (`:` and `end`, as opposed to `do` and `end` as used by Lua etc). Are there any languages that use it, or is Python unique in using `:` to begi
367.
▲
by
pansa2
2y ago
>>> from __future__ import braces SyntaxError: not a chance
368.
▲
by
pansa2
2y ago
Did this attempt manage to preserve single-threaded performance, or was the requirement dropped?
369.
▲
by
pansa2
2y ago
> What is the real world benefit we will get in return? If you have many CPU cores and an embarrassingly parallel algorithm, multi-threaded Python can now approach the performance of a single-threaded compiled language.
370.
▲
by
pansa2
2y ago
> Python is thus very much part of the modern statically typed languages scene (moreso than Go) Python’s type system is substantially more complex than Go’s - it’s probably more complete , but given it’s optional nature, less sound .
371.
▲
by
pansa2
2y ago
> two mature type checkers I’ve never quite understood how this works. Surely a type system is absolutely fundamental to a language - how can you have multiple incompatible ones? Do you need to choose a particular type checker for each
372.
▲
by
pansa2
2y ago
> an OO system that looks like it has been bolted in, compared to Ruby I think the two languages just have different design philosophies. In Python, functions are fundamental and classes are built on top of them. In Ruby, objects are f
373.
▲
by
pansa2
2y ago
> something that doesn't get used Sorry, you've lost me. What doesn't get used?
374.
▲
by
pansa2
2y ago
Thanks!
375.
▲
by
pansa2
2y ago
Here, for example: https://www.quora.com/Is-LuaJIT-still-faster-than-JavaScript... LuaJIT's speed is very impressive, but the optimizations it can use are limited by its desire to remain lightweight. It's understa
376.
▲
by
pansa2
2y ago
> It seems like each version of lua is kind of a separate language. In Lua's versioning scheme, each 0.1 increment is a new major version. That means Lua 5.1 => 5.2 => 5.3 => 5.4 is similar to Python 2 => 3 => 4 =&g
377.
▲
by
pansa2
2y ago
> is that it? Performance? Performance, size and compatibility. It's essentially a drop-in replacement for the stock Lua 5.1 implementation, with the same small size but with much higher performance. About the only downside compar
378.
▲
by
pansa2
2y ago
> in my opinion they all do the wrong thing What would be the right thing? Combining the original exception and the error from `close` into some kind of `MultipleError`?
379.
▲
by
pansa2
2y ago
AFAIK Python/C# use a similar approach to Go - instead of `defer`, they have `using`/`with` statements. Go's `defer` seems more flexible though - it can execute custom code each time it's used, whereas `using`/`with
380.
▲
by
pansa2
2y ago
> "Purer" unsafety issues are treated as bugs and patched, but that doesn't stop them from existing periodically. Yeah, the same is true for Lua (search for "segfault" here: https://www.lua.org/
381.
▲
by
pansa2
2y ago
> memory-unsafety is difficult to accidentally reach from regular Python code Can you give an example of Python (source) code that isn't memory safe? I assumed Python would be similar to Lua in this respect - the interpreter is me
382.
▲
by
pansa2
2y ago
> this is pretty weird in multi lines: [obj.y for obj in my_list if obj.x >3 ] Yeah, it's a shame that Python doesn't allow us to write this as `[for obj in my_list: if obj.x > 3: obj.y]`
383.
▲
by
pansa2
2y ago
Ruby's object system is much nicer than Python's, but Ruby has plenty of warts of its own. For example: extremely complex syntax compared to Python's LL(1), overloaded constructs like blocks/procs/lambdas (whereas P
384.
▲
by
pansa2
2y ago
> But I don't think ints, strings, or bytes do Everything in CPython is pass-by-reference. But there's no difference between that and pass-by-value for types like `int` and `str` because they're immutable.
385.
▲
by
pansa2
2y ago
> It's popular because it's popular It's interesting - Python originally became popular because of the language itself, which led to the creation of libraries like NumPy, SciPy etc. But more recently, people come to Pyth
386.
▲
Python Developers Survey 2023 Results
(lp.jetbrains.com)
3 points
by
pansa2
2y ago
|
0 comments
387.
▲
by
pansa2
2y ago
If you're looking for a high-level scripting language for small projects that you keep to yourself, Ruby is the obvious alternative to Python. Lua not so much - it's fine when embedded but doesn't have the ecosystem for stand
388.
▲
by
pansa2
2y ago
I've heard this several times - "Go would be great if only they added <my-favourite-feature>"... Go's philosophy is that a coherent, curated feature set is as valid an approach to language design as the C++/Py
389.
▲
by
pansa2
2y ago
> Will this always necessarily be substantially slower than Javascript? Yes, interpreted Python will always be slower than JIT-compiled JavaScript. PyPy.js [0] is a JIT compiler for Python that runs in the browser - its performance cou
390.
▲
by
pansa2
2y ago
Brython seems to be a Python => JS translator, rather than an in-browser Python implementation. Similar end result, but works in a completely different way. https://yasoob.me/2019/05/22/running-python-in-th
More ›