From chris at sencjw.com Mon Nov 2 14:56:57 2020 From: chris at sencjw.com (Chris Wilson) Date: Mon, 02 Nov 2020 08:56:57 -0600 Subject: Podcast About the History of UNIX Message-ID: <71a84eaf-49c3-490b-b0a8-3ed83445f376@www.fastmail.com> I thought that some of you here may enjoy this interview with Brian Kernighan: https://corecursive.com/brian-kernighan-unix-bell-labs1/ There's a transcript here: https://corecursive.com/058-brian-kernighan-unix-bell-labs/ From joe at begriffs.com Sat Nov 7 18:38:23 2020 From: joe at begriffs.com (Joe Nelson) Date: Sat, 7 Nov 2020 12:38:23 -0600 Subject: Podcast About the History of UNIX In-Reply-To: <71a84eaf-49c3-490b-b0a8-3ed83445f376@www.fastmail.com> References: <71a84eaf-49c3-490b-b0a8-3ed83445f376@www.fastmail.com> Message-ID: <20201107183823.GC23278@begriffs.com> Chris Wilson wrote: > I thought that some of you here may enjoy this interview with Brian Kernighan: > https://corecursive.com/058-brian-kernighan-unix-bell-labs/ Thanks, nice article. It was interesting to see the contrast between Hamming's self-conscious "Great Thoughts" and the spontaneous collaboration of Unix hackers. That's always a balance, how much to plan ahead, and how much to dive in to something (anything). Also, I knew Unix came out of Bell Labs, but I didn't realize just how many other things did too! Wikipedia says: Researchers working at Bell Labs are credited with the development of radio astronomy, the transistor, the laser, the photovoltaic cell, the charge-coupled device (CCD), information theory, the Unix operating system, and the programming languages B, C, C++, and S. Nine Nobel Prizes have been awarded for work completed at Bell Laboratories. From dklann at grunch.org Sat Nov 7 18:51:05 2020 From: dklann at grunch.org (David Klann) Date: Sat, 7 Nov 2020 12:51:05 -0600 Subject: Podcast About the History of UNIX In-Reply-To: <20201107183823.GC23278@begriffs.com> References: <71a84eaf-49c3-490b-b0a8-3ed83445f376@www.fastmail.com> <20201107183823.GC23278@begriffs.com> Message-ID: On 11/7/20 12:38 PM, Joe Nelson wrote: > Chris Wilson wrote: >> I thought that some of you here may enjoy this interview with Brian Kernighan: >> https://corecursive.com/058-brian-kernighan-unix-bell-labs/ > > Thanks, nice article. It was interesting to see the contrast between > Hamming's self-conscious "Great Thoughts" and the spontaneous > collaboration of Unix hackers. That's always a balance, how much to plan > ahead, and how much to dive in to something (anything). > > Also, I knew Unix came out of Bell Labs, but I didn't realize just how > many other things did too! Wikipedia says: > > Researchers working at Bell Labs are credited with the development > of radio astronomy, the transistor, the laser, the photovoltaic > cell, the charge-coupled device (CCD), information theory, the Unix > operating system, and the programming languages B, C, C++, and S. > Nine Nobel Prizes have been awarded for work completed at Bell > Laboratories. > Yes, it was a great time for corporate-sponsored (well, regulated monopoly) basic research! In related news, I thought this was also an interesting read: "The Elements of Style: UNIX as Literature" -- http://theody.net/elements.html ~David From salo at saloits.com Sat Nov 7 23:09:36 2020 From: salo at saloits.com (Timothy J. Salo) Date: Sat, 7 Nov 2020 17:09:36 -0600 Subject: Podcast About the History of UNIX In-Reply-To: References: <71a84eaf-49c3-490b-b0a8-3ed83445f376@www.fastmail.com> <20201107183823.GC23278@begriffs.com> Message-ID: <81c774df-8740-6b6a-a18d-2a0b13efc0ce@saloits.com> On 11/7/2020 12:51 PM, David Klann wrote: >> ????Researchers working at Bell Labs are credited with the development >> ????of radio astronomy, the transistor, the laser, the photovoltaic >> ????cell, the charge-coupled device (CCD), information theory, the Unix >> ????operating system, and the programming languages B, C, C++, and S. >> ????Nine Nobel Prizes have been awarded for work completed at Bell >> ????Laboratories. > > Yes, it was a great time for corporate-sponsored (well, regulated > monopoly) basic research! Over the years, there have been a number of productive centers of research: o DARPA: The Internet, drones, ect. etc. I think that some at DARPA have claimed that for years DARPA kept computer science departments alive, although the NSF has largely taken over that role. o Cisco: For years, the Internet seemed to live on beta Cisco products. In its early years, there was a visible flow of the best and the brightest networking minds to Cisco. o Google: Autonomous vehicles, for a start. But, yes, it seems like anything on the theoretical side of strictly applied research requires funds that aren't sucked into just keeping the organization alive, whether it is Federal funding or excess profits. By the way, Cisco and Google are somewhat unique in that they have access to large-scale testbeds for their idea, (most notably, the Internet). The ability to attract exceptional talent is also a factor. Who wouldn't want DARPA funding? Or, a job at Bell Labs, Cisco (at one time), Google, or Tesla? -tjs From joe at begriffs.com Wed Nov 11 03:59:32 2020 From: joe at begriffs.com (Joe Nelson) Date: Tue, 10 Nov 2020 21:59:32 -0600 Subject: Parse pal Message-ID: <20201111035932.GD23278@begriffs.com> ------- TLDR; I put in a fair amount of work learning lex and yacc and would like a study partner as I continue to learn more. Anyone interested? ------- Programs often have to read structured information, like config files or network protocols. Rather than reinventing the wheel by parsing that stuff myself, I thought it would be a good investment to learn to do it right with a general purpose tool. I picked Lex and Yacc since they are old and available everywhere. I went through a book about them, and tried some examples in it, like a calculator, a word counter, and a parts-of-speech classifier. Some of the programs use Lex alone, and others use Lex and Yacc in combination. Part of the challenge not fully covered by the book was to create a robust Makefile that captures the dependencies between the generated files. My results are in this repo: https://github.com/begriffs/lexyacc By default, yacc generates source code that compiles into a standalone executable. I wondered how to have it create code suitable for a library instead, that I could include in my own bigger programs. In particular, how to generate multiple parsers that I could link to at once. (One for parsing a config file as I mentioned, and another for parsing IRC messages, say.) To make proper re-entrant code I had to go beyond lex and yacc to Flex and Bison. I don't feel too bad about it because they are as old as the hills and ubiquitous as well. I found a way to make the clean library-safe parsers and have them compile without warnings on mac/linux/obsd. Here's the structure: https://github.com/begriffs/multiparse Now that the boring infrastructure is out of the way, I'm ready to get to the heart of the matter, writing real-world parsers. I'd like to do full RFC 4180 CSV, S-expressions, RFC 2822 messages, INI, JSON, TOML, YAML. I want to throw nasty examples at it and make sure I can handle them. Does anyone on the list have experience with -- or curiosity about -- parsing? I'm a little tired after my efforts thus far and would find it motivating to pair program with someone on this. From denisovenator at gmail.com Wed Nov 11 05:35:32 2020 From: denisovenator at gmail.com (Victor Denisov) Date: Tue, 10 Nov 2020 21:35:32 -0800 Subject: Parse pal In-Reply-To: <20201111035932.GD23278@begriffs.com> References: <20201111035932.GD23278@begriffs.com> Message-ID: I did some yacc like work in Java and Go. Though I did relatively simple expressions. I heard a very good argument by Rob Pike in favor of custom lexers for go rather than lex. Do you use any instant messengers? On Tue, Nov 10, 2020 at 7:59 PM Joe Nelson wrote: > ------- > TLDR; I put in a fair amount of work learning lex and yacc and would > like a study partner as I continue to learn more. Anyone interested? > ------- > > Programs often have to read structured information, like config files or > network protocols. Rather than reinventing the wheel by parsing that > stuff myself, I thought it would be a good investment to learn to do it > right with a general purpose tool. > > I picked Lex and Yacc since they are old and available everywhere. I > went through a book about them, and tried some examples in it, like a > calculator, a word counter, and a parts-of-speech classifier. > > Some of the programs use Lex alone, and others use Lex and Yacc in > combination. Part of the challenge not fully covered by the book was to > create a robust Makefile that captures the dependencies between the > generated files. My results are in this repo: > > https://github.com/begriffs/lexyacc > > By default, yacc generates source code that compiles into a standalone > executable. I wondered how to have it create code suitable for a library > instead, that I could include in my own bigger programs. In particular, > how to generate multiple parsers that I could link to at once. (One for > parsing a config file as I mentioned, and another for parsing IRC > messages, say.) > > To make proper re-entrant code I had to go beyond lex and yacc to Flex > and Bison. I don't feel too bad about it because they are as old as the > hills and ubiquitous as well. > > I found a way to make the clean library-safe parsers and have them > compile without warnings on mac/linux/obsd. Here's the structure: > > https://github.com/begriffs/multiparse > > Now that the boring infrastructure is out of the way, I'm ready to get > to the heart of the matter, writing real-world parsers. I'd like to do > full RFC 4180 CSV, S-expressions, RFC 2822 messages, INI, JSON, TOML, > YAML. I want to throw nasty examples at it and make sure I can handle > them. > > Does anyone on the list have experience with -- or curiosity about -- > parsing? I'm a little tired after my efforts thus far and would find it > motivating to pair program with someone on this. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris at sencjw.com Wed Nov 11 16:01:58 2020 From: chris at sencjw.com (Chris Wilson) Date: Wed, 11 Nov 2020 10:01:58 -0600 Subject: Parse pal In-Reply-To: <20201111035932.GD23278@begriffs.com> References: <20201111035932.GD23278@begriffs.com> Message-ID: On Tue, Nov 10, 2020, at 9:59 PM, Joe Nelson wrote: > ------- > TLDR; I put in a fair amount of work learning lex and yacc and would > like a study partner as I continue to learn more. Anyone interested? > ------- I've done some lex and yacc projects. And I've used a smattering of tools based on lex/yacc. I know I could use a refresher and to learn them better. When using yacc, I feel like I'm just guessing about the grammar and my "workflow" is tweak things until shift/reduce conflicts go away ;) I'd be up for a pairing session or something. From joe at begriffs.com Wed Nov 11 23:48:41 2020 From: joe at begriffs.com (Joe Nelson) Date: Wed, 11 Nov 2020 17:48:41 -0600 Subject: Parse pal In-Reply-To: References: <20201111035932.GD23278@begriffs.com> Message-ID: <20201111234841.GE23278@begriffs.com> Victor Denisov wrote: > I heard a very good argument by Rob Pike in favor of custom lexers for > go rather than lex. One of the exercises in the book I went through was about that. Here's an example of a custom lexer in C: https://github.com/begriffs/lexyacc/blob/master/ch1-lex-vs-c-2.c?ts=4 Then the same thing rewritten in Lex: https://github.com/begriffs/lexyacc/blob/master/ch1-lex-vs-c-1.l?ts=4 I think the Lex one is easier to understand, but maybe there's room for improvement in my C version. Can you share the Go example? > Do you use any instant messengers? I'm usually idling on Freenode, and you can direct message me there. From joe at begriffs.com Thu Nov 12 01:28:05 2020 From: joe at begriffs.com (Joe Nelson) Date: Wed, 11 Nov 2020 19:28:05 -0600 Subject: Parse pal In-Reply-To: References: <20201111035932.GD23278@begriffs.com> Message-ID: <20201112012805.GF23278@begriffs.com> Chris Wilson wrote: > I've done some lex and yacc projects. And I've used a smattering of > tools based on lex/yacc. I know I could use a refresher and to learn > them better. When using yacc, I feel like I'm just guessing about the > grammar and my "workflow" is tweak things until shift/reduce conflicts > go away ;) TBH that's more experience than I have, since the examples were given to me and I didn't need to puzzle over ss/sr conflicts. > I'd be up for a pairing session or something. That's great! I'll schedule with you off-list. Here's where I am right now, I want to parse S-expressions since it seems like they *should* be pretty easy. At the moment I just copied an example from stack overflow: https://stackoverflow.com/questions/517113/lisp-grammar-in-yacc I put it into my project in these two files: https://github.com/begriffs/multiparse/blob/master/lisp.l https://github.com/begriffs/multiparse/blob/master/lisp.y It doesn't work though. $ ./driver_lisp (42 100) NUM matched sexpr members 1 syntax error, unexpected invalid token, expecting ')' Depending on where I look online, I find slightly different grammar variations. Maybe we try to make these examples work: https://github.com/mjsottile/sfsexp/blob/master/tests/test_expressions From denisovenator at gmail.com Thu Nov 12 02:01:11 2020 From: denisovenator at gmail.com (Victor Denisov) Date: Wed, 11 Nov 2020 18:01:11 -0800 Subject: Parse pal In-Reply-To: <20201111234841.GE23278@begriffs.com> References: <20201111035932.GD23278@begriffs.com> <20201111234841.GE23278@begriffs.com> Message-ID: Here is the link to his presentation: https://www.youtube.com/watch?v=HxaD_trXwRE&t=2415s It uses a lot of go specific features that allow for an elegant solution. On Wed, Nov 11, 2020 at 3:48 PM Joe Nelson wrote: > Victor Denisov wrote: > > I heard a very good argument by Rob Pike in favor of custom lexers for > > go rather than lex. > > One of the exercises in the book I went through was about that. Here's > an example of a custom lexer in C: > > https://github.com/begriffs/lexyacc/blob/master/ch1-lex-vs-c-2.c?ts=4 > > Then the same thing rewritten in Lex: > > https://github.com/begriffs/lexyacc/blob/master/ch1-lex-vs-c-1.l?ts=4 > > I think the Lex one is easier to understand, but maybe there's room for > improvement in my C version. Can you share the Go example? > > > Do you use any instant messengers? > > I'm usually idling on Freenode, and you can direct message me there. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicholasdrozd at gmail.com Thu Nov 12 15:49:08 2020 From: nicholasdrozd at gmail.com (Nicholas Drozd) Date: Thu, 12 Nov 2020 09:49:08 -0600 Subject: Parse pal In-Reply-To: <20201111035932.GD23278@begriffs.com> References: <20201111035932.GD23278@begriffs.com> Message-ID: On Tue, Nov 10, 2020 at 9:59 PM Joe Nelson wrote: > ------- > TLDR; I put in a fair amount of work learning lex and yacc and would > like a study partner as I continue to learn more. Anyone interested? > ------- I'm not prepared to get into any new study at the moment, but if one of your famous deep-dive posts is in the works, I would be happy to read rough drafts, verify code samples, etc. From nicholasdrozd at gmail.com Thu Nov 12 16:21:38 2020 From: nicholasdrozd at gmail.com (Nicholas Drozd) Date: Thu, 12 Nov 2020 10:21:38 -0600 Subject: Podcast About the History of UNIX In-Reply-To: <20201107183823.GC23278@begriffs.com> References: <71a84eaf-49c3-490b-b0a8-3ed83445f376@www.fastmail.com> <20201107183823.GC23278@begriffs.com> Message-ID: Tangentially related: a few months ago I did a survey of transliterations of "Kernighan" in foreign-language Wikipedia articles, focusing on how "gh" is represented in other scripts. https://nickdrozd.github.io/2020/05/28/kernighan-pronunciation.html In many ways this is a frivolous topic. And note the date it was posted! But I sent it to Kernighan himself, and he described it as "pretty entertaining". From joe at begriffs.com Sat Nov 14 17:28:28 2020 From: joe at begriffs.com (Joe Nelson) Date: Sat, 14 Nov 2020 11:28:28 -0600 Subject: Parse pal In-Reply-To: References: <20201111035932.GD23278@begriffs.com> Message-ID: <20201114172828.GL23278@begriffs.com> Nicholas Drozd wrote: > I'm not prepared to get into any new study at the moment, but if one > of your famous deep-dive posts is in the works, I would be happy to > read rough drafts, verify code samples, etc. Thanks! I do want to write something about parsing, and I'm trying to find the right scope for the article. I'll let you know when there's something to review. From joe at begriffs.com Sat Nov 21 01:26:33 2020 From: joe at begriffs.com (Joe Nelson) Date: Fri, 20 Nov 2020 19:26:33 -0600 Subject: Installing mimedown on Debian In-Reply-To: <20201007054304.GA25681@begriffs.com> References: <1pCo~.wSWlVy3aqv2@19a6.net> <20201007054304.GA25681@begriffs.com> Message-ID: <20201121012633.GA89416@begriffs.com> > > I did some more tests. Including the line > > > > ![](https://teamkave.us/files/books1.jpg) > > Thanks for the test case, I reproduced the problem. Examining the core > dump inside my debugger, it looks like the problem is in my new text > justification code, in best_breaks(). I got around to pushing a fix for this tonight. Should be good now if you pull the latest code and build it.