logoalt Hacker News

drschwabeyesterday at 7:37 PM3 repliesview on HN

When I first read the source for his original QuickJS implementation I was amazed to discover he created the entirety of JavaScript in a single xxx thousand line C file (more or less).

That was a sort of defining moment in my personal coding; a lot of my websites and apps are now single file source wherever possible/practical.


Replies

kvemkonyesterday at 9:18 PM

SQLite 3.51.1

  $ wc -l ...
  265908 sqlite-amalgamation-3510100/sqlite3.c
Is there any as large as possible single source (or normal with amalgamation version) more or less meaningful project that could be compiled directly with rustc -o executable src.rs? Just to compare build time / memory consumption.
show 3 replies
zdragnaryesterday at 7:56 PM

I honestly think the single file thing is best reserved for C, given how bad the language support for modularity is.

I've had the inverse experience dealing with a many thousand line "core.php" file way back in the day helping debug an expressionengine site (back in the php 5.2ish days) and it was awful.

Unless you have an editor which can create short links in a hierarchical tree from semantic comments to let you organize your thoughts, digging through thousands of lines of code all in the same scope can be exceptionally painful.

show 4 replies