TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

My website is one binary (2022)

249 点作者 greenSunglass超过 1 年前

54 条评论

otikik超过 1 年前
Website width isn’t calculated correctly for mobile and you need to scroll left and right in order to read the text. I was doing that right after reading<p>&gt; i have very high and unusual standards,<p>Which was kind of funny TBH :)
评论 #37973508 未加载
评论 #37973438 未加载
评论 #37973764 未加载
评论 #37973582 未加载
评论 #37973270 未加载
评论 #37973912 未加载
评论 #37977376 未加载
评论 #37973735 未加载
评论 #37973718 未加载
评论 #37973796 未加载
评论 #37978782 未加载
评论 #37973481 未加载
评论 #37973319 未加载
danpalmer超过 1 年前
What even does &quot;keep it simple&quot; mean. What even is &quot;understandable&quot;. Every article about this sort of thing skips past the interesting arguments and assumes that their approach is the simple one, that their aim is simplicity.<p>If you are presented with the option of an abstraction – perhaps a library or framework, perhaps a service or API – is it &quot;simpler&quot; to use it or to not?<p>If you don&#x27;t use it, and you build the alternative, you know more about how the system works as a whole, and therefore arguably it&#x27;s simpler. But complexity is still introduced, and in some cases the abstraction layers still need to be built (but maybe not all of them).<p>If you do use it, you can consider the system to be simpler because you hide the complexity, and on the happy-path of usage that may be true, but the complexity still exists and you don&#x27;t understand it because it&#x27;s hidden. Arguably it&#x27;s simpler, but it&#x27;s easy to point to how it&#x27;s more complex.<p>I&#x27;ve met engineers who strongly prioritise one or the other of these sorts, and to them that way is <i>obviously</i> simpler, but the problem is that both approaches are <i>obviously</i> simpler when you look at them in a certain way, you have to get past the obvious to realise that there are trade-offs.
评论 #37974671 未加载
评论 #37978967 未加载
评论 #37975992 未加载
hiAndrewQuinn超过 1 年前
Very cool!<p>&gt; you should do this too!<p>Absolutely not :)<p>Maintainability is one of my core values too, down to doing my own bike maintenance, like you! But it is far from being #1 to such a degree that this would make sense for me.<p>The Framework laptop is a good divergence point for us. Whereas you continue to eke out 9s on the DIY side, I realize resilience by having a spare decade old ThinkPad lying around at all times on which I can run Linux and Neovim in a pinch, and trusting there will be a <i>lot</i> of sub-$100 ThinkPads in the future should that one break on me too. I carry around the bits of CS and mathematics needed to trust myself to write a slow, informal, bug ridden parser with Haskell&#x27;s combinators from Markdown to HTML if I ever have to. I don&#x27;t see that day coming any time soon.<p>I&#x27;d hire you if I could. You&#x27;d be the perfect counterweight to a great many folks who tilt in the opposite direction.
评论 #37976133 未加载
tczMUFlmoNk超过 1 年前
I really enjoyed reading this article.<p>The author is honest with themself and earnest with the reader. They&#x27;re unapologetically themself, and figuring out how to achieve their goals in ways that align with their values and bring them joy. If those values do not align with yours, that is okay. That is beautiful! Now you have a clue as to what path <i>you</i> might explore.<p>The article is kind and humble and authentic, and I think that the author and the article make the world a better place. Thank you for writing it, and thank you for sharing it.
评论 #37975124 未加载
评论 #37974617 未加载
评论 #37973670 未加载
corbezzoli超过 1 年前
I gave it a quick look and I am almost certain that this person is trolling us. The website literally mentions it uses “plain HTML” when in reality the website is “plain text”. There’s zero formatting HTML here. No headers, no paragraphs, no lists, not even a &lt;center&gt;<p>The little HTML and CSS it uses actively renders the website worse. The poster is a troll.
评论 #37974053 未加载
csomar超过 1 年前
&gt; i have very high and unusual standards,<p>&gt; this script runs every minute on a cronjob, and rebuilds my site if the git repo has been updated.<p>He is pulling the git repo 525,600 times a year for the few commits he&#x27;ll be making in that year... I guess that explains the &quot;unusual&quot; word?
评论 #37973820 未加载
评论 #37973790 未加载
评论 #37989365 未加载
评论 #37976836 未加载
runlaszlorun超过 1 年前
To OP:<p>I see a lot of very critical posts on here.<p>With all due respect… screw them.<p>Perhaps they may be right in their critiques, but as an industry we’re rapidly heading off into mass stupidity in order to follow a bunch of collective “ought to”s and “shoulds”. Many of which have the current validity of an urban myth.<p>What passes for “engineering” these days would be laughable if we weren’t actively building our future on it. My father was an aerospace engineer and I feel I can hear him rolling over in his grave at was passes for engineering in modern software development.<p>Yes, this is a comment section so everyone is free to comment. But personally it’s taken me 25 years in the industry to finally ignore all those chattering voices and actually do what I feel makes sense for those few opportunities where I can.<p>And on a personal site no less? That old “here’s to the crazy ones” line in the Apple commercial sure rings far from true. Given what the internet has become and that once startups are now literally the largest corporate behemoths on the landscape- it should not be a surprise.<p>Teddy Roosevelt’s quote about “the man in the arena” is so true these days.<p>I say rock on, OP, rock on…
评论 #37989207 未加载
snickerer超过 1 年前
You showed us yours, I show you mine.<p>My website, game engine, and webserver is one binary. The source has 1000 lines of C code. The binary has a size of 164k (I don&#x27;t know why it is so damned big).<p>I included my own webserver. The existing servers add way too much (hidden) complexity.<p>You can check out the result, an interactive fiction game in German, here: <a href="http:&#x2F;&#x2F;vmd34232.contaboserver.net&#x2F;" rel="nofollow noreferrer">http:&#x2F;&#x2F;vmd34232.contaboserver.net&#x2F;</a> (no tracking, no ads, not commercial)
评论 #37977074 未加载
评论 #37974175 未加载
tetsuhamu超过 1 年前
I agree wholeheartedly with all of the points made in the article, but this website kinda sucks as an example.<p>- The website is &quot;one binary&quot;, but the deploy strategy involves compiling it instead of running a binary artifact<p>- Won&#x27;t rely on github pages, but depends on external resource at openlibrary.org<p>- Writing your own stuff lets you take advantage of open standards, but the .html files in thoughts&#x2F; are structured as plaintext with a false file extension<p>- When people go this route, they usually try to cram everything into the initial page load. This has several static files served dynamically.<p>- The Golang code does not cache any responses, and does not store templates in memory.<p>- Several dependencies in the go.mod file, all of them seem unused?<p>Most importantly: No discussion about the technical benefits of the &quot;single-binary&quot; ethos compared to modern infrastructure.<p>It&#x27;s my humble opinion that it&#x27;s a great idea, and this is a poor example.
评论 #37974277 未加载
eviks超过 1 年前
&gt; have very high and unusual standards<p>Unusual yes, but very low given the awful resulting design of the website that can&#x27;t even present text to fit your screen properly
Retr0id超过 1 年前
Maybe it&#x27;s just not the kind of thing I do, I&#x27;m not sure I see the huge need for dynamism.<p>For my personal blog, I wrote a simple static site generator in Python. It converts markdown files into articles, an index page, and an RSS feed. The HTML templates and CSS are written by hand. It&#x27;s required minimal maintenance over the years, and for the most part Just Works. After an edit, I rebuild the site on my local machine, and deploy with `rsync`.<p>I do have a couple of &quot;dynamic&quot; things hosted behind the same domain. For those, I configure nginx to reverse-proxy to a local service - which could be a python script, or anything else.<p>The only real advantage I can see to my setup, beyond personal preference, is that redeploys come with precisely 0 downtime. Presumably, if you&#x27;re updating a binary, there&#x27;s a brief moment where the old one shuts down and the new one starts up (unless you&#x27;re doing some kind of clever reverse-proxy switchover)
wiseowise超过 1 年前
&gt; mY vALuES<p>Apparently accessibility isn’t one of them, given that increasing zoom level on Safari does jack shit.
aae42超过 1 年前
I share a number of the same values as the author. I also have a hard time with not understanding things and relying on others. But I guess I understand Hugo and GitHub pages (I use gitlab pages) well enough that I&#x27;m happy to use them.<p>I wonder if the author owns a car, and if he does, which?<p>Locking my Hugo build with something like Nix makes that comfortable. I can upgrade as I discover bugs but can always go back if it ain&#x27;t broke. I do wish sometimes they would stop adding features.<p>What it&#x27;s driving me to do in this same vein is build my own Hugo theme.<p>Also, tend to agree about dynamic sites vs JavaScript behemoths.<p>Disagree with the authors styling, and am a big fan of classless lightweight CSS, of which there are a number to choose from these days (I keep a list).
mattlondon超过 1 年前
So the tl;Dr is they have all of the complexity and bugs of a static site generator, and all of the complexity and bugs and security risks and runtime cost of a dynamic website too.<p>I think they missed the point of a static site generator: you &quot;compile&quot; your site once, and then you have static assets that never need any maintenance ever again (unless you decide to change something) and which can be served by anything, anywhere.<p>This approach seems to take the worst aspects of static site generators <i>and</i> dynamic sites and bundle them together: you now have a binary to maintain (that has to generate the HTML et al anyway) <i>and</i> you have the potential for security&#x2F;other bugs <i>and</i> you now have extra CPU&#x2F;RAM&#x2F;IO load on your server <i>and</i> you need specific hosting that allows you to run your binary.<p>Don&#x27;t get me wrong this is fun and all and nice that it works for the author, but I don&#x27;t think it is a sensible way to make things simpler, more reliable, or easier maintain (the opposite in my mind).<p>I will agree that Hugo is terrible IME - so so so much complexity for very little benefit when compared to Jekyll et al.
ruduhudi超过 1 年前
This website is not readable on my phone at all.<p>Thanks to the odd scroll container i cannot zoom to a view where i do not have to side-scroll anymore.
gorgoiler超过 1 年前
[2022], but specifically April 1st.<p>[edit: with hindsight, looking at the other content on their site, I don’t think the date being April Fool’s day is particularly relevant.]
评论 #37974017 未加载
评论 #37973818 未加载
Eiim超过 1 年前
I quite like this! I see a lot of people quoting the line &quot;I have very high and unusual standards&quot; and only paying attention to the first adjective. It&#x27;s obvious that many of the things people are complaining about are simply not important to them, which is fine! Part of the magic of the personal website the author talks about comes from how different people prioritize different parts of the website creation and usage experience differently.<p>Where I do think the article misses the ball is on static vs. dynamic websites. If you need a dynamic website (for example, to display the user&#x27;s IP), build a dynamic website. If you don&#x27;t, build a static website. There really isn&#x27;t another argument presented here beyond &quot;some things you can&#x27;t do with a static website&quot;, which is really just the fundamental tradeoff of a static site.<p>Anyways, a neat glimpse into a particular development philosophy that I will very likely never do but I will share with some similarly-minded friends :)
mr-karan超过 1 年前
With just really minimal efforts of styling, a webpage can be looked so much cleaner. This[1] is a really good example of it. This website is simply unreadable and shows lack of care for their readers, which makes me spend even lesser time on it than I would.<p>[1]: <a href="http:&#x2F;&#x2F;motherfuckingwebsite.com&#x2F;" rel="nofollow noreferrer">http:&#x2F;&#x2F;motherfuckingwebsite.com&#x2F;</a>
评论 #37973688 未加载
tromp超过 1 年前
Related: Redbean - Single-file distributable web server [1]<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26271117">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26271117</a>
Ono-Sendai超过 1 年前
My blog is a single binary also: <a href="https:&#x2F;&#x2F;forwardscattering.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;forwardscattering.org&#x2F;</a><p>Src code: <a href="https:&#x2F;&#x2F;github.com&#x2F;Ono-Sendai&#x2F;blog">https:&#x2F;&#x2F;github.com&#x2F;Ono-Sendai&#x2F;blog</a>
评论 #37982383 未加载
mrlonglong超过 1 年前
Idea is good, write-up not so good. You need to cater for people using differently sized reading devices and rewrite the article to be more readable. If it alienates people then you&#x27;ve lost the battle.
评论 #37989434 未加载
fullstackchris超过 1 年前
Lot of (IMO) useless hot air comments saying this or that in here...<p>You can do your fancy build process, single binary, whatever. The bottom line is if you want to call yourself a (good&#x2F;strong&#x2F;solid) web developer, your site needs to be accessible across all form factors.<p>I&#x27;m on mobile so I can&#x27;t check, but I would bet this thing doesn&#x27;t get even close to a good score on a tool like Lighthouse. Then the fact that some people are applauding OP and turning around making fun of &quot;modern&quot; software development (whatever that means) don&#x27;t even realize they&#x27;re part of perpetuating that problem (applauding sites which are missing key peices of accessibility and functionality)<p>This isn&#x27;t really opinion or up for discussion either, this is quite literally the benchmark of living in our reality. We have accesibility guidelines and standards built over the years by hundreds of dedicated folks who worked hard to make those standards and guidelines clear - SO USE THEM! (meaning HTML5&#x2F;CSS3&#x2F;WCAG) Software is for humans, to be used by humans. Sure, I get the aspect that there is a bit of artistic freedom which OP has taken and by no means has to follow any guidelines at all. But this is definitively NOT a high standard or normal in any sense of what decent modern web development is.
apatheticonion超过 1 年前
I was hoping this was a wasm binary being used as an entry point for a website (skipping the HTML and JS entirely and going straight to wasm).<p>Nope. Just a static HTML website... Cool...?
评论 #37974449 未加载
评论 #37976853 未加载
评论 #37975234 未加载
bradley13超过 1 年前
I get it, to some extent. I serve one of my sites with my own web server. I detest using programs that drag in zillions of dependencies over which you have no control, and every modern web server does exactly that.<p>That said, compiling your web content into your server? That&#x27;s a step too far. Data and the application that process that data are two very different things, and (imho) should remain separate.
评论 #37973556 未加载
评论 #37973645 未加载
评论 #37974231 未加载
hackish超过 1 年前
Similarly, I was recently itching to generate Github Pages-like static sites from my self-hosted Gitea instance to include a blog. I had set up a global webhook filtered for &#x27;webdeploy&#x27; branch pushes that would send a request to a specific Caddy path whitelisted for Gitea. An exec function for Caddy would run a shell script (yeah, I know) that would clone&#x2F;pull the repo into a known directory, create a proxied subdomain for it in Cloudflare, and push necessary changes to Caddy&#x27;s config.<p>While I don&#x27;t have the same hesitations about depending on a small chain of open-source projects, I really didn&#x27;t like the idea of caddy-exec despite my basic precautions, so I abandoned this approach until I can ponder it a bit more.
urbandw311er超过 1 年前
I’m torn.<p>I admire the determination to “own” and control the entire stack.<p>Equally parts of this smell of “not invented here” syndrome.
评论 #37976911 未加载
block_dagger超过 1 年前
Very high and unusual website. Unreadable. 100% bounce.
wutwutwat超过 1 年前
Golang has a ton of single binary websites out there. The two that come to mind off hand are Gogs&#x2F;Gitea only because I contributed to them<p><a href="https:&#x2F;&#x2F;github.com&#x2F;gogs&#x2F;gogs">https:&#x2F;&#x2F;github.com&#x2F;gogs&#x2F;gogs</a><p><a href="https:&#x2F;&#x2F;gogs.io&#x2F;docs&#x2F;installation&#x2F;install_from_binary.html#downloads" rel="nofollow noreferrer">https:&#x2F;&#x2F;gogs.io&#x2F;docs&#x2F;installation&#x2F;install_from_binary.html#d...</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea">https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea</a>
userbinator超过 1 年前
This is how the configuration UI in a lot of cheap router firmware was (is still?) designed. A few hundred KB of RAM and a MB or two of flash doesn&#x27;t leave much room for inefficiency.
OhHiMarkos超过 1 年前
OP I like you. You are a refreshing voice in the current tech jungle. I think your post clicked for me and made me think about my projects&#x2F;ideas and how to approach them.<p>So, thank you I guess. I would like to see more of your stuff and your approaches.
yoav超过 1 年前
If this isn’t parody I don’t know what is.
gildas超过 1 年前
Shameless plug, my homepage on GitHub is also one binary (self-extracting ZIP) file which run on client-side, see <a href="https:&#x2F;&#x2F;gildas-lormeau.github.io&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;gildas-lormeau.github.io&#x2F;</a>
评论 #37977259 未加载
f1shy超过 1 年前
For me single binary website is like single line program. You can do it, but will not be the most scalable thing. I like to have separate things independent: server and content; so I can switch any of the 2 at whim.<p>As said before BTW the format in Mobile is horrible!
评论 #37973610 未加载
tap-snap-or-nap超过 1 年前
If someone needs to host less than 10 static pages then HTML is perfectly good.
slmjkdbtl超过 1 年前
Reminded of me once also wrote my websites in C using only POSIX compliant system libraries, with assets embedded in the single binary as base64 &#x2F; hex arr. The worst part is I bragged about it.
fsiefken超过 1 年前
Tiddlywiki is a single selfcontained javascript executable, would make more sense to me. As of yet I&#x27;m very happy with my simple obsidian and hugo setup. What exactly is the problem with hugo or ssg in general? I think they are fantastic. You want a webserver to host only static files, some javascript&#x2F;wasm for dynamic stuff if needed and if really needed sqlite for persistent shared storage.<p>It reminds me of the guy who coded and compiled his impressive crypto exchange in c by hand to get the attack surface low and the performance extremely high. Does anyone remember the name of the site? I think he mentioned (years ago) he was on the brink of giving up.
JodieBenitez超过 1 年前
&gt; i have very high and unusual standards,<p>Apparently latency is not one of them.
mortallywounded超过 1 年前
My website is also a single binary (assets, styles, html and everything is embedded in it). It&#x27;s scp&#x27;d onto my server and restarted with systemd.<p>It has been great.
drawkbox超过 1 年前
I like the thinking and dependencies are a weight that make at least personal projects more maintenance long term, even if they help in the short term.<p>This doesn&#x27;t fly at clients&#x2F;customers usually but what you control needs to be highly maintainable and simple. Whatever works for you to achieve this is good. In regards to personal projects or internal products, in that case a framework with massive dependencies just isn&#x27;t easier to maintain long term over simple web standards and market standard formats like HTML&#x2F;CSS&#x2F;JSON&#x2F;Markdown&#x2F;etc.<p>My only complaint is the lack of capitalization on the content, so many tech&#x2F;devs do this, just don&#x27;t. Even Sam Altman...<p>How dare you not capitalize in a capitalist system. &#x2F;s<p>Seriously though, just capitalize your sentences.
rurban超过 1 年前
That&#x27;s what the various ruby, python or perl compilers are good for. Single huge binary, huge RAM savings, easy deployment and updates.
forgotpwd16超过 1 年前
Kinda confused. So like the text is inside the binary? And whenever they change any text they&#x27;ve to recompile and serve the new binary?
sotix超过 1 年前
It’s always refreshing to see someone’s personal and unique website that isn’t full of paywalls or newsletter pop up spam while you scroll that most articles linked on HN contain[0]. I particularly like the fish bouncing around at the top like the DVD logo on idling DVD players. The site could use a few fixes to the formatting to fit the content into the device’s width, but I applaud the author for making the website in their own manner. Truly the spirit of a hacker!<p>[0] I would be in favor of getting rid of the modern atrocities of website design that frequently make the front page of HN. Simpler, more effective designs without distractions should be boosted.
ljm超过 1 年前
If you wanted a quick and easy dynamically served website then you could just as well do it in PHP and rsync your changes over.
xyzzy4747超过 1 年前
Just use Vercel + next.js + tailwind.css + typescript + node.js + pm2 and get stuff done quickly and sleep easy.
评论 #37984050 未加载
crabbone超过 1 年前
To all those complaining about &quot;mobile hostile&quot;: the site has horizontal scroll on desktop too. Probably just a miscalculation somewhere on the author&#x27;s side.<p>Also, however way you spin it, mobile is a hostile environment compared to desktop. It&#x27;s inconvenient to have to deal with tiny screen and defective keyboard. So, any usability defect that also exists on the desktop risks overflowing the cup of patience.
评论 #37973686 未加载
评论 #37978597 未加载
walteweiss超过 1 年前
Impossible to read on a mobile, not even reader mode helps. Good bye, end of the discussion.
评论 #37973771 未加载
zzo38computer超过 1 年前
Disabling CSS gets rid of the line breaks, unfortunately.
toriningen超过 1 年前
So, the guy reinvented CGI, but worse?
28304283409234超过 1 年前
&quot;(2022)&quot;
pyrolistical超过 1 年前
This would be fun to do in zig. Imagine using comptime to bake the static vs dynamic. Then concat it together when streaming the bytes.<p>You get all the power of templating and minimal cost
kosolam超过 1 年前
I came in here to write the same. :p
iamafk超过 1 年前
small I triggers me
marcrosoft超过 1 年前
It is Go not golang. Golang is used for search it is not the name of the language.
评论 #37976818 未加载
Dwedit超过 1 年前
&quot;my website is one binary&quot;<p>&lt;link rel=&quot;stylesheet&quot; href=&quot;&#x2F;static&#x2F;style.css&quot; type=&quot;text&#x2F;css&quot;&gt;<p>Well then...
评论 #37973193 未加载
评论 #37973167 未加载
评论 #37976450 未加载
评论 #37973256 未加载