HNHacker News
TopNewBestAskShowJobs

alkh

214 karma · joined March 2, 2023

submissionscomments
alkh··on Rust for the small things? but what about Python?
I agree with you overall but there's a huge caveat: you need to make sure whoever is writing the code in Python has performance in mind. The problem I encounter a lot is that many Data Scientists write unoptimized code that is taking longer to run than it should(ex. using for loops instead of numpy vectorization). You could have inefficient code in Rust as easily but even then the runtime difference would be the same.
alkh··on Rust for the small things? but what about Python?
The main criteria for me would be the frequency of execution. Say I have a model that will be retrained every quarter via CI/CD or Airflow DAG. Does it make a huge difference for me to have parsing done in 410.71ms in Rust vs 740 ms in Python(a convoluted example,of course)? Probably not. Would 400.71 ms vs 5 min, for example still make a difference? I don't think so either.

It would be a different matter entirely if that piece of code is executed more frequently and is also taking a lot of time as I could save both computing resources and money

alkh··on Debugging running Python scripts with PDB via GDB
That's really cool! I've just tested it, and it seems to still be in pdb even if the program finished successfully. Is there any way to make it so that it would enter the debugger only on an exception?
alkh··on Python extensions should be lazy
Re: 2, is there any good repo with raw C Python API that can be used as a reference for someone who is not too proficient in C? I took a look at numpy but it seems too complicated for me
alkh··on Show HN: Ell – A command-line interface for LLMs written in Bash
Looks great! I work on a number of different machines, so having something lightweight(like written in shell) is always desired.

Out of curiosity, can someone explain to me why certain commands start with a colon? Like : "${ELL_LOG_LEVEL:=2}";[1] I thought it was useful only as a no-op? [1]: https://github.com/simonmysun/ell/blob/main/ell.sh#L19C1-L19...

alkh··on Show HN: Wat – Deep inspection of Python objects
It important to remind everyone that you can already do something similar via the build-in function help(). For example, if I run help({1}) I get the documentation for a set, running help(set.add) gives the documentation for the add() method, etc. You can even preview objects that you haven't imported by using strings(ex. running help('numpy.ndarray') will correctly give you the documentation, provided numpy is installed in your current python environment). It's pretty helpful and doesn't require installing anything extra
alkh··on Use a work journal
Sadly, the image doesn't load to me (I get ![[focus.png]] instead)
alkh··on Rotz: Cross platform dotfile manager written in Rust
Is there any specific benefit of using this instead of GNU stow besides the Windows support(for Linux/OS X only folks)?
alkh··on How is a binary executable organized? Let's explore it (2014)
For a person with a heavy Python background, can anyone suggest a resource/book that would be a good applied intro to practical low-level programming? I've recently started learning Rust and realized I need to catch up on many things. I haven't taken any compiler course, so maybe that's the reason I am missing so much information. For example, I had no idea that symbols in a binary were a thing or what the difference between ELF/MACH-O was
← PreviousPage 4 of 4