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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

HTTP: , FTP:, and Dict:?

425 点作者 edent8 个月前

21 条评论

masswerk8 个月前
Nowadays, on macOS, "dict://Internet" will open the Dictionary app with the query "Internet". (Probably behind a security prompt.) Not sure, if there's similar functionality on other operating systems.
评论 #41616796 未加载
im3w1l8 个月前
I admire these old protocols that are intentionally built to be usable both by machines and humans. Like the combination of a response code, and a human readable explanation. A help command right in the protocol.<p>Makes me think it&#x27;s a shame that making a json based protocol is so much easier to whip up than a textual ebnf-specified protocol.<p>Like imagine if in python there was some library that you gave an ebnf spec maybe with some extra features similar to regex (named groups?) and you could compile it to a state machine and use it to parse documents, getting a Dict out.
评论 #41617062 未加载
评论 #41616747 未加载
评论 #41616964 未加载
评论 #41617042 未加载
评论 #41620807 未加载
评论 #41620733 未加载
评论 #41622407 未加载
评论 #41617795 未加载
praveen99208 个月前
&gt; in an age of low-size disk drives and expensive software, looking up data over a dedicated protocol seems like a nifty2 idea. Then disk size exploded, databases became cheap, and search engines made it easy to look up words.<p>I love this particular part of history about How protocols and applications got build based on restrictions and got evolved after improvements. Similar examples exists everywhere in computer history. Projecting the same with LLMs, we will have AIs running locally on mobile devices or perhaps AIs replacing OS of mobile devices and router protocols and servers.<p>In future HN people looking at the code and feeling nostalgic about writing code
评论 #41622430 未加载
评论 #41625573 未加载
评论 #41629559 未加载
评论 #41621815 未加载
评论 #41620423 未加载
hebocon8 个月前
I recently began testing my own public `dictd` server. The main goal was to make the OED (the full and proper one) available outside of a university proxy. I figured I would add the Webster&#x27;s 1913 one too.<p>Unfortunately the vast majority of dictionary files are in &quot;stardict&quot; format and the conversion to &quot;dict&quot; has yielded mixed results. I was hoping to host _every_ dictionary, good and bad, but will walk that back now. A free VPS could at least run the OED.
评论 #41619555 未加载
评论 #41618733 未加载
wormius8 个月前
Wow, either I&#x27;ve forgotten this existed, or had no clue, I was around for this era, and I remember Veronica, Archie, WAIS, Gopher, etc, but never recall reading about a Dict protocol, nice find!
hkt8 个月前
I&#x27;ve been aware of dict for a while since I wrapped up an esperanto to english dictionary for KOReader in a format KOReader could understand. What I&#x27;d really have liked is a format like this:<p>dict:&#x2F;&#x2F;&lt;server&#x2F;&lt;origin language&gt;&#x2F;&lt;definition language&gt;&#x2F;&lt;word&gt;<p>Still, it is pretty cool that dict servers exist at all, so no complaints here.
cratermoon8 个月前
Oh yes, I remember dictionary servers. Also many other protocols.<p>What happened to all of those other protocols? Everything got squished onto http(s) for various reasons. As mentioned in this thread, corporate firewalls blocking every other port except 80 and 443. Around the time of the invention of http, protocols were proliferating for all kinds of new ideas. Today &quot;innovation&quot; happens on top of http, which devolves into some new kind of format to push back and forth.
评论 #41620214 未加载
nunobrito8 个月前
Nice find, didn&#x27;t knew the protocol either. The site lists all available dictionaries here: <a href="https:&#x2F;&#x2F;dict.org&#x2F;bin&#x2F;Dict?Form=Dict4" rel="nofollow">https:&#x2F;&#x2F;dict.org&#x2F;bin&#x2F;Dict?Form=Dict4</a><p>I&#x27;ll then be writing a java server for DICT. Likely add more recent types of dictionaries and acronyms to help keeping it alive.
t-38 个月前
dict is a must for me on any daily driver. Removing the friction of opening a web browser or specialized app and just looking up text from the terminal is just so nice. Just like bc, you don&#x27;t miss it when you don&#x27;t know it&#x27;s there, but once you get used to using it you can&#x27;t live without. Making custom dictionaries is not very well documented though.
commandersaki8 个月前
I love dict&#x2F;dictd but I had an issue using it in hostile networks that block the port&#x2F;protocol.<p>I&#x27;ve been tempted to revamp dict&#x2F;dictd to shovel the dict protocol over websokets so I can use it over the web. Just one of those ideas in the pipeline that I haven&#x27;t revisited because I&#x27;m no longer dealing with that hostile network.
评论 #41616925 未加载
divbzero8 个月前
Regarding OP’s unanswered question:<p>&gt; <i>00. Are there any other Dictionary Servers still available on the Internet?</i><p>There are a number of other <i>dict:</i> servers including ones for different languages:<p><a href="https:&#x2F;&#x2F;servers.freedict.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;servers.freedict.org&#x2F;</a>
kragen8 个月前
dict and the relevant dictionaries are things i pretty much always install on every new laptop. gcide in particular includes most of the famous 1913 webster dictionary with its sparkling prose:<p><pre><code> : ~; dict glisten 2 definitions found From The Collaborative International Dictionary of English v.0.48 [gcide]: Glisten \Glis&quot;ten\ (gl[i^]s&quot;&#x27;n), v. i. [imp. &amp; p. p. {Glistened}; p. pr. &amp; vb. n. {Glistening}.] [OE. glistnian, akin to glisnen, glisien, AS. glisian, glisnian, akin to E. glitter. See {Glitter}, v. i., and cf. {Glister}, v. i.] To sparkle or shine; especially, to shine with a mild, subdued, and fitful luster; to emit a soft, scintillating light; to gleam; as, the glistening stars. Syn: See {Flash}. [1913 Webster] </code></pre> it&#x27;s interesting to think about how you would implement this service efficiently under the constraints of mid-01990s computers, where a gigabyte was still a lot of disk space and multiuser unix servers commonly had about 100 mips (<a href="https:&#x2F;&#x2F;netlib.org&#x2F;performance&#x2F;html&#x2F;dhrystone.data.col0.html" rel="nofollow">https:&#x2F;&#x2F;netlib.org&#x2F;performance&#x2F;html&#x2F;dhrystone.data.col0.html</a>)<p>totally by coincidence i was looking at the dictzip man page this morning; it produces gzip-compatible files that support random seeks so you can keep the database for your dictd server compressed. (as far as i know, rik faith&#x27;s dictd is still the only server implementation of the dict protocol, which is incidentally not a very good protocol.) you can see that the penalty for seekability is about 6% in this case:<p><pre><code> : ~; ls -l &#x2F;usr&#x2F;share&#x2F;dictd&#x2F;jargon.dict.dz -rw-r--r-- 1 root root 587377 Jan 1 2021 &#x2F;usr&#x2F;share&#x2F;dictd&#x2F;jargon.dict.dz : ~; \time gzip -dc &#x2F;usr&#x2F;share&#x2F;dictd&#x2F;jargon.dict.dz|wc -c 0.01user 0.00system 0:00.01elapsed 100%CPU (0avgtext+0avgdata 1624maxresident)k 0inputs+0outputs (0major+160minor)pagefaults 0swaps 1418350 : ~; gzip -dc &#x2F;usr&#x2F;share&#x2F;dictd&#x2F;jargon.dict.dz|gzip -9c|wc -c 556102 : ~; units -t 587377&#x2F;556102 % 105.62397 </code></pre> nowadays computers are fast enough that it probably isn&#x27;t a big win to gzip in such small chunks (dictzip has a chunk limit of 64k) and you might as well use a zipfile, all implementations of which support random access:<p><pre><code> : ~; mkdir jargsplit : ~; cd jargsplit : jargsplit; gzip -dc &#x2F;usr&#x2F;share&#x2F;dictd&#x2F;jargon.dict.dz|split -b256K : jargsplit; zip jargon.zip xaa xab xac xad xae xaf adding: xaa (deflated 60%) adding: xab (deflated 59%) adding: xac (deflated 59%) adding: xad (deflated 61%) adding: xae (deflated 62%) adding: xaf (deflated 58%) : jargsplit; ls -l jargon.zip -rw-r--r-- 1 user user 565968 Sep 22 09:47 jargon.zip : jargsplit; time unzip -o jargon.zip xad Archive: jargon.zip inflating: xad real 0m0.011s user 0m0.000s sys 0m0.011s </code></pre> so you see 256-kibibyte chunks have submillisecond decompression time (more like 2 milliseconds on my cellphone) and only about a 1.8% size penalty for seekability:<p><pre><code> : jargsplit; units -t 565968&#x2F;556102 % 101.77413 </code></pre> and, unlike the dictzip format (which lists the chunks in an extra backward-combatible file header), zip also supports efficient appending<p>even in python (3.11.2) it&#x27;s only about a millisecond:<p><pre><code> In [13]: z = zipfile.ZipFile(&#x27;jargon.zip&#x27;) In [14]: [f.filename for f in z.infolist()] Out[14]: [&#x27;xaa&#x27;, &#x27;xab&#x27;, &#x27;xac&#x27;, &#x27;xad&#x27;, &#x27;xae&#x27;, &#x27;xaf&#x27;] In [15]: %timeit z.open(&#x27;xab&#x27;).read() 1.13 ms ± 16.2 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each) </code></pre> this kind of performance means that any algorithm that would be efficient reading data stored on a conventional spinning-rust disk will be efficient reading compressed data if you put the data into a zipfile in &quot;files&quot; of around a meg each. (writing is another matter; zstd may help here, with its order-of-magnitude faster compression, but info-zip zip and unzip don&#x27;t support zstd yet.)<p>dictd keeps an index file in tsv format which uses what looks like base64 to locate the desired chunk and offset in the chunk:<p><pre><code> : jargsplit; &lt; &#x2F;usr&#x2F;share&#x2F;dictd&#x2F;jargon.index shuf -n 4 | LANG=C sort | cat -vte fossil^IB9xE^IL8$ frednet^IB+q5^IDD$ upload^IE&#x2F;t5^IJ1$ warez d00dz^IFLif^In0$ </code></pre> this is very similar to the index format used by eric raymond&#x27;s volks-hypertext <a href="https:&#x2F;&#x2F;www.ibiblio.org&#x2F;pub&#x2F;Linux&#x2F;apps&#x2F;doctools&#x2F;vh-1.8.tar.gz" rel="nofollow">https:&#x2F;&#x2F;www.ibiblio.org&#x2F;pub&#x2F;Linux&#x2F;apps&#x2F;doctools&#x2F;vh-1.8.tar.g...</a> or vi ctags or emacs etags, but it supports random access into the file<p>strfile from the fortune package works on a similar principle but uses a binary data file and no keys, just offsets:<p><pre><code> : ~; wget -nv canonical.org&#x2F;~kragen&#x2F;quotes.txt 2024-09-22 10:44:50 URL:http:&#x2F;&#x2F;canonical.org&#x2F;~kragen&#x2F;quotes.txt [49884&#x2F;49884] -&gt; &quot;quotes.txt&quot; [1] : ~; strfile quotes.txt &quot;quotes.txt.dat&quot; created There were 87 strings Longest string: 1625 bytes Shortest string: 92 bytes : ~; fortune quotes.txt Get enough beyond FUM [Fuck You Money], and it&#x27;s merely Nice To Have Money. -- Dave Long, &lt;dl@silcom.com&gt;, on FoRK, around 2000-08-16, in Message-ID &lt;200008162000.NAA10898@maltesecat&gt; : ~; od -i --endian=big quotes.txt.dat 0000000 2 87 1625 92 0000020 0 620756992 0 933 0000040 1460 2307 2546 3793 0000060 3887 4149 5160 5471 0000100 5661 6185 6616 7000 </code></pre> of course if you were using a zipfile you could keep the index in the zipfile itself, and then there&#x27;s no point in using base64 for the file offsets, or limiting them to 32 bits
评论 #41619760 未加载
dokyun8 个月前
Emacs includes a browsable client for this protocol; you can use it with `M-x dictionary`.
divbzero8 个月前
The DICT Development Group also provides a dedicated <i>dict:</i> client:<p><pre><code> sudo apt install dict brew install dict </code></pre> Which allows you to query dict:&#x2F;&#x2F;dict.org&#x2F; directly:<p><pre><code> dict foo</code></pre>
sedatk8 个月前
There was also a translation server called Babylon that used a similar raw text protocol (like WHOIS, and DICT here) in 1998. I remember adding it to my IRC script, but it must have stopped working at some point that I had replaced it with &quot;babelfish.altavista.com&quot; :)
anthk8 个月前
<p><pre><code> echo &quot;define * hacker &quot; | nc dict.org 2628 | less</code></pre>
fitsumbelay8 个月前
<i>super</i> fascinating and potentially useful for future projects with or w&#x2F;o AI. obviously makes me want to maintain my own dict service love this
mogoh8 个月前
hmmm<p><pre><code> $&gt;curl dict:&#x2F;&#x2F;dict.org&#x2F;d:Internet curl: (1) Protocol &quot;dict&quot; not supported</code></pre>
评论 #41616732 未加载
kgbcia8 个月前
Isn&#x27;t .mobi an ebook format?
评论 #41622037 未加载
nashashmi8 个月前
I dont think dict is secure enough. We need a new version called dick. K is for encryption key. &#x2F;s &#x2F;rant (at sftp).
bubblesnort8 个月前
Never heard of the dict command?<p>The author went through the trouble of figuring out the protocol but never bothered to just run dict. Okay.
评论 #41616331 未加载
评论 #41616813 未加载
评论 #41616695 未加载
评论 #41616449 未加载