News for hackers. Stuff that matters.

smacke

Show HN: Automagically synchronize subtitles with video, in-browser clientside

https://smacke.net/ffsubsync/

Input a video and subtitle file, receive a synchronized output, no need to mess with python environments are dependencies (which historically was a challenge for ffsubsync users). This works thanks to ffmpeg.wasm to extract audio + pyodide for all the python dependencies (including one I had to compile to webassembly myself in order to get voice audio detection, since all I had was the...

( Read More... | no comments | on HN )
Re:Ask HN: What Are You Working On? (July 2026) on Sunday July 12, 2026 @06:40PM (#48885605)
I started burning down the backlog of all the stuff I wanted to get to for side projects but never had time for (before LLMs):

- https://smacke.net/ffsubsync -- automagically synchronize subtitles, now purely client-side in your browser thanks to pyodide

- https://ipyflow.github.io/ipyflow/lab/index.html?path=demo.i... -- reactive python jupyter notebooks, again in the browser thanks to pyodide / jupyterlite

- https://smacke.net/pipescript/lab/index.html?path=demo.ipynb -- magritter-like pipe / placeholder syntax for ipython / jupyter, again able to run purely in the browser

- https://smacke.net/pycograd/lab/index.html?path=pycograd_sim... -- pyccolo and pipescript-powered autograd, once again able to run purely in the browser since numpy has a wasm target (notice a theme here :) )

Re:Show HN: Magrittr-like pipe syntax for IPython on Tuesday January 06, 2026 @09:52AM (#46512973)
Some auto formatting italicized the text between * on different lines :')

Should be `reduce[$*$]`

Show HN: Magrittr-like pipe syntax for IPython

https://github.com/smacke/pipescript

Hi HN, sharing my holiday season passion project, pipescript, which lets you write code like this in Jupyter Python notebooks:42 |> $+1 # 43The $ is a placeholder for the value in the previous pipeline step, like (.) in magrittr.There's a ton more you can do thanks to macro expansion capabilities added by pipescript. Here's 5 factorial:range(1, 6) |> reduce[$$] # 120Placeholders can also...

( Read More... | 1 comment | 2 points | on HN )
Re:Show HN: Powerful pipeline syntax for IPython and Jupyter on Sunday January 04, 2026 @08:45AM (#46487891)
Hi HN, I built pipescript over the holidays after I discovered magrittr for R and realized the same kind of pipe operator and placeholder syntax could be implemented for Python notebooks with a bit of creativity. I developed it while using it in parallel for Advent of Code and had a lot of fun with it; hope you like it.
Re:Reloading Classes in Python on Saturday August 30, 2025 @02:12AM (#45072305)
Pickling + unpickling the object is a neat trick to update objects to point to the new methods, but it's even more straightforward to just patch `obj.__class__ = reloaded_module.NewClass`. This is what ipython's autoreload extension used to do (and still does in some circumstances, along with other tricks to patch up old references), though nowadays it's had some improvements over this approach: https://github.com/ipython/ipython/pull/14500
I developed a tool (https://github.com/smacke/ffsubsync) which can sync subtitles against each other (or even against an audio track), and this can be used in conjunction with other tools such as https://pypi.org/project/srt/ to combine multiple subtitle streams into a single stream. I've used this strategy to good effect to get both English and Chinese subtitles up at once.
Re:Beautiful Proof of Heron's Formula on Monday April 15, 2024 @01:16AM (#40037280)
Discussion on reddit from when I posted about this (more than 10 years ago now!): https://old.reddit.com/r/math/comments/144qc4/a_beautiful_pr...

Original pdf seems to have been taking down from AOPS but is still available in the internet archive: https://web.archive.org/web/20121018044426/https://artofprob...

You're probably referring to nbgather (https://github.com/microsoft/gather), which shipped with VSCode for a while.

nbgather used static slicing to get all the code necessary to reconstruct some cell. I actually worked with Andrew Head (original nbgather author) and Shreya Shankar to implement something similar in ipyflow (but with dynamic slicing and a not-as-nice interface): https://github.com/ipyflow/ipyflow?tab=readme-ov-file#state-...

I have no doubt something like this will make its way into marimo's roadmap at some point :)

ipyflow has a %%memoize magic which looks quite similar to %%xetmemo (just without specifying the inputs / outputs explicitly): https://github.com/ipyflow/ipyflow/?tab=readme-ov-file#memoi...

Would be cool if we could come up with a standard that works across notebooks / libraries!

I'm a big fan of Marimo (and of Akshay and Myles in particular); it's great to finally see a viable competitor to Jupyter as it can only mean good things for the ecosystem of scientific tooling as a whole.
Re:Fortran 2023 on Wednesday November 22, 2023 @04:21PM (#38385290)
I don't think anything here is in conflict with the statement that Fortran can be faster than C in some cases, but yes you're right that technically that should be qualified as naive Fortran can be faster than naive C
Re:Fortran 2023 on Wednesday November 22, 2023 @11:23AM (#38381295)
Fortran can be faster than C because it has a more restrictive memory model (compiler can make more optimizations when it knows nothing else is aliasing some memory)
> Another giveaway is the ratio of stars to watchers / forks. I remember one project with thousands of stars but only 10 users "watching" it. They went on to raise a sizable seed round too.

Not necessarily indicative of foul play. I have two projects like this (https://github.com/smacke/ffsubsync and https://github.com/ipyflow/ipyflow) and I attribute it to not having great developer documentation.

Re:Flappy Bird Implemented in TypeScript Types on Friday October 20, 2023 @06:10PM (#37962061)
Is the recursion limit an implementation detail of the compiler though, or something statically built into the language? If the former there's nothing to prevent the language itself from being Turing complete.

(Similar to how every Turing complete programming language today runs on something technically weaker than a Turing machine due to finite memory.)

Re:LSP could have been better on Thursday October 12, 2023 @02:52PM (#37861383)
Ah yeah, Carlos is very low on cycles (like all of us I guess), probably due to the day job. (If only OSS had competitive pay...)
Re:LSP could have been better on Thursday October 12, 2023 @01:35AM (#37853773)
Have you opened an issue against https://github.com/python-lsp/python-lsp-server? I'm an occasional contributor for easy fixes; if your fix is easy chances are it would get picked up.
Re:Python 3.12 on Monday October 02, 2023 @03:41PM (#37743386)
It's not in the highlights, but one of the things that excites me most is this: https://docs.python.org/dev/whatsnew/3.12.html#pep-669-low-i...

> PEP 669 defines a new API for profilers, debuggers, and other tools to monitor events in CPython. It covers a wide range of events, including calls, returns, lines, exceptions, jumps, and more. This means that you only pay for what you use, providing support for near-zero overhead debuggers and coverage tools. See sys.monitoring for details.

Low-overhead instrumentation opens up a whole bunch of interesting interactive use cases (i.e. Jupyter etc.), and as the author of one library that relies heavily on instrumentation (https://github.com/ipyflow/ipyflow), I'm very keen to explore the possibilities here.

Re:Mojo: It’s Finally Here on Thursday September 07, 2023 @01:39PM (#37422638)
Didn't try downloading the SDK yet, but in the playground, seems like the "Python superset" advertisement does not hold (trying to define a class gives "error: classes not implemented yet"). Great to see progress in this space but I think the real killer feature of Mojo would be to run any existing Python program and allow programmers to incrementally adopt Mojo's syntax for targeted optimizations, and seems like we're not there yet.
Re:Jupyter Notebook 7 on Thursday July 27, 2023 @05:53AM (#36891234)
What would a "composable" experience look like?
Re:IPyflow: Reactive Python Notebooks in Jupyter(Lab) on Thursday May 18, 2023 @05:25PM (#35994256)
Err, I guess Pluto probably needs the round trip too but I guess Julia is faster after the initial jit...
Re:IPyflow: Reactive Python Notebooks in Jupyter(Lab) on Saturday May 13, 2023 @03:12AM (#35926325)
TY for the feedback; updated the readme to try to get the value proposition across more quickly.
Re:IPyflow: Reactive Python Notebooks in Jupyter(Lab) on Wednesday May 10, 2023 @05:27PM (#35893773)
I would be very surprised if something like this gets support in core Jupyter -- there's a lot of added complexity. Fortunately it is doable as extensions for Jupyter / JupyterLab.
Re:IPyflow: Reactive Python Notebooks in Jupyter(Lab) on Wednesday May 10, 2023 @05:26PM (#35893759)
We have a couple of papers that go into some of the details.

https://smacke.net/papers/nbsafety.pdf https://smacke.net/papers/nbslicer.pdf

It looks like you are using a static approach for dependency inference. There are a lot of benefits to static approaches, but they can only get you so far. My JupyterCon presentation includes a bunch of examples where dynamic approaches are a must: https://t.ly/78rS

Besides that, there are a bunch of interesting design decisions about when to add edges between cells, when to break them, what metadata to annotate edges with, etc.

I'm hoping to abstract a way a bunch of the complexity by developing something like a runtime version of a language server protocol (working name "language kernel protocol") so that any editor that implements the protocol would get reactivity for free when running a kernel that likewise implements the protocol. I have an early version of this which is how IPyflow works for both Jupyter and JupyterLab; VSCode would be a great editor to add support for next.

Re:IPyflow: Reactive Python Notebooks in Jupyter(Lab) on Wednesday May 10, 2023 @05:13PM (#35893612)
Personally I don't like the "write to disk" approach; I think it kind of just punts the state problem somewhere else (i.e. from memory to disk). Writing to a database and adding versioning is better, but that's a lot of machinery to expect a notebook user to adopt (though maybe better tooling could help). Also a lot of Python objects are not out-of-the-box pickleable (e.g. generators). Also pickle is a mess.

Older »