Hacker Newsnew | past | comments | ask | show | jobs | submit | adhami's commentslogin

it's possible to render data out-of-core with XY, allowing it to render the entirety of OpenStreetMaps (that's 10,742,674,832 nodes!) with sub-second pan/zooms. it's a bit difficult to host online but you can try it out locally: https://github.com/reflex-dev/xy/tree/main/examples/osm


it's possible! although many of the constraints in this blog were because we wanted to work with ast module in Python. If we were allowed to create our own types, we can do so much better. I think ruff has an even faster walk by those standards.

It seems bandit is using some decent optimizations already, looking at the `@test.checks("Call")` seems like they already captured some easy wins.

The largest win honestly would be using the same ast.walk for multiple rules, which we also did, but not mentioned in the blog.


ruff probably does.

Docs for ruff_python_ast: https://docs.rs/littrs-ruff-python-ast/latest/ruff_python_as...

src: ruff/crates/ruff_python_ast: https://github.com/astral-sh/ruff/tree/main/crates/ruff_pyth...

ast.toml, generate.py, Cargo.toml, src/ https://github.com/astral-sh/ruff/blob/main/crates/ruff_pyth...

Just rewrote docutils and myst-md-parser in rust with byte-for-byte equivalent output the other day; as westurner/dsport/src/docutilsrs and sphinxdocrs and so on. Pygmentsrs required fancy-regex because rust regex is linear. rstest and cargo-insta helped.

PyCQA/docformatter https://github.com/PyCQA/docformatter and https://github.com/PyCQA/doc8 would be useful in rust, too. This from the other day: "A benchmark for catching when code doesn't do what its documentation claims"; docs fidelity evals https://news.ycombinator.com/item?id=48530786


only because I'm too lazy to learn how to write C with Python, if anything Rust wasn't helpful with all of those unsafes


You’d have to spend a bit of time picking apart your arguments and releasing stuff on early error returns, but otherwise the Python/C API is completely banal and doesn’t really have much to learn. It might be worth the time to poke at it at some point to assure yourself this is the case.

(Or you could switch to C++ and use pybind11, but now you’re just switching from one quite complex and somewhat off-putting language to another really complicated and very ugly one, so the win is less clear.)


I was wondering how 2048 would feel like if instead of powers of two, we can merge consequent fibonacci numbers. Turns out to be a rather interesting game that is fairly forgiving and grows very slowly. I found it difficult to come up with an overall strategy. I had a simple search algorithm that was able to achieve a score of exactly 66,666 (not joking). Getting a 987 block shouldn't be difficult.

You can take a look into the code here: https://github.com/adhami3310/987 (the simple search algorithm is inside the code as well)


I'm the tech lead! Your feedback is highly appreciated :)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: