HNHacker News
TopNewBestAskShowJobs

groovy2shoes

1,904 karma · joined February 3, 2011

https://github.com/baguette

cmburget@gmail.com

my topcolor is 8674a9

submissionscomments
groovy2shoes··on Key Greenland glacier growing again after shrinking for years, Nasa study shows
Experience has shown that additional flames won't make the Earth any cooler or more hospitable.

While I appreciate your frustration to a certain extent, the point's not offal dining nor is it waiting for enlightenment. The point's a revision of strategy: the scientists out in the field, observing and gathering measurements, reviewing the data revealed, and publishing papers with findings and—since without understanding themselves, they'd not have a standing to recommend—must already be in the light, because we turn to them for their recommendations today; so perhaps it'd rather be productive helping layfolk understand, in lieu of tearing them new arseholes every time they toot descant.

groovy2shoes··on The rise and fall of scientific authority, and how to bring it back
When you talk like that, I feel as though I am talking to the emacs psychotherapist. It too is a mere instrument that reports on its internal state.

If you have found it a useful communicative tool, then I am glad for you. No doubt communication can be hard, so we've gotta use whatever tools we find effective. But honestly when I try speaking like that, I can't help but feel like a robot or a program. It feels very unnatural and very awkward to me. Perhaps that distance is exactly what lends it efficacy for some people, but that very distance only lends it offputticacy for me.

Am I right and you wrong? No, I don't think so. I have no reason to doubt that you have found success with such an approach. But were I a barkeep and you a patron responding like that when asked "why the long face?", you'd be getting a double of tequila on the house. (Tequila has a funny way of bringing out one's inner party, in my experience—or getting one started where there's yet only a quiet inner evening get-together).

https://i.imgur.com/ShGZjQ6.png

groovy2shoes··on The Voyage of the Kon-Tiki Misled the World About Navigating the Pacific (2014)
ita est totali ridiculus! ergo ridebam tantum. concordamus nos. bonus risus, amice mi atave.
groovy2shoes··on JSON with Sqlite
> It’s like saying specifying the file directory SQLite uses is config.

Or, to continue the fopen analogy, like saying that the file you've given fopen is to be opened with mode "a+". The only real difference is that fopen's mode argument is required whereas SQLite's mode has a useful default.

> Enabling WAL can hardly be called config, it’s a one liner in every driver I’ve ever seen.

Even in the raw libsqlite3 C API (as long as you don't need any error checking ;) ):

    sqlite3_exec(db, "PRAGMA journal_mode=WAL", NULL, NULL, NULL);
presumably because it's just a one-liner in SQLite's dialect.
groovy2shoes··on NASM Tutorial (2018)
Tabs are intended to be used for alignment. "Tab" is a clipping of "tabulator", as in "thing that tabulates" or "thing for tabulating", where "tabulate" means "to arrange in a tabular manner, to format as a table". But rather than risk etymological fallacy, I'll explain the history of the tab key to illuminate that it was certainly intended for alignment.

The tab key on typewriters caused the carriage to advance to the next tab stop. The tab stops were physical barriers that would stop the carriage from moving at a specific position. In many cases they were adjustable, but the specifics of how varied from model to model. Usually it would be pins, clips, sliders, vel sim. attached to a bar near the carriage. The tab key would raise the carriage and fling it across until it hit a tab stop and... stopped.

This mechanism can't have been invented terribly long after typewriters started to be sold commercially in 1868, because by 1900 Underwood was already advertising tabulating as "part of the machine, not an attachment"[1]. The Underwood No. 5 was immensely popular and became the template for what we think of today as a typewriter; earlier models were subject to much variation, and in many cases the typist couldn't even see what she was typing, because the typeheads would strike from behind the paper! Of course, nobody had to copy every feature of the Underwood machine, so the tabulator must've been somewhat popular. I imagine it was rather handy in businesses or any institution that kept typed records.

It's true that many cheaper machines only had support for a single tab stop, and that it was oftentimes used for paragraph indentation, but this is a limitation of low-cost machines rather than an intention, I think, and even a single tab stop can be used for tabulation—so long as you only need to make tables of two columns ;)

The tab's entry into computing is somewhat accidental, due to the usage of teletypewriters as terminals in the early years, and thus both the adoption of teleprinter codes such as ASCII for information encoding and the adaptation of the keyboards of such terminals for later HIDs. When the CRT terminal emulator ("glass TTY") was introduced, its tab stop functionality would often emulate that of a typewriter—in many cases even going as far as being adjustable (see e.g. [2]).

Despite the accident, there were some benefits to keeping tabs around, especially in the early days. Kernighan & Plaugher's «Software Tools in Pascal» presents them in §2.1 where it introduces a filter called "entab":

… you could convert your files to a standard representation, one that has no wasteful imbedded blank strings. As an added payoff, your files are smaller and they all look alike; that makes it easier to write programs that talk and work together. ¶ Another use for `entab` is to prepare output to be sent to a terminal. You might have a program that expects to drive a smart printer. You would like to speed up printing by tabbing whenever possible. Rather than rewrite a working program, you are better off with a separate program to filter the output before it is typed. Thus `entab`.

And although it's common these days for software to give tabs a simplistic treatment by always expanding them to a constant number of blanks, Kernighan & Plaugher's "detab" tool in §1.5 demonstrates that this is not how tabs are "supposed" to work: when you have a fixed-width typeface, are to be expanded to a variable number of blanks, depending on the distance between the current cursor column and the next tab stop. If tab stops are set to 8, then it's roughly equivalent to 8 blanks in the first column, but 7 blanks in the second column, 6 in the third, and so on, because the tab key isn't "supposed" to mean "k blanks", but rather "skip to column k". And that certainly sounds like alignment to me! (For the curious, I've translated K&P's `detab` tool to Lua (and made it a bit more flexible); you can find it at [3]).

Unfortunately, the utility of tabs for alignment is countered by their lack of portability. Since every terminal (and later every text editor/word processor) had its own notion of tab stops, and since they were often configurable (and therefore many users would change them to suit their own tastes), tabs couldn't really be relied upon for conveying pretty files. And as technology has advanced, their utility as an optimization or convenience has diminished significantly. So the only utility they're left with is as a configurable signal of indentation. For programmers especially, this is no small utility, perhaps, but it wasn't how they were intended to be used ;)

——

[1]: https://www.antiquetypewriters.com/typewriter/underwood-1-ty...

[2]: http://man.openbsd.org/POSIX-2013/tabs

[3]: http://ix.io/1Cnh.lua (whereto I hereby disclaim any warranty, and likewise disclaim all copyright—insofar as I believe it my right to do so, I make it communis juris, in solemn hope that if it be any use whatsoever that it be a benefit to all; and I am not proud, for yet this is but a humble offering, not likely to be of much use to any; but considering my own shortcomings, not least among them is a lack of foresight, so be it far from me to prophesy what benefit may come of the thoughts or actions of others who have been free to think and to act; and considering also that history has shown what great achievements whereof mankind is capable when each one is allowed to nourish and complement each other: I say let none languish in bondage, but grow to magnificence in freedom, for the good of each other and of our whole humanity; wherefore I would encourage others do likewise, even with so small a thing as this, however I do not demand it)

groovy2shoes··on Explain shell
But it does. From OpenBSD's mdoc(7):

The mdoc language supports authoring of manual pages for the man(1) utility by allowing semantic annotations of words, phrases, page sections and complete manual pages.

From GNU groff's mdoc(7):

The -mdoc package is a set of content-based and domain-based macros used to format the BSD man pages.

I'm not 100% sure when exactly mdoc was introduced, but the earliest appearance I can find is in /share/tmac/tmac.doc in 4.3BSD-Reno [1], whose file header gives it as version 5.9, dated 24 July 1990 (a modified version of this same file appears in the earliest release of GNU groff I could find, version 1.02 from 2 June 1991 [2]). And taking a look at the mdoc language reveals that it is indeed very much a semantic markup, even more so than most markups that otherwise receive the moniker.

And even the unmaintained (and relatively featureless) version of man(1) that ships with my Slackware 14.2 installation supports it by default, via the magic of groff -mandoc:

mandoc — Use this file in case you don't know whether the man macros or the mdoc package should be used. Multiple man pages (in either format) can be handled.

(that's from groff_tmac(5); meanwhile man.conf(5) says that -mandoc is used by default).

A look at the source (in /usr/share/groff/1.22.3/tmac/andoc.tmac on my system) reveals some troff macro trickery to load either the man package or the mdoc package based on which macros the manpage is trying to use, and then reload the manpage with the appropriate package.

4.3BSD-Reno has an equivalent, too (in /share/tmac/tmac.andoc), whose header gives it as version 5.4, dated 28 July 1990—it strikes me as considerably simpler, but the basic idea is the same. Ye olde groff's was similarly simple, so I'm sure there are good reasons for the complexity that's since been introduced.

The point of all this being: man(1) has supported semantic markup by default since before Linux or any of the modern BSDs existed. On BSD it's been the preferred markup for manpages for ages, afaict, but it's never really caught on in the Linux world, despite having been supported—perhaps because it's always been more popular to write manpages in something like POD or LinuxDoc or DocBook or AsciiDoc or Markdown or some other markup and programmatically convert them to roff(7) input, and those formats don't offer the semantic richness or detail for the domain of manpages that mdoc(7) does, so converting to man(7) makes more sense in that case.

--

[1]: https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD-Reno/sh...

[2]: http://git.savannah.gnu.org/cgit/groff.git/commit/macros?id=...

groovy2shoes··on The Scots Language
> The usual criterion for distinguishing language from dialect is mutual intelligibility.

The problem with this criterion is that mutual intelligibility is not transitive, so it doesn't support an intuitive notion of sameness that one might expect. Consider some language with distinct dialects A, B, and C lying at different points on the dialect continuum. If A and B are mutually intelligible, and B and C are mutually intelligible, it is still possible that A and C are not mutually intelligible. However, this is a property we'd expect if this criterion were enough to say that A, B, and C were all dialects of the same language. In addition to being unintuitive, it also raises some tough questions, like: if they're all the same language today and the last speaker of B dies tomorrow, are A and C still dialects of the same language?

From a linguist's point of view, there's no useful distinction between a dialect and a language. It's more common to talk about "varieties", which is a more general term that includes dialects, regiolects, sociolects, idiolects, &c. Grouping of varieties is done contextually and for utility, often for the sake of convenience, and often according to some guiding principles (phylogeny in diachronic linguistics, for example, helps us to understand the historical relationships among groups).

There's some truth to the quip that a language is a dialect with an army and a navy, though: in practice, the distinction between the two is a sociopolitical one. Some people will be very upset if some outside group starts insisting that, in fact, no, you do not speak Arabic anymore, or, no, you do not speak Chinese anymore, or, no, Moldovan was never really a language. For many people, their native language is an integral part of their national identity, and it's not for outsiders to decide. It won't matter how precise and logical a definition someone comes up with, because it was never a scientific or philosophical issue to begin with. We allow social groups to self-actualize their own identities, or everyone is gonna have a bad time.

groovy2shoes··on Show HN: Thi.ng/hdom – S-expression based, pure ES6 UI/VDOM components
I have no idea where the industry is headed, but I feel rather confident that there will always be some group of people that will find some reason to look down on your codebase. If you rewrote the whole thing in state-of-the-art FP tonight, then by morning there will be some contingent of zealous logic programmers with their noses turnt up.

Don't worry about being looked down on. Worry about improving yourself as our field figures out how we can improve our craft. There's a lot of noise, which makes it hard to tell which things offer the most improvement, but knowledge is never a setback. You will never learn something new and be worse off than you were before. And learning something new doesn't require you to rewrite your codebase to use it, either—of course, you can if you so chose, but that's not a decision you can make until you've grokked the newness ;)

As for the difficulty of the transition: I didn't find it difficult, but I also had the luxury of time. I think it could potentially be difficult for someone thrown into the deep end (e.g., "go into the `hdom-canvas-draw` example and implement new features X, Y, and Z by Thursday!"). People often talk about FP being a different way of thinking about programming. That's true to some extent, but it's not entirely different from what you're used to. I think the thing that seems strangest for newcomers to FP isn't the way of thinking, it's the terminology. Names like `filter`, `map`, `mapcat`, `partition`, &c. seem odd and incomprehensible at first. But they're just operators, like `add`, `multiply`, `insert`, `append`. They're the kind of operator that make functional programming functional: they operate (at least in part) on functions.

If FP is something you want to learn, my advice is to start slow and simple. Some people can probably dive into that example code, tear it apart, figure out how it works, and learn that way. Perhaps I could if I were motivated enough, I don't know. What I do know is that I can't be arsed to do something like that. It's frustrating. Annoying. I have better things to do with my time.

The common advice is Abelson & Sussman's «Structure and Interpretation of Computer Programs», which is pretty good, though it has some problems. Felleisen & al. wrote «How to Design Programs» to address some problems with SICP, and wound up introducing even more problems. The choice between those two boils down to whether you want a book that addresses you like a 13-year-old with a good grasp of the infinitesimal calculus (SICP) or one that addresses you like an 11-year-old that barely understands elementary algebra (HtDP). Personally, I rather like Paulson's «ML for the Working Programmer», which assumes you're an adult who probably doesn't hold a degree in mathematics. Unfortunately, it's not freely available like the other two.

If you decide to go with SICP, I recommend using either MIT Scheme or Racket with sicp mode (you can install the mode through the menus in the DrRacket IDE). For MLftWP, I'd recommend using PolyML (any Standard ML implementation compatible with the revised definition will work fine, but PolyML is actively maintained and easy to set up).

From there, you should be pretty versed in the foundations of FP, and it's just a matter of practice to get comfortable. Of course, there will always be more to learn—the student may never rest :)

ETA - My best advice would be this: if you have the money and the time, read both the Paulson book and SICP; if you have the money but not the time, read the Paulson book; if you don't have the money, read SICP, which you can find in many formats on the Web (it's CC BY-SA licensed). I would not recommend HtDP to a professional programmer, and only maybe to a neophyte.

groovy2shoes··on Whatever Happened to the Semantic Web?
I've never worked in any field that might be considered "semantic web", but at my last gig I spent some time researching deductive database technology.

"Semantic web" was like a keyword that popped up in the abstract of virtually every paper published on the topic since the mid 90s or so. It seemed to me one of those phrases that virtually guaranteed grants of funding if you could work it into your paper.

I think you're correct that people working in the field of semantic web oftentimes didn't understand (or lost sight of) the intended nature and utility of the concept. But I also think that its buzzword status lead to the label being applied to many things that were only loosely related.

There was (is?) a lot of good work happening under the heading of "semantic web", but—partly because the term was not an apt one for the work, and partly because the dream of the semantic web never really actualized—that work has remained relatively obscure. Obversely, there was much work of questionable worth happening under the same banner, likely because it was a reliable way to get funding, at which point we return to that extremely important-sounding literature that's nothing but a giant ball of crap...

groovy2shoes··on Secessio plebis
The -i in gens Sempronii is the singular genitive in this case ("the clan of Sempronius" or "Sempronius's clan"). Good ol' inflexional paradigms :)
groovy2shoes··on “Prestudy”: Learning Chinese Through Reading
> annotations which translate certain words (the name of which escapes me at the moment)

Perhaps you're thinking of glosses? I'm not familiar with graded readers, but I am rather familiar with mediæval manuscripts, wherein it's common to see copies of Latin works with little annotations near certain (sometimes all) words. When the gloss has been added above (or below) the word(s) they annotate, they're said to be interlinear, but marginal glosses aren't unheard of.

The glosses were sometimes written by the same scribe that made the copy, but often they appear to have been added later, perhaps by the owner of the book—sometimes in a comically small hand so as to fit in narrow spaces :)

groovy2shoes··on Oops, I Wrote a C++ Compiler
> Hello everybody out there using minix -

> I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones.

—Linus Torvalds, in a post[1] to comp.os.minix, 25 August 1991 (emphasis mine)

[1]: https://groups.google.com/forum/#!msg/comp.os.minix/dlNtH7RR...

groovy2shoes··on The next 700 programming languages (1966) [pdf]
The original ML language (the one produced as part of the LCF theorem prover), did have a `where` clause that works like the one in Haskell. See here for example: https://github.com/theoremprover-museum/LCF77/blob/master/sr...

A brief skim over the revised definition of Standard ML indicates that it was abandoned at some point. I've no idea if Caml or OCaml kept it.

That said, I'm reasonably sure that the syntactic construct (insofar is it is used in programming languages) originated with the ISWIM introduced in this paper, which was rather influential in its day, perhaps especially in the functional programming community.

groovy2shoes··on Manners in Early Modern England
> You see the same phenomenon in German, a language that's retained multiple forms of the second person. In German translations of the Bible, and in German prayers, God is addressed as "Du" (the familiar singular "you").

You also see it in the Latin Vulgate, where God is addressed as "tu" (singular), rather than "vos" (plural). My point is that the translation as "thou" was more-or-less a direct translation of the original text in almost all cases, preserving the distictions made in the Hebrew and Greek manuscripts. At the time those English translations were made, the choice was theologically neutral insofar as the original texts were theologically neutral.

groovy2shoes··on Manners in Early Modern England
As far as I can tell, the use of "thou" in the early (until about the 17th century) English translations was to preserve the grammatical number found in the Hebrew and Greek originals, which had separate forms for singular and plural second-person pronouns. This was certainly the case in the Old English translations, as well as in Wycliffe's Middle English and Tyndale's early Modern English. When those translations were made, "thou" and "ye" were the ordinary English words that corresponded with the originals. It has nothing at all to do with Latin.

At the time James VI/I commissioned his Authorized translation, "thou" was already starting to fall out of production, but was not something that seemed foreign or archaic to English speakers, and he'd asked his translators to follow the style of the existing English translations, which were by-and-large based on Tyndale's. There are certainly some ways in which the translation attempts to emphasize certain theological/christological viewpoints, but the usage of "thou" is not one of them.

groovy2shoes··on Manners in Early Modern England
You've got it sorta backwards, at least as far as English is concerned.

"Thou" and "thee" were the descendents of Old English "þū" and "þē", respectively, and were originally the nominative and dative[1] forms of the singular second-person pronoun. "Ye" and "you" (< OE "ġē" and "ēow") were the corresponding forms of the plural second-person pronoun. In the High Middle Ages, English adopted the "tu-vous distinction", named after the French pronouns corresponding to "thou-you", wherein social superiors were always addressed in the plural (cf. "the royal we"). "Thou" fell out of use because people did not want to risk offending anyone by implying the other was their social inferior, wherefore they began addressing everyone as a superior.

When Shakespeare writes "I thou thee!", it's not to ironically mock, but rather to explicitly disparage, by asserting that the recipient is inferior, unworthy of being ye'd.

Of course, the vacuum created by the loss of a productive singular was later filled by constructions like "y'all", "you guys", "yous", &c. The same phenomenon occurred in Dutch, where the singular "du"/"di" was replaced by the plural (and therefore formal) "gi/u" during the Middle Dutch period, and the plural later filled by "jullie", a contraction of "je lui", meaning "you folks".

[1]: In late Old English, also the accusative, replacing "þec". From Middle English, the oblique (the sole objective case).

groovy2shoes··on ​Mark Shuttleworth on where Canonical and Ubuntu Linux are going next
I haven't used i3 in a long time, but if it's got support for systray icons, you can run the NetworkManager applet and manage your network settings there as you would in any ol' desktop environment.

I do this with awesome, and it works well. It's a one-liner in rc.lua:

    awful.spawn.with_shell "nm-applet"
Also good for volume control applets :)
groovy2shoes··on Ask HN: What are useful CS theories you actually use at work?
I've worked in several different fields: financial analytics, network monitoring, enterprise storage, and most recently electronic design automation. Each of them has involved different sets of formal theories. Sometimes combinatorics has come in handy, sometimes relational algebra, sometimes binary arithmetic, and so on.

Off the top of my head, I can only think of two that have been universally useful in all of them, and they have been very useful too. Graph theory comes straight to mind, and the only thing that might rival it is automata theory (including formal languages).

Graph theory and automata theory often prove to be useful even in problems that aren't conventionally thought of as graph problems or automata problems, but once you get a good grasp on them, you start to recognize patterns in problems (or sub-problems) that naturally lend themselves to elegant solutions if the problem is re-framed from the perspective of the appropriate theory. I've wound up on several projects where the requirements seemed really complex and gnarly at first glance, but we would be able to create successful, maintainable, extensible systems whose architectures essentially consisted of a chain of ETL ⇒ {graph,automaton}+ ⇔ UI — basically the same shape as the conventional compiler pipeline but applied to data, and sometimes interactive.

Graphs are extremely versatile as data structures, with well-studied properties, subtypes, and algorithms. Automata are similarly versatile as models of processes, and similarly well-studied.

The two are easily combined. One project in particular would take in a set of rules from the user, construct an automaton out of it, feed data through it, which would generate yet another automaton that doubled as a digraph. This autographaton modeled the control flow of the former automaton during execution, amenable to graph algorithms (search, flow, sort, pattern matching, etc.), arbitrarily modifiable by the user, and executable to generate an arbitrary amount of mock data that had the same characteristics (as defined by the input rules) as the data that it characterized. It was designed to aid in the analysis and simulation of network traffic, but it wound up being general enough that people in other parts of the company started using it for other things, too (that I knew of at the time I left the company: I/O loads, software testing, and automated bug report arbitrage using core dumps).

You could probably write such a program without any understanding of the theories involved, but I think that knowing the theories had some definite benefits. The theories led the program to be structured in a clean, elegant, modular, and straightforward way. They helped the program be general yet powerful and useful. Importantly, they helped the program to operate in such a way (and to present such an interface) that was intuitive for the tasks—and the people—it was designed for. I absolutely credit the solid theoretical foundations with the success of the program, and I've gone on to design programs with similar foundations yet intended for different sorts of tasks—and people—that have also been rather successful, though, admittedly, perhaps not so generically applicable.

groovy2shoes··on Fortran is still a thing (2017)
The FreeBSD bootloader (on several platforms, at least, including i386 and amd64) is written largely in a dialect of Forth called Ficl [1]. Perhaps GP got "Forth" and "Fortran" mixed up?

Looks like the Forth loader is going to eventually be replaced by a Lua one, though [2].

[1]: https://github.com/freebsd/freebsd/tree/release/11.1.0/sys/b...

[2]: https://lists.freebsd.org/pipermail/freebsd-current/2018-Feb...

groovy2shoes··on Why “children,” not “childs”? (2016)
I þink you mean þe letter "þorn" ("thorn") ;)

Ðere was also ðe letter "ðæt" ("that"), a later invention ðat began as a stylistic alternative to þorn in Old English manuscripts, but fell out of favour early in þe Middle English period (during þe 1200s or so).

Þorn continued to be used to a limited extent in early printed works of English. The <th> digraph started to supplant it already in manuscripts during the Middle English period, with <þ> being retained only in limited contexts well before the introduction of the press in Europe (contexts being primarily common sigla (scribal abbreviations) like <þᵉ> for "the" and <þᵗ> for "that", and occasionally when the scribe felt like they might run out of room on the line).

See some previous discussion here: https://news.ycombinator.com/item?id=16059265

groovy2shoes··on Why “children,” not “childs”? (2016)
And "an ekename" -> "a nickname"
groovy2shoes··on SHCL – An unholy union of Posix shell and Common Lisp
If you haven't already, I recommend checking out rlwrap, which you can use to run any ol' program that takes input on stdin and give it readline support. I use it quite a lot, and I have aliases in my .bashrc for wrapping various interpreters (like tclsh, sbcl, ocaml, and my own interpreters), but you can even use it to wrap /bin/cat and have a rudimentary line editor ;)
groovy2shoes··on SHCL – An unholy union of Posix shell and Common Lisp
Yes. As a bonus, the acknowledgements in the scsh manual also features some of the finest writing I've ever read in a technical document: https://scsh.net/docu/html/man.html
groovy2shoes··on Safe ways to do things in bash
In addition to bash itself being widespread, most of the common "bashisms" are also supported by zsh and most variants of ksh (and many systems actually use some variant of ksh disguised as /bin/sh). This is unsurprising given that bash itself was originally meant to be a clone of ksh. The places where they differ tend to cluster around uncommon/newer features (like coprocesses), certain syntactic quirks (but if you're aware of them they're usually easy to work around), and interactive features (which are mostly irrelevant for scripts). If you're writing simple scripts (or you're writing complex ones in a careful way), you can reasonably "target" bash and expect them to work on other common shells.

If you're going to be distributing shell scripts, it's probably a good idea to test them on a handful of common shells anyway. If portability between shells isn't something you're worried about, it's exactly as reasonable to ask users to install bash as it is to ask them to install mksh or zsh (or even python or lua or whatever) anyway. If you're most comfortable with bash, just use bash!

But for the love of god and all that is holy, please don't write csh scripts ;)

groovy2shoes··on Xz format inadequate for long-term archiving (2017)
7z, xz, and lzip all use the same compression algorithm (LZMA). The differences between them are in the container format that stores the data, not in the compression of the data. 7z is akin to zip in that it functions as an archive in addition to the compressed data. xz and lzip both accomplish the same goal, which is to store the LZMA-compressed stream while letting some other tool handle archival if desired, as is traditional on unixy systems, where archival is usually handled by tar (though you will sometimes fun into cpio or ar archives) while compression is handled by gzip (same compression algorithm as zip) or bzip2 or whatever else.

Thus, the proposed benefits of the compression ratio apply equally to lzip as they do to 7z and xz. When the article talks about shortcomings of the xz file format compared to the lzip file format, it's talking about file structure and metadata, not compression algorithm. Just running some informal comparisons on my machine, an empty (zero byte) file results in a 36 byte lzip file and a 32 byte xz file, while my hosts file of 1346 bytes compresses to a 738 byte lzip file and a 772 byte xz file. An mtree file listing my home directory comes to 268 Mbytes uncompressed, resulting in an 81M lzip file and an 80M xz file (a difference of 720 Kbytes, less than 0.9% overhead). Suffice it to say, the compression of the two files is comparable. Yet, the lzip file format also has the advantages discussed in the article.

That said, for long-term archival I wouldn't use any of the above: I prefer zpaq, which offers better compression than straight LZMA, along with dedup, journaling, incremental backup, append-only archives, and some other desirable features for archival. Together with an mtree listing (to capture some metadata that zpaq doesn't record) and some error recovery files (par2 or zfec), this makes a good archival solution, though I hesitate to call it perfect.

groovy2shoes··on Carp: A statically typed Lisp, without a GC, for real-time applications
You can map locations in generated C code to locations in some other file, too. Standard C has a pragma for it:

    #line <num> "filename"
or, if the filename is the same as the previous pragma, you can omit it from the pragma:

    #line <num>
This pragma is used to inform the compiler of what information it should use when displaying error messages and such. I think it's meant to be used by the C preprocessor, but the preprocessor isn't required to use it, and other programs aren't prohibited from using it.

You might wind up generating a lot of these, but they're really easy to generate as long as you preserve that information all the way through compilation (which I'd assume you'd have to do for LLVM IR regardless).

groovy2shoes··on Common Lisp Standard Draft
Yeah. I quite like the way the second edition was conveyed, though, with additions and amendments indicated by typographic conventions, because the result is that when you have the second edition, you also kinda have the first edition. It's also cool from a historical perspective, since it is very much an intermediate "development snapshot" between CLtL1 and the ANSI standard, and the votes and discussion topics are meticulously catalogued.

But despite CLtL2 not being a standard per se, I think the ANSI standard as published retains a lot of the "spirit" of CLtL, in that it defines things precisely without resorting to obtuse formalisms or overly-dry description, and in that it is organized in a similarly versatile way.

groovy2shoes··on Common Lisp Standard Draft
I don't have a copy of CLtL1 myself (though I vaguely recall checking it out from the university library a few times many moons ago). I'm replying to you because your post was the last stop for my train of thought, but this isn't a rebuttal by any means.

CLtL2 has 1053 pages if you count the front- and back-matter, 975 if you don't.

For comparison, the ANSI C11 standard comes to 683 pages, but I think it's worth mentioning that CL leaves far fewer things unspecified, is much more "powerful", and is written in such a way that it can reasonably serve as an introduction and a reference in addition to a definition, compared to the C11 standard which, imo, doesn't serve particularly well for any use other than definition (I'm far more likely to reach for Harbison & Steele than for ANSI C if I need a C reference, and if a handful of programmers trying to learn C given only the standard were broadcast on TV, I'd set my DVR, because that would be very entertaining).

The Emacs Lisp reference manual weighs in at 1077 pages. Nobody really cares.

Standard ML (revised) comes to 583 pages between the Definition and the Basis Library, but its succinctness comes at the cost of being nigh incomprehensible to mere mortals, since the ~100 pages of the Definition are largely occupied by formal semantics; this is both a good thing (formal semantics are nice to have) and a bad thing (to understand it you have to learn the formal language first... I don't consider this a huge deal, but my experience has been that most people can't be arsed).

IEEE Scheme comes to 73 pages, but it omits a lot of things that would be considered essential for "programming in the large": modules, records, macros, &c. While I don't think it could serve as an introduction for anyone not already versed in a Lisp dialect or at least some applicative language, it does function rather well as a reference, except that 80% of the time you're better off checking your implementation's documentation (for example, the 895 pages of the Guile 2.0 reference manual).

ISLISP is 127 pages (the "official" ISO ISLISP standard is also the most expensive of all of these documents by far, but fortunately Kent did us all a solid), and suffers from some of the same "problems"[1] as IEEE Scheme.

BCPL punches at the featherweight class, containing the language definition, tutorial, examples, reference, virtual machine specification, and a source listing of a self-hosted reference compiler, all in a mere 183 pages. Despite its admirable simplicity, so few people seem to be writing any serious software in BCPL these days. I wonder why that is...

Die-hard Wirth fans like to champion the fact that the Oberon-07 report is small enough to keep in your wallet, so you can drunkenly show it to strangers at the pub and proudly tell them all about your wee little language that you haven't seen since your Wirth left you 10 years ago. It's only 17 pages, but it deals almost exclusively with matters of syntax, including only the bare minimum informal, imprecise descriptions of semantics interleaved therewith. The library reference consists of a couple lists of procedure names without even an afterthought mentioning what they actually do, all the while making even the IEEE Scheme standard library look luxurious and capacious in comparison.

The point of mentioning all this is that even after a language has been designed and documented, the act of writing it down comes with all kinds of tradeoffs. Pages numbering in the quadruple digits can be intimidating and perhaps tedious at times, but pages numbering in the double digits can be rather frustrating and just as tedious at times, too: when you find that some aspect of the language is only vaguely specified or communicated, and you have to take your best guess (which is probably wrong, as a rule of thumb); or when your program grows beyond the original intent and suddenly packages and CLOS really start looking like they're worth their weight in paper. The complexity of a programming language is many-dimensional, and there are many possible functions that can map that complexity into the single dimension of page count; some of those functions might result in standards that are great for neophytes but aggravating for professionals, others might yield results that are brilliant for implementors but absolute rubbish for students.

All things considered, I think ANSI CL (and CLtL, for that matter) approximate a sweetspot in the language standard space, not even just in terms of how they're designed but in how they're written: they're immanently accessible to regular programmers, provide thorough coverage of the language and libraries in a format that also serves as a handy reference, and (usually) offer enough detail that implementors don't have to roll any dice. They're not absolutely perfect, but having read so many language standards from so many different perspectives (learner, practitioner, implementor, and once-upon-a-time author), I've really developed an admiration for those in particular. It's not an easy task to write a language definition, especially with a language as featureful as CL, and yet they still manage to do it in a way that I consider exemplary.

—

[1]: Depending on your use case, they're features rather than problems. Everything would be so much better if only we could all agree on a damn use case.

groovy2shoes··on The Oforth Programming Language
While I do get that feel with PostScript, as far as I can tell it was accidental rather than a conscious design decision.

The stack-oriented nature of PostScript appears to have been influenced by the engineers' experiences with working with some stack-oriented architectures from Burroughs [1], rather than from Forth. Some aspects of PostScript were influenced heavily by other languages in use at Xerox PARC during the Interpress era [ibid], most notably Cedar, but considering that Interlisp was also in use at the time, it's not unreasonable to conjecture that it had some influence; however, any such Lisp influence was likely subconscious, and none of the people working on Interpress or PostScript or their forebears seems to explicated such an influence (as far as I can find).

Charles Geschke and John Warnock, the co-founders of Adobe, both deny any influence from Forth, suspecting that some overlap of design requirements between the two languages led to the shared properties [2]. I know that can be hard to believe, given the striking similarity of the two languages, but it's not the only time that concatenative programming would have been independently invented: Manfred von Thun's Joy language is likewise similar to Forth, but, again, not inspired by it. Whereas the similarity of PostScript to Forth can be explained by a simultaneous need for portability and dynamism in tightly-constrained environments, Joy's similarity to Forth is a result of a desire for algebraic manipulation of program text (Forth's (somewhat) having this property may have been a conscious design decision, but I'd bet cold, hard cash that it was a happy accident).

Indeed, any of these stack-oriented concatenative languages are computationally equivalent to a transformation monoid (algebra of functions and function composition) where evaluation proceeds according to a (possibly effectful) term-rewriting relation. Viewed in this light, the stack effectively becomes a mere implementation detail as far as the semantics are concerned, but I think that any language designer starting with such a monoid+rewriting semantics, when facing reasonable implementation on real hardware, is likely to come up with something quite similar to Forth &c. That is to say, starting with a low-level focus on efficient and portable implementation, or starting with a high-level focus on code representation as algebraic terms, there's a good chance you'll wind up with something similar to an established concatenative language, whether you mean to or not.

---

[1]: "PostScript and Interpress: a comparison", Brian Reid: http://tech-insider.org/unix/research/1985/0301.html

[2]: Masterminds of Programming, Federico Biancuzzi & Shane Warden (eds.)

groovy2shoes··on The Oforth Programming Language
Combining aspects of Lisp with aspects of Forth is not a new idea. The RPN calculators offered by HP used a language called RPL ("Reverse Polish Lisp")[1], including a user-level version (a little more Lisp-y) and a system-level version (a little more Forth-y). While RPL is what came immediately to my mind, I doubt it's the only historical example of such a combination; people have been drawing similarities between the Lisp family and the Forth family for ages.

[1]: https://en.wikipedia.org/wiki/RPL_(programming_language)

← PreviousPage 3 of 34Next →