Live data from Hacker News

Show HN: Vomitorium – all of your project in 1 text file

npmjs.com

31–40 of 56 posts

Re: Show HN: Vomitorium – all of your project in 1 text file

#33
post #9

Love this. I created (half-jokingly, but only half) the concept of a monofile (inspired by our monorepo) in our team. I have not managed to convince my colleagues to switch yet, but maybe this package can help. Unironically, I find that in larger python projects, combining various related sub 100 loc files into one big sub 1000 loc file can do magic to circular import errors and remove 100s of lines of import stateme…

To help with circular import, we switched a few years ago to lazily importing submodules on demand, and never switched back.

Just add to your __init__.py files:

import importlib

def __getattr__(submodule_name):

    return importlib.import_module('.' + submodule_name, __package__)
And then just import the root module and use it without ever needing to import individual submodules:

import foo

def bar():

    return foo.subfoo.bar() # foo.subfoo is imported when the function is first executed instead of when it is parsed, so no circular import happen

Re: Show HN: Vomitorium – all of your project in 1 text file

#34

I can imagine the token counts to be off the charts. How would an llm handle this input? Llm output quality already drops quite hard at a out 3000 tokens let alone 128k

Depends on the LLM, perhaps, and/or the problem being solved. I get very good output from 10K–25K token submissions to Anthropic's Claude API.

Re: Show HN: Vomitorium – all of your project in 1 text file

#35
post #9

Love this. I created (half-jokingly, but only half) the concept of a monofile (inspired by our monorepo) in our team. I have not managed to convince my colleagues to switch yet, but maybe this package can help. Unironically, I find that in larger python projects, combining various related sub 100 loc files into one big sub 1000 loc file can do magic to circular import errors and remove 100s of lines of import stateme…

I once had a 4k line javascript file (a vuex module), which I navigated using / in vim, which came with another 20k likes of tests (also in the single file). I would say 5k lines is the real celling.

Re: Show HN: Vomitorium – all of your project in 1 text file

#36
post #7

Love the name :D.

> A vomitorium is a passage situated below or behind a tier of seats in an amphitheatre or a stadium through which large crowds can exit rapidly at the end of an event. > A commonly held but erroneous notion is that Ancient Romans designated spaces called vomitoria for the purpose of literal vomiting, as part of a binge-and-purge cycle https://en.wikipedia.org/wiki/Vomitorium

In which the thing being spewed is people

Re: Show HN: Vomitorium – all of your project in 1 text file

#39
post #9

Love this. I created (half-jokingly, but only half) the concept of a monofile (inspired by our monorepo) in our team. I have not managed to convince my colleagues to switch yet, but maybe this package can help. Unironically, I find that in larger python projects, combining various related sub 100 loc files into one big sub 1000 loc file can do magic to circular import errors and remove 100s of lines of import stateme…

To help with circular import, we switched a few years ago to lazily importing submodules on demand, and never switched back. Just add to your __init__.py files: import importlib def __getattr__(submodule_name): return importlib.import_module('.' + submodule_name, __package__) And then just import the root module and use it without ever needing to import individual submodules: import foo def bar(): return foo.subfoo.b…

Doesn't that mean your editor support is crap though?
Post reply on HN